diff --git a/assets/AnimatedWave-BNwebIpR.js b/assets/AnimatedWave-BNwebIpR.js new file mode 100644 index 0000000000000000000000000000000000000000..cb9c6d1be31aab1a3ac08f1e147bd06e3fbf6381 --- /dev/null +++ b/assets/AnimatedWave-BNwebIpR.js @@ -0,0 +1,3 @@ +import{b as e}from"./Basic-Cwa2X3hA.js";import{A as t,B as n,C as r,D as i,I as a,J as o,L as s,Q as c,a4 as l,a5 as u,aL as d,aP as f,aS as p,aW as m,aY as h,aa as g,ab as _,ag as v,aq as y,b$ as b,b2 as x,b3 as S,bA as C,bB as w,bC as T,bD as E,bE as ee,bG as D,bH as O,bI as k,bJ as A,bK as j,bL as M,bM as N,bO as P,bP as F,bQ as I,bR as L,bS as R,bT as z,bU as B,bX as V,b_ as H,bv as U,bw as W,bx as G,by as K,bz as te,c0 as q,c1 as J}from"./index-J3uhnpYL.js";import{b as Y,c as X,d as ne}from"./HeaderLink-C5rYwZW4.js";import{d as Z,e as re,f as ie}from"./Scenes-CEy5mzwe.js";function ae(e,t){let n=ie(e,t?.in);if(!re(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=Z(n.getDate(),2),t=Z(n.getMonth()+1,2),r=Z(n.getFullYear(),4);a=`${r}${o}${t}${o}${e}`}if(i!==`date`){let e=Z(n.getHours(),2),t=Z(n.getMinutes(),2),r=Z(n.getSeconds(),2),i=a===``?``:` `;a=`${a}${i}${e}${s}${t}${s}${r}`}return a}const oe={},se={class:`cross-background-container`};function ce(e,t){return z(),N(`div`,se,[T(e.$slots,`default`,{},void 0,!0)])}var le=d(oe,[[`render`,ce],[`__scopeId`,`data-v-455eb62c`]]);const ue={"mb-1":``,"w-full":``,"gap-2":``},de={"w-full":``};var fe=A({__name:`Header`,setup(e){return(e,t)=>(z(),N(`header`,ue,[B(`div`,de,[P(Y)]),P(H(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:M(()=>t[0]||=[B(`div`,{"i-solar:settings-minimalistic-bold-duotone":``},null,-1)]),_:1,__:[0]})]))}}),pe=fe,me=`/assets/worker-FPXhib_8.js`;const Q=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`.split(``),he=e=>{let t=typeof e;return t===`object`?e===null?`null`:e?.constructor?.name??`object`:t},ge=e=>{if(typeof e==`string`)return new TextEncoder().encode(e);if(e instanceof Uint8Array)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);throw TypeError(`The input must be a Uint8Array, a string, or an ArrayBuffer. Received a value of the type ${he(e)}.`)},_e=e=>{let t=ge(e),n=``,r,i=t.length;for(r=2;r>2],n+=Q[(t[r-2]&3)<<4|t[r-1]>>4],n+=Q[(t[r-1]&15)<<2|t[r]>>6],n+=Q[t[r]&63];return r===i+1&&(n+=Q[t[r-2]>>2],n+=Q[(t[r-2]&3)<<4],n+=`==`),r===i&&(n+=Q[t[r-2]>>2],n+=Q[(t[r-2]&3)<<4|t[r-1]>>4],n+=Q[(t[r-1]&15)<<2],n+=`=`),n};function $(e,t,n){for(let r=0;r{k().then(()=>{t.value&&(t.value.scrollTop=t.value.scrollHeight)})}),l(async()=>{k().then(()=>{t.value&&(t.value.scrollTop=t.value.scrollHeight)})}),(e,i)=>{let s=R(`auto-animate`);return z(),N(`div`,be,[i[3]||=B(`div`,{"flex-1":``},null,-1),E((z(),N(`div`,{ref_key:`chatHistoryRef`,ref:t,"h-full":``,"w-full":``,flex:`~ col`,"overflow-scroll":``},[i[2]||=B(`div`,{"flex-1":``},null,-1),(z(!0),N(D,null,G(H(r),(e,t)=>(z(),N(`div`,{key:t,"mb-2":``},[e.role===`error`?(z(),N(`div`,xe,[B(`div`,Se,[B(`div`,Ce,[B(`div`,we,[B(`span`,Te,q(H(n)(`stage.chat.message.character-name.core-system`)),1)]),i[0]||=B(`div`,{"i-solar:danger-triangle-bold-duotone":``,"text-violet-500":``},null,-1)]),H(a)&&t===H(r).length-1?(z(),N(`div`,Ee)):(z(),N(`div`,{key:1,class:`markdown-content break-words text-violet-500`,text:`base (z(),N(`div`,{key:t},[e.type===`tool-call`?(z(),N(`div`,Me,[B(`div`,Ne,[i[1]||=K(` Called: `),B(`code`,null,q(e.toolCall.toolName),1)])])):e.type===`tool-call-result`?(z(),N(`div`,Pe)):(z(),N(`div`,{key:2,innerHTML:H(o)(e.text)},null,8,Fe))]))),128))])):(z(),N(`div`,Ie))])])):e.role===`user`?(z(),N(`div`,Le,[B(`div`,Re,[B(`div`,null,[B(`span`,ze,q(H(n)(`stage.chat.message.character-name.you`)),1)]),e.content?(z(),N(`div`,{key:0,class:`markdown-content break-words`,text:`base {if(!e||!e.trim())return;let t=h.getProviderConfig(_.value);await w(e,{chatProvider:await h.getProviderInstance(_.value),model:v.value,providerConfig:t})}});async function F(){if(!(!r.value.trim()||m.value))try{let e=h.getProviderConfig(_.value);await w(r.value,{chatProvider:await h.getProviderInstance(_.value),model:v.value,providerConfig:e})}catch(e){O.value.pop(),O.value.push({role:`error`,content:e.message})}}let{destroy:L,start:R}=l(C,{onSpeechStart:()=>{u.value=!0},onVADMisfire:()=>{u.value=!1},onSpeechEnd:e=>{u.value=!1,U(e.buffer)},auto:!1});async function U(e){await k.resume();let t=await ye(e,k.sampleRate);j({type:`generate`,data:{audio:t,language:`en`}})}return I(x,async e=>{e===`false`&&(L(),M())}),I(f,async e=>{e&&await b()}),I([_,v],async()=>{_.value&&v.value&&await D(v.value,await h.getProviderInstance(_.value),[])}),ee(()=>{R()}),T(async()=>{r.value=``}),(t,n)=>(z(),N(`div`,We,[B(`fieldset`,Ge,[B(`label`,{class:J([d.value===`chat`?`bg-primary-100 dark:bg-primary-900`:`bg-white dark:bg-primary-950`,d.value===`chat`?`text-primary-500 dark:text-primary-500`:``,{"transition-colors-none ":H(y)}]),flex:`~ row`,checked:d.value===`chat`,"aria-checked":d.value===`chat`,border:`solid 2 primary-100 dark:primary-900`,text:`primary-300 hover:primary-500 dark:primary-300/50 dark:hover:primary-500`,transition:`all duration-250 ease-in-out`,"cursor-pointer":``,"items-center":``,"gap-1":``,"rounded-lg":``,"px-2":``},[E(B(`input`,{"onUpdate:modelValue":n[0]||=e=>d.value=e,type:`radio`,name:`tab`,value:`chat`,hidden:``},null,512),[[W,d.value]]),n[4]||=B(`div`,{"i-solar:dialog-2-bold-duotone":``,text:`2xl`,transform:`translate-y--2`},null,-1),B(`div`,qe,[B(`span`,Je,q(H(A)(`stage.chat.tabs.chat`)),1)])],10,Ke)]),B(`div`,Ye,[B(`div`,Xe,[P(Ue,{"h-full":``,"flex-1":``,"p-4":``,w:`full`,"max-h":`r.value=e,placeholder:H(A)(`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:J({"transition-colors-none placeholder:transition-colors-none":H(y)}),onSubmit:F,onCompositionstart:n[2]||=e=>m.value=!0,onCompositionend:n[3]||=e=>m.value=!1},null,8,[`modelValue`,`placeholder`,`class`])])])])]))}}),$e=Qe;const et=[`src`],tt=[`src`];var nt=A({__name:`MobileHeaderLink`,setup(e){let t=m();return(e,n)=>(z(),C(H(f),{to:`/`,flex:`~`,"items-center":``,"gap-2":``,"px-2":``,"text-nowrap":``,"text-2xl":``,"outline-none":``},{default:M(()=>[H(t)?(z(),N(`img`,{key:0,src:H(ne),"h-8":``,"w-8":``,class:`theme-colored`},null,8,et)):(z(),N(`img`,{key:1,src:H(X),"h-8":``,"w-8":``,class:`theme-colored`},null,8,tt))]),_:1}))}}),rt=d(nt,[[`__scopeId`,`data-v-9c3d67a4`]]);const it={"mb-1":``,"w-full":``,"gap-2":``},at={"w-full":``,flex:``,"justify-center":``};var ot=A({__name:`MobileHeader`,setup(e){return(e,t)=>(z(),N(`header`,it,[B(`div`,at,[P(rt)])]))}}),st=ot;const ct={flex:`~ col`,rounded:`lg`,"overflow-hidden":``},lt={key:0,flex:``,mr:`12`},ut={flex:`~ col`,shadow:`md violet-200/20 dark:none`,"min-w-20":``,"rounded-lg":``,"px-3":``,"py-2":``,h:`unset {k().then(()=>{t.value&&(t.value.scrollTop=t.value.scrollHeight)})}),c(async()=>{k().then(()=>{t.value&&(t.value.scrollTop=t.value.scrollHeight)})}),(e,i)=>{let o=R(`auto-animate`);return z(),N(`div`,ct,[E((z(),N(`div`,{ref_key:`chatHistoryRef`,ref:t,"max-h":`35dvh`,"z-5":``,flex:`~ col`,"h-full":``,"w-full":``,"overflow-scroll":``,class:`chat-history`},[(z(!0),N(D,null,G(H(r),(e,t)=>(z(),N(`div`,{key:t,"mb-2":``},[e.role===`error`?(z(),N(`div`,lt,[B(`div`,ut,[B(`div`,dt,[B(`div`,ft,[B(`span`,pt,q(H(n)(`stage.chat.message.character-name.core-system`)),1)]),i[0]||=B(`div`,{"i-solar:danger-triangle-bold-duotone":``,"text-violet-500":``},null,-1)]),e.content?(z(),N(`div`,{key:0,class:`markdown-content`,text:`base {if(kt.test(e)){let t=Date.prototype[e.replace(kt,`$1UTC`)];t&&(Ot.prototype[e]=t)}});var At=class extends Ot{toString(){let e=this.toDateString(),t=this.toTimeString();return`${e} ${t}`}toDateString(){let e=jt.format(this),t=Mt.format(this),n=this.getFullYear();return`${e} ${t} ${n}`}toTimeString(){let e=Nt.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})}},jt=new Intl.DateTimeFormat(`en-US`,{weekday:`short`,timeZone:`UTC`}),Mt=new Intl.DateTimeFormat(`en-US`,{month:`short`,day:`numeric`,timeZone:`UTC`}),Nt=new Intl.DateTimeFormat(`en-GB`,{hour12:!1,hour:`numeric`,minute:`numeric`,second:`numeric`,timeZone:`UTC`});const Pt=`50371c580a`,Ft=`main`,It=`Tue Jul 22 14:28:27 2025 +0800`,Lt={"max-w":`calc[100%-2rem]`,"mx-auto":``,"h-full":``,flex:``,"flex-col":``,"pt-14":``},Rt={"flex-1":``},zt={grid:`~ cols-[70px_1fr]`,"mt-4":``,"gap-2":``,"text-sm":``},Bt={"font-mono":``},Vt={"font-mono":``},Ht={"font-mono":``};var Ut=A({__name:`About`,setup(e){let t=V(!1),n=ae(new At(It));return(e,r)=>(z(),N(D,null,[B(`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]||=[B(`div`,{"i-solar:info-circle-outline":``,"size-5":``,text:`neutral-500 dark:neutral-400`},null,-1)]),P(H(_),{modelValue:t.value,"onUpdate:modelValue":r[1]||=e=>t.value=e},{default:M(()=>[B(`div`,Lt,[r[7]||=B(`div`,{"font-sans-rounded":``,"mb-14":``,"text-center":``,"text-5xl":``},[B(`span`,{text:`neutral-400 dark:neutral-100/65`},`Project`),K(),B(`span`,{text:`pink-400 dark:pink-300/90`},`AIRI`),B(`div`,{"mt-2":``,"text-base":``},` Web ver. `)],-1),B(`div`,Rt,[r[6]||=B(`div`,{text:`neutral-500 dark:neutral-400`},` Application build information `,-1),B(`div`,zt,[r[3]||=B(`div`,{text:`neutral-500 dark:neutral-400`},` Branch `,-1),B(`div`,Bt,q(H(Ft)),1),r[4]||=B(`div`,{text:`neutral-500 dark:neutral-400`},` Commit `,-1),B(`div`,Vt,q(H(Pt).substring(0,7)),1),r[5]||=B(`div`,{text:`neutral-500 dark:neutral-400`},` Built on `,-1),B(`div`,Ht,q(H(n)),1)])]),r[8]||=B(`div`,{"my-10":``},[B(`div`,{text:`neutral-500 dark:neutral-400`},` About `),B(`div`,{"mt-4":``,flex:``,"flex-col":``,"gap-2":``},[B(`a`,{class:J([`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`},[B(`div`,{"i-solar:home-smile-outline":``}),B(`div`,null,`Home`)]),B(`a`,{href:`https://airi.moeru.ai/docs/en/docs/overview/`,class:J([`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`},[B(`div`,{"i-solar:document-add-outline":``}),B(`div`,null,`Documentations`)]),B(`a`,{href:`https://github.com/moeru-ai/airi`,class:J([`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`},[B(`div`,{"i-simple-icons:github":``}),B(`div`,null,`GitHub`)])])],-1)])]),_:1},8,[`modelValue`])],64))}}),Wt=Ut;const Gt={"w-full":``,flex:``,"flex-1":``,"items-center":``,"self-end":``,"justify-end":``,"gap-2":``},Kt={key:0,"w-full":``,flex:``,"justify-between":``,"gap-2":``},qt={key:0,"i-solar:tuning-outline":``,"size-5":``},Jt={key:1,"i-solar:alt-arrow-right-outline":``,"size-5":``};var Yt=A({__name:`ViewControls`,props:{modelValue:{required:!0},modelModifiers:{}},emits:F([`reset`],[`update:modelValue`]),setup(e,{emit:t}){let r=t,{stageView:i,stageViewControlsEnabled:a}=p(n()),o=w(e,`modelValue`);function s(e){if(o.value===e){r(`reset`);return}o.value=e}return(e,t)=>(z(),N(`div`,Gt,[P(U,{name:`fade`},{default:M(()=>[H(a)?(z(),N(`div`,Kt,[P(H(v),{variant:`secondary-muted`,toggled:o.value===`x`,"w-full":``,onClick:t[0]||=e=>s(`x`)},{default:M(()=>t[5]||=[K(` X `)]),_:1,__:[5]},8,[`toggled`]),P(H(v),{variant:`secondary-muted`,toggled:o.value===`y`,"w-full":``,onClick:t[1]||=e=>s(`y`)},{default:M(()=>t[6]||=[K(` Y `)]),_:1,__:[6]},8,[`toggled`]),H(i)===`3d`?(z(),C(H(v),{key:0,variant:`secondary-muted`,toggled:o.value===`z`,"w-full":``,onClick:t[2]||=e=>s(`z`)},{default:M(()=>t[7]||=[K(` Z `)]),_:1,__:[7]},8,[`toggled`])):j(``,!0),P(H(v),{variant:`secondary-muted`,toggled:o.value===`scale`,"w-full":``,onClick:t[3]||=e=>s(`scale`)},{default:M(()=>t[8]||=[K(` Scale `)]),_:1,__:[8]},8,[`toggled`])])):j(``,!0)]),_:1}),B(`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=>a.value=!H(a)},[P(U,{name:`fade`,mode:`out-in`},{default:M(()=>[H(a)?(z(),N(`div`,Jt)):(z(),N(`div`,qt))]),_:1})])]))}}),Xt=d(Yt,[[`__scopeId`,`data-v-35df7db7`]]);const Zt={key:0},Qt={key:0,relative:``,class:`[&_.round-range-tooltip]:hover:opacity-100`},$t={class:`round-range-tooltip`,top:`50%`,"translate-y":`[-50%]`,absolute:``,"left-10":``,"font-mono":``,"op-0":``,transition:`all duration-200 ease-in-out`},en={key:1,relative:``,class:`[&_.round-range-tooltip]:hover:opacity-100`},tn={class:`round-range-tooltip`,top:`50%`,"translate-y":`[-50%]`,absolute:``,"left-10":``,"font-mono":``,"op-0":``,transition:`all duration-200 ease-in-out`},nn={key:2,relative:``,class:`[&_.round-range-tooltip]:hover:opacity-100`},rn={class:`round-range-tooltip`,top:`50%`,"translate-y":`[-50%]`,absolute:``,"left-10":``,"font-mono":``,"op-0":``,transition:`all duration-200 ease-in-out`},an={key:3,relative:``,class:`[&_.round-range-tooltip]:hover:opacity-100`},on={class:`round-range-tooltip`,top:`50%`,"translate-y":`[-50%]`,absolute:``,"left-10":``,"font-mono":``,"op-0":``,transition:`all duration-200 ease-in-out`};var sn=A({__name:`Inputs`,props:{mode:{}},setup(e,{expose:i}){let a=e,{stageView:o,stageViewControlsEnabled:s}=p(n()),{scale:c,position:l,modelSize:u}=p(t()),{scale:d,position:f}=p(r()),m=O({get:()=>{switch(o.value){case`2d`:return f.value.x;case`3d`:return l.value.x;default:return 0}},set:e=>{switch(o.value){case`2d`:f.value.x=e;break;case`3d`:l.value.x=e;break;default:break}}}),h=O(()=>o.value===`2d`?-500:-u.value.x-10),g=O(()=>o.value===`2d`?500:u.value.x+10),_=O({get:()=>{switch(o.value){case`2d`:return f.value.y;case`3d`:return l.value.y;default:return 0}},set:e=>{switch(o.value){case`2d`:f.value.y=e;break;case`3d`:l.value.y=e;break;default:break}}}),v=O(()=>o.value===`2d`?-500:-u.value.y-10),b=O(()=>o.value===`2d`?500:u.value.y+10),x=O({get:()=>{switch(o.value){case`2d`:return 0;case`3d`:return l.value.z;default:return 0}},set:e=>{switch(o.value){case`2d`:break;case`3d`:l.value.z=e;break;default:break}}}),S=O(()=>o.value===`2d`?-500:-u.value.z-10),w=O(()=>o.value===`2d`?500:u.value.z+10),T=O({get:()=>o.value===`2d`?d.value:c.value,set:e=>{o.value===`2d`?d.value=e:c.value=e}});function E(){switch(a.mode){case`x`:m.value=0;break;case`y`:_.value=0;break;case`z`:x.value=0;break;case`scale`:T.value=1;break}}return i({resetOnMode:E}),(e,t)=>(z(),C(U,{name:`fade-side-pops-in`},{default:M(()=>[H(s)?(z(),N(`div`,Zt,[P(U,{name:`fade-side-pops-in`,mode:`out-in`},{default:M(()=>[a.mode===`x`?(z(),N(`div`,Qt,[P(H(y),{modelValue:m.value,"onUpdate:modelValue":t[0]||=e=>m.value=e,min:h.value,max:g.value,step:.01,"data-direction":`vertical`,h:`50%`,"write-vertical-left":``},null,8,[`modelValue`,`min`,`max`]),B(`div`,$t,q(m.value.toFixed(2)),1)])):a.mode===`y`?(z(),N(`div`,en,[P(H(y),{modelValue:_.value,"onUpdate:modelValue":t[1]||=e=>_.value=e,min:v.value,max:b.value,step:.01,"write-vertical-left":``,h:`50%`,"data-direction":`vertical`},null,8,[`modelValue`,`min`,`max`]),B(`div`,tn,q(_.value.toFixed(2)),1)])):H(o)===`3d`&&a.mode===`z`?(z(),N(`div`,nn,[P(H(y),{modelValue:x.value,"onUpdate:modelValue":t[2]||=e=>x.value=e,min:S.value,max:w.value,step:.01,"write-vertical-left":``,h:`50%`,"data-direction":`vertical`},null,8,[`modelValue`,`min`,`max`]),B(`div`,rn,q(x.value.toFixed(2)),1)])):a.mode===`scale`?(z(),N(`div`,an,[P(H(y),{modelValue:T.value,"onUpdate:modelValue":t[3]||=e=>T.value=e,min:0,max:3,step:1e-4,"write-vertical-left":``,h:`50%`,"data-direction":`vertical`},null,8,[`modelValue`]),B(`div`,on,q(T.value.toFixed(2)),1)])):j(``,!0)]),_:1})])):j(``,!0)]),_:1}))}}),cn=d(sn,[[`__scopeId`,`data-v-d116bf35`]]);const ln={fixed:``,"bottom-0":``,"w-full":``,flex:``,"flex-col":``},un={relative:``,"w-full":``,"self-end":``},dn={top:`50%`,"translate-y":`[-50%]`,fixed:``,"z-15":``,"px-3":``},fn={"translate-y":`[-100%]`,absolute:``,"right-0":``,"w-full":``,"px-3":``,"pb-3":``,"font-sans":``},pn={flex:`~ col`,"w-full":``,"gap-1":``},mn={key:0,"i-solar:moon-outline":``,"size-5":``,text:`neutral-500 dark:neutral-400`},hn={key:1,"i-solar:sun-2-outline":``,"size-5":``,text:`neutral-500 dark:neutral-400`},gn={key:0,"size-5":``,text:`neutral-500 dark:neutral-400`,"inline-flex":``,"items-center":``,"justify-center":``},_n={key:1,"size-5":``,text:`neutral-500 dark:neutral-400`,"inline-flex":``,"items-center":``,"justify-center":``};var vn=A({__name:`MobileInteractiveArea`,setup(t){let r=m({disableTransition:!1}),c=V(`scale`),u=te(`viewControlsInputs`),d=V(``),g=V(!1),_=V(!1),v=h(),y=o(),{activeProvider:S,activeModel:w}=p(a());x(document.documentElement,()=>v.update());let{isAudioInputOn:T,selectedAudioDeviceId:E,themeColorsHueDynamic:D,stageView:O,stageViewControlsEnabled:k}=p(n()),{send:A,onAfterSend:F,discoverToolsCompatibility:R}=i(),{messages:W}=p(i()),{t:G}=s();async function K(){if(!(!d.value.trim()||_.value))try{let e=y.getProviderConfig(S.value);await A(d.value,{chatProvider:await y.getProviderInstance(S.value),model:w.value,providerConfig:e})}catch(e){W.value.pop(),W.value.push({role:`error`,content:e.message})}}let{destroy:q,start:Y}=l(E,{onSpeechStart:()=>{g.value=!0},onVADMisfire:()=>{g.value=!1},onSpeechEnd:e=>{g.value=!1,X(e)},auto:!1});function X(e){alert(`Transcription is not implemented yet`)}return I(T,async e=>{e===`false`&&q()}),F(async()=>{d.value=``}),I([S,w],async()=>{S.value&&w.value&&await R(w.value,await y.getProviderInstance(S.value),[])}),ee(()=>{Y(),v.update()}),(t,n)=>(z(),N(`div`,ln,[(z(),C(L,null,[P(U,{name:`fade`},{default:M(()=>[H(k)?j(``,!0):(z(),C(Dt,{key:0,"max-w":`[calc(100%-3.5rem)]`,"w-full":``,"self-start":``,"pl-3":``}))]),_:1})],1024)),B(`div`,un,[B(`div`,dn,[P(cn,{ref:`viewControlsInputs`,mode:c.value},null,8,[`mode`])]),B(`div`,fn,[B(`div`,pn,[P(Wt),B(`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=>r.value=!H(r)},[P(U,{name:`fade`,mode:`out-in`},{default:M(()=>[H(r)?(z(),N(`div`,mn)):(z(),N(`div`,hn))]),_:1})]),P(H(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:M(()=>n[7]||=[B(`div`,{"i-solar:settings-outline":``,"size-5":``,text:`neutral-500 dark:neutral-400`},null,-1)]),_:1,__:[7]}),B(`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=>O.value=H(O)===`2d`?`3d`:`2d`},[H(O)===`2d`?(z(),N(`div`,gn,n[8]||=[B(`span`,null,`2D`,-1)])):j(``,!0),H(O)===`3d`?(z(),N(`div`,_n,n[9]||=[B(`span`,null,`3D`,-1)])):j(``,!0)]),P(Xt,{modelValue:c.value,"onUpdate:modelValue":n[2]||=e=>c.value=e,onReset:n[3]||=()=>u.value?.resetOnMode()},null,8,[`modelValue`])])]),B(`div`,{bg:`white dark:neutral-800`,"max-h-100dvh":``,"max-w-100dvw":``,"w-full":``,flex:``,"gap-1":``,"overflow-auto":``,"px-3":``,"pt-2":``,style:b({paddingBottom:`${Math.max(Number.parseFloat(H(v).bottom.value.replace(`px`,``)),12)}px`})},[P(H(e),{modelValue:d.value,"onUpdate:modelValue":n[4]||=e=>d.value=e,placeholder:H(G)(`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:J([H(D)?`transition-colors-none placeholder:transition-colors-none`:``]),"default-height":`1lh`,onSubmit:K,onCompositionstart:n[5]||=e=>_.value=!0,onCompositionend:n[6]||=e=>_.value=!1},null,8,[`modelValue`,`placeholder`,`class`]),d.value.trim()||_.value?(z(),N(`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]||=[B(`div`,{"i-solar:arrow-up-outline":``},null,-1)])):j(``,!0)],4)])]))}}),yn=vn;const bn={class:`relative`},xn={absolute:``,"left-0":``,"right-0":``,"top-0":``,"w-full":``,"overflow-hidden":``};var Sn=A({__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=V(t.height),r=V(t.amplitude),i=V(t.waveLength),a=V(t.fillColor),o=V(t.direction),s=V(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=O(()=>n.value+r.value*2),u=O(()=>{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)=>(z(),N(`div`,bn,[T(e.$slots,`default`,{},void 0,!0),B(`div`,xn,[B(`div`,{class:`colored-area wave`,style:b({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)])]))}}),Cn=d(Sn,[[`__scopeId`,`data-v-33a54ad1`]]);export{Cn as b,yn as c,st as d,$e as e,pe as f,le as g}; \ No newline at end of file diff --git a/assets/AnimatedWave-DHHIvVVC.js b/assets/AnimatedWave-DHHIvVVC.js deleted file mode 100644 index 0036d2a3fcf491d759927211612b42db5668d5cb..0000000000000000000000000000000000000000 --- a/assets/AnimatedWave-DHHIvVVC.js +++ /dev/null @@ -1,3 +0,0 @@ -import{b as e}from"./Basic-CcFV8fg0.js";import{A as t,B as n,C as r,D as i,I as a,J as o,L as s,Q as c,a$ as l,a4 as u,a5 as d,a9 as f,aL as p,aP as m,aS as h,aT as g,aW as _,ab as v,ag as y,aq as b,b$ as x,b0 as S,bA as C,bB as w,bC as T,bD as E,bE as D,bF as O,bG as k,bH as A,bI as j,bJ as M,bK as N,bM as P,bN as F,bO as I,bP as L,bQ as R,bR as z,bS as B,bU as V,bX as H,b_ as U,bt as W,bv as G,bx as K,by as q,bz as J,c0 as Y,c1 as X}from"./index-BFym949y.js";import{b as ee,c as te,d as ne}from"./HeaderLink-BXWLCGTy.js";import{d as Z,e as re,f as ie}from"./Scenes-CZrLq5ZX.js";function ae(e,t){let n=ie(e,t?.in);if(!re(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=Z(n.getDate(),2),t=Z(n.getMonth()+1,2),r=Z(n.getFullYear(),4);a=`${r}${o}${t}${o}${e}`}if(i!==`date`){let e=Z(n.getHours(),2),t=Z(n.getMinutes(),2),r=Z(n.getSeconds(),2),i=a===``?``:` `;a=`${a}${i}${e}${s}${t}${s}${r}`}return a}const oe={},se={class:`cross-background-container`};function ce(e,t){return C(),B(`div`,se,[j(e.$slots,`default`,{},void 0,!0)])}var le=p(oe,[[`render`,ce],[`__scopeId`,`data-v-455eb62c`]]);const ue={"mb-1":``,"w-full":``,"gap-2":``},de={"w-full":``};var fe=L({__name:`Header`,setup(e){return(e,t)=>(C(),B(`header`,ue,[w(`div`,de,[V(ee)]),V(U(m),{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:z(()=>t[0]||=[w(`div`,{"i-solar:settings-minimalistic-bold-duotone":``},null,-1)]),_:1,__:[0]})]))}}),pe=fe,me=`/assets/worker-Bv82ofgX.js`;const Q=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`.split(``),he=e=>{let t=typeof e;return t===`object`?e===null?`null`:e?.constructor?.name??`object`:t},ge=e=>{if(typeof e==`string`)return new TextEncoder().encode(e);if(e instanceof Uint8Array)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);throw TypeError(`The input must be a Uint8Array, a string, or an ArrayBuffer. Received a value of the type ${he(e)}.`)},_e=e=>{let t=ge(e),n=``,r,i=t.length;for(r=2;r>2],n+=Q[(t[r-2]&3)<<4|t[r-1]>>4],n+=Q[(t[r-1]&15)<<2|t[r]>>6],n+=Q[t[r]&63];return r===i+1&&(n+=Q[t[r-2]>>2],n+=Q[(t[r-2]&3)<<4],n+=`==`),r===i&&(n+=Q[t[r-2]>>2],n+=Q[(t[r-2]&3)<<4|t[r-1]>>4],n+=Q[(t[r-1]&15)<<2],n+=`=`),n};function $(e,t,n){for(let r=0;r{I().then(()=>{t.value&&(t.value.scrollTop=t.value.scrollHeight)})}),l(async()=>{I().then(()=>{t.value&&(t.value.scrollTop=t.value.scrollHeight)})}),(e,i)=>{let s=J(`auto-animate`);return C(),B(`div`,be,[i[2]||=w(`div`,{"flex-1":``},null,-1),M((C(),B(`div`,{ref_key:`chatHistoryRef`,ref:t,"h-full":``,"w-full":``,flex:`~ col`,"overflow-scroll":``},[i[1]||=w(`div`,{"flex-1":``},null,-1),(C(!0),B(P,null,E(U(r),(e,t)=>(C(),B(`div`,{key:t,"mb-2":``},[e.role===`error`?(C(),B(`div`,xe,[w(`div`,Se,[w(`div`,Ce,[w(`div`,we,[w(`span`,Te,X(U(n)(`stage.chat.message.character-name.core-system`)),1)]),i[0]||=w(`div`,{"i-solar:danger-triangle-bold-duotone":``,"text-violet-500":``},null,-1)]),U(a)&&t===U(r).length-1?(C(),B(`div`,Ee)):(C(),B(`div`,{key:1,class:`markdown-content break-words text-violet-500`,text:`base {if(!e||!e.trim())return;let t=g.getProviderConfig(_.value);await D(e,{chatProvider:await g.getProviderInstance(_.value),model:v.value,providerConfig:t})}});async function L(){if(!(!r.value.trim()||m.value))try{let e=g.getProviderConfig(_.value);await D(r.value,{chatProvider:await g.getProviderInstance(_.value),model:v.value,providerConfig:e})}catch(e){A.value.pop(),A.value.push({role:`error`,content:e.message})}}let{destroy:R,start:z}=u(E,{onSpeechStart:()=>{l.value=!0},onVADMisfire:()=>{l.value=!1},onSpeechEnd:e=>{l.value=!1,W(e.buffer)},auto:!1});async function W(e){await j.resume();let t=await ye(e,j.sampleRate);F({type:`generate`,data:{audio:t,language:`en`}})}return q(T,async e=>{e===`false`&&(R(),I())}),q(p,async e=>{e&&await b()}),q([_,v],async()=>{_.value&&v.value&&await k(v.value,await g.getProviderInstance(_.value),[])}),N(()=>{z()}),O(async()=>{r.value=``}),(t,n)=>(C(),B(`div`,Be,[w(`fieldset`,Ve,[w(`label`,{class:x([d.value===`chat`?`bg-primary-100 dark:bg-primary-900`:`bg-white dark:bg-primary-950`,d.value===`chat`?`text-primary-500 dark:text-primary-500`:``,{"transition-colors-none ":U(y)}]),flex:`~ row`,checked:d.value===`chat`,"aria-checked":d.value===`chat`,border:`solid 2 primary-100 dark:primary-900`,text:`primary-300 hover:primary-500 dark:primary-300/50 dark:hover:primary-500`,transition:`all duration-250 ease-in-out`,"cursor-pointer":``,"items-center":``,"gap-1":``,"rounded-lg":``,"px-2":``},[M(w(`input`,{"onUpdate:modelValue":n[0]||=e=>d.value=e,type:`radio`,name:`tab`,value:`chat`,hidden:``},null,512),[[G,d.value]]),n[4]||=w(`div`,{"i-solar:dialog-2-bold-duotone":``,text:`2xl`,transform:`translate-y--2`},null,-1),w(`div`,Ue,[w(`span`,We,X(U(P)(`stage.chat.tabs.chat`)),1)])],10,He)]),w(`div`,Ge,[w(`div`,Ke,[V(ze,{"h-full":``,"flex-1":``,"p-4":``,w:`full`,"max-h":`r.value=e,placeholder:U(P)(`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:x({"transition-colors-none placeholder:transition-colors-none":U(y)}),onSubmit:L,onCompositionstart:n[2]||=e=>m.value=!0,onCompositionend:n[3]||=e=>m.value=!1},null,8,[`modelValue`,`placeholder`,`class`])])])])]))}}),Ye=Je;const Xe=[`src`],Ze=[`src`];var Qe=L({__name:`MobileHeaderLink`,setup(e){let t=g();return(e,n)=>(C(),k(U(m),{to:`/`,flex:`~`,"items-center":``,"gap-2":``,"px-2":``,"text-nowrap":``,"text-2xl":``,"outline-none":``},{default:z(()=>[U(t)?(C(),B(`img`,{key:0,src:U(ne),"h-8":``,"w-8":``,class:`theme-colored`},null,8,Xe)):(C(),B(`img`,{key:1,src:U(te),"h-8":``,"w-8":``,class:`theme-colored`},null,8,Ze))]),_:1}))}}),$e=p(Qe,[[`__scopeId`,`data-v-9c3d67a4`]]);const et={"mb-1":``,"w-full":``,"gap-2":``},tt={"w-full":``,flex:``,"justify-center":``};var nt=L({__name:`MobileHeader`,setup(e){return(e,t)=>(C(),B(`header`,et,[w(`div`,tt,[V($e)])]))}}),rt=nt;const it={flex:`~ col`,rounded:`lg`,"overflow-hidden":``},at={key:0,flex:``,mr:`12`},ot={flex:`~ col`,shadow:`md violet-200/20 dark:none`,"min-w-20":``,"rounded-lg":``,"px-3":``,"py-2":``,h:`unset {I().then(()=>{t.value&&(t.value.scrollTop=t.value.scrollHeight)})}),c(async()=>{I().then(()=>{t.value&&(t.value.scrollTop=t.value.scrollHeight)})}),(e,i)=>{let o=J(`auto-animate`);return C(),B(`div`,it,[M((C(),B(`div`,{ref_key:`chatHistoryRef`,ref:t,"max-h":`35dvh`,"z-5":``,flex:`~ col`,"h-full":``,"w-full":``,"overflow-scroll":``,class:`chat-history`},[(C(!0),B(P,null,E(U(r),(e,t)=>(C(),B(`div`,{key:t,"mb-2":``},[e.role===`error`?(C(),B(`div`,at,[w(`div`,ot,[w(`div`,st,[w(`div`,ct,[w(`span`,lt,X(U(n)(`stage.chat.message.character-name.core-system`)),1)]),i[0]||=w(`div`,{"i-solar:danger-triangle-bold-duotone":``,"text-violet-500":``},null,-1)]),e.content?(C(),B(`div`,{key:0,class:`markdown-content`,text:`base {if(Tt.test(e)){let t=Date.prototype[e.replace(Tt,`$1UTC`)];t&&(wt.prototype[e]=t)}});var Et=class extends wt{toString(){let e=this.toDateString(),t=this.toTimeString();return`${e} ${t}`}toDateString(){let e=Dt.format(this),t=Ot.format(this),n=this.getFullYear();return`${e} ${t} ${n}`}toTimeString(){let e=kt.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})}},Dt=new Intl.DateTimeFormat(`en-US`,{weekday:`short`,timeZone:`UTC`}),Ot=new Intl.DateTimeFormat(`en-US`,{month:`short`,day:`numeric`,timeZone:`UTC`}),kt=new Intl.DateTimeFormat(`en-GB`,{hour12:!1,hour:`numeric`,minute:`numeric`,second:`numeric`,timeZone:`UTC`});const At=`88abef140d`,jt=`main`,Mt=`Tue Jul 22 14:05:19 2025 +0800`,Nt={"max-w":`calc[100%-2rem]`,"mx-auto":``,"h-full":``,flex:``,"flex-col":``,"pt-14":``},Pt={"flex-1":``},Ft={grid:`~ cols-[70px_1fr]`,"mt-4":``,"gap-2":``,"text-sm":``},It={"font-mono":``},Lt={"font-mono":``},Rt={"font-mono":``};var zt=L({__name:`About`,setup(e){let t=H(!1),n=ae(new Et(Mt));return(e,r)=>(C(),B(P,null,[w(`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]||=[w(`div`,{"i-solar:info-circle-outline":``,"size-5":``,text:`neutral-500 dark:neutral-400`},null,-1)]),V(U(v),{modelValue:t.value,"onUpdate:modelValue":r[1]||=e=>t.value=e},{default:z(()=>[w(`div`,Nt,[r[7]||=w(`div`,{"font-sans-rounded":``,"mb-14":``,"text-center":``,"text-5xl":``},[w(`span`,{text:`neutral-400 dark:neutral-100/65`},`Project`),D(),w(`span`,{text:`pink-400 dark:pink-300/90`},`AIRI`),w(`div`,{"mt-2":``,"text-base":``},` Web ver. `)],-1),w(`div`,Pt,[r[6]||=w(`div`,{text:`neutral-500 dark:neutral-400`},` Application build information `,-1),w(`div`,Ft,[r[3]||=w(`div`,{text:`neutral-500 dark:neutral-400`},` Branch `,-1),w(`div`,It,X(U(jt)),1),r[4]||=w(`div`,{text:`neutral-500 dark:neutral-400`},` Commit `,-1),w(`div`,Lt,X(U(At).substring(0,7)),1),r[5]||=w(`div`,{text:`neutral-500 dark:neutral-400`},` Built on `,-1),w(`div`,Rt,X(U(n)),1)])]),r[8]||=w(`div`,{"my-10":``},[w(`div`,{text:`neutral-500 dark:neutral-400`},` About `),w(`div`,{"mt-4":``,flex:``,"flex-col":``,"gap-2":``},[w(`a`,{class:x([`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`},[w(`div`,{"i-solar:home-smile-outline":``}),w(`div`,null,`Home`)]),w(`a`,{href:`https://airi.moeru.ai/docs/en/docs/overview/`,class:x([`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`},[w(`div`,{"i-solar:document-add-outline":``}),w(`div`,null,`Documentations`)]),w(`a`,{href:`https://github.com/moeru-ai/airi`,class:x([`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`},[w(`div`,{"i-simple-icons:github":``}),w(`div`,null,`GitHub`)])])],-1)])]),_:1},8,[`modelValue`])],64))}}),Bt=zt;const Vt={"w-full":``,flex:``,"flex-1":``,"items-center":``,"self-end":``,"justify-end":``,"gap-2":``},Ht={key:0,"w-full":``,flex:``,"justify-between":``,"gap-2":``},Ut={key:0,"i-solar:tuning-outline":``,"size-5":``},Wt={key:1,"i-solar:alt-arrow-right-outline":``,"size-5":``};var Gt=L({__name:`ViewControls`,props:{modelValue:{required:!0},modelModifiers:{}},emits:K([`reset`],[`update:modelValue`]),setup(e,{emit:t}){let r=t,{stageView:i,stageViewControlsEnabled:a}=h(n()),o=A(e,`modelValue`);function s(e){if(o.value===e){r(`reset`);return}o.value=e}return(e,t)=>(C(),B(`div`,Vt,[V(W,{name:`fade`},{default:z(()=>[U(a)?(C(),B(`div`,Ht,[V(U(y),{variant:`secondary-muted`,toggled:o.value===`x`,"w-full":``,onClick:t[0]||=e=>s(`x`)},{default:z(()=>t[5]||=[D(` X `)]),_:1,__:[5]},8,[`toggled`]),V(U(y),{variant:`secondary-muted`,toggled:o.value===`y`,"w-full":``,onClick:t[1]||=e=>s(`y`)},{default:z(()=>t[6]||=[D(` Y `)]),_:1,__:[6]},8,[`toggled`]),U(i)===`3d`?(C(),k(U(y),{key:0,variant:`secondary-muted`,toggled:o.value===`z`,"w-full":``,onClick:t[2]||=e=>s(`z`)},{default:z(()=>t[7]||=[D(` Z `)]),_:1,__:[7]},8,[`toggled`])):R(``,!0),V(U(y),{variant:`secondary-muted`,toggled:o.value===`scale`,"w-full":``,onClick:t[3]||=e=>s(`scale`)},{default:z(()=>t[8]||=[D(` Scale `)]),_:1,__:[8]},8,[`toggled`])])):R(``,!0)]),_:1}),w(`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=>a.value=!U(a)},[V(W,{name:`fade`,mode:`out-in`},{default:z(()=>[U(a)?(C(),B(`div`,Wt)):(C(),B(`div`,Ut))]),_:1})])]))}}),Kt=p(Gt,[[`__scopeId`,`data-v-35df7db7`]]);const qt={key:0},Jt={key:0,relative:``,class:`[&_.round-range-tooltip]:hover:opacity-100`},Yt={class:`round-range-tooltip`,top:`50%`,"translate-y":`[-50%]`,absolute:``,"left-10":``,"font-mono":``,"op-0":``,transition:`all duration-200 ease-in-out`},Xt={key:1,relative:``,class:`[&_.round-range-tooltip]:hover:opacity-100`},Zt={class:`round-range-tooltip`,top:`50%`,"translate-y":`[-50%]`,absolute:``,"left-10":``,"font-mono":``,"op-0":``,transition:`all duration-200 ease-in-out`},Qt={key:2,relative:``,class:`[&_.round-range-tooltip]:hover:opacity-100`},$t={class:`round-range-tooltip`,top:`50%`,"translate-y":`[-50%]`,absolute:``,"left-10":``,"font-mono":``,"op-0":``,transition:`all duration-200 ease-in-out`},en={key:3,relative:``,class:`[&_.round-range-tooltip]:hover:opacity-100`},tn={class:`round-range-tooltip`,top:`50%`,"translate-y":`[-50%]`,absolute:``,"left-10":``,"font-mono":``,"op-0":``,transition:`all duration-200 ease-in-out`};var nn=L({__name:`Inputs`,props:{mode:{}},setup(e,{expose:i}){let a=e,{stageView:o,stageViewControlsEnabled:s}=h(n()),{scale:c,position:l,modelSize:u}=h(t()),{scale:d,position:f}=h(r()),p=F({get:()=>{switch(o.value){case`2d`:return f.value.x;case`3d`:return l.value.x;default:return 0}},set:e=>{switch(o.value){case`2d`:f.value.x=e;break;case`3d`:l.value.x=e;break;default:break}}}),m=F(()=>o.value===`2d`?-500:-u.value.x-10),g=F(()=>o.value===`2d`?500:u.value.x+10),_=F({get:()=>{switch(o.value){case`2d`:return f.value.y;case`3d`:return l.value.y;default:return 0}},set:e=>{switch(o.value){case`2d`:f.value.y=e;break;case`3d`:l.value.y=e;break;default:break}}}),v=F(()=>o.value===`2d`?-500:-u.value.y-10),y=F(()=>o.value===`2d`?500:u.value.y+10),x=F({get:()=>{switch(o.value){case`2d`:return 0;case`3d`:return l.value.z;default:return 0}},set:e=>{switch(o.value){case`2d`:break;case`3d`:l.value.z=e;break;default:break}}}),S=F(()=>o.value===`2d`?-500:-u.value.z-10),T=F(()=>o.value===`2d`?500:u.value.z+10),E=F({get:()=>o.value===`2d`?d.value:c.value,set:e=>{o.value===`2d`?d.value=e:c.value=e}});function D(){switch(a.mode){case`x`:p.value=0;break;case`y`:_.value=0;break;case`z`:x.value=0;break;case`scale`:E.value=1;break}}return i({resetOnMode:D}),(e,t)=>(C(),k(W,{name:`fade-side-pops-in`},{default:z(()=>[U(s)?(C(),B(`div`,qt,[V(W,{name:`fade-side-pops-in`,mode:`out-in`},{default:z(()=>[a.mode===`x`?(C(),B(`div`,Jt,[V(U(b),{modelValue:p.value,"onUpdate:modelValue":t[0]||=e=>p.value=e,min:m.value,max:g.value,step:.01,"data-direction":`vertical`,h:`50%`,"write-vertical-left":``},null,8,[`modelValue`,`min`,`max`]),w(`div`,Yt,X(p.value.toFixed(2)),1)])):a.mode===`y`?(C(),B(`div`,Xt,[V(U(b),{modelValue:_.value,"onUpdate:modelValue":t[1]||=e=>_.value=e,min:v.value,max:y.value,step:.01,"write-vertical-left":``,h:`50%`,"data-direction":`vertical`},null,8,[`modelValue`,`min`,`max`]),w(`div`,Zt,X(_.value.toFixed(2)),1)])):U(o)===`3d`&&a.mode===`z`?(C(),B(`div`,Qt,[V(U(b),{modelValue:x.value,"onUpdate:modelValue":t[2]||=e=>x.value=e,min:S.value,max:T.value,step:.01,"write-vertical-left":``,h:`50%`,"data-direction":`vertical`},null,8,[`modelValue`,`min`,`max`]),w(`div`,$t,X(x.value.toFixed(2)),1)])):a.mode===`scale`?(C(),B(`div`,en,[V(U(b),{modelValue:E.value,"onUpdate:modelValue":t[3]||=e=>E.value=e,min:0,max:3,step:1e-4,"write-vertical-left":``,h:`50%`,"data-direction":`vertical`},null,8,[`modelValue`]),w(`div`,tn,X(E.value.toFixed(2)),1)])):R(``,!0)]),_:1})])):R(``,!0)]),_:1}))}}),rn=p(nn,[[`__scopeId`,`data-v-d116bf35`]]);const an={fixed:``,"bottom-0":``,"w-full":``,flex:``,"flex-col":``},on={relative:``,"w-full":``,"self-end":``},sn={top:`50%`,"translate-y":`[-50%]`,fixed:``,"z-15":``,"px-3":``},cn={"translate-y":`[-100%]`,absolute:``,"right-0":``,"w-full":``,"px-3":``,"pb-3":``,"font-sans":``},ln={flex:`~ col`,"w-full":``,"gap-1":``},un={key:0,"i-solar:moon-outline":``,"size-5":``,text:`neutral-500 dark:neutral-400`},dn={key:1,"i-solar:sun-2-outline":``,"size-5":``,text:`neutral-500 dark:neutral-400`},fn={key:0,"size-5":``,text:`neutral-500 dark:neutral-400`,"inline-flex":``,"items-center":``,"justify-center":``},pn={key:1,"size-5":``,text:`neutral-500 dark:neutral-400`,"inline-flex":``,"items-center":``,"justify-center":``};var mn=L({__name:`MobileInteractiveArea`,setup(t){let r=g({disableTransition:!1}),c=H(`scale`),d=O(`viewControlsInputs`),f=H(``),p=H(!1),v=H(!1),y=_(),b=o(),{activeProvider:S,activeModel:E}=h(a());l(document.documentElement,()=>y.update());let{isAudioInputOn:D,selectedAudioDeviceId:A,themeColorsHueDynamic:j,stageView:M,stageViewControlsEnabled:P}=h(n()),{send:F,onAfterSend:I,discoverToolsCompatibility:L}=i(),{messages:G}=h(i()),{t:K}=s();async function J(){if(!(!f.value.trim()||v.value))try{let e=b.getProviderConfig(S.value);await F(f.value,{chatProvider:await b.getProviderInstance(S.value),model:E.value,providerConfig:e})}catch(e){G.value.pop(),G.value.push({role:`error`,content:e.message})}}let{destroy:X,start:ee}=u(A,{onSpeechStart:()=>{p.value=!0},onVADMisfire:()=>{p.value=!1},onSpeechEnd:e=>{p.value=!1,te(e)},auto:!1});function te(e){alert(`Transcription is not implemented yet`)}return q(D,async e=>{e===`false`&&X()}),I(async()=>{f.value=``}),q([S,E],async()=>{S.value&&E.value&&await L(E.value,await b.getProviderInstance(S.value),[])}),N(()=>{ee(),y.update()}),(t,n)=>(C(),B(`div`,an,[(C(),k(T,null,[V(W,{name:`fade`},{default:z(()=>[U(P)?R(``,!0):(C(),k(Ct,{key:0,"max-w":`[calc(100%-3.5rem)]`,"w-full":``,"self-start":``,"pl-3":``}))]),_:1})],1024)),w(`div`,on,[w(`div`,sn,[V(rn,{ref:`viewControlsInputs`,mode:c.value},null,8,[`mode`])]),w(`div`,cn,[w(`div`,ln,[V(Bt),w(`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=>r.value=!U(r)},[V(W,{name:`fade`,mode:`out-in`},{default:z(()=>[U(r)?(C(),B(`div`,un)):(C(),B(`div`,dn))]),_:1})]),V(U(m),{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:z(()=>n[7]||=[w(`div`,{"i-solar:settings-outline":``,"size-5":``,text:`neutral-500 dark:neutral-400`},null,-1)]),_:1,__:[7]}),w(`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=>M.value=U(M)===`2d`?`3d`:`2d`},[U(M)===`2d`?(C(),B(`div`,fn,n[8]||=[w(`span`,null,`2D`,-1)])):R(``,!0),U(M)===`3d`?(C(),B(`div`,pn,n[9]||=[w(`span`,null,`3D`,-1)])):R(``,!0)]),V(Kt,{modelValue:c.value,"onUpdate:modelValue":n[2]||=e=>c.value=e,onReset:n[3]||=()=>d.value?.resetOnMode()},null,8,[`modelValue`])])]),w(`div`,{bg:`white dark:neutral-800`,"max-h-100dvh":``,"max-w-100dvw":``,"w-full":``,flex:``,"gap-1":``,"overflow-auto":``,"px-3":``,"pt-2":``,style:Y({paddingBottom:`${Math.max(Number.parseFloat(U(y).bottom.value.replace(`px`,``)),12)}px`})},[V(U(e),{modelValue:f.value,"onUpdate:modelValue":n[4]||=e=>f.value=e,placeholder:U(K)(`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:x([U(j)?`transition-colors-none placeholder:transition-colors-none`:``]),"default-height":`1lh`,onSubmit:J,onCompositionstart:n[5]||=e=>v.value=!0,onCompositionend:n[6]||=e=>v.value=!1},null,8,[`modelValue`,`placeholder`,`class`]),f.value.trim()||v.value?(C(),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:J},n[10]||=[w(`div`,{"i-solar:arrow-up-outline":``},null,-1)])):R(``,!0)],4)])]))}}),hn=mn;const gn={class:`relative`},_n={absolute:``,"left-0":``,"right-0":``,"top-0":``,"w-full":``,"overflow-hidden":``};var vn=L({__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=H(t.height),r=H(t.amplitude),i=H(t.waveLength),a=H(t.fillColor),o=H(t.direction),s=H(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=F(()=>n.value+r.value*2),u=F(()=>{let e=` - - `;return`url(data:image/svg+xml;base64,${btoa(e)})`});return q(()=>[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)=>(C(),B(`div`,gn,[j(e.$slots,`default`,{},void 0,!0),w(`div`,_n,[w(`div`,{class:`colored-area wave`,style:Y({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)])]))}}),yn=p(vn,[[`__scopeId`,`data-v-33a54ad1`]]);export{yn as b,hn as c,rt as d,Ye as e,pe as f,le as g}; \ No newline at end of file diff --git a/assets/Basic-CcFV8fg0.js b/assets/Basic-CcFV8fg0.js deleted file mode 100644 index a3cf106e8d64e34cf0fa3effc3cbc53dc67d5dd5..0000000000000000000000000000000000000000 --- a/assets/Basic-CcFV8fg0.js +++ /dev/null @@ -1 +0,0 @@ -import{bA as e,bH as t,bJ as n,bP as r,bS as i,bX as a,bu as o,bx as s,by as c,c0 as l}from"./index-BFym949y.js";var u=r({__name:`Basic`,props:s({defaultHeight:{}},{modelValue:{default:``},modelModifiers:{}}),emits:s([`submit`],[`update:modelValue`]),setup(r,{emit:s}){let u=r,d=s,f=t(r,`modelValue`),p=a(),m=a(`auto`);function h(e){e.code===`Enter`&&!e.shiftKey&&(e.preventDefault(),d(`submit`,f.value))}return c(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}),(t,r)=>n((e(),i(`textarea`,{ref_key:`textareaRef`,ref:p,"onUpdate:modelValue":r[0]||=e=>f.value=e,style:l({height:m.value}),onKeydown:h},null,36)),[[o,f.value]])}}),d=u;export{d as b}; \ No newline at end of file diff --git a/assets/Basic-Cwa2X3hA.js b/assets/Basic-Cwa2X3hA.js new file mode 100644 index 0000000000000000000000000000000000000000..053b0780312e867977ad95856b6a1f1a03cd07ee --- /dev/null +++ b/assets/Basic-Cwa2X3hA.js @@ -0,0 +1 @@ +import{b$ as e,bB as t,bD as n,bJ as r,bM as i,bP as a,bQ as o,bT as s,bX as c,bu as l}from"./index-J3uhnpYL.js";var u=r({__name:`Basic`,props:a({defaultHeight:{}},{modelValue:{default:``},modelModifiers:{}}),emits:a([`submit`],[`update:modelValue`]),setup(r,{emit:a}){let u=r,d=a,f=t(r,`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}),(t,r)=>n((s(),i(`textarea`,{ref_key:`textareaRef`,ref:p,"onUpdate:modelValue":r[0]||=e=>f.value=e,style:e({height:m.value}),onKeydown:h},null,36)),[[l,f.value]])}}),d=u;export{d as b}; \ No newline at end of file diff --git a/assets/CardCreate-BOXHbJQd.js b/assets/CardCreate-BlTH4Xox.js similarity index 54% rename from assets/CardCreate-BOXHbJQd.js rename to assets/CardCreate-BlTH4Xox.js index cef8c5c1a4b2401c5b5db257456c95335618a7cb..f68189daef454303ac69b8c138db0c40a2ee579c 100644 --- a/assets/CardCreate-BOXHbJQd.js +++ b/assets/CardCreate-BlTH4Xox.js @@ -1 +1 @@ -import{L as e,bA as t,bB as n,bP as r,bS as i,b_ as a,c1 as o}from"./index-BFym949y.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)=>(t(),i(`div`,s,[r[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 +import{L as e,bJ as t,bM as n,bT as r,bU as i,b_ as a,c0 as o}from"./index-J3uhnpYL.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)=>(r(),n(`div`,s,[t[0]||=i(`div`,{"i-solar:add-square-line-duotone":``,"mb-4":``,"text-5xl":``,text:`neutral-400 dark:neutral-500`},null,-1),i(`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-CQKwfgDh.js b/assets/CardCreate-CQKwfgDh.js deleted file mode 100644 index f10f5e8d33a799870aa89e540f7120d9a88461ab..0000000000000000000000000000000000000000 --- a/assets/CardCreate-CQKwfgDh.js +++ /dev/null @@ -1 +0,0 @@ -import{b as e}from"./CardCreate-BOXHbJQd.js";export{e as default}; \ No newline at end of file diff --git a/assets/CardCreate-eYkmqupR.js b/assets/CardCreate-eYkmqupR.js new file mode 100644 index 0000000000000000000000000000000000000000..5f7eec5688d826ec9201d3eadac3bd9a6a545e2d --- /dev/null +++ b/assets/CardCreate-eYkmqupR.js @@ -0,0 +1 @@ +import{b as e}from"./CardCreate-BlTH4Xox.js";export{e as default}; \ No newline at end of file diff --git a/assets/CardCreationDialog-BV9G3q2c.js b/assets/CardCreationDialog-BV9G3q2c.js new file mode 100644 index 0000000000000000000000000000000000000000..ad7e543427cc5456f86c5915acdf7632edf4f77c --- /dev/null +++ b/assets/CardCreationDialog-BV9G3q2c.js @@ -0,0 +1,3 @@ +import{F as e,L as t,aL as n,ag as r,as as i,aw as a,bA as o,bB as s,bG as c,bH as l,bJ as u,bK as d,bL as f,bM as p,bO as m,bP as h,bT as g,bU as _,bV as v,bX as y,bY as ee,b_ as b,bx as te,by as x,c0 as S,c1 as C,c2 as w,c6 as T,d as E,f as D,h as O,l as ne,n as re}from"./index-J3uhnpYL.js";var k=w((exports,t)=>{function n(e){return e.toLowerCase()}t.exports=n}),A=w((exports,t)=>{var n=k();t.exports=n}),j=w((exports,t)=>{function n(e,t,n){return e.replace(t,n)}t.exports=n}),M=w((exports,t)=>{var n=j();t.exports=n}),N=w((exports,t)=>{var n=String.prototype.trim!==void 0;t.exports=n}),P=w((exports,t)=>{var n=String.prototype.trim;t.exports=n}),F=w((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=w((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=w((exports,t)=>{var n=P();function r(e){return n.call(e)}t.exports=r}),R=w((exports,t)=>{var n=N(),r=F(),i=I(),a=L(),o;o=n&&r()?a:i,t.exports=o}),z=w((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=w((exports,t)=>{var n=z();t.exports=n}),V=T(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:h({modelValue:{type:Boolean}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:h([`update:modelValue`],[`update:modelValue`]),setup(n,{emit:u}){let h=u,w=s(n,`modelValue`),{t:T}=t(),k=e(),A=y(``),j=[{id:`identity`,label:T(`settings.pages.card.creation.identity`),icon:`i-solar:emoji-funny-square-bold-duotone`},{id:`behavior`,label:T(`settings.pages.card.creation.behavior`),icon:`i-solar:chat-round-line-bold-duotone`},{id:`settings`,label:T(`settings.pages.card.creation.settings`),icon:`i-solar:settings-bold-duotone`}],M=l({get:()=>j.find(e=>e.id===A.value)?A.value:j[0]?.id||``,set:e=>{A.value=e}}),N=y(!1),P=y(``);function F(e){let t=ee(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=T(`settings.pages.card.creation.errors.posthistoryinstructions`),!1}else return N.value=!0,P.value=T(`settings.pages.card.creation.errors.systemprompt`),!1;else return N.value=!0,P.value=T(`settings.pages.card.creation.errors.scenario`),!1;else return N.value=!0,P.value=T(`settings.pages.card.creation.errors.personality`),!1;else return N.value=!0,P.value=T(`settings.pages.card.creation.errors.description`),!1;else return N.value=!0,P.value=T(`settings.pages.card.creation.errors.version`),!1;else return N.value=!0,P.value=T(`settings.pages.card.creation.errors.name`),!1;return N.value=!1,k.addCard(t),w.value=!1,!0}let I=y({name:T(`settings.pages.card.creation.defaults.name`),nickname:void 0,version:`1.0`,description:``,notes:void 0,personality:T(`settings.pages.card.creation.defaults.personality`),scenario:T(`settings.pages.card.creation.defaults.scenario`),systemPrompt:T(`settings.pages.card.creation.defaults.systemprompt`),postHistoryInstructions:T(`settings.pages.card.creation.defaults.posthistoryinstructions`),greetings:[],messageExample:[]});function L(e,t){return l({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=l({get:()=>I.value.greetings??[],set:e=>{I.value.greetings=e||[]}}),Z=L(`version`),Q=L(`systemPrompt`),$=L(`postHistoryInstructions`);return(e,t)=>(g(),o(b(re),{open:w.value,"onUpdate:open":t[12]||=e=>h(`update:modelValue`,e)},{default:f(()=>[m(b(ne),null,{default:f(()=>[m(b(D),{class:`data-[state=open]:animate-fadeIn data-[state=closed]:animate-fadeOut fixed inset-0 z-100 bg-black/50 backdrop-blur-sm`}),m(b(E),{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:f(()=>[_(`div`,H,[m(b(O),{"text-2xl":``,"font-normal":``,class:`from-primary-500 to-primary-400 bg-gradient-to-r bg-clip-text text-transparent`},{default:f(()=>[x(S(b(T)(`settings.pages.card.create_card`)),1)]),_:1}),_(`div`,U,[_(`div`,W,[_(`div`,G,[(g(),p(c,null,te(j,e=>_(`button`,{key:e.id,class:C([`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},[_(`div`,ie,[_(`div`,{class:C(e.icon)},null,2),x(` `+S(e.label),1)])],10,K)),64))])])]),N.value?(g(),p(`div`,ae,[_(`p`,oe,S(P.value),1)])):d(``,!0),M.value===`identity`?(g(),p(`div`,se,[_(`p`,ce,S(b(T)(`settings.pages.card.creation.fields_info.subtitle`)),1),_(`div`,le,[m(b(a),{modelValue:b(R),"onUpdate:modelValue":t[0]||=e=>v(R)?R.value=e:null,label:b(T)(`settings.pages.card.creation.name`),description:b(T)(`settings.pages.card.creation.fields_info.name`),required:!0},null,8,[`modelValue`,`label`,`description`]),m(b(a),{modelValue:b(z),"onUpdate:modelValue":t[1]||=e=>v(z)?z.value=e:null,label:b(T)(`settings.pages.card.creation.nickname`),description:b(T)(`settings.pages.card.creation.fields_info.nickname`)},null,8,[`modelValue`,`label`,`description`]),m(b(a),{modelValue:b(B),"onUpdate:modelValue":t[2]||=e=>v(B)?B.value=e:null,label:b(T)(`settings.pages.card.creation.description`),"single-line":!1,required:!0,description:b(T)(`settings.pages.card.creation.fields_info.description`)},null,8,[`modelValue`,`label`,`description`]),m(b(a),{modelValue:b(q),"onUpdate:modelValue":t[3]||=e=>v(q)?q.value=e:null,label:b(T)(`settings.pages.card.creator_notes`),"single-line":!1,description:b(T)(`settings.pages.card.creation.fields_info.notes`)},null,8,[`modelValue`,`label`,`description`])])])):M.value===`behavior`?(g(),p(`div`,ue,[_(`div`,de,[m(b(a),{modelValue:b(J),"onUpdate:modelValue":t[4]||=e=>v(J)?J.value=e:null,label:b(T)(`settings.pages.card.personality`),"single-line":!1,required:!0,description:b(T)(`settings.pages.card.creation.fields_info.personality`)},null,8,[`modelValue`,`label`,`description`]),m(b(a),{modelValue:b(Y),"onUpdate:modelValue":t[5]||=e=>v(Y)?Y.value=e:null,label:b(T)(`settings.pages.card.scenario`),"single-line":!1,required:!0,description:b(T)(`settings.pages.card.creation.fields_info.scenario`)},null,8,[`modelValue`,`label`,`description`]),m(b(i),{modelValue:X.value,"onUpdate:modelValue":t[6]||=e=>X.value=e,label:b(T)(`settings.pages.card.creation.greetings`),description:b(T)(`settings.pages.card.creation.fields_info.greetings`)},null,8,[`modelValue`,`label`,`description`])])])):M.value===`settings`?(g(),p(`div`,fe,[_(`div`,pe,[m(b(a),{modelValue:b(Q),"onUpdate:modelValue":t[7]||=e=>v(Q)?Q.value=e:null,label:b(T)(`settings.pages.card.systemprompt`),"single-line":!1,required:!0,description:b(T)(`settings.pages.card.creation.fields_info.systemprompt`)},null,8,[`modelValue`,`label`,`description`]),m(b(a),{modelValue:b($),"onUpdate:modelValue":t[8]||=e=>v($)?$.value=e:null,label:b(T)(`settings.pages.card.posthistoryinstructions`),"single-line":!1,required:!0,description:b(T)(`settings.pages.card.creation.fields_info.posthistoryinstructions`)},null,8,[`modelValue`,`label`,`description`]),m(b(a),{modelValue:b(Z),"onUpdate:modelValue":t[9]||=e=>v(Z)?Z.value=e:null,label:b(T)(`settings.pages.card.creation.version`),required:!0,description:b(T)(`settings.pages.card.creation.fields_info.version`)},null,8,[`modelValue`,`label`,`description`])])])):d(``,!0),_(`div`,me,[m(b(r),{variant:`secondary`,icon:`i-solar:undo-left-bold-duotone`,label:b(T)(`settings.pages.card.cancel`),disabled:!1,onClick:t[10]||=e=>w.value=!1},null,8,[`label`]),m(b(r),{variant:`primary`,icon:`i-solar:check-circle-bold-duotone`,label:b(T)(`settings.pages.card.creation.create`),disabled:!1,onClick:t[11]||=e=>F(I.value)},null,8,[`label`])])])]),_:1})]),_:1})]),_:1},8,[`open`]))}}),J=n(q,[[`__scopeId`,`data-v-c19882e9`]]);export{J as b}; \ No newline at end of file diff --git a/assets/CardCreationDialog-BrvTqDsp.js b/assets/CardCreationDialog-BrvTqDsp.js deleted file mode 100644 index c7195eb2758963bfd3a78fddc5b3def67107e8f4..0000000000000000000000000000000000000000 --- a/assets/CardCreationDialog-BrvTqDsp.js +++ /dev/null @@ -1,3 +0,0 @@ -import{F as e,L as t,aL as n,ag as r,as as i,aw as a,b$ as o,bA as s,bB as c,bD as ee,bE as l,bG as u,bH as d,bM as te,bN as f,bP as p,bQ as m,bR as h,bS as g,bU as _,bV as v,bX as y,bY as ne,b_ as b,bx as x,c as S,c1 as C,c2 as w,c6 as T,e as E,g as D,k as re,m as ie}from"./index-BFym949y.js";var O=w((exports,t)=>{function n(e){return e.toLowerCase()}t.exports=n}),k=w((exports,t)=>{var n=O();t.exports=n}),A=w((exports,t)=>{function n(e,t,n){return e.replace(t,n)}t.exports=n}),j=w((exports,t)=>{var n=A();t.exports=n}),M=w((exports,t)=>{var n=String.prototype.trim!==void 0;t.exports=n}),N=w((exports,t)=>{var n=String.prototype.trim;t.exports=n}),P=w((exports,t)=>{var n=N(),r=` - \r -\f\v            \u2028\u2029   `,i=`᠎`;function a(){return n.call(r)===``&&n.call(i)===i}t.exports=a}),F=w((exports,t)=>{var n=j(),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}),I=w((exports,t)=>{var n=N();function r(e){return n.call(e)}t.exports=r}),L=w((exports,t)=>{var n=M(),r=P(),i=F(),a=I(),o;o=n&&r()?a:i,t.exports=o}),R=w((exports,t)=>{var n=k(),r=j(),i=L(),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}),z=w((exports,t)=>{var n=R();t.exports=n}),B=T(z());const V={class:`w-full flex flex-col gap-5`},H={class:`mt-4`},U={class:`border-b border-neutral-200 dark:border-neutral-700`},W={class:`flex justify-center -mb-px sm:justify-start space-x-1`},G=[`onClick`],K={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=p({__name:`CardCreationDialog`,props:x({modelValue:{type:Boolean}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:x([`update:modelValue`],[`update:modelValue`]),setup(n,{emit:p}){let x=p,w=d(n,`modelValue`),{t:T}=t(),O=e(),k=y(``),A=[{id:`identity`,label:T(`settings.pages.card.creation.identity`),icon:`i-solar:emoji-funny-square-bold-duotone`},{id:`behavior`,label:T(`settings.pages.card.creation.behavior`),icon:`i-solar:chat-round-line-bold-duotone`},{id:`settings`,label:T(`settings.pages.card.creation.settings`),icon:`i-solar:settings-bold-duotone`}],j=f({get:()=>A.find(e=>e.id===k.value)?k.value:A[0]?.id||``,set:e=>{k.value=e}}),M=y(!1),N=y(``);function P(e){let t=ne(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 M.value=!0,N.value=T(`settings.pages.card.creation.errors.posthistoryinstructions`),!1}else return M.value=!0,N.value=T(`settings.pages.card.creation.errors.systemprompt`),!1;else return M.value=!0,N.value=T(`settings.pages.card.creation.errors.scenario`),!1;else return M.value=!0,N.value=T(`settings.pages.card.creation.errors.personality`),!1;else return M.value=!0,N.value=T(`settings.pages.card.creation.errors.description`),!1;else return M.value=!0,N.value=T(`settings.pages.card.creation.errors.version`),!1;else return M.value=!0,N.value=T(`settings.pages.card.creation.errors.name`),!1;return M.value=!1,O.addCard(t),w.value=!1,!0}let F=y({name:T(`settings.pages.card.creation.defaults.name`),nickname:void 0,version:`1.0`,description:``,notes:void 0,personality:T(`settings.pages.card.creation.defaults.personality`),scenario:T(`settings.pages.card.creation.defaults.scenario`),systemPrompt:T(`settings.pages.card.creation.defaults.systemprompt`),postHistoryInstructions:T(`settings.pages.card.creation.defaults.posthistoryinstructions`),greetings:[],messageExample:[]});function I(e,t){return f({get:()=>F.value[e]??``,set:n=>{let r=n.trim();F.value[e]=r.length>0?t?t(r):r:``}})}let L=I(`name`,e=>(0,B.default)(e)),R=I(`nickname`),z=I(`description`),q=I(`notes`),J=I(`personality`),Y=I(`scenario`),X=f({get:()=>F.value.greetings??[],set:e=>{F.value.greetings=e||[]}}),Z=I(`version`),Q=I(`systemPrompt`),$=I(`postHistoryInstructions`);return(e,t)=>(s(),u(b(ie),{open:w.value,"onUpdate:open":t[12]||=e=>x(`update:modelValue`,e)},{default:h(()=>[_(b(re),null,{default:h(()=>[_(b(E),{class:`data-[state=open]:animate-fadeIn data-[state=closed]:animate-fadeOut fixed inset-0 z-100 bg-black/50 backdrop-blur-sm`}),_(b(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:h(()=>[c(`div`,V,[_(b(D),{"text-2xl":``,"font-normal":``,class:`from-primary-500 to-primary-400 bg-gradient-to-r bg-clip-text text-transparent`},{default:h(()=>[l(C(b(T)(`settings.pages.card.create_card`)),1)]),_:1}),c(`div`,H,[c(`div`,U,[c(`div`,W,[(s(),g(te,null,ee(A,e=>c(`button`,{key:e.id,class:o([`px-4 py-2 text-sm font-medium`,[j.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=>j.value=e.id},[c(`div`,K,[c(`div`,{class:o(e.icon)},null,2),l(` `+C(e.label),1)])],10,G)),64))])])]),M.value?(s(),g(`div`,ae,[c(`p`,oe,C(N.value),1)])):m(``,!0),j.value===`identity`?(s(),g(`div`,se,[c(`p`,ce,C(b(T)(`settings.pages.card.creation.fields_info.subtitle`)),1),c(`div`,le,[_(b(a),{modelValue:b(L),"onUpdate:modelValue":t[0]||=e=>v(L)?L.value=e:null,label:b(T)(`settings.pages.card.creation.name`),description:b(T)(`settings.pages.card.creation.fields_info.name`),required:!0},null,8,[`modelValue`,`label`,`description`]),_(b(a),{modelValue:b(R),"onUpdate:modelValue":t[1]||=e=>v(R)?R.value=e:null,label:b(T)(`settings.pages.card.creation.nickname`),description:b(T)(`settings.pages.card.creation.fields_info.nickname`)},null,8,[`modelValue`,`label`,`description`]),_(b(a),{modelValue:b(z),"onUpdate:modelValue":t[2]||=e=>v(z)?z.value=e:null,label:b(T)(`settings.pages.card.creation.description`),"single-line":!1,required:!0,description:b(T)(`settings.pages.card.creation.fields_info.description`)},null,8,[`modelValue`,`label`,`description`]),_(b(a),{modelValue:b(q),"onUpdate:modelValue":t[3]||=e=>v(q)?q.value=e:null,label:b(T)(`settings.pages.card.creator_notes`),"single-line":!1,description:b(T)(`settings.pages.card.creation.fields_info.notes`)},null,8,[`modelValue`,`label`,`description`])])])):j.value===`behavior`?(s(),g(`div`,ue,[c(`div`,de,[_(b(a),{modelValue:b(J),"onUpdate:modelValue":t[4]||=e=>v(J)?J.value=e:null,label:b(T)(`settings.pages.card.personality`),"single-line":!1,required:!0,description:b(T)(`settings.pages.card.creation.fields_info.personality`)},null,8,[`modelValue`,`label`,`description`]),_(b(a),{modelValue:b(Y),"onUpdate:modelValue":t[5]||=e=>v(Y)?Y.value=e:null,label:b(T)(`settings.pages.card.scenario`),"single-line":!1,required:!0,description:b(T)(`settings.pages.card.creation.fields_info.scenario`)},null,8,[`modelValue`,`label`,`description`]),_(b(i),{modelValue:X.value,"onUpdate:modelValue":t[6]||=e=>X.value=e,label:b(T)(`settings.pages.card.creation.greetings`),description:b(T)(`settings.pages.card.creation.fields_info.greetings`)},null,8,[`modelValue`,`label`,`description`])])])):j.value===`settings`?(s(),g(`div`,fe,[c(`div`,pe,[_(b(a),{modelValue:b(Q),"onUpdate:modelValue":t[7]||=e=>v(Q)?Q.value=e:null,label:b(T)(`settings.pages.card.systemprompt`),"single-line":!1,required:!0,description:b(T)(`settings.pages.card.creation.fields_info.systemprompt`)},null,8,[`modelValue`,`label`,`description`]),_(b(a),{modelValue:b($),"onUpdate:modelValue":t[8]||=e=>v($)?$.value=e:null,label:b(T)(`settings.pages.card.posthistoryinstructions`),"single-line":!1,required:!0,description:b(T)(`settings.pages.card.creation.fields_info.posthistoryinstructions`)},null,8,[`modelValue`,`label`,`description`]),_(b(a),{modelValue:b(Z),"onUpdate:modelValue":t[9]||=e=>v(Z)?Z.value=e:null,label:b(T)(`settings.pages.card.creation.version`),required:!0,description:b(T)(`settings.pages.card.creation.fields_info.version`)},null,8,[`modelValue`,`label`,`description`])])])):m(``,!0),c(`div`,me,[_(b(r),{variant:`secondary`,icon:`i-solar:undo-left-bold-duotone`,label:b(T)(`settings.pages.card.cancel`),disabled:!1,onClick:t[10]||=e=>w.value=!1},null,8,[`label`]),_(b(r),{variant:`primary`,icon:`i-solar:check-circle-bold-duotone`,label:b(T)(`settings.pages.card.creation.create`),disabled:!1,onClick:t[11]||=e=>P(F.value)},null,8,[`label`])])])]),_:1})]),_:1})]),_:1},8,[`open`]))}}),J=n(q,[[`__scopeId`,`data-v-c19882e9`]]);export{J as b}; \ No newline at end of file diff --git a/assets/CardCreationDialog-CSbQbKao.js b/assets/CardCreationDialog-CSbQbKao.js new file mode 100644 index 0000000000000000000000000000000000000000..11e2c12bed6bb0529308fc0a0102952b99b9f95c --- /dev/null +++ b/assets/CardCreationDialog-CSbQbKao.js @@ -0,0 +1 @@ +import{b as e}from"./CardCreationDialog-BV9G3q2c.js";export{e as default}; \ No newline at end of file diff --git a/assets/CardCreationDialog-DzTU0wp7.js b/assets/CardCreationDialog-DzTU0wp7.js deleted file mode 100644 index 1b47975df84b8d56a212cad2c708aca9e56c8c5f..0000000000000000000000000000000000000000 --- a/assets/CardCreationDialog-DzTU0wp7.js +++ /dev/null @@ -1 +0,0 @@ -import{b as e}from"./CardCreationDialog-BrvTqDsp.js";export{e as default}; \ No newline at end of file diff --git a/assets/CardDetailDialog-BKAC6QHD.js b/assets/CardDetailDialog-BKAC6QHD.js new file mode 100644 index 0000000000000000000000000000000000000000..428f154e40580c6ace8a0aaf4aba082a0a4a698e --- /dev/null +++ b/assets/CardDetailDialog-BKAC6QHD.js @@ -0,0 +1 @@ +import"./DeleteCardDialog-UKAwGyZQ.js";import{b as e}from"./CardDetailDialog-DkixqMs_.js";export{e as default}; \ No newline at end of file diff --git a/assets/CardDetailDialog-DhX59GOE.js b/assets/CardDetailDialog-DhX59GOE.js deleted file mode 100644 index 0a6a1a4f07559538d612169b623624c76bd927f3..0000000000000000000000000000000000000000 --- a/assets/CardDetailDialog-DhX59GOE.js +++ /dev/null @@ -1 +0,0 @@ -import"./DeleteCardDialog-Bm5B-ykC.js";import{b as e}from"./CardDetailDialog-CxE7smOI.js";export{e as default}; \ No newline at end of file diff --git a/assets/CardDetailDialog-CxE7smOI.js b/assets/CardDetailDialog-DkixqMs_.js similarity index 56% rename from assets/CardDetailDialog-CxE7smOI.js rename to assets/CardDetailDialog-DkixqMs_.js index 98f75459976af3fdaabca751d6c18a0e8be8724f..2f9a24d126ac3c79be14c989c360f0e1ca4c5971 100644 --- a/assets/CardDetailDialog-CxE7smOI.js +++ b/assets/CardDetailDialog-DkixqMs_.js @@ -1 +1 @@ -import{F as e,L as t,aS as ee,ag as te,b$ as n,bA as r,bB as i,bD as a,bE as o,bM as s,bN as c,bP as l,bQ as u,bR as d,bS as f,bU as p,bX as m,b_ as h,c as ne,c1 as g,e as _,g as v,k as re,m as ie}from"./index-BFym949y.js";import{b as ae}from"./DeleteCardDialog-Bm5B-ykC.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`},y={class:`flex justify-center -mb-px sm:justify-start space-x-1`},b=[`onClick`],x={class:`flex items-center gap-1`},S={key:0},C=[`innerHTML`],w={key:1},T=[`innerHTML`],E={key:2},D={flex:`~ col`,"max-h-60":``,"gap-4":``,"overflow-auto":``,"pr-1":``,"sm:max-h-80":``},O={key:0,flex:`~ col`,"gap-2":``},k={"text-lg":``,"text-neutral-500":``,"font-medium":``,"dark:text-neutral-400":``},A=[`innerHTML`],j={key:3},M={grid:`~ cols-1 sm:cols-3`,"gap-4":``},N={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`},P={flex:`~ row`,"items-center":``,"gap-2":``,"text-sm":``,"text-neutral-500":``,"dark:text-neutral-400":``},F={truncate:``,"font-medium":``},I={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`},L={flex:`~ row`,"items-center":``,"gap-2":``,"text-sm":``,"text-neutral-500":``,"dark:text-neutral-400":``},ge={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=l({__name:`CardDetailDialog`,props:{modelValue:{type:Boolean},cardId:{}},emits:[`update:modelValue`],setup(l,{emit:R}){let z=l,B=R,{t:V}=t(),H=e(),{removeCard:xe}=H,{activeCardId:U}=ee(H),W=c(()=>{if(z.cardId)return H.getCard(z.cardId)}),G=c(()=>{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=c(()=>W.value?{personality:W.value.personality,scenario:W.value.scenario,systemPrompt:W.value.systemPrompt,postHistoryInstructions:W.value.postHistoryInstructions}:{}),q=c(()=>z.cardId===U.value),J=m(!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=m(!1);function Ce(){W.value&&(xe(z.cardId),B(`update:modelValue`,!1)),X.value=!1}let Z=m(``),Q=c(()=>{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}),$=c({get:()=>Q.value.find(e=>e.id===Z.value)?Z.value:Q.value[0]?.id||``,set:e=>{Z.value=e}});return(e,t)=>(r(),f(s,null,[p(h(ie),{open:e.modelValue,"onUpdate:open":t[0]||=e=>B(`update:modelValue`,e)},{default:d(()=>[p(h(re),null,{default:d(()=>[p(h(_),{class:`data-[state=open]:animate-fadeIn data-[state=closed]:animate-fadeOut fixed inset-0 z-100 bg-black/50 backdrop-blur-sm`}),p(h(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:d(()=>[W.value?(r(),f(`div`,oe,[i(`div`,se,[i(`div`,ce,[i(`div`,null,[i(`div`,le,[p(h(v),{"text-2xl":``,"font-normal":``,class:`from-primary-500 to-primary-400 bg-gradient-to-r bg-clip-text text-transparent`},{default:d(()=>[o(g(W.value.name),1)]),_:1}),q.value?(r(),f(`div`,ue,[t[3]||=i(`div`,{"i-solar:check-circle-bold-duotone":``,"text-xs":``},null,-1),o(` `+g(h(V)(`settings.pages.card.active_badge`)),1)])):u(``,!0)]),i(`div`,de,[o(` v`+g(W.value.version)+` `,1),W.value.creator?(r(),f(s,{key:0},[o(` · `+g(h(V)(`settings.pages.card.created_by`))+` `,1),i(`span`,fe,g(W.value.creator),1)],64)):u(``,!0)])]),i(`div`,pe,[p(h(te),{variant:`primary`,icon:q.value?`i-solar:check-circle-bold-duotone`:`i-solar:play-circle-broken`,label:q.value?h(V)(`settings.pages.card.active`):h(V)(`settings.pages.card.activate`),disabled:q.value,class:n({"animate-pulse":J.value}),onClick:Se},null,8,[`icon`,`label`,`disabled`,`class`])])]),i(`div`,me,[i(`div`,he,[i(`div`,y,[(r(!0),f(s,null,a(Q.value,e=>(r(),f(`button`,{key:e.id,class:n([`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},[i(`div`,x,[i(`div`,{class:n(e.icon)},null,2),o(` `+g(e.label),1)])],10,b))),128))])])]),$.value===`notes`&&W.value.notes?(r(),f(`div`,S,[i(`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,C)])):u(``,!0),$.value===`description`&&W.value.description?(r(),f(`div`,w,[i(`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,T)])):u(``,!0),$.value===`character`&&Object.values(K.value).some(e=>!!e)?(r(),f(`div`,E,[i(`div`,D,[(r(!0),f(s,null,a(K.value,(e,t)=>(r(),f(s,{key:t},[e?(r(),f(`div`,O,[i(`h2`,k,g(h(V)(`settings.pages.card.${t.toLowerCase()}`)),1),i(`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,A)])):u(``,!0)],64))),128))])])):u(``,!0),$.value===`modules`?(r(),f(`div`,j,[i(`div`,M,[i(`div`,N,[i(`span`,P,[t[4]||=i(`div`,{"i-lucide:ghost":``},null,-1),o(` `+g(h(V)(`settings.pages.card.consciousness.model`)),1)]),i(`div`,F,g(G.value.consciousness??`default`),1)]),i(`div`,I,[i(`span`,L,[t[5]||=i(`div`,{"i-lucide:mic":``},null,-1),o(` `+g(h(V)(`settings.pages.card.speech.model`)),1)]),i(`div`,ge,g(G.value.speech??`default`),1)]),i(`div`,_e,[i(`span`,ve,[t[6]||=i(`div`,{"i-lucide:music":``},null,-1),o(` `+g(h(V)(`settings.pages.card.speech.voice`)),1)]),i(`div`,ye,g(G.value.voice??`default`),1)])])])):u(``,!0)])])):(r(),f(`div`,be,[t[7]||=i(`div`,{"i-solar:card-search-broken":``,"mx-auto":``,"mb-3":``,"text-6xl":``,"text-neutral-400":``},null,-1),o(` `+g(h(V)(`settings.pages.card.card_not_found`)),1)]))]),_:1})]),_:1})]),_:1},8,[`open`]),p(ae,{modelValue:X.value,"onUpdate:modelValue":t[1]||=e=>X.value=e,"card-name":W.value?.name,onConfirm:Ce,onCancel:t[2]||=e=>X.value=!1},null,8,[`modelValue`,`card-name`])],64))}}),z=R;export{z as b}; \ No newline at end of file +import{F as e,L as t,aS as ee,ag as te,bG as n,bH as r,bJ as i,bK as a,bL as o,bM as s,bO as c,bT as l,bU as u,bX as d,b_ as f,bx as p,by as m,c0 as h,c1 as g,d as ne,f as _,h as v,l as re,n as ie}from"./index-J3uhnpYL.js";import{b as ae}from"./DeleteCardDialog-UKAwGyZQ.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`},y={class:`flex justify-center -mb-px sm:justify-start space-x-1`},b=[`onClick`],x={class:`flex items-center gap-1`},S={key:0},C=[`innerHTML`],w={key:1},T=[`innerHTML`],E={key:2},D={flex:`~ col`,"max-h-60":``,"gap-4":``,"overflow-auto":``,"pr-1":``,"sm:max-h-80":``},O={key:0,flex:`~ col`,"gap-2":``},k={"text-lg":``,"text-neutral-500":``,"font-medium":``,"dark:text-neutral-400":``},A=[`innerHTML`],j={key:3},M={grid:`~ cols-1 sm:cols-3`,"gap-4":``},N={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`},P={flex:`~ row`,"items-center":``,"gap-2":``,"text-sm":``,"text-neutral-500":``,"dark:text-neutral-400":``},F={truncate:``,"font-medium":``},I={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`},L={flex:`~ row`,"items-center":``,"gap-2":``,"text-sm":``,"text-neutral-500":``,"dark:text-neutral-400":``},ge={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}=t(),H=e(),{removeCard:xe}=H,{activeCardId:U}=ee(H),W=r(()=>{if(z.cardId)return H.getCard(z.cardId)}),G=r(()=>{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=r(()=>W.value?{personality:W.value.personality,scenario:W.value.scenario,systemPrompt:W.value.systemPrompt,postHistoryInstructions:W.value.postHistoryInstructions}:{}),q=r(()=>z.cardId===U.value),J=d(!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=d(!1);function Ce(){W.value&&(xe(z.cardId),B(`update:modelValue`,!1)),X.value=!1}let Z=d(``),Q=r(()=>{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}),$=r({get:()=>Q.value.find(e=>e.id===Z.value)?Z.value:Q.value[0]?.id||``,set:e=>{Z.value=e}});return(e,t)=>(l(),s(n,null,[c(f(ie),{open:e.modelValue,"onUpdate:open":t[0]||=e=>B(`update:modelValue`,e)},{default:o(()=>[c(f(re),null,{default:o(()=>[c(f(_),{class:`data-[state=open]:animate-fadeIn data-[state=closed]:animate-fadeOut fixed inset-0 z-100 bg-black/50 backdrop-blur-sm`}),c(f(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:o(()=>[W.value?(l(),s(`div`,oe,[u(`div`,se,[u(`div`,ce,[u(`div`,null,[u(`div`,le,[c(f(v),{"text-2xl":``,"font-normal":``,class:`from-primary-500 to-primary-400 bg-gradient-to-r bg-clip-text text-transparent`},{default:o(()=>[m(h(W.value.name),1)]),_:1}),q.value?(l(),s(`div`,ue,[t[3]||=u(`div`,{"i-solar:check-circle-bold-duotone":``,"text-xs":``},null,-1),m(` `+h(f(V)(`settings.pages.card.active_badge`)),1)])):a(``,!0)]),u(`div`,de,[m(` v`+h(W.value.version)+` `,1),W.value.creator?(l(),s(n,{key:0},[m(` · `+h(f(V)(`settings.pages.card.created_by`))+` `,1),u(`span`,fe,h(W.value.creator),1)],64)):a(``,!0)])]),u(`div`,pe,[c(f(te),{variant:`primary`,icon:q.value?`i-solar:check-circle-bold-duotone`:`i-solar:play-circle-broken`,label:q.value?f(V)(`settings.pages.card.active`):f(V)(`settings.pages.card.activate`),disabled:q.value,class:g({"animate-pulse":J.value}),onClick:Se},null,8,[`icon`,`label`,`disabled`,`class`])])]),u(`div`,me,[u(`div`,he,[u(`div`,y,[(l(!0),s(n,null,p(Q.value,e=>(l(),s(`button`,{key:e.id,class:g([`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},[u(`div`,x,[u(`div`,{class:g(e.icon)},null,2),m(` `+h(e.label),1)])],10,b))),128))])])]),$.value===`notes`&&W.value.notes?(l(),s(`div`,S,[u(`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,C)])):a(``,!0),$.value===`description`&&W.value.description?(l(),s(`div`,w,[u(`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,T)])):a(``,!0),$.value===`character`&&Object.values(K.value).some(e=>!!e)?(l(),s(`div`,E,[u(`div`,D,[(l(!0),s(n,null,p(K.value,(e,t)=>(l(),s(n,{key:t},[e?(l(),s(`div`,O,[u(`h2`,k,h(f(V)(`settings.pages.card.${t.toLowerCase()}`)),1),u(`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,A)])):a(``,!0)],64))),128))])])):a(``,!0),$.value===`modules`?(l(),s(`div`,j,[u(`div`,M,[u(`div`,N,[u(`span`,P,[t[4]||=u(`div`,{"i-lucide:ghost":``},null,-1),m(` `+h(f(V)(`settings.pages.card.consciousness.model`)),1)]),u(`div`,F,h(G.value.consciousness??`default`),1)]),u(`div`,I,[u(`span`,L,[t[5]||=u(`div`,{"i-lucide:mic":``},null,-1),m(` `+h(f(V)(`settings.pages.card.speech.model`)),1)]),u(`div`,ge,h(G.value.speech??`default`),1)]),u(`div`,_e,[u(`span`,ve,[t[6]||=u(`div`,{"i-lucide:music":``},null,-1),m(` `+h(f(V)(`settings.pages.card.speech.voice`)),1)]),u(`div`,ye,h(G.value.voice??`default`),1)])])])):a(``,!0)])])):(l(),s(`div`,be,[t[7]||=u(`div`,{"i-solar:card-search-broken":``,"mx-auto":``,"mb-3":``,"text-6xl":``,"text-neutral-400":``},null,-1),m(` `+h(f(V)(`settings.pages.card.card_not_found`)),1)]))]),_:1})]),_:1})]),_:1},8,[`open`]),c(ae,{modelValue:X.value,"onUpdate:modelValue":t[1]||=e=>X.value=e,"card-name":W.value?.name,onConfirm:Ce,onCancel:t[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/CardListItem-BPRbxcba.js b/assets/CardListItem-BPRbxcba.js deleted file mode 100644 index 2e568e8da1ac8503b0b8c4d8995f232ba7075b68..0000000000000000000000000000000000000000 --- a/assets/CardListItem-BPRbxcba.js +++ /dev/null @@ -1 +0,0 @@ -import{b as e}from"./CardListItem-BBGsnLNq.js";export{e as default}; \ No newline at end of file diff --git a/assets/CardListItem-CaTpYoW4.js b/assets/CardListItem-CaTpYoW4.js new file mode 100644 index 0000000000000000000000000000000000000000..ece248957101780a7deef24a88566e4e9c63ba36 --- /dev/null +++ b/assets/CardListItem-CaTpYoW4.js @@ -0,0 +1 @@ +import{b as e}from"./CardListItem-CfAvmf_x.js";export{e as default}; \ No newline at end of file diff --git a/assets/CardListItem-BBGsnLNq.js b/assets/CardListItem-CfAvmf_x.js similarity index 65% rename from assets/CardListItem-BBGsnLNq.js rename to assets/CardListItem-CfAvmf_x.js index 21243498dc94466f9b7cf644be46ea9816daa393..a9182af645fb615ac32fb72c072edecbef46c12e 100644 --- a/assets/CardListItem-BBGsnLNq.js +++ b/assets/CardListItem-CfAvmf_x.js @@ -1 +1 @@ -import{ac as e,b$ as t,bA as n,bB as r,bG as i,bP as a,bQ as o,bR as s,bS as c,b_ as l,bw as u,c1 as d}from"./index-BFym949y.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=a({__name:`CardListItem`,props:{id:{},name:{},description:{},isActive:{type:Boolean},isSelected:{type:Boolean},version:{},consciousnessModel:{},voiceModel:{}},emits:[`select`,`activate`,`delete`],setup(a,{emit:C}){let w=C;return(a,C)=>(n(),i(l(e),{relative:``,"min-h-120px":``,flex:`~ col`,"cursor-pointer":``,"overflow-hidden":``,"rounded-xl":``,class:t([a.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:s(()=>[r(`div`,f,[r(`div`,p,[r(`h3`,m,d(a.name),1),a.isActive?(n(),c(`div`,h,C[3]||=[r(`div`,{"i-solar:check-circle-bold-duotone":``,"text-sm":``},null,-1)])):o(``,!0)]),a.description?(n(),c(`p`,g,d(a.description),1)):o(``,!0),r(`div`,_,[r(`div`,null,`v`+d(a.version),1),r(`div`,v,[r(`div`,y,[C[4]||=r(`div`,{"i-lucide:ghost":``,"text-xs":``},null,-1),r(`span`,null,d(a.consciousnessModel),1)]),r(`div`,b,[C[5]||=r(`div`,{"i-lucide:mic":``,"text-xs":``},null,-1),r(`span`,null,d(a.voiceModel),1)])])])]),r(`div`,x,[r(`button`,{"rounded-lg":``,"p-1.5":``,"transition-colors":``,hover:`bg-neutral-200 dark:bg-neutral-700/50`,disabled:a.isActive,onClick:C[0]||=u(e=>w(`activate`),[`stop`])},[r(`div`,{class:t([a.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),a.id===`default`?o(``,!0):(n(),c(`button`,{key:0,"rounded-lg":``,"p-1.5":``,"transition-colors":``,hover:`bg-neutral-200 dark:bg-neutral-700/50`,onClick:C[1]||=u(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 +import{ac as e,bA as t,bJ as n,bK as r,bL as i,bM as a,bT as o,bU as s,b_ as c,br as l,c0 as u,c1 as d}from"./index-J3uhnpYL.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=n({__name:`CardListItem`,props:{id:{},name:{},description:{},isActive:{type:Boolean},isSelected:{type:Boolean},version:{},consciousnessModel:{},voiceModel:{}},emits:[`select`,`activate`,`delete`],setup(n,{emit:C}){let w=C;return(n,C)=>(o(),t(c(e),{relative:``,"min-h-120px":``,flex:`~ col`,"cursor-pointer":``,"overflow-hidden":``,"rounded-xl":``,class:d([n.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:i(()=>[s(`div`,f,[s(`div`,p,[s(`h3`,m,u(n.name),1),n.isActive?(o(),a(`div`,h,C[3]||=[s(`div`,{"i-solar:check-circle-bold-duotone":``,"text-sm":``},null,-1)])):r(``,!0)]),n.description?(o(),a(`p`,g,u(n.description),1)):r(``,!0),s(`div`,_,[s(`div`,null,`v`+u(n.version),1),s(`div`,v,[s(`div`,y,[C[4]||=s(`div`,{"i-lucide:ghost":``,"text-xs":``},null,-1),s(`span`,null,u(n.consciousnessModel),1)]),s(`div`,b,[C[5]||=s(`div`,{"i-lucide:mic":``,"text-xs":``},null,-1),s(`span`,null,u(n.voiceModel),1)])])])]),s(`div`,x,[s(`button`,{"rounded-lg":``,"p-1.5":``,"transition-colors":``,hover:`bg-neutral-200 dark:bg-neutral-700/50`,disabled:n.isActive,onClick:C[0]||=l(e=>w(`activate`),[`stop`])},[s(`div`,{class:d([n.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),n.id===`default`?r(``,!0):(o(),a(`button`,{key:0,"rounded-lg":``,"p-1.5":``,"transition-colors":``,hover:`bg-neutral-200 dark:bg-neutral-700/50`,onClick:C[1]||=l(e=>w(`delete`),[`stop`])},C[6]||=[s(`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-Bm5B-ykC.js b/assets/DeleteCardDialog-Bm5B-ykC.js deleted file mode 100644 index 42662e00006d646f6d8ab78f98020172283b9b03..0000000000000000000000000000000000000000 --- a/assets/DeleteCardDialog-Bm5B-ykC.js +++ /dev/null @@ -1 +0,0 @@ -import{L as e,ag as t,bA as n,bB as r,bE as i,bG as a,bP as o,bR as s,bU as c,b_ as l,c1 as u,d,f,h as p,i as m,j as h,l as g,n as _,o as v}from"./index-BFym949y.js";const y={class:`flex flex-row justify-end gap-3`};var b=o({__name:`DeleteCardDialog`,props:{modelValue:{type:Boolean},cardName:{}},emits:[`update:modelValue`,`confirm`,`cancel`],setup(o,{emit:b}){let x=b,{t:S}=e();function C(){x(`update:modelValue`,!1),x(`cancel`)}function w(){x(`update:modelValue`,!1),x(`confirm`)}return(e,o)=>(n(),a(l(f),{open:e.modelValue,"onUpdate:open":o[0]||=e=>x(`update:modelValue`,e)},{default:s(()=>[c(l(d),null,{default:s(()=>[c(l(m),{class:`data-[state=open]:animate-fadeIn data-[state=closed]:animate-fadeOut fixed inset-0 z-100 bg-black/50`}),c(l(g),{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:s(()=>[c(l(h),{class:`mb-4 text-xl font-normal`},{default:s(()=>[i(u(l(S)(`settings.pages.card.delete_card`)),1)]),_:1}),c(l(v),{class:`mb-6`},{default:s(()=>[i(u(l(S)(`settings.pages.card.delete_confirmation`))+` `,1),r(`b`,null,`"`+u(e.cardName||``)+`"`,1)]),_:1}),r(`div`,y,[c(l(_),{"as-child":``},{default:s(()=>[c(l(t),{variant:`secondary`,label:l(S)(`settings.pages.card.cancel`),onClick:C},null,8,[`label`])]),_:1}),c(l(p),{"as-child":``},{default:s(()=>[c(l(t),{variant:`danger`,label:l(S)(`settings.pages.card.delete`),onClick:w},null,8,[`label`])]),_:1})])]),_:1})]),_:1})]),_:1},8,[`open`]))}}),x=b;export{x as b}; \ No newline at end of file diff --git a/assets/DeleteCardDialog-DTWpW-2T.js b/assets/DeleteCardDialog-DTWpW-2T.js new file mode 100644 index 0000000000000000000000000000000000000000..cad7f211b43cec711791e5a45058b0c6e34d04e0 --- /dev/null +++ b/assets/DeleteCardDialog-DTWpW-2T.js @@ -0,0 +1 @@ +import{b as e}from"./DeleteCardDialog-UKAwGyZQ.js";export{e as default}; \ No newline at end of file diff --git a/assets/DeleteCardDialog-DUAm5fH5.js b/assets/DeleteCardDialog-DUAm5fH5.js deleted file mode 100644 index 469ae28364cc2bc5b1717d770a4008293449d69d..0000000000000000000000000000000000000000 --- a/assets/DeleteCardDialog-DUAm5fH5.js +++ /dev/null @@ -1 +0,0 @@ -import{b as e}from"./DeleteCardDialog-Bm5B-ykC.js";export{e as default}; \ No newline at end of file diff --git a/assets/DeleteCardDialog-UKAwGyZQ.js b/assets/DeleteCardDialog-UKAwGyZQ.js new file mode 100644 index 0000000000000000000000000000000000000000..0136f1ed704faa9bce45f9a33e0b9409d27be246 --- /dev/null +++ b/assets/DeleteCardDialog-UKAwGyZQ.js @@ -0,0 +1 @@ +import{L as e,ag as t,bA as n,bJ as r,bL as i,bO as a,bT as o,bU as s,b_ as c,by as l,c as u,c0 as d,e as f,g as p,i as m,j as h,k as g,m as _,o as v}from"./index-J3uhnpYL.js";const y={class:`flex flex-row justify-end gap-3`};var b=r({__name:`DeleteCardDialog`,props:{modelValue:{type:Boolean},cardName:{}},emits:[`update:modelValue`,`confirm`,`cancel`],setup(r,{emit:b}){let x=b,{t:S}=e();function C(){x(`update:modelValue`,!1),x(`cancel`)}function w(){x(`update:modelValue`,!1),x(`confirm`)}return(e,r)=>(o(),n(c(p),{open:e.modelValue,"onUpdate:open":r[0]||=e=>x(`update:modelValue`,e)},{default:i(()=>[a(c(f),null,{default:i(()=>[a(c(h),{class:`data-[state=open]:animate-fadeIn data-[state=closed]:animate-fadeOut fixed inset-0 z-100 bg-black/50`}),a(c(_),{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:i(()=>[a(c(g),{class:`mb-4 text-xl font-normal`},{default:i(()=>[l(d(c(S)(`settings.pages.card.delete_card`)),1)]),_:1}),a(c(u),{class:`mb-6`},{default:i(()=>[l(d(c(S)(`settings.pages.card.delete_confirmation`))+` `,1),s(`b`,null,`"`+d(e.cardName||``)+`"`,1)]),_:1}),s(`div`,y,[a(c(v),{"as-child":``},{default:i(()=>[a(c(t),{variant:`secondary`,label:c(S)(`settings.pages.card.cancel`),onClick:C},null,8,[`label`])]),_:1}),a(c(m),{"as-child":``},{default:i(()=>[a(c(t),{variant:`danger`,label:c(S)(`settings.pages.card.delete`),onClick:w},null,8,[`label`])]),_:1})])]),_:1})]),_:1})]),_:1},8,[`open`]))}}),x=b;export{x as b}; \ No newline at end of file diff --git a/assets/HeaderLink-BXWLCGTy.js b/assets/HeaderLink-BXWLCGTy.js deleted file mode 100644 index f2fb7b426d7d88c94d169bea3b7f6519d5b77740..0000000000000000000000000000000000000000 --- a/assets/HeaderLink-BXWLCGTy.js +++ /dev/null @@ -1 +0,0 @@ -import{aL as e,aP as t,aT as n,bA as r,bB as i,bG as a,bP as o,bR as s,bS as c,b_ as l}from"./index-BFym949y.js";var u=`/assets/logo-dark-B0bvNYTh.svg`,d=`/assets/logo-B2aCU-bH.svg`;const f=[`src`],p=[`src`];var m=o({__name:`HeaderLink`,setup(e){let o=n();return(e,n)=>(r(),a(l(t),{to:`/`,flex:`~`,"items-center":``,"gap-2":``,"px-2":``,"text-nowrap":``,"text-2xl":``,"outline-none":``},{default:s(()=>[l(o)?(r(),c(`img`,{key:0,src:l(u),"h-8":``,"w-8":``,class:`theme-colored`},null,8,f)):(r(),c(`img`,{key:1,src:l(d),"h-8":``,"w-8":``,class:`theme-colored`},null,8,p)),n[0]||=i(`div`,{"translate-y":`[2px]`,"font-quicksand":``,"font-semibold":``},[i(`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-C5rYwZW4.js b/assets/HeaderLink-C5rYwZW4.js new file mode 100644 index 0000000000000000000000000000000000000000..75fdc38e97b8067b3992578cc6e41b9cd75245d4 --- /dev/null +++ b/assets/HeaderLink-C5rYwZW4.js @@ -0,0 +1 @@ +import{aL as e,aP as t,aW as n,bA as r,bJ as i,bL as a,bM as o,bT as s,bU as c,b_ as l}from"./index-J3uhnpYL.js";var u=`/assets/logo-dark-B0bvNYTh.svg`,d=`/assets/logo-B2aCU-bH.svg`;const f=[`src`],p=[`src`];var m=i({__name:`HeaderLink`,setup(e){let i=n();return(e,n)=>(s(),r(l(t),{to:`/`,flex:`~`,"items-center":``,"gap-2":``,"px-2":``,"text-nowrap":``,"text-2xl":``,"outline-none":``},{default:a(()=>[l(i)?(s(),o(`img`,{key:0,src:l(u),"h-8":``,"w-8":``,class:`theme-colored`},null,8,f)):(s(),o(`img`,{key:1,src:l(d),"h-8":``,"w-8":``,class:`theme-colored`},null,8,p)),n[0]||=c(`div`,{"translate-y":`[2px]`,"font-quicksand":``,"font-semibold":``},[c(`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-BEHmQAW0.js b/assets/IconAnimation-BEHmQAW0.js new file mode 100644 index 0000000000000000000000000000000000000000..e7d93b977889739e16f27698c4f2067979cc3614 --- /dev/null +++ b/assets/IconAnimation-BEHmQAW0.js @@ -0,0 +1 @@ +import{b$ as e,bH as t,bJ as n,bM as r,bQ as i,bT as a,bU as o,bX as s,c1 as c}from"./index-J3uhnpYL.js";var l=n({__name:`IconAnimation`,props:{icon:{},iconSize:{},position:{},duration:{},started:{type:Boolean},textColor:{},isReverse:{type:Boolean},zIndex:{}},emits:[`animationEnded`],setup(n,{emit:l}){let u=n,d=l,f=s(!1);i(()=>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=s([]),h=s(!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(t,n)=>(a(),r(`div`,{"pointer-events-none":``,fixed:``,w:`100dvw`,h:`100dvh`,style:e({zIndex:h.value?t.zIndex:void 0})},[o(`div`,{fixed:``,"inset-0":``,"bg-primary-500":``,"transition-opacity":``,"ease-linear":``,style:e({opacity:p.value.opacity,transitionDuration:`${t.duration}ms`})},null,4),o(`div`,{fixed:``,"inset-0":``,"ease-in-out":``,style:e({width:`${p.value.size}rem`,height:`${p.value.size}rem`,transform:`translate(${p.value.position})`,transitionDuration:`${t.duration}ms`}),class:c([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/IconAnimation-DfKVRS59.js b/assets/IconAnimation-DfKVRS59.js deleted file mode 100644 index a69fae96e8f440257c887098f7ae277dc6174a0e..0000000000000000000000000000000000000000 --- a/assets/IconAnimation-DfKVRS59.js +++ /dev/null @@ -1 +0,0 @@ -import{b$ as e,bA as t,bB as n,bN as r,bP as i,bS as a,bX as o,by as s,c0 as c}from"./index-BFym949y.js";var l=i({__name:`IconAnimation`,props:{icon:{},iconSize:{},position:{},duration:{},started:{type:Boolean},textColor:{},isReverse:{type:Boolean},zIndex:{}},emits:[`animationEnded`],setup(i,{emit:l}){let u=i,d=l,f=o(!1);s(()=>u.started,e=>{e&&requestAnimationFrame(()=>{f.value=!0})});let p=r(()=>({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(r,i)=>(t(),a(`div`,{"pointer-events-none":``,fixed:``,w:`100dvw`,h:`100dvh`,style:c({zIndex:h.value?r.zIndex:void 0})},[n(`div`,{fixed:``,"inset-0":``,"bg-primary-500":``,"transition-opacity":``,"ease-linear":``,style:c({opacity:p.value.opacity,transitionDuration:`${r.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:`${r.duration}ms`}),class:e([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-BA4DYXXI.js b/assets/InputFile-BA4DYXXI.js deleted file mode 100644 index ec5050671275c85bed6c286e42895b8db40d4766..0000000000000000000000000000000000000000 --- a/assets/InputFile-BA4DYXXI.js +++ /dev/null @@ -1 +0,0 @@ -import{b$ as e,b5 as t,bA as n,bB as r,bH as i,bI as a,bP as o,bS as s,bX as c,b_ as l,bx as u}from"./index-BFym949y.js";const d=[`accept`,`multiple`],f={key:0,text:`center`,"text-sm":``},p={key:1,text:`center`,"text-sm":``};var m=o({__name:`InputFile`,props:u({accept:{},multiple:{type:Boolean}},{modelValue:{required:!1,default:()=>[]},modelModifiers:{}}),emits:[`update:modelValue`],setup(o){let u=i(o,`modelValue`),m=c(),h=c(!1),g=t(h,150);function _(e){let t=e.target;t.files&&t.files.length>0&&(m.value=t.files[0]),u.value=Array.from(t.files||[]),h.value=!1}return(t,i)=>(n(),s(`label`,{relative:``,class:e([`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:i[0]||=e=>h.value=!0,onDragleave:i[1]||=e=>h.value=!1},[r(`input`,{type:`file`,accept:t.accept,multiple:t.multiple,"cursor-pointer":``,class:`absolute inset-0 h-full w-full opacity-0`,onChange:_},null,40,d),a(t.$slots,`default`,{isDragging:l(g),firstFile:m.value,files:u.value},()=>[r(`div`,{class:e([`flex flex-col items-center`,[l(g)?`text-primary-500 dark:text-primary-400`:`text-neutral-400 dark:text-neutral-500`]])},[i[2]||=r(`div`,{"i-solar:upload-square-line-duotone":``,"mb-2":``,"text-5xl":``},null,-1),i[3]||=r(`p`,{"font-medium":``,text:`center lg`},` Upload `,-1),l(g)?(n(),s(`p`,f,` Release to upload `)):(n(),s(`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/InputFile-DYGPp1hR.js b/assets/InputFile-DYGPp1hR.js new file mode 100644 index 0000000000000000000000000000000000000000..55899fb4d6e538082d3d67e871fc555a86d6b28e --- /dev/null +++ b/assets/InputFile-DYGPp1hR.js @@ -0,0 +1 @@ +import{b6 as e,bB as t,bC as n,bJ as r,bM as i,bP as a,bT as o,bU as s,bX as c,b_ as l,c1 as u}from"./index-J3uhnpYL.js";const d=[`accept`,`multiple`],f={key:0,text:`center`,"text-sm":``},p={key:1,text:`center`,"text-sm":``};var m=r({__name:`InputFile`,props:a({accept:{},multiple:{type:Boolean}},{modelValue:{required:!1,default:()=>[]},modelModifiers:{}}),emits:[`update:modelValue`],setup(r){let a=t(r,`modelValue`),m=c(),h=c(!1),g=e(h,150);function _(e){let t=e.target;t.files&&t.files.length>0&&(m.value=t.files[0]),a.value=Array.from(t.files||[]),h.value=!1}return(e,t)=>(o(),i(`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:t[0]||=e=>h.value=!0,onDragleave:t[1]||=e=>h.value=!1},[s(`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),n(e.$slots,`default`,{isDragging:l(g),firstFile:m.value,files:a.value},()=>[s(`div`,{class:u([`flex flex-col items-center`,[l(g)?`text-primary-500 dark:text-primary-400`:`text-neutral-400 dark:text-neutral-500`]])},[t[2]||=s(`div`,{"i-solar:upload-square-line-duotone":``,"mb-2":``,"text-5xl":``},null,-1),t[3]||=s(`p`,{"font-medium":``,text:`center lg`},` Upload `,-1),l(g)?(o(),i(`p`,f,` Release to upload `)):(o(),i(`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-CZrLq5ZX.js b/assets/Scenes-CEy5mzwe.js similarity index 66% rename from assets/Scenes-CZrLq5ZX.js rename to assets/Scenes-CEy5mzwe.js index b6f24c5000b0fc7956eeddc9fbb198fe5c72dc98..e025b4888c49c07d1767c3092ca53d40d1272690 100644 --- a/assets/Scenes-CZrLq5ZX.js +++ b/assets/Scenes-CEy5mzwe.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/__vite-browser-external-CKGmuslh.js","assets/index-BFym949y.js","assets/index-DW4V58Ib.css","assets/default-node-C7L-dwjz.js","assets/import-url-browser-CkMcxt8_.js","assets/import-url-browser-CzbE4_30.js","assets/duckdb-mvp-1eM9E9sB.js","assets/import-url-node-DmUEwuAI.js"])))=>i.map(i=>d[i]); -import{$ as e,A as t,B as n,C as r,D as i,G as a,H as o,J as s,R as c,S as l,T as u,U as d,V as f,W as p,X as m,Y as h,Z as g,_,a1 as v,a2 as y,a3 as b,a9 as x,aC as S,aD as C,aF as w,aG as T,aI as E,aR as D,aS as O,aT as k,aU as A,aa as j,ae as M,b2 as ee,b4 as te,b7 as N,b8 as ne,bA as P,bB as re,bG as ie,bI as ae,bK as oe,bM as se,bN as ce,bP as le,bQ as ue,bR as de,bS as fe,bT as pe,bU as me,bW as he,bX as ge,bZ as _e,b_ as ve,ba as ye,bb as be,bc as xe,bd as Se,be as Ce,bf as we,bg as Te,bh as Ee,bi as De,bj as Oe,bk as ke,bl as Ae,bm as je,bn as Me,bo as Ne,bp as Pe,bq as Fe,by as Ie,c2 as Le,c3 as Re,c4 as ze,c5 as Be,c6 as Ve}from"./index-BFym949y.js";import{b as He}from"./import-url-browser-CzbE4_30.js"; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/__vite-browser-external-MQa0rNba.js","assets/index-J3uhnpYL.js","assets/index-BT-tiZao.css","assets/default-node-DnFRZ-9a.js","assets/import-url-browser-iGhQiEJs.js","assets/import-url-browser-BymzNjKM.js","assets/duckdb-mvp-1eM9E9sB.js","assets/import-url-node-DHMEAMi-.js"])))=>i.map(i=>d[i]); +import{$ as e,A as t,B as n,C as r,D as i,G as a,H as o,J as s,R as c,S as l,T as u,U as d,V as f,W as p,X as m,Y as h,Z as g,_,a1 as v,a2 as y,a3 as b,a9 as x,aC as S,aD as C,aF as w,aG as T,aI as E,aR as D,aS as O,aT as k,aV as A,aW as j,aX as M,aa as ee,ae as te,b8 as N,b9 as ne,bA as P,bC as re,bE as ie,bG as ae,bH as oe,bJ as se,bK as ce,bL as le,bM as ue,bN as de,bO as fe,bQ as pe,bT as me,bU as he,bW as ge,bX as _e,bZ as ve,b_ as ye,ba as be,bb as xe,bc as Se,bd as Ce,be as we,bf as Te,bg as Ee,bh as De,bi as Oe,bj as ke,bk as Ae,bl as je,bm as Me,bn as Ne,bo as Pe,bp as Fe,bq as Ie,c2 as Le,c3 as Re,c4 as ze,c5 as Be,c6 as Ve}from"./index-J3uhnpYL.js";import{b as He}from"./import-url-browser-BymzNjKM.js"; /*! * @pixi/constants - v6.5.10 * Compiled Thu, 06 Jul 2023 15:25:11 UTC @@ -547,7 +547,7 @@ void main(void){ `,t),a(t)})),c[n]}catch(r){wc.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(rl.releaseTasks)||e.once(`destroy`,rl.releaseTasks);let a=rl.expressionTasksMap.get(e);a||(a=[],rl.expressionTasksMap.set(e,a));let o=e.getExpressionFile(i);return(n=a[t])??(a[t]=Jc.load({url:o,settings:e.settings,type:`json`,target:e}).then(n=>{let r=rl.expressionTasksMap.get(e);r&&delete r[t];let a=e.createExpression(n,i);return e.emit(`expressionLoaded`,t,a),a}).catch(t=>{wc.warn(e.tag,`Failed to load expression: ${o} `,t),r(t)})),a[t]}catch(n){wc.warn(e.tag,`Failed to load expression at [${t}] -`,n),r(n)}return Promise.resolve(void 0)}static releaseTasks(){this instanceof Bc?rl.motionTasksMap.delete(this):rl.expressionTasksMap.delete(this)}};let il=rl;il.runtimes=[],il.urlToJSON=Zc,il.jsonToSettings=Qc,il.waitUntilReady=$c,il.setupOptionals=el,il.setupEssentials=tl,il.createInternalModel=nl,il.live2DModelMiddlewares=[Zc,Qc,$c,el,tl,nl],il.motionTasksMap=new WeakMap,il.expressionTasksMap=new WeakMap,Bc.prototype._loadMotion=function(e,t){return il.loadMotion(this,e,t)},kc.prototype._loadExpression=function(e){return il.loadExpression(this,e)};var al=class{constructor(){this._autoInteract=!1}get autoInteract(){return this._autoInteract}set autoInteract(e){e!==this._autoInteract&&(e?this.on(`pointertap`,ol,this):this.off(`pointertap`,ol,this),this._autoInteract=e)}registerInteraction(e){e!==this.interactionManager&&(this.unregisterInteraction(),this._autoInteract&&e&&(this.interactionManager=e,e.on(`pointermove`,sl,this)))}unregisterInteraction(){var e;this.interactionManager&&((e=this.interactionManager)==null||e.off(`pointermove`,sl,this),this.interactionManager=void 0)}};function ol(e){this.tap(e.data.global.x,e.data.global.y)}function sl(e){this.focus(e.data.global.x,e.data.global.y)}var cl=class extends Yn{};const ll=new jn,ul=new zn;let dl;var fl=class extends ro{constructor(e){super(),this.tag=`Live2DModel(uninitialized)`,this.textures=[],this.transform=new cl,this.anchor=new Rn(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 il.setupLive2DModel(n,e,t).then(()=>n)}static fromSync(e,t){let n=new this(t);return il.setupLive2DModel(n,e,t).then(t?.onLoad).catch(t?.onError),n}static registerTicker(e){dl=e}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){var t;dl||=(t=window.PIXI)?.Ticker,e?this._destroyed||(dl?(dl.shared.add(this.onTickerUpdate,this),this._autoUpdate=!0):wc.warn(this.tag,`No Ticker registered, please call Live2DModel.registerTicker(Ticker).`)):(dl?.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){ll.x=e,ll.y=t,this.toModelPosition(ll,ll,!0);let r=ll.x/this.internalModel.originalWidth*2-1,i=ll.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&&(wc.log(this.tag,`Hit`,n),this.emit(`hit`,n))}hitTest(e,t){return ll.x=e,ll.y=t,this.toModelPosition(ll,ll),this.internalModel.hitTest(ll.x,ll.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(dl.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)}};Ec(fl,[al]);const pl=class{static resolveURL(e,t){var n;let r=(n=pl.filesMap[e])?.[t];if(r===void 0)throw Error(`Cannot find this file from uploaded files: `+t);return r}static upload(e,t){return so(this,null,function*(){let n={};for(let r of t.getDefinedFiles()){let i=decodeURI(Ut.resolve(t.url,r)),a=e.find(e=>e.webkitRelativePath===i);a&&(n[r]=URL.createObjectURL(a))}pl.filesMap[t._objectURL]=n})}static createSettings(e){return so(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 pl.readText(t),r=JSON.parse(n);r.url=t.webkitRelativePath;let i=il.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 so(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 ml=pl;ml.filesMap={},ml.factory=(e,t)=>so(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 pl.createSettings(t);else if(!n._objectURL)throw Error(`"_objectURL" must be specified in ModelSettings`);n.validateFiles(t.map(e=>encodeURI(e.webkitRelativePath))),yield pl.upload(t,n),n.resolveURL=function(e){return pl.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),pl.filesMap[e])for(let t of Object.values(pl.filesMap[e]))URL.revokeObjectURL(t);delete pl.filesMap[e]})})}return t()}),il.live2DModelMiddlewares.unshift(ml.factory);const hl=class{static unzip(e,t){return so(this,null,function*(){let n=yield hl.getFilePaths(e),r=[];for(let e of t.getDefinedFiles()){let i=decodeURI(Ut.resolve(t.url,e));n.includes(i)&&r.push(i)}let i=yield hl.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 hl.readText(e,n);if(!r)throw Error(`Empty settings file: `+n);let i=JSON.parse(r);i.url=n;let a=il.findRuntime(i);if(!a)throw Error(`Unknown settings JSON`);return a.createModelSettings(i)})}static zipReader(e,t){return so(this,null,function*(){throw Error(`Not implemented`)})}static getFilePaths(e){return so(this,null,function*(){throw Error(`Not implemented`)})}static getFiles(e,t){return so(this,null,function*(){throw Error(`Not implemented`)})}static readText(e,t){return so(this,null,function*(){throw Error(`Not implemented`)})}static releaseReader(e){}};let gl=hl;if(gl.ZIP_PROTOCOL=`zip://`,gl.uid=0,gl.factory=(e,t)=>so(void 0,null,function*(){let n=e.source,r,i,a;if(typeof n==`string`&&(n.endsWith(`.zip`)||n.startsWith(hl.ZIP_PROTOCOL))?(r=n.startsWith(hl.ZIP_PROTOCOL)?n.slice(hl.ZIP_PROTOCOL.length):n,i=yield Jc.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 hl.zipReader(i,r);a||=yield hl.createSettings(t),a._objectURL=hl.ZIP_PROTOCOL+hl.uid+`/`+a.url;let n=yield hl.unzip(t,a);n.settings=a,e.source=n,r.startsWith(`blob:`)&&e.live2dModel.once(`modelLoaded`,e=>{e.once(`destroy`,function(){URL.revokeObjectURL(r)})}),hl.releaseReader(t)}return t()}),il.live2DModelMiddlewares.unshift(gl.factory),!window.Live2DCubismCore)throw Error(`Could not find Cubism 4 runtime. This plugin requires live2dcubismcore.js to be loaded.`);var _l=class extends kc{constructor(e,t){var n;super(e,t),this.queueManager=new gs,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 Vo.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)}},vl=class e extends Pc{constructor(t){if(super(t),!e.isValidJSON(t))throw TypeError(`Invalid JSON.`);Object.assign(this,new pc(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=ms.create(e),i=new Zo(e),a=(t===this.groups.idle?Cc.idleMotionFadingDuration:Cc.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 bl=new xo;var xl=class extends Hc{constructor(e,t,n){super(),this.lipSync=!0,this.breath=co.create(),this.renderer=new fc,this.idParamAngleX=mc,this.idParamAngleY=hc,this.idParamAngleZ=gc,this.idParamEyeBallX=_c,this.idParamEyeBallY=vc,this.idParamBodyAngleX=yc,this.idParamBreath=bc,this.pixelsPerUnit=1,this.centeringTransform=new zn,this.coreModel=e,this.settings=t,this.motionManager=new yl(t,n),this.init()}init(){var e;super.init(),(e=this.settings.getEyeBlinkParameters())?.length>0&&(this.eyeBlink=fo.create(this.settings)),this.breath.setParameters([new lo(this.idParamAngleX,0,15,6.5345,.5),new lo(this.idParamAngleY,0,8,3.5345,.5),new lo(this.idParamAngleZ,0,10,5.5345,.5),new lo(this.idParamBodyAngleX,0,4,15.5345,.5),new lo(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,rc.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{Tl(),e()}catch(e){if(Cl--,Cl<0){let n=Error(`Failed to start up Cubism 4 framework.`);n.cause=e,t(n);return}wc.log(`Cubism4`,`Startup failed, retrying 10ms later...`),setTimeout(n,10)}}n()}),Sl)}function Tl(e){e=Object.assign({logFunction:console.log,loggingLevel:Ao.LogLevel_Verbose},e),ko.startUp(e),ko.initialize()}il.registerRuntime({version:4,ready:wl,test(e){return e instanceof vl||vl.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 vl(e)},createCoreModel(e){let t=Ro.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 xl(e,t,n),i=e;return i.__moc&&(r.__moc=i.__moc,delete i.__moc,r.once(`destroy`,El)),r},createPhysics(e,t){return Ms.create(t)},createPose(e,t){return go.create(t)}});function El(){var e;(e=this.__moc)==null||e.release()}var Dl=le({__name:`Canvas`,props:{width:{},height:{},resolution:{default:2}},setup(e,{expose:t}){let n=e,r=ge(),i=ge(),a=ge();async function o(e){fl.registerTicker(Tn),xn.add(En),i.value=new ao({width:n.width*n.resolution,height:n.height*n.resolution,backgroundAlpha:0,preserveDrawingBuffer:!0}),a.value=i.value.view,a.value.style.width=`100%`,a.value.style.height=`100%`,a.value.style.objectFit=`cover`,a.value.style.display=`block`,e.appendChild(i.value.view)}function s(){i.value&&i.value.renderer.resize(n.width,n.height)}Ie([()=>n.width,()=>n.height],()=>s()),Ie(()=>n.resolution,e=>{i.value&&e&&(i.value.renderer.resolution=e,s())}),oe(async()=>r.value&&await o(r.value)),pe(()=>i.value?.destroy());async function c(){let e=new Promise(e=>{if(!a.value||!i.value)return e(null);i.value.render(),a.value.toBlob(e)});return e}function l(){return a.value}return t({captureFrame:c,canvasElement:l}),(e,t)=>(P(),fe(`div`,{ref_key:`containerRef`,ref:r,"h-full":``,"w-full":``},[ae(e.$slots,`default`,{app:i.value})],512))}}),Ol=Dl,kl=Le((exports,t)=>{ +`,n),r(n)}return Promise.resolve(void 0)}static releaseTasks(){this instanceof Bc?rl.motionTasksMap.delete(this):rl.expressionTasksMap.delete(this)}};let il=rl;il.runtimes=[],il.urlToJSON=Zc,il.jsonToSettings=Qc,il.waitUntilReady=$c,il.setupOptionals=el,il.setupEssentials=tl,il.createInternalModel=nl,il.live2DModelMiddlewares=[Zc,Qc,$c,el,tl,nl],il.motionTasksMap=new WeakMap,il.expressionTasksMap=new WeakMap,Bc.prototype._loadMotion=function(e,t){return il.loadMotion(this,e,t)},kc.prototype._loadExpression=function(e){return il.loadExpression(this,e)};var al=class{constructor(){this._autoInteract=!1}get autoInteract(){return this._autoInteract}set autoInteract(e){e!==this._autoInteract&&(e?this.on(`pointertap`,ol,this):this.off(`pointertap`,ol,this),this._autoInteract=e)}registerInteraction(e){e!==this.interactionManager&&(this.unregisterInteraction(),this._autoInteract&&e&&(this.interactionManager=e,e.on(`pointermove`,sl,this)))}unregisterInteraction(){var e;this.interactionManager&&((e=this.interactionManager)==null||e.off(`pointermove`,sl,this),this.interactionManager=void 0)}};function ol(e){this.tap(e.data.global.x,e.data.global.y)}function sl(e){this.focus(e.data.global.x,e.data.global.y)}var cl=class extends Yn{};const ll=new jn,ul=new zn;let dl;var fl=class extends ro{constructor(e){super(),this.tag=`Live2DModel(uninitialized)`,this.textures=[],this.transform=new cl,this.anchor=new Rn(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 il.setupLive2DModel(n,e,t).then(()=>n)}static fromSync(e,t){let n=new this(t);return il.setupLive2DModel(n,e,t).then(t?.onLoad).catch(t?.onError),n}static registerTicker(e){dl=e}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){var t;dl||=(t=window.PIXI)?.Ticker,e?this._destroyed||(dl?(dl.shared.add(this.onTickerUpdate,this),this._autoUpdate=!0):wc.warn(this.tag,`No Ticker registered, please call Live2DModel.registerTicker(Ticker).`)):(dl?.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){ll.x=e,ll.y=t,this.toModelPosition(ll,ll,!0);let r=ll.x/this.internalModel.originalWidth*2-1,i=ll.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&&(wc.log(this.tag,`Hit`,n),this.emit(`hit`,n))}hitTest(e,t){return ll.x=e,ll.y=t,this.toModelPosition(ll,ll),this.internalModel.hitTest(ll.x,ll.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(dl.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)}};Ec(fl,[al]);const pl=class{static resolveURL(e,t){var n;let r=(n=pl.filesMap[e])?.[t];if(r===void 0)throw Error(`Cannot find this file from uploaded files: `+t);return r}static upload(e,t){return so(this,null,function*(){let n={};for(let r of t.getDefinedFiles()){let i=decodeURI(Ut.resolve(t.url,r)),a=e.find(e=>e.webkitRelativePath===i);a&&(n[r]=URL.createObjectURL(a))}pl.filesMap[t._objectURL]=n})}static createSettings(e){return so(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 pl.readText(t),r=JSON.parse(n);r.url=t.webkitRelativePath;let i=il.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 so(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 ml=pl;ml.filesMap={},ml.factory=(e,t)=>so(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 pl.createSettings(t);else if(!n._objectURL)throw Error(`"_objectURL" must be specified in ModelSettings`);n.validateFiles(t.map(e=>encodeURI(e.webkitRelativePath))),yield pl.upload(t,n),n.resolveURL=function(e){return pl.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),pl.filesMap[e])for(let t of Object.values(pl.filesMap[e]))URL.revokeObjectURL(t);delete pl.filesMap[e]})})}return t()}),il.live2DModelMiddlewares.unshift(ml.factory);const hl=class{static unzip(e,t){return so(this,null,function*(){let n=yield hl.getFilePaths(e),r=[];for(let e of t.getDefinedFiles()){let i=decodeURI(Ut.resolve(t.url,e));n.includes(i)&&r.push(i)}let i=yield hl.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 hl.readText(e,n);if(!r)throw Error(`Empty settings file: `+n);let i=JSON.parse(r);i.url=n;let a=il.findRuntime(i);if(!a)throw Error(`Unknown settings JSON`);return a.createModelSettings(i)})}static zipReader(e,t){return so(this,null,function*(){throw Error(`Not implemented`)})}static getFilePaths(e){return so(this,null,function*(){throw Error(`Not implemented`)})}static getFiles(e,t){return so(this,null,function*(){throw Error(`Not implemented`)})}static readText(e,t){return so(this,null,function*(){throw Error(`Not implemented`)})}static releaseReader(e){}};let gl=hl;if(gl.ZIP_PROTOCOL=`zip://`,gl.uid=0,gl.factory=(e,t)=>so(void 0,null,function*(){let n=e.source,r,i,a;if(typeof n==`string`&&(n.endsWith(`.zip`)||n.startsWith(hl.ZIP_PROTOCOL))?(r=n.startsWith(hl.ZIP_PROTOCOL)?n.slice(hl.ZIP_PROTOCOL.length):n,i=yield Jc.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 hl.zipReader(i,r);a||=yield hl.createSettings(t),a._objectURL=hl.ZIP_PROTOCOL+hl.uid+`/`+a.url;let n=yield hl.unzip(t,a);n.settings=a,e.source=n,r.startsWith(`blob:`)&&e.live2dModel.once(`modelLoaded`,e=>{e.once(`destroy`,function(){URL.revokeObjectURL(r)})}),hl.releaseReader(t)}return t()}),il.live2DModelMiddlewares.unshift(gl.factory),!window.Live2DCubismCore)throw Error(`Could not find Cubism 4 runtime. This plugin requires live2dcubismcore.js to be loaded.`);var _l=class extends kc{constructor(e,t){var n;super(e,t),this.queueManager=new gs,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 Vo.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)}},vl=class e extends Pc{constructor(t){if(super(t),!e.isValidJSON(t))throw TypeError(`Invalid JSON.`);Object.assign(this,new pc(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=ms.create(e),i=new Zo(e),a=(t===this.groups.idle?Cc.idleMotionFadingDuration:Cc.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 bl=new xo;var xl=class extends Hc{constructor(e,t,n){super(),this.lipSync=!0,this.breath=co.create(),this.renderer=new fc,this.idParamAngleX=mc,this.idParamAngleY=hc,this.idParamAngleZ=gc,this.idParamEyeBallX=_c,this.idParamEyeBallY=vc,this.idParamBodyAngleX=yc,this.idParamBreath=bc,this.pixelsPerUnit=1,this.centeringTransform=new zn,this.coreModel=e,this.settings=t,this.motionManager=new yl(t,n),this.init()}init(){var e;super.init(),(e=this.settings.getEyeBlinkParameters())?.length>0&&(this.eyeBlink=fo.create(this.settings)),this.breath.setParameters([new lo(this.idParamAngleX,0,15,6.5345,.5),new lo(this.idParamAngleY,0,8,3.5345,.5),new lo(this.idParamAngleZ,0,10,5.5345,.5),new lo(this.idParamBodyAngleX,0,4,15.5345,.5),new lo(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,rc.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{Tl(),e()}catch(e){if(Cl--,Cl<0){let n=Error(`Failed to start up Cubism 4 framework.`);n.cause=e,t(n);return}wc.log(`Cubism4`,`Startup failed, retrying 10ms later...`),setTimeout(n,10)}}n()}),Sl)}function Tl(e){e=Object.assign({logFunction:console.log,loggingLevel:Ao.LogLevel_Verbose},e),ko.startUp(e),ko.initialize()}il.registerRuntime({version:4,ready:wl,test(e){return e instanceof vl||vl.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 vl(e)},createCoreModel(e){let t=Ro.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 xl(e,t,n),i=e;return i.__moc&&(r.__moc=i.__moc,delete i.__moc,r.once(`destroy`,El)),r},createPhysics(e,t){return Ms.create(t)},createPose(e,t){return go.create(t)}});function El(){var e;(e=this.__moc)==null||e.release()}var Dl=se({__name:`Canvas`,props:{width:{},height:{},resolution:{default:2}},setup(e,{expose:t}){let n=e,r=_e(),i=_e(),a=_e();async function o(e){fl.registerTicker(Tn),xn.add(En),i.value=new ao({width:n.width*n.resolution,height:n.height*n.resolution,backgroundAlpha:0,preserveDrawingBuffer:!0}),a.value=i.value.view,a.value.style.width=`100%`,a.value.style.height=`100%`,a.value.style.objectFit=`cover`,a.value.style.display=`block`,e.appendChild(i.value.view)}function s(){i.value&&i.value.renderer.resize(n.width,n.height)}pe([()=>n.width,()=>n.height],()=>s()),pe(()=>n.resolution,e=>{i.value&&e&&(i.value.renderer.resolution=e,s())}),ie(async()=>r.value&&await o(r.value)),de(()=>i.value?.destroy());async function c(){let e=new Promise(e=>{if(!a.value||!i.value)return e(null);i.value.render(),a.value.toBlob(e)});return e}function l(){return a.value}return t({captureFrame:c,canvasElement:l}),(e,t)=>(me(),ue(`div`,{ref_key:`containerRef`,ref:r,"h-full":``,"w-full":``},[re(e.$slots,`default`,{app:i.value})],512))}}),Ol=Dl,kl=Le((exports,t)=>{ /*! localForage -- Offline Storage, Improved Version 1.10.0 @@ -2390,7 +2390,7 @@ void main() { gl_FragColor = color; } -`,ap=function(e){tp(t,e);function t(n){var r=this,i=Object.assign(t.defaults,n),a=i.maxKernelSize,o=np(i,[`maxKernelSize`]);return r=e.call(this,rp,ip.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}(Ri);function op(){let e=-1,t,n=-1;function r(r,i){(i>=e||i({x:0,y:0})},disableFocusAt:{type:Boolean,default:!1},xOffset:{},yOffset:{},scale:{default:1}},emits:[`modelLoaded`],setup(e,{expose:t,emit:i}){let a=e,o=i;function s(){let e=Number.parseFloat(String(a.xOffset))||0,t=Number.parseFloat(String(a.yOffset))||0;return String(a.xOffset).endsWith(`%`)&&(e=Number.parseFloat(String(a.xOffset).replace(`%`,``))/100*a.width),String(a.yOffset).endsWith(`%`)&&(t=Number.parseFloat(String(a.yOffset).replace(`%`,``))/100*a.height),{xOffset:e,yOffset:t}}let c=ce(()=>s()),l=he(()=>a.app),u=he(()=>a.paused),d=he(()=>a.focusAt),f=ge(),p=ge(0),m=ge(0),h=ce(()=>Math.max(0,Math.min(100,a.mouthOpenSize))),g=k(),_=te(A),v=ce(()=>_.between(`sm`,`md`).value||_.smaller(`sm`).value),y=op(),b=_e(new xd({alpha:.2,blur:0,distance:20,rotation:45}));function x(){return f.value.internalModel.coreModel}function S(){if(!f.value)return;let e=2.2;v.value&&(e=2.2);let t=a.height*.95/m.value*e,n=a.width*.95/p.value*e,r=Math.min(t,n);f.value.scale.set(r*a.scale,r*a.scale),f.value.x=a.width/2+c.value.xOffset,f.value.y=a.height+c.value.yOffset}let{modelFile:C,loadingModel:w,currentMotion:T,availableMotions:D,loadSource:j,modelUrl:M}=O(r()),{themeColorsHue:ee,themeColorsHueDynamic:ie}=O(n()),le=ge({group:`Idle`,index:0});async function ue(){if(!l.value)return;f.value&&(l.value.stage.removeChild(f.value),f.value.destroy(),f.value=void 0);let e=new fl;j.value===`file`?await il.setupLive2DModel(e,[C.value],{autoInteract:!1}):j.value===`url`&&await il.setupLive2DModel(e,M.value,{autoInteract:!1}),f.value=e,l.value.stage.addChild(f.value),p.value=f.value.width,m.value=f.value.height,f.value.anchor.set(.5,.5),S(),f.value.on(`hit`,e=>{f.value&&e.includes(`body`)&&f.value.motion(`tap_body`)});let t=f.value.internalModel,n=t.coreModel,r=t.motionManager;n.setParameterValueById(`ParamMouthOpenY`,h.value),D.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 i=r.update;r.update=function(e,n){return i?.call(this,e,n),r.state.currentGroup===r.groups.idle&&y.update(t,n),!0},r.on(`motionStart`,(e,t)=>{le.value={group:e,index:t}}),C.value&&await sp.default.setItem(`live2dModel`,C.value),o(`modelLoaded`),w.value=!1}async function de(){if(!l.value)return;fl.registerTicker(Tn),xn.add(En),xn.add(zl);let e=await sp.default.getItem(`live2dModel`);if(e){C.value=e,j.value=`file`,w.value=!0;return}if(M.value){j.value=`url`,w.value=!0;return}w.value=!1}async function me(e,t){await f.value?.motion(e,t,Fc.FORCE)}let ve=ne(S,100),ye=ge(),be=ge(0);function xe(){if(f.value){let e=getComputedStyle(ye.value).backgroundColor;b.value.color=Number(E(e).replace(`#`,`0x`)),f.value.filters=[b.value]}}Ie([()=>a.width,()=>a.height],()=>ve()),Ie(g,xe,{immediate:!0}),Ie([f,ee],xe),Ie(c,S),Ie(()=>a.scale,S);function Se(){xe(),be.value=requestAnimationFrame(Se)}Ie(ie,()=>{ie.value?be.value=requestAnimationFrame(Se):(cancelAnimationFrame(be.value),be.value=0)},{immediate:!0}),Ie(h,e=>x().setParameterValueById(`ParamMouthOpenY`,e)),Ie(l,de),Ie(T,e=>me(e.group,e.index)),Ie(u,e=>e?l.value?.stop():l.value?.start()),Ie(d,e=>{f.value&&(a.disableFocusAt||f.value.focus(e.x,e.y))}),N(w,e=>{e&&ue()},{debounce:1e3}),oe(xe),pe(()=>{cancelAnimationFrame(be.value),f.value&&l.value?.stage.removeChild(f.value)});function Ce(){return D.value}return t({setMotion:me,listMotionGroups:Ce}),(e,t)=>(P(),fe(se,null,[re(`div`,{ref_key:`dropShadowColorComputer`,ref:ye,hidden:``,bg:`primary-400 dark:primary-500`},null,512),ae(e.$slots,`default`)],64))}}),lp=cp,up=Le((exports,t)=>{ +`,ap=function(e){tp(t,e);function t(n){var r=this,i=Object.assign(t.defaults,n),a=i.maxKernelSize,o=np(i,[`maxKernelSize`]);return r=e.call(this,rp,ip.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}(Ri);function op(){let e=-1,t,n=-1;function r(r,i){(i>=e||i({x:0,y:0})},disableFocusAt:{type:Boolean,default:!1},xOffset:{},yOffset:{},scale:{default:1}},emits:[`modelLoaded`],setup(e,{expose:t,emit:i}){let a=e,o=i;function s(){let e=Number.parseFloat(String(a.xOffset))||0,t=Number.parseFloat(String(a.yOffset))||0;return String(a.xOffset).endsWith(`%`)&&(e=Number.parseFloat(String(a.xOffset).replace(`%`,``))/100*a.width),String(a.yOffset).endsWith(`%`)&&(t=Number.parseFloat(String(a.yOffset).replace(`%`,``))/100*a.height),{xOffset:e,yOffset:t}}let c=oe(()=>s()),l=ge(()=>a.app),u=ge(()=>a.paused),d=ge(()=>a.focusAt),f=_e(),p=_e(0),m=_e(0),h=oe(()=>Math.max(0,Math.min(100,a.mouthOpenSize))),g=j(),_=A(M),v=oe(()=>_.between(`sm`,`md`).value||_.smaller(`sm`).value),y=op(),b=ve(new xd({alpha:.2,blur:0,distance:20,rotation:45}));function x(){return f.value.internalModel.coreModel}function S(){if(!f.value)return;let e=2.2;v.value&&(e=2.2);let t=a.height*.95/m.value*e,n=a.width*.95/p.value*e,r=Math.min(t,n);f.value.scale.set(r*a.scale,r*a.scale),f.value.x=a.width/2+c.value.xOffset,f.value.y=a.height+c.value.yOffset}let{modelFile:C,loadingModel:w,currentMotion:T,availableMotions:D,loadSource:k,modelUrl:ee}=O(r()),{themeColorsHue:te,themeColorsHueDynamic:P}=O(n()),se=_e({group:`Idle`,index:0});async function ce(){if(!l.value)return;f.value&&(l.value.stage.removeChild(f.value),f.value.destroy(),f.value=void 0);let e=new fl;k.value===`file`?await il.setupLive2DModel(e,[C.value],{autoInteract:!1}):k.value===`url`&&await il.setupLive2DModel(e,ee.value,{autoInteract:!1}),f.value=e,l.value.stage.addChild(f.value),p.value=f.value.width,m.value=f.value.height,f.value.anchor.set(.5,.5),S(),f.value.on(`hit`,e=>{f.value&&e.includes(`body`)&&f.value.motion(`tap_body`)});let t=f.value.internalModel,n=t.coreModel,r=t.motionManager;n.setParameterValueById(`ParamMouthOpenY`,h.value),D.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 i=r.update;r.update=function(e,n){return i?.call(this,e,n),r.state.currentGroup===r.groups.idle&&y.update(t,n),!0},r.on(`motionStart`,(e,t)=>{se.value={group:e,index:t}}),C.value&&await sp.default.setItem(`live2dModel`,C.value),o(`modelLoaded`),w.value=!1}async function le(){if(!l.value)return;fl.registerTicker(Tn),xn.add(En),xn.add(zl);let e=await sp.default.getItem(`live2dModel`);if(e){C.value=e,k.value=`file`,w.value=!0;return}if(ee.value){k.value=`url`,w.value=!0;return}w.value=!1}async function fe(e,t){await f.value?.motion(e,t,Fc.FORCE)}let ye=ne(S,100),be=_e(),xe=_e(0);function Se(){if(f.value){let e=getComputedStyle(be.value).backgroundColor;b.value.color=Number(E(e).replace(`#`,`0x`)),f.value.filters=[b.value]}}pe([()=>a.width,()=>a.height],()=>ye()),pe(g,Se,{immediate:!0}),pe([f,te],Se),pe(c,S),pe(()=>a.scale,S);function Ce(){Se(),xe.value=requestAnimationFrame(Ce)}pe(P,()=>{P.value?xe.value=requestAnimationFrame(Ce):(cancelAnimationFrame(xe.value),xe.value=0)},{immediate:!0}),pe(h,e=>x().setParameterValueById(`ParamMouthOpenY`,e)),pe(l,le),pe(T,e=>fe(e.group,e.index)),pe(u,e=>e?l.value?.stop():l.value?.start()),pe(d,e=>{f.value&&(a.disableFocusAt||f.value.focus(e.x,e.y))}),N(w,e=>{e&&ce()},{debounce:1e3}),ie(Se),de(()=>{cancelAnimationFrame(xe.value),f.value&&l.value?.stage.removeChild(f.value)});function we(){return D.value}return t({setMotion:fe,listMotionGroups:we}),(e,t)=>(me(),ue(ae,null,[he(`div`,{ref_key:`dropShadowColorComputer`,ref:be,hidden:``,bg:`primary-400 dark:primary-500`},null,512),re(e.$slots,`default`)],64))}}),lp=cp,up=Le((exports,t)=>{ /*! JSZip v3.10.1 - A JavaScript class for generating and reading zip files @@ -2403,12 +2403,12 @@ 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 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,j=0;E&&(A|=16),o===`UNIX`?(j=798,A|=function(e,t){var n=e;return e||(n=t?16893:33204),(65535&n)<<16}(p.unixPermissions,E)):(j=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 M=``;return M+=` -\0`,M+=r(k,2),M+=m.magic,M+=r(d,2),M+=r(f,2),M+=r(O.crc32,4),M+=r(O.compressedSize,4),M+=r(O.uncompressedSize,4),M+=r(g.length,2),M+=r(C.length,2),{fileRecord:l.LOCAL_FILE_HEADER+M+g+C,dirRecord:l.CENTRAL_FILE_HEADER+r(j,2)+M+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,j=4;function M(e,t){return e.msg=c[t],t}function ee(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 ne(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,N(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,ne(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-T&&(ne(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(ne(e,!0),e.strm.avail_out===0?A:j):(e.strstart>e.block_start&&(ne(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)),N(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)),N(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)),N(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&&N(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(N(e),e.avail_out===0)return i.last_flush=-1,d}else if(e.avail_in===0&&ee(t)<=ee(n)&&t!==u)return M(e,-5);if(i.status===666&&e.avail_in!==0)return M(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&&(ne(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(ne(e,!0),e.strm.avail_out===0?A:j):e.last_lit&&(ne(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&&(ne(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(ne(e,!0),e.strm.avail_out===0?A:j):e.last_lit&&(ne(e,!1),e.strm.avail_out===0)?O:k}(i,t):r[i.level].func(i,t);if(m!==A&&m!==j||(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&&(te(i.head),i.lookahead===0&&(i.strstart=0,i.block_start=0,i.insert=0))),N(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)),N(e),0=n.w_size&&(s===0&&(te(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,N=8+(15&(b>>>=4)),n.wbits===0)n.wbits=N;else if(N>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&&(N=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,N)),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;N=p[g+ E++],n.head&&N&&n.length<65536&&(n.head.name+=String.fromCharCode(N)),N&&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},ne=s(0,n.lens,0,19,n.lencode,0,n.work,P),n.lenbits=P.bits,ne){e.msg=`invalid code lengths set`,n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have>>16&255,j=65535&ie,!((k=ie>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>>=k,x-=k,n.lens[n.have++]=j;else{if(j===16){for(re=k+2;x>>=k,x-=k,n.have===0){e.msg=`invalid bit length repeat`,n.mode=30;break}N=n.lens[n.have-1],E=3+(3&b),b>>>=2,x-=2}else if(j===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++]=N}}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},ne=s(c,n.lens,0,n.nlen,n.lencode,0,n.work,P),n.lenbits=P.bits,ne){e.msg=`invalid literal/lengths set`,n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,P={bits:n.distbits},ne=s(l,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,P),n.distbits=P.bits,ne){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,j=65535&ie,!((k=ie>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>M)])>>>16&255,j=65535&ie,!(M+(k=ie>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>>=M,x-=M,n.back+=M}if(b>>>=k,x-=k,n.back+=k,n.length=j,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,j=65535&ie,!((k=ie>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>M)])>>>16&255,j=65535&ie,!(M+(k=ie>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>>=M,x-=M,n.back+=M}if(b>>>=k,x-=k,n.back+=k,64&A){e.msg=`invalid distance code`,n.mode=30;break}n.offset=j,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]],ee[te+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?M=0:(M&=p-1,M+=p),w++,--N[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*ne(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)})}),dp=Ve(up());gl.zipReader=(e,t)=>dp.default.loadAsync(e);const fp=gl.createSettings;gl.createSettings=async e=>{let t=Object.keys(e.files);return t.find(e=>pp(e))?fp(e):gp(t)};function pp(e){return e.endsWith(`model3.json`)}function mp(e){return e.endsWith(`.moc3`)}function hp(e){return e.split(/[\\/]/).pop()}function gp(e){let t=e.filter(e=>mp(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=hp(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 vl({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}gl.readText=(e,t)=>{let n=e.file(t);if(!n)throw Error(`Cannot find file: ${t}`);return n.async(`text`)},gl.getFilePaths=e=>{let t=[];return e.forEach(e=>t.push(e)),Promise.resolve(t)},gl.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 _p=le({__name:`Live2D`,props:{paused:{type:Boolean,default:!1},mouthOpenSize:{default:0},focusAt:{default:()=>({x:0,y:0})},xOffset:{},yOffset:{},scale:{default:1}},setup(e){return(e,t)=>(P(),ie(M,{relative:``},{default:de(({width:t,height:n})=>[me(Ol,{width:t,height:n,resolution:2,"max-h":`100dvh`},{default:de(({app:r})=>[me(lp,{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},null,8,[`app`,`mouth-open-size`,`width`,`height`,`paused`,`focus-at`,`x-offset`,`y-offset`,`scale`])]),_:2},1032,[`width`,`height`])]),_:1}))}}),vp=_p;function yp(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 bp(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 xp(e){return this instanceof xp?(this.v=e,this):new xp(e)}function Sp(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 xp?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 Cp(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:xp(e[r](t)),done:!1}:i?i(t):t}:i}}function wp(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof bp==`function`?bp(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 Tp=new TextDecoder(`utf-8`),Ep=e=>Tp.decode(e),Dp=new TextEncoder,Op=e=>Dp.encode(e),kp=e=>typeof e==`number`,Ap=e=>typeof e==`boolean`,jp=e=>typeof e==`function`,Mp=e=>e!=null&&Object(e)===e,Np=e=>Mp(e)&&jp(e.then),Pp=e=>Mp(e)&&jp(e[Symbol.iterator]),Fp=e=>Mp(e)&&jp(e[Symbol.asyncIterator]),Ip=e=>Mp(e)&&Mp(e.schema),Lp=e=>Mp(e)&&`done`in e&&`value`in e,Rp=e=>Mp(e)&&jp(e.stat)&&kp(e.fd),zp=e=>Mp(e)&&Hp(e.body),Bp=e=>`_getDOMStream`in e&&`_getNodeStream`in e,Vp=e=>Mp(e)&&jp(e.abort)&&jp(e.getWriter)&&!Bp(e),Hp=e=>Mp(e)&&jp(e.cancel)&&jp(e.getReader)&&!Bp(e),Up=e=>Mp(e)&&jp(e.end)&&jp(e.write)&&Ap(e.writable)&&!Bp(e),Wp=e=>Mp(e)&&jp(e.read)&&jp(e.pipe)&&Ap(e.readable)&&!Bp(e),Gp=e=>Mp(e)&&jp(e.clear)&&jp(e.bytes)&&jp(e.position)&&jp(e.setPosition)&&jp(e.capacity)&&jp(e.getBufferIdentifier)&&jp(e.createLong),Kp=typeof SharedArrayBuffer<`u`?SharedArrayBuffer:ArrayBuffer;function qp(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;++cXp(Int32Array,e),Qp=e=>Xp(BigInt64Array,e),$p=e=>Xp(Uint8Array,e),em=e=>(e.next(),e);function*tm(e,t){let n=function*(e){yield e},r=typeof t==`string`||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Kp?n(t):Pp(t)?t:n(t);return yield*em(function*(t){let n=null;do n=t.next(yield Xp(e,n));while(!n.done)}(r[Symbol.iterator]())),new e}const nm=e=>tm(Uint8Array,e);function rm(e,t){return Sp(this,arguments,function*(){if(Np(t))return yield xp(yield xp(yield*Cp(wp(rm(e,yield xp(t))))));let n=function(e){return Sp(this,arguments,function*(){yield yield xp(yield xp(e))})},r=function(e){return Sp(this,arguments,function*(){yield xp(yield*Cp(wp(em(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 Kp?n(t):Pp(t)?r(t):Fp(t)?t:n(t);return yield xp(yield*Cp(wp(em(function(t){return Sp(this,arguments,function*(){let n=null;do n=yield xp(t.next(yield yield xp(Xp(e,n))));while(!n.done)})}(i[Symbol.asyncIterator]()))))),yield xp(new e)})}const im=e=>rm(Uint8Array,e);function am(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*lm(e){let t,n=!1,r=[],i,a,o,s=0;function c(){return a===`peek`?Yp(r,o)[0]:([i,r,s]=Yp(r,o),i)}({cmd:a,size:o}=(yield(()=>null)())||{cmd:`read`,size:0});let l=nm(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=im(e)[Symbol.asyncIterator]();try{do if({done:t,value:i}=Number.isNaN(o-s)?yield xp(l.next()):yield xp(l.next(o-s)),!t&&i.byteLength>0&&(r.push(i),s+=i.byteLength),t||o<=s)do({cmd:a,size:o}=yield yield xp(c()));while(onull)()))||{cmd:`read`,size:0});let l=new fm(e);try{do if({done:t,value:i}=Number.isNaN(o-s)?yield xp(l.read()):yield xp(l.read(o-s)),!t&&i.byteLength>0&&(r.push($p(i)),s+=i.byteLength),t||o<=s)do({cmd:a,size:o}=yield yield xp(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 yp(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 yp(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=$p(t)),t})}};const pm=(e,t)=>{let n=e=>r([t,e]),r;return[t,n,new Promise(i=>(r=i)&&e.once(t,n))]};function mm(e){return Sp(this,arguments,function*(){let t=[],n=`error`,r=!1,i=null,a,o,s=0,c=[],l;function u(){return a===`peek`?Yp(c,o)[0]:([l,c,s]=Yp(c,o),l)}if({cmd:a,size:o}=(yield yield xp((()=>null)()))||{cmd:`read`,size:0},e.isTTY)return yield yield xp(new Uint8Array),yield xp(null);try{t[0]=pm(e,`end`),t[1]=pm(e,`error`);do{if(t[2]=pm(e,`readable`),[n,i]=yield xp(Promise.race(t.map(e=>e[2]))),n===`error`)break;if((r=n===`end`)||(Number.isFinite(o-s)?(l=$p(e.read(o-s)),l.byteLength0&&(c.push(l),s+=l.byteLength)),r||o<=s)do({cmd:a,size:o}=yield yield xp(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 hm;(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`})(hm||={});var gm;(function(e){e[e.Sparse=0]=`Sparse`,e[e.Dense=1]=`Dense`})(gm||={});var _m;(function(e){e[e.HALF=0]=`HALF`,e[e.SINGLE=1]=`SINGLE`,e[e.DOUBLE=2]=`DOUBLE`})(_m||={});var vm;(function(e){e[e.DAY=0]=`DAY`,e[e.MILLISECOND=1]=`MILLISECOND`})(vm||={});var ym;(function(e){e[e.SECOND=0]=`SECOND`,e[e.MILLISECOND=1]=`MILLISECOND`,e[e.MICROSECOND=2]=`MICROSECOND`,e[e.NANOSECOND=3]=`NANOSECOND`})(ym||={});var bm;(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`})(bm||={});const xm=2,Sm=4,Cm=4,wm=4,Tm=new Int32Array(2),Em=new Float32Array(Tm.buffer),Dm=new Float64Array(Tm.buffer),Om=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var km;(function(e){e[e.UTF8_BYTES=1]=`UTF8_BYTES`,e[e.UTF16_STRING=2]=`UTF16_STRING`})(km||={});var Am=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){Em[0]=t,this.writeInt32(e,Tm[0])}writeFloat64(e,t){Dm[0]=t,this.writeInt32(e,Tm[Om?0:1]),this.writeInt32(e+4,Tm[Om?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)*xm;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,Sm+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)}},ch=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()+wm),(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)}},lh;(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`})(lh||={});var uh=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()+wm),(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):lh.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 Hm).__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,lh.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}},dh=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()+wm),(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):zm.Little}fields(e,t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new uh).__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,zm.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)}},fh;(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`})(fh||={});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 ph;(function(e){e[e.OFFSET=0]=`OFFSET`,e[e.DATA=1]=`DATA`,e[e.VALIDITY=2]=`VALIDITY`,e[e.TYPE=3]=`TYPE`})(ph||={});const mh=void 0;function hh(e){if(e===null)return`null`;if(e===mh)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=>hh(e))}]`:`[${e}]`:ArrayBuffer.isView(e)?`[${e}]`:JSON.stringify(e,(e,t)=>typeof t==`bigint`?`${t}`:t)}function gh(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 _h(e,t){return gh(e/t)+gh(e%t)/gh(t)}const vh=Symbol.for(`isArrowBigNum`);function yh(e,...t){return t.length===0?Object.setPrototypeOf(Xp(this.TypedArray,e),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(e,...t),this.constructor.prototype)}yh.prototype[vh]=!0,yh.prototype.toJSON=function(){return`"${Eh(this)}"`},yh.prototype.valueOf=function(e){return Th(this,e)},yh.prototype.toString=function(){return Eh(this)},yh.prototype[Symbol.toPrimitive]=function(e=`default`){switch(e){case`number`:return Th(this);case`string`:return Eh(this);case`default`:return Dh(this)}return Eh(this)};function bh(...e){return yh.apply(this,e)}function xh(...e){return yh.apply(this,e)}function Sh(...e){return yh.apply(this,e)}Object.setPrototypeOf(bh.prototype,Object.create(Int32Array.prototype)),Object.setPrototypeOf(xh.prototype,Object.create(Uint32Array.prototype)),Object.setPrototypeOf(Sh.prototype,Object.create(Uint32Array.prototype)),Object.assign(bh.prototype,yh.prototype,{constructor:bh,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array}),Object.assign(xh.prototype,yh.prototype,{constructor:xh,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array}),Object.assign(Sh.prototype,yh.prototype,{constructor:Sh,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});const Ch=BigInt(4294967296)*BigInt(4294967296),wh=Ch-BigInt(1);function Th(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 Oh(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 Qh=class extends R{constructor(){super(L.Null)}toString(){return`Null`}};jh=Symbol.toStringTag,Qh[jh]=(e=>e[Symbol.toStringTag]=`Null`)(Qh.prototype);var $h=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}`}};Mh=Symbol.toStringTag,$h[Mh]=(e=>(e.isSigned=null,e.bitWidth=null,e[Symbol.toStringTag]=`Int`))($h.prototype);var eg=class extends $h{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},tg=class extends $h{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},ng=class extends $h{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},rg=class extends $h{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},ig=class extends $h{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},ag=class extends $h{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},og=class extends $h{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},sg=class extends $h{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(eg.prototype,`ArrayType`,{value:Int8Array}),Object.defineProperty(tg.prototype,`ArrayType`,{value:Int16Array}),Object.defineProperty(ng.prototype,`ArrayType`,{value:Int32Array}),Object.defineProperty(rg.prototype,`ArrayType`,{value:BigInt64Array}),Object.defineProperty(ig.prototype,`ArrayType`,{value:Uint8Array}),Object.defineProperty(ag.prototype,`ArrayType`,{value:Uint16Array}),Object.defineProperty(og.prototype,`ArrayType`,{value:Uint32Array}),Object.defineProperty(sg.prototype,`ArrayType`,{value:BigUint64Array});var cg=class extends R{constructor(e){super(L.Float),this.precision=e}get ArrayType(){switch(this.precision){case _m.HALF:return Uint16Array;case _m.SINGLE:return Float32Array;case _m.DOUBLE:return Float64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};Nh=Symbol.toStringTag,cg[Nh]=(e=>(e.precision=null,e[Symbol.toStringTag]=`Float`))(cg.prototype);var lg=class extends cg{constructor(){super(_m.HALF)}},ug=class extends cg{constructor(){super(_m.SINGLE)}},dg=class extends cg{constructor(){super(_m.DOUBLE)}};Object.defineProperty(lg.prototype,`ArrayType`,{value:Uint16Array}),Object.defineProperty(ug.prototype,`ArrayType`,{value:Float32Array}),Object.defineProperty(dg.prototype,`ArrayType`,{value:Float64Array});var fg=class extends R{constructor(){super(L.Binary)}toString(){return`Binary`}};Ph=Symbol.toStringTag,fg[Ph]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Binary`))(fg.prototype);var pg=class extends R{constructor(){super(L.LargeBinary)}toString(){return`LargeBinary`}};Fh=Symbol.toStringTag,pg[Fh]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]=`LargeBinary`))(pg.prototype);var mg=class extends R{constructor(){super(L.Utf8)}toString(){return`Utf8`}};Ih=Symbol.toStringTag,mg[Ih]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Utf8`))(mg.prototype);var hg=class extends R{constructor(){super(L.LargeUtf8)}toString(){return`LargeUtf8`}};Lh=Symbol.toStringTag,hg[Lh]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]=`LargeUtf8`))(hg.prototype);var gg=class extends R{constructor(){super(L.Bool)}toString(){return`Bool`}};Rh=Symbol.toStringTag,gg[Rh]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Bool`))(gg.prototype);var _g=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}]`}};zh=Symbol.toStringTag,_g[zh]=(e=>(e.scale=null,e.precision=null,e.ArrayType=Uint32Array,e[Symbol.toStringTag]=`Decimal`))(_g.prototype);var vg=class extends R{constructor(e){super(L.Date),this.unit=e}toString(){return`Date${(this.unit+1)*32}<${vm[this.unit]}>`}get ArrayType(){return this.unit===vm.DAY?Int32Array:BigInt64Array}};Bh=Symbol.toStringTag,vg[Bh]=(e=>(e.unit=null,e[Symbol.toStringTag]=`Date`))(vg.prototype);var yg=class extends R{constructor(e,t){super(L.Time),this.unit=e,this.bitWidth=t}toString(){return`Time${this.bitWidth}<${ym[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};Vh=Symbol.toStringTag,yg[Vh]=(e=>(e.unit=null,e.bitWidth=null,e[Symbol.toStringTag]=`Time`))(yg.prototype);var bg=class extends R{constructor(e,t){super(L.Timestamp),this.unit=e,this.timezone=t}toString(){return`Timestamp<${ym[this.unit]}${this.timezone?`, ${this.timezone}`:``}>`}};Hh=Symbol.toStringTag,bg[Hh]=(e=>(e.unit=null,e.timezone=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]=`Timestamp`))(bg.prototype);var xg=class extends R{constructor(e){super(L.Interval),this.unit=e}toString(){return`Interval<${bm[this.unit]}>`}};Uh=Symbol.toStringTag,xg[Uh]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]=`Interval`))(xg.prototype);var Sg=class extends R{constructor(e){super(L.Duration),this.unit=e}toString(){return`Duration<${ym[this.unit]}>`}};Wh=Symbol.toStringTag,Sg[Wh]=(e=>(e.unit=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]=`Duration`))(Sg.prototype);var Cg=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}};Gh=Symbol.toStringTag,Cg[Gh]=(e=>(e.children=null,e[Symbol.toStringTag]=`List`))(Cg.prototype);var wg=class extends R{constructor(e){super(L.Struct),this.children=e}toString(){return`Struct<{${this.children.map(e=>`${e.name}:${e.type}`).join(`, `)}}>`}};Kh=Symbol.toStringTag,wg[Kh]=(e=>(e.children=null,e[Symbol.toStringTag]=`Struct`))(wg.prototype);var Tg=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(` | `)}>`}};qh=Symbol.toStringTag,Tg[qh]=(e=>(e.mode=null,e.typeIds=null,e.children=null,e.typeIdToChildIndex=null,e.ArrayType=Int8Array,e[Symbol.toStringTag]=`Union`))(Tg.prototype);var Eg=class extends R{constructor(e){super(L.FixedSizeBinary),this.byteWidth=e}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};Jh=Symbol.toStringTag,Eg[Jh]=(e=>(e.byteWidth=null,e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`FixedSizeBinary`))(Eg.prototype);var Dg=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}>`}};Yh=Symbol.toStringTag,Dg[Yh]=(e=>(e.children=null,e.listSize=null,e[Symbol.toStringTag]=`FixedSizeList`))(Dg.prototype);var Og=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(`, `)}}>`}};Xh=Symbol.toStringTag,Og[Xh]=(e=>(e.children=null,e.keysSorted=null,e[Symbol.toStringTag]=`Map_`))(Og.prototype);const kg=(e=>()=>++e)(-1);var Ag=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?kg():gh(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}>`}};Zh=Symbol.toStringTag,Ag[Zh]=(e=>(e.id=null,e.indices=null,e.isOrdered=null,e.dictionary=null,e[Symbol.toStringTag]=`Dictionary`))(Ag.prototype);function jg(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 Mg=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 Ng(this,e,t)}getVisitFnByTypeId(e,t=!0){return Pg(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 Ng(e,t,n=!0){return typeof t==`number`?Pg(e,t,n):typeof t==`string`&&t in L?Pg(e,L[t],n):t&&t instanceof R?Pg(e,Fg(t),n):t?.type&&t.type instanceof R?Pg(e,Fg(t.type),n):Pg(e,L.NONE,n)}function Pg(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 Fg(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 _m.HALF:return L.Float16;case _m.SINGLE:return L.Float32;case _m.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 ym.SECOND:return L.TimeSecond;case ym.MILLISECOND:return L.TimeMillisecond;case ym.MICROSECOND:return L.TimeMicrosecond;case ym.NANOSECOND:return L.TimeNanosecond}return L.Time;case L.Timestamp:switch(e.unit){case ym.SECOND:return L.TimestampSecond;case ym.MILLISECOND:return L.TimestampMillisecond;case ym.MICROSECOND:return L.TimestampMicrosecond;case ym.NANOSECOND:return L.TimestampNanosecond}return L.Timestamp;case L.Date:switch(e.unit){case vm.DAY:return L.DateDay;case vm.MILLISECOND:return L.DateMillisecond}return L.Date;case L.Interval:switch(e.unit){case bm.DAY_TIME:return L.IntervalDayTime;case bm.YEAR_MONTH:return L.IntervalYearMonth}return L.Interval;case L.Duration:switch(e.unit){case ym.SECOND:return L.DurationSecond;case ym.MILLISECOND:return L.DurationMillisecond;case ym.MICROSECOND:return L.DurationMicrosecond;case ym.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 gm.Dense:return L.DenseUnion;case gm.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]}'`)}Mg.prototype.visitInt8=null,Mg.prototype.visitInt16=null,Mg.prototype.visitInt32=null,Mg.prototype.visitInt64=null,Mg.prototype.visitUint8=null,Mg.prototype.visitUint16=null,Mg.prototype.visitUint32=null,Mg.prototype.visitUint64=null,Mg.prototype.visitFloat16=null,Mg.prototype.visitFloat32=null,Mg.prototype.visitFloat64=null,Mg.prototype.visitDateDay=null,Mg.prototype.visitDateMillisecond=null,Mg.prototype.visitTimestampSecond=null,Mg.prototype.visitTimestampMillisecond=null,Mg.prototype.visitTimestampMicrosecond=null,Mg.prototype.visitTimestampNanosecond=null,Mg.prototype.visitTimeSecond=null,Mg.prototype.visitTimeMillisecond=null,Mg.prototype.visitTimeMicrosecond=null,Mg.prototype.visitTimeNanosecond=null,Mg.prototype.visitDenseUnion=null,Mg.prototype.visitSparseUnion=null,Mg.prototype.visitIntervalDayTime=null,Mg.prototype.visitIntervalYearMonth=null,Mg.prototype.visitDuration=null,Mg.prototype.visitDurationSecond=null,Mg.prototype.visitDurationMillisecond=null,Mg.prototype.visitDurationMicrosecond=null,Mg.prototype.visitDurationNanosecond=null;const Ig=new Float64Array(1),Lg=new Uint32Array(Ig.buffer);function Rg(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 zg(e){if(e!==e)return 32256;Ig[0]=e;let t=(Lg[1]&2147483648)>>16&65535,n=Lg[1]&2146435072,r=0;return n>=1089470464?Lg[0]>0?n=31744:(n=(n&2080374784)>>16,r=(Lg[1]&1048575)>>10):n<=1056964608?(r=1048576+(Lg[1]&1048575),r=1048576+(r<<(n>>20)-998)>>21,n=0):(n=n-1056964608>>10,r=(Lg[1]&1048575)+512>>10),t|n|r&65535}var Bg=class extends Mg{};function Vg(e){return(t,n,r)=>{if(t.setValid(n,r!=null))return e(t,n,r)}}const Hg=(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},Kg=({values:e},t,n)=>{e[t]=n},qg=({values:e},t,n)=>{e[t]=zg(n)},Jg=(e,t,n)=>{switch(e.type.precision){case _m.HALF:return qg(e,t,n);case _m.SINGLE:case _m.DOUBLE:return Kg(e,t,n)}},Yg=({values:e},t,n)=>{Hg(e,t,n.valueOf())},Xg=({values:e},t,n)=>{e[t]=BigInt(n)},Zg=({stride:e,values:t},n,r)=>{t.set(r.subarray(0,e),e*n)},Qg=({values:e,valueOffsets:t},n,r)=>Ug(e,t,n,r),$g=({values:e,valueOffsets:t},n,r)=>Ug(e,t,n,Op(r)),e_=(e,t,n)=>{e.type.unit===vm.DAY?Yg(e,t,n):Xg(e,t,n)},t_=({values:e},t,n)=>{e[t]=BigInt(n/1e3)},n_=({values:e},t,n)=>{e[t]=BigInt(n)},r_=({values:e},t,n)=>{e[t]=BigInt(n*1e3)},i_=({values:e},t,n)=>{e[t]=BigInt(n*1e6)},a_=(e,t,n)=>{switch(e.type.unit){case ym.SECOND:return t_(e,t,n);case ym.MILLISECOND:return n_(e,t,n);case ym.MICROSECOND:return r_(e,t,n);case ym.NANOSECOND:return i_(e,t,n)}},o_=({values:e},t,n)=>{e[t]=n},s_=({values:e},t,n)=>{e[t]=n},c_=({values:e},t,n)=>{e[t]=n},l_=({values:e},t,n)=>{e[t]=n},u_=(e,t,n)=>{switch(e.type.unit){case ym.SECOND:return o_(e,t,n);case ym.MILLISECOND:return s_(e,t,n);case ym.MICROSECOND:return c_(e,t,n);case ym.NANOSECOND:return l_(e,t,n)}},d_=({values:e,stride:t},n,r)=>{e.set(r.subarray(0,t),t*n)},f_=(e,t,n)=>{let r=e.children[0],i=e.valueOffsets,a=M_.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=M_.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},m_=(e,t)=>(n,r,i,a)=>r&&n(r,e,t[a]),h_=(e,t)=>(n,r,i,a)=>r&&n(r,e,t.get(a)),g_=(e,t)=>(n,r,i,a)=>r&&n(r,e,t.get(i.name)),__=(e,t)=>(n,r,i,a)=>r&&n(r,e,t[i.name]),v_=(e,t,n)=>{let r=e.type.children.map(e=>M_.getVisitFn(e.type)),i=n instanceof Map?g_(t,n):n instanceof Oy?h_(t,n):Array.isArray(n)?m_(t,n):__(t,n);e.type.children.forEach((t,n)=>i(r[n],e.children[n],t,n))},y_=(e,t,n)=>{e.type.mode===gm.Dense?b_(e,t,n):x_(e,t,n)},b_=(e,t,n)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];M_.visit(i,e.valueOffsets[t],n)},x_=(e,t,n)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];M_.visit(i,t,n)},S_=(e,t,n)=>{var r;(r=e.dictionary)==null||r.set(e.values[t],n)},C_=(e,t,n)=>{e.type.unit===bm.DAY_TIME?w_(e,t,n):T_(e,t,n)},w_=({values:e},t,n)=>{e.set(n.subarray(0,2),2*t)},T_=({values:e},t,n)=>{e[t]=n[0]*12+n[1]%12},E_=({values:e},t,n)=>{e[t]=n},D_=({values:e},t,n)=>{e[t]=n},O_=({values:e},t,n)=>{e[t]=n},k_=({values:e},t,n)=>{e[t]=n},A_=(e,t,n)=>{switch(e.type.unit){case ym.SECOND:return E_(e,t,n);case ym.MILLISECOND:return D_(e,t,n);case ym.MICROSECOND:return O_(e,t,n);case ym.NANOSECOND:return k_(e,t,n)}},j_=(e,t,n)=>{let{stride:r}=e,i=e.children[0],a=M_.getVisitFn(i);if(Array.isArray(n))for(let e=-1,o=t*r;++e`${hh(e)}: ${hh(t)}`).join(`, `)}}`}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.toString()}[Symbol.iterator](){return new I_(this[N_],this[P_])}},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[N_].type.children.findIndex(e=>e.name===t)!==-1}getOwnPropertyDescriptor(e,t){if(e[N_].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[N_].type.children.findIndex(e=>e.name===t);if(n!==-1){let r=Dv.visit(e[N_].children[n],e[P_]);return Reflect.set(e,t,r),r}}set(e,t,n){let r=e[N_].type.children.findIndex(e=>e.name===t);return r===-1?Reflect.has(e,t)||typeof t==`symbol`?Reflect.set(e,t,n):!1:(M_.visit(e[N_].children[r],e[P_],n),Reflect.set(e,t,n))}},z=class extends Mg{};function R_(e){return(t,n)=>t.getValid(n)?e(t,n):null}const z_=(e,t)=>864e5*e[t],B_=(e,t)=>null,V_=(e,t,n)=>{if(n+1>=t.length)return null;let r=gh(t[n]),i=gh(t[n+1]);return e.subarray(r,i)},H_=({offset:e,values:t},n)=>{let r=e+n,i=t[r>>3];return(i&1<z_(e,t),W_=({values:e},t)=>gh(e[t]),G_=({stride:e,values:t},n)=>t[e*n],K_=({stride:e,values:t},n)=>Rg(t[e*n]),q_=({values:e},t)=>e[t],J_=({stride:e,values:t},n)=>t.subarray(e*n,e*(n+1)),Y_=({values:e,valueOffsets:t},n)=>V_(e,t,n),X_=({values:e,valueOffsets:t},n)=>{let r=V_(e,t,n);return r===null?null:Ep(r)},Z_=({values:e},t)=>e[t],Q_=({type:e,values:t},n)=>e.precision===_m.HALF?Rg(t[n]):t[n],$_=(e,t)=>e.type.unit===vm.DAY?U_(e,t):W_(e,t),ev=({values:e},t)=>1e3*gh(e[t]),tv=({values:e},t)=>gh(e[t]),nv=({values:e},t)=>_h(e[t],BigInt(1e3)),rv=({values:e},t)=>_h(e[t],BigInt(1e6)),iv=(e,t)=>{switch(e.type.unit){case ym.SECOND:return ev(e,t);case ym.MILLISECOND:return tv(e,t);case ym.MICROSECOND:return nv(e,t);case ym.NANOSECOND:return rv(e,t)}},av=({values:e},t)=>e[t],ov=({values:e},t)=>e[t],sv=({values:e},t)=>e[t],cv=({values:e},t)=>e[t],lv=(e,t)=>{switch(e.type.unit){case ym.SECOND:return av(e,t);case ym.MILLISECOND:return ov(e,t);case ym.MICROSECOND:return sv(e,t);case ym.NANOSECOND:return cv(e,t)}},uv=({values:e,stride:t},n)=>kh.decimal(e.subarray(t*n,t*(n+1))),dv=(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 Oy([c])},fv=(e,t)=>{let{valueOffsets:n,children:r}=e,{[t]:i,[t+1]:a}=n,o=r[0];return new Mv(o.slice(i,a-i))},pv=(e,t)=>new F_(e,t),mv=(e,t)=>e.type.mode===gm.Dense?hv(e,t):gv(e,t),hv=(e,t)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return Dv.visit(r,e.valueOffsets[t])},gv=(e,t)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return Dv.visit(r,t)},_v=(e,t)=>{var n;return(n=e.dictionary)?.get(e.values[t])},vv=(e,t)=>e.type.unit===bm.DAY_TIME?yv(e,t):bv(e,t),yv=({values:e},t)=>e.subarray(2*t,2*(t+1)),bv=({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},xv=({values:e},t)=>e[t],Sv=({values:e},t)=>e[t],Cv=({values:e},t)=>e[t],wv=({values:e},t)=>e[t],Tv=(e,t)=>{switch(e.type.unit){case ym.SECOND:return xv(e,t);case ym.MILLISECOND:return Sv(e,t);case ym.MICROSECOND:return Cv(e,t);case ym.NANOSECOND:return wv(e,t)}},Ev=(e,t)=>{let{stride:n,children:r}=e,i=r[0],a=i.slice(t*n,n);return new Oy([a])};z.prototype.visitNull=R_(B_),z.prototype.visitBool=R_(H_),z.prototype.visitInt=R_(Z_),z.prototype.visitInt8=R_(G_),z.prototype.visitInt16=R_(G_),z.prototype.visitInt32=R_(G_),z.prototype.visitInt64=R_(q_),z.prototype.visitUint8=R_(G_),z.prototype.visitUint16=R_(G_),z.prototype.visitUint32=R_(G_),z.prototype.visitUint64=R_(q_),z.prototype.visitFloat=R_(Q_),z.prototype.visitFloat16=R_(K_),z.prototype.visitFloat32=R_(G_),z.prototype.visitFloat64=R_(G_),z.prototype.visitUtf8=R_(X_),z.prototype.visitLargeUtf8=R_(X_),z.prototype.visitBinary=R_(Y_),z.prototype.visitLargeBinary=R_(Y_),z.prototype.visitFixedSizeBinary=R_(J_),z.prototype.visitDate=R_($_),z.prototype.visitDateDay=R_(U_),z.prototype.visitDateMillisecond=R_(W_),z.prototype.visitTimestamp=R_(iv),z.prototype.visitTimestampSecond=R_(ev),z.prototype.visitTimestampMillisecond=R_(tv),z.prototype.visitTimestampMicrosecond=R_(nv),z.prototype.visitTimestampNanosecond=R_(rv),z.prototype.visitTime=R_(lv),z.prototype.visitTimeSecond=R_(av),z.prototype.visitTimeMillisecond=R_(ov),z.prototype.visitTimeMicrosecond=R_(sv),z.prototype.visitTimeNanosecond=R_(cv),z.prototype.visitDecimal=R_(uv),z.prototype.visitList=R_(dv),z.prototype.visitStruct=R_(pv),z.prototype.visitUnion=R_(mv),z.prototype.visitDenseUnion=R_(hv),z.prototype.visitSparseUnion=R_(gv),z.prototype.visitDictionary=R_(_v),z.prototype.visitInterval=R_(vv),z.prototype.visitIntervalDayTime=R_(yv),z.prototype.visitIntervalYearMonth=R_(bv),z.prototype.visitDuration=R_(Tv),z.prototype.visitDurationSecond=R_(xv),z.prototype.visitDurationMillisecond=R_(Sv),z.prototype.visitDurationMicrosecond=R_(Cv),z.prototype.visitDurationNanosecond=R_(wv),z.prototype.visitFixedSizeList=R_(Ev),z.prototype.visitMap=R_(fv);const Dv=new z,Ov=Symbol.for(`keys`),kv=Symbol.for(`vals`),Av=Symbol.for(`kKeysAsStrings`),jv=Symbol.for(`_kKeysAsStrings`);var Mv=class{constructor(e){return this[Ov]=new Oy([e.children[0]]).memoize(),this[kv]=e.children[1],new Proxy(this,new Pv)}get[Av](){return this[jv]||(this[jv]=Array.from(this[Ov].toArray(),String))}[Symbol.iterator](){return new Nv(this[Ov],this[kv])}get size(){return this[Ov].length}toArray(){return Object.values(this.toJSON())}toJSON(){let e=this[Ov],t=this[kv],n={};for(let r=-1,i=e.length;++r`${hh(e)}: ${hh(t)}`).join(`, `)}}`}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.toString()}},Nv=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),Dv.visit(this.vals,e)]})}},Pv=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[Av]}has(e,t){return e[Av].includes(t)}getOwnPropertyDescriptor(e,t){let n=e[Av].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[Av].indexOf(t);if(n!==-1){let r=Dv.visit(Reflect.get(e,kv),n);return Reflect.set(e,t,r),r}}set(e,t,n){let r=e[Av].indexOf(t);return r===-1?Reflect.has(e,t)?Reflect.set(e,t,n):!1:(M_.visit(Reflect.get(e,kv),r,n),Reflect.set(e,t,n))}};Object.defineProperties(Mv.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:`Row`},[Ov]:{writable:!0,enumerable:!1,configurable:!1,value:null},[kv]:{writable:!0,enumerable:!1,configurable:!1,value:null},[jv]:{writable:!0,enumerable:!1,configurable:!1,value:null}});let Fv;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 Lv=(e,t)=>e<0?t+e:e,Rv=e=>e!==e;function zv(e){let t=typeof e;if(t!==`object`||e===null)return Rv(e)?Rv: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?om(e,t):!1:e instanceof Map?Vv(e):Array.isArray(e)?Bv(e):e instanceof Oy?Hv(e):Uv(e,!0)}function Bv(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 Gv(e,n);case Map:return qv(e,n,n.keys());case Mv:case F_:case Object:case void 0:return qv(e,n,t||Object.keys(n))}return n instanceof Oy?Kv(e,n):!1}}function Gv(e,t){let n=e.length;if(t.length!==n)return!1;for(let r=-1;++r>r}function Xv(e,t,n){let r=n.byteLength+7&-8;if(e>0||n.byteLength>3):Zv(new Qv(n,e,t,null,Jv)).subarray(0,r)),i}return n}function Zv(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 Qv=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 $v(e,t,i)+$v(e,r,n)+ey(e,i>>3,r-i>>3)}function ey(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+=ty(a.getUint32(i)),i+=4;for(;o-i>=2;)r+=ty(a.getUint16(i)),i+=2;for(;o-i>=1;)r+=ty(a.getUint8(i)),i+=1;return r}function ty(e){let t=Math.trunc(e);return t-=t>>>1&1431655765,t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}const ny=-1;var ry=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<=ny&&(t=this.nullBitmap)&&(this._nullCount=e=t.length===0?0:this.length-$v(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=jg(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===gm.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(Xv(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(Xv(this.offset,t,this.nullBitmap),0);let i=this.buffers;return i[ph.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[ph.TYPE])&&(a[ph.TYPE]=i.subarray(e,e+t)),(i=a[ph.OFFSET])&&(a[ph.OFFSET]=i.subarray(e,e+t+1))||(i=a[ph.DATA])&&(a[ph.DATA]=r===6?i:i.subarray(n*e,n*(e+t))),a}_sliceChildren(e,t,n){return e.map(e=>e.slice(t,n))}};ry.prototype.children=Object.freeze([]);var iy=class e extends Mg{visit(e){return this.getVisitFn(e.type).call(this,e)}visitNull(e){let{type:t,offset:n=0,length:r=0}=e;return new ry(t,n,r,r)}visitBool(e){let{type:t,offset:n=0}=e,r=$p(e.nullBitmap),i=Xp(t.ArrayType,e.data),{length:a=i.length>>3,nullCount:o=e.nullBitmap?-1:0}=e;return new ry(t,n,a,o,[void 0,i,r])}visitInt(e){let{type:t,offset:n=0}=e,r=$p(e.nullBitmap),i=Xp(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new ry(t,n,a,o,[void 0,i,r])}visitFloat(e){let{type:t,offset:n=0}=e,r=$p(e.nullBitmap),i=Xp(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new ry(t,n,a,o,[void 0,i,r])}visitUtf8(e){let{type:t,offset:n=0}=e,r=$p(e.data),i=$p(e.nullBitmap),a=Zp(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new ry(t,n,o,s,[a,r,i])}visitLargeUtf8(e){let{type:t,offset:n=0}=e,r=$p(e.data),i=$p(e.nullBitmap),a=Qp(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new ry(t,n,o,s,[a,r,i])}visitBinary(e){let{type:t,offset:n=0}=e,r=$p(e.data),i=$p(e.nullBitmap),a=Zp(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new ry(t,n,o,s,[a,r,i])}visitLargeBinary(e){let{type:t,offset:n=0}=e,r=$p(e.data),i=$p(e.nullBitmap),a=Qp(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new ry(t,n,o,s,[a,r,i])}visitFixedSizeBinary(e){let{type:t,offset:n=0}=e,r=$p(e.nullBitmap),i=Xp(t.ArrayType,e.data),{length:a=i.length/jg(t),nullCount:o=e.nullBitmap?-1:0}=e;return new ry(t,n,a,o,[void 0,i,r])}visitDate(e){let{type:t,offset:n=0}=e,r=$p(e.nullBitmap),i=Xp(t.ArrayType,e.data),{length:a=i.length/jg(t),nullCount:o=e.nullBitmap?-1:0}=e;return new ry(t,n,a,o,[void 0,i,r])}visitTimestamp(e){let{type:t,offset:n=0}=e,r=$p(e.nullBitmap),i=Xp(t.ArrayType,e.data),{length:a=i.length/jg(t),nullCount:o=e.nullBitmap?-1:0}=e;return new ry(t,n,a,o,[void 0,i,r])}visitTime(e){let{type:t,offset:n=0}=e,r=$p(e.nullBitmap),i=Xp(t.ArrayType,e.data),{length:a=i.length/jg(t),nullCount:o=e.nullBitmap?-1:0}=e;return new ry(t,n,a,o,[void 0,i,r])}visitDecimal(e){let{type:t,offset:n=0}=e,r=$p(e.nullBitmap),i=Xp(t.ArrayType,e.data),{length:a=i.length/jg(t),nullCount:o=e.nullBitmap?-1:0}=e;return new ry(t,n,a,o,[void 0,i,r])}visitList(e){let{type:t,offset:n=0,child:r}=e,i=$p(e.nullBitmap),a=Zp(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new ry(t,n,o,s,[a,void 0,i],[r])}visitStruct(e){let{type:t,offset:n=0,children:r=[]}=e,i=$p(e.nullBitmap),{length:a=r.reduce((e,{length:t})=>Math.max(e,t),0),nullCount:o=e.nullBitmap?-1:0}=e;return new ry(t,n,a,o,[void 0,void 0,i],r)}visitUnion(e){let{type:t,offset:n=0,children:r=[]}=e,i=Xp(t.ArrayType,e.typeIds),{length:a=i.length,nullCount:o=-1}=e;if(R.isSparseUnion(t))return new ry(t,n,a,o,[void 0,void 0,void 0,i],r);let s=Zp(e.valueOffsets);return new ry(t,n,a,o,[s,void 0,void 0,i],r)}visitDictionary(t){let{type:n,offset:r=0}=t,i=$p(t.nullBitmap),a=Xp(n.indices.ArrayType,t.data),{dictionary:o=new Oy([new e().visit({type:n.dictionary})])}=t,{length:s=a.length,nullCount:c=t.nullBitmap?-1:0}=t;return new ry(n,r,s,c,[void 0,a,i],[],o)}visitInterval(e){let{type:t,offset:n=0}=e,r=$p(e.nullBitmap),i=Xp(t.ArrayType,e.data),{length:a=i.length/jg(t),nullCount:o=e.nullBitmap?-1:0}=e;return new ry(t,n,a,o,[void 0,i,r])}visitDuration(e){let{type:t,offset:n=0}=e,r=$p(e.nullBitmap),i=Xp(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new ry(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=$p(t.nullBitmap),{length:o=i.length/jg(n),nullCount:s=t.nullBitmap?-1:0}=t;return new ry(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=$p(t.nullBitmap),o=Zp(t.valueOffsets),{length:s=o.length-1,nullCount:c=t.nullBitmap?-1:0}=t;return new ry(n,r,s,c,[o,void 0,a],[i])}};const ay=new iy;function oy(e){return ay.visit(e)}var sy=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 ly(e){return e.reduce((e,t)=>e+t.nullCount,0)}function uy(e){return e.reduce((e,t,n)=>(e[n+1]=e[n]+t.length,e),new Uint32Array(e.length+1))}function dy(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 fy(e,t,n,r){let i=0,a=0,o=t.length-1;do{if(i>=o-1)return n0?0:-1}function vy(e,t){let{nullBitmap:n}=e;if(!n||e.nullCount<=0)return-1;let r=0;for(let i of new Qv(n,e.offset+(t||0),e.length,n,Jv)){if(!i)return r;++r}return-1}function yy(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 vy(e,n)}let r=Dv.getVisitFn(e),i=zv(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 sy(e.data.length,t=>{let r=e.data[t],i=r.length,a=e.slice(n,n+i);return n+=i,new Cy(a)})}var Cy=class{constructor(e){this.vector=e,this.index=0}next(){return this.indexe.data):t;if(a.length===0||a.some(e=>!(e instanceof ry)))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}=Ey[o.typeId],r=a[0];this.isValid=e=>py(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,Dy[o.typeId]),this._offsets=uy(a);break}this.data=a,this.type=o,this.stride=jg(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 cy(this.data)}get nullCount(){return ly(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(Lv(e,this.length))}set(e,t){}indexOf(e,t){return-1}includes(e,t){return this.indexOf(e,t)>-1}[Symbol.iterator](){return wy.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)=>dy(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 ky(this.data[0].dictionary),n=this.data.map(e=>{let n=e.clone();return n.dictionary=t,n});return new e(n)}return new ky(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}};Ty=Symbol.toStringTag,Oy[Ty]=(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=Dv.getVisitFnByTypeId(n),r=M_.getVisitFnByTypeId(n),i=xy.getVisitFnByTypeId(n);Ey[n]={get:t,set:r,indexOf:i},Dy[n]=Object.create(e,{isValid:{value:my(py)},get:{value:my(Dv.getVisitFnByTypeId(n))},set:{value:hy(M_.getVisitFnByTypeId(n))},indexOf:{value:gy(xy.getVisitFnByTypeId(n))}})}return`Vector`})(Oy.prototype);var ky=class e extends Oy{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 Oy(this.data)}),Object.defineProperty(this,`memoize`,{value:()=>this})}},Ay=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()}},jy=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()+wm),(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):hm.V1}schema(e){let t=this.bb.__offset(this.bb_pos,6);return t?(e||new dh).__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 Ay).__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 Ay).__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,hm.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)}},My=class e{constructor(e=[],t,n,r=hm.V5){this.fields=e||[],this.metadata=t||new Map,n||=Fy(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=Py(Py(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:Py(Py(new Map,r[t].metadata),e.metadata)}))&&!1:!0}),o=Fy(a,new Map);return new e([...r,...a],i,new Map([...this.dictionaries,...o]))}};My.prototype.fields=null,My.prototype.metadata=null,My.prototype.dictionaries=null;var Ny=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)}};Ny.prototype.type=null,Ny.prototype.name=null,Ny.prototype.nullable=null,Ny.prototype.metadata=null;function Py(e,t){return new Map([...e||new Map,...t||new Map])}function Fy(e,t=new Map){for(let n=-1,r=e.length;++n0&&Fy(i.children,t)}return t}var Iy=jm,Ly=Am,Ry=class{static decode(e){e=new Ly($p(e));let t=jy.getRootAsFooter(e),n=My.decode(t.schema(),new Map,t.version());return new zy(n,t)}static encode(e){let t=new Iy,n=My.encode(t,e.schema);jy.startRecordBatchesVector(t,e.numRecordBatches);for(let n of[...e.recordBatches()].slice().reverse())By.encode(t,n);let r=t.endVector();jy.startDictionariesVector(t,e.numDictionaries);for(let n of[...e.dictionaryBatches()].slice().reverse())By.encode(t,n);let i=t.endVector();return jy.startFooter(t),jy.addSchema(t,n),jy.addVersion(t,hm.V5),jy.addRecordBatches(t,r),jy.addDictionaries(t,i),jy.finishFooterBuffer(t,jy.endFooter(t)),t.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(e,t=hm.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 yp(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(Vy);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(e){return sm.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,e)}toNodeStream(e){return sm.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,e)}throw(e){return yp(this,void 0,void 0,function*(){return yield this.abort(e),Vy})}return(e){return yp(this,void 0,void 0,function*(){return yield this.close(),Vy})}read(e){return yp(this,void 0,void 0,function*(){return(yield this.next(e,`read`)).value})}peek(e){return yp(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(Vy)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw Error(`AsyncQueue is closed`)}},Gy=class extends Wy{write(e){if((e=$p(e)).byteLength>0)return super.write(e)}toString(e=!1){return e?Ep(this.toUint8Array(!0)):this.toUint8Array(!1).then(Ep)}toUint8Array(e=!1){return e?Yp(this._values)[0]:(()=>yp(this,void 0,void 0,function*(){var e,t,n,r;let i=[],a=0;try{for(var o=!0,s=wp(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 Yp(i,a)[0]}))()}},Ky=class{constructor(e){e&&(this.source=new Jy(sm.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)}},qy=class e{constructor(t){t instanceof e?this.source=t.source:t instanceof Gy?this.source=new Yy(sm.fromAsyncIterable(t)):Wp(t)?this.source=new Yy(sm.fromNodeStream(t)):Hp(t)?this.source=new Yy(sm.fromDOMStream(t)):zp(t)?this.source=new Yy(sm.fromDOMStream(t.body)):Pp(t)?this.source=new Yy(sm.fromIterable(t)):(Np(t)||Fp(t))&&(this.source=new Yy(sm.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)}},Jy=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)||Vy)}return(e){return Object.create(this.source.return&&this.source.return(e)||Vy)}},Yy=class{constructor(e){this.source=e,this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}cancel(e){return yp(this,void 0,void 0,function*(){yield this.return(e)})}get closed(){return this._closedPromise}read(e){return yp(this,void 0,void 0,function*(){return(yield this.next(e,`read`)).value})}peek(e){return yp(this,void 0,void 0,function*(){return(yield this.next(e,`peek`)).value})}next(e){return yp(this,arguments,void 0,function*(e,t=`read`){return yield this.source.next({cmd:t,size:e})})}throw(e){return yp(this,void 0,void 0,function*(){let t=this.source.throw&&(yield this.source.throw(e))||Vy;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)})}return(e){return yp(this,void 0,void 0,function*(){let t=this.source.return&&(yield this.source.return(e))||Vy;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)})}},Xy=class extends Ky{constructor(e,t){super(),this.position=0,this.buffer=$p(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),eyp(this,void 0,void 0,function*(){this.size=(yield e.stat()).size,delete this._pending}))()}readInt32(e){return yp(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 yp(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`${$y(this.buffer[3])} ${$y(this.buffer[2])} ${$y(this.buffer[1])} ${$y(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)}},sb=class extends ob{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:Zv(this.sources[n])}readOffsets(e,{offset:t}=this.nextBufferRange()){return Xp(Uint8Array,Xp(e.OffsetArrayType,this.sources[t]))}readTypeIds(e,{offset:t}=this.nextBufferRange()){return Xp(Uint8Array,Xp(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===vm.MILLISECOND?Xp(Uint8Array,ib.convertArray(n[t])):R.isDecimal(e)?Xp(Uint8Array,ab.convertArray(n[t])):R.isBinary(e)||R.isLargeBinary(e)||R.isFixedSizeBinary(e)?cb(n[t]):R.isBool(e)?Zv(n[t]):R.isUtf8(e)||R.isLargeUtf8(e)?Op(n[t].join(``)):Xp(Uint8Array,Xp(e.ArrayType,n[t].map(e=>+e)))}};function cb(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 lb=class extends Mg{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 ub(e,t){return t instanceof e.constructor}function db(e,t){return e===t||ub(e,t)}function fb(e,t){return e===t||ub(e,t)&&e.bitWidth===t.bitWidth&&e.isSigned===t.isSigned}function pb(e,t){return e===t||ub(e,t)&&e.precision===t.precision}function mb(e,t){return e===t||ub(e,t)&&e.byteWidth===t.byteWidth}function hb(e,t){return e===t||ub(e,t)&&e.unit===t.unit}function gb(e,t){return e===t||ub(e,t)&&e.unit===t.unit&&e.timezone===t.timezone}function _b(e,t){return e===t||ub(e,t)&&e.unit===t.unit&&e.bitWidth===t.bitWidth}function vb(e,t){return e===t||ub(e,t)&&e.children.length===t.children.length&&Eb.compareManyFields(e.children,t.children)}function yb(e,t){return e===t||ub(e,t)&&e.children.length===t.children.length&&Eb.compareManyFields(e.children,t.children)}function bb(e,t){return e===t||ub(e,t)&&e.mode===t.mode&&e.typeIds.every((e,n)=>e===t.typeIds[n])&&Eb.compareManyFields(e.children,t.children)}function xb(e,t){return e===t||ub(e,t)&&e.id===t.id&&e.isOrdered===t.isOrdered&&Eb.visit(e.indices,t.indices)&&Eb.visit(e.dictionary,t.dictionary)}function Sb(e,t){return e===t||ub(e,t)&&e.unit===t.unit}function Cb(e,t){return e===t||ub(e,t)&&e.unit===t.unit}function wb(e,t){return e===t||ub(e,t)&&e.listSize===t.listSize&&e.children.length===t.children.length&&Eb.compareManyFields(e.children,t.children)}function Tb(e,t){return e===t||ub(e,t)&&e.keysSorted===t.keysSorted&&e.children.length===t.children.length&&Eb.compareManyFields(e.children,t.children)}lb.prototype.visitNull=db,lb.prototype.visitBool=db,lb.prototype.visitInt=fb,lb.prototype.visitInt8=fb,lb.prototype.visitInt16=fb,lb.prototype.visitInt32=fb,lb.prototype.visitInt64=fb,lb.prototype.visitUint8=fb,lb.prototype.visitUint16=fb,lb.prototype.visitUint32=fb,lb.prototype.visitUint64=fb,lb.prototype.visitFloat=pb,lb.prototype.visitFloat16=pb,lb.prototype.visitFloat32=pb,lb.prototype.visitFloat64=pb,lb.prototype.visitUtf8=db,lb.prototype.visitLargeUtf8=db,lb.prototype.visitBinary=db,lb.prototype.visitLargeBinary=db,lb.prototype.visitFixedSizeBinary=mb,lb.prototype.visitDate=hb,lb.prototype.visitDateDay=hb,lb.prototype.visitDateMillisecond=hb,lb.prototype.visitTimestamp=gb,lb.prototype.visitTimestampSecond=gb,lb.prototype.visitTimestampMillisecond=gb,lb.prototype.visitTimestampMicrosecond=gb,lb.prototype.visitTimestampNanosecond=gb,lb.prototype.visitTime=_b,lb.prototype.visitTimeSecond=_b,lb.prototype.visitTimeMillisecond=_b,lb.prototype.visitTimeMicrosecond=_b,lb.prototype.visitTimeNanosecond=_b,lb.prototype.visitDecimal=db,lb.prototype.visitList=vb,lb.prototype.visitStruct=yb,lb.prototype.visitUnion=bb,lb.prototype.visitDenseUnion=bb,lb.prototype.visitSparseUnion=bb,lb.prototype.visitDictionary=xb,lb.prototype.visitInterval=Sb,lb.prototype.visitIntervalDayTime=Sb,lb.prototype.visitIntervalYearMonth=Sb,lb.prototype.visitDuration=Cb,lb.prototype.visitDurationSecond=Cb,lb.prototype.visitDurationMillisecond=Cb,lb.prototype.visitDurationMicrosecond=Cb,lb.prototype.visitDurationNanosecond=Cb,lb.prototype.visitFixedSizeList=wb,lb.prototype.visitMap=Tb;const Eb=new lb;function Db(e,t){return Eb.compareSchemas(e,t)}function Ob(e,t){return kb(e,t.map(e=>e.data.concat()))}function kb(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++]=oy({type:new wg(n),length:o,nullCount:0,children:u.slice()})))}return[e=e.assign(n),r.map(t=>new Pb(e,t))]}function Ab(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))??oy({type:r.type,length:t,nullCount:t,nullBitmap:new Uint8Array(o)})}}return n}var jb,Mb=class e{constructor(...t){var n,r;if(t.length===0)return this.batches=[],this.schema=new My([]),this._offsets=[0],this;let i,a;t[0]instanceof My&&(i=t.shift()),t.at(-1)instanceof Uint32Array&&(a=t.pop());let o=t=>{if(t){if(t instanceof Pb)return[t];if(t instanceof e)return t.batches;if(t instanceof ry){if(t.type instanceof wg)return[new Pb(new My(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 Oy([t[e]])),r=i??new My(e.map((e,t)=>new Ny(String(e),n[t].type,n[t].nullable))),[,a]=Ob(r,n);return a.length===0?[new Pb(t)]:a}}return[]},s=t.flatMap(e=>o(e));if(i=(r=i??(n=s[0])?.schema)??new My([]),!(i instanceof My))throw TypeError(`Table constructor expects a [Schema, RecordBatch[]] pair.`);for(let e of s){if(!(e instanceof Pb))throw TypeError(`Table constructor expects a [Schema, RecordBatch[]] pair.`);if(!Db(i,e.schema))throw TypeError(`Table and inner RecordBatch schemas must be equivalent.`)}this.schema=i,this.batches=s,this._offsets=a??uy(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=ly(this.data)),this._nullCount}isValid(e){return!1}get(e){return null}at(e){return this.get(Lv(e,this.numRows))}set(e,t){}indexOf(e,t){return-1}[Symbol.iterator](){return this.batches.length>0?wy.visit(new Oy(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 Pb(n,e)))}slice(t,n){let r=this.schema;[t,n]=Iv({length:this.numRows},t,n);let i=dy(this.data,this._offsets,t,n);return new e(r,i.map(e=>new Pb(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=oy({type:n,length:0,nullCount:0});t.push(r._changeLengthAndBackfillNullBitmap(this.numRows))}return new Oy(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]=Ob(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(...Ob(a,o))}};jb=Symbol.toStringTag,Mb[jb]=(e=>(e.schema=null,e.batches=[],e._offsets=new Uint32Array([0]),e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,e.isValid=my(py),e.get=my(Dv.getVisitFn(L.Struct)),e.set=hy(M_.getVisitFn(L.Struct)),e.indexOf=gy(xy.getVisitFn(L.Struct)),`Table`))(Mb.prototype);var Nb,Pb=class e{constructor(...e){switch(e.length){case 2:if([this.schema]=e,!(this.schema instanceof My)||([,this.data=oy({nullCount:0,type:new wg(this.schema.fields),children:this.schema.fields.map(e=>oy({type:e.type,nullCount:0}))})]=e,!(this.data instanceof ry)))throw TypeError(`RecordBatch constructor expects a [Schema, Data] pair.`);[this.schema,this.data]=Fb(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]=Ny.new({name:n,type:t[n].type,nullable:!0}),e),{length:0,fields:[],children:[]}),a=new My(n),o=oy({type:new wg(n),length:i,children:r,nullCount:0});[this.schema,this.data]=Fb(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||=Ib(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 Dv.visit(this.data,e)}at(e){return this.get(Lv(e,this.numRows))}set(e,t){return M_.visit(this.data,e,t)}indexOf(e,t){return xy.visit(this.data,e,t)}[Symbol.iterator](){return wy.visit(new Oy([this.data]))}toArray(){return[...this]}concat(...e){return new Mb(this.schema,[this,...e])}slice(t,n){let[r]=new Oy([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,oy({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=oy({type:new wg(n.fields),length:this.numRows,children:r});return new e(n,i)}};Nb=Symbol.toStringTag,Pb[Nb]=(e=>(e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,`RecordBatch`))(Pb.prototype);function Fb(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))??oy({type:c.type,length:n,nullCount:n,nullBitmap:new Uint8Array(o)}))}return[e.assign(i),oy({type:new wg(i),length:n,children:a})]}function Ib(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;++roy({type:e.type})),n=oy({type:new wg(e.fields),nullCount:0,children:t});super(e,n)}},Rb=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()+wm),(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):hm.V1}headerType(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb_pos+e):fh.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,hm.V1)}static addHeaderType(e,t){e.addFieldInt8(1,t,fh.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)}},zb=class extends Mg{visit(e,t){return e==null||t==null?void 0:super.visit(e,t)}visitNull(e,t){return rh.startNull(t),rh.endNull(t)}visitInt(e,t){return Vm.startInt(t),Vm.addBitWidth(t,e.bitWidth),Vm.addIsSigned(t,e.isSigned),Vm.endInt(t)}visitFloat(e,t){return Zm.startFloatingPoint(t),Zm.addPrecision(t,e.precision),Zm.endFloatingPoint(t)}visitBinary(e,t){return Wm.startBinary(t),Wm.endBinary(t)}visitLargeBinary(e,t){return $m.startLargeBinary(t),$m.endLargeBinary(t)}visitBool(e,t){return Gm.startBool(t),Gm.endBool(t)}visitUtf8(e,t){return ch.startUtf8(t),ch.endUtf8(t)}visitLargeUtf8(e,t){return eh.startLargeUtf8(t),eh.endLargeUtf8(t)}visitDecimal(e,t){return qm.startDecimal(t),qm.addScale(t,e.scale),qm.addPrecision(t,e.precision),qm.addBitWidth(t,e.bitWidth),qm.endDecimal(t)}visitDate(e,t){return Km.startDate(t),Km.addUnit(t,e.unit),Km.endDate(t)}visitTime(e,t){return ah.startTime(t),ah.addUnit(t,e.unit),ah.addBitWidth(t,e.bitWidth),ah.endTime(t)}visitTimestamp(e,t){let n=e.timezone&&t.createString(e.timezone)||void 0;return oh.startTimestamp(t),oh.addUnit(t,e.unit),n!==void 0&&oh.addTimezone(t,n),oh.endTimestamp(t)}visitInterval(e,t){return Qm.startInterval(t),Qm.addUnit(t,e.unit),Qm.endInterval(t)}visitDuration(e,t){return Jm.startDuration(t),Jm.addUnit(t,e.unit),Jm.endDuration(t)}visitList(e,t){return th.startList(t),th.endList(t)}visitStruct(e,t){return ih.startStruct_(t),ih.endStruct_(t)}visitUnion(e,t){sh.startTypeIdsVector(t,e.typeIds.length);let n=sh.createTypeIdsVector(t,e.typeIds);return sh.startUnion(t),sh.addMode(t,e.mode),sh.addTypeIds(t,n),sh.endUnion(t)}visitDictionary(e,t){let n=this.visit(e.indices,t);return Hm.startDictionaryEncoding(t),Hm.addId(t,BigInt(e.id)),Hm.addIsOrdered(t,e.isOrdered),n!==void 0&&Hm.addIndexType(t,n),Hm.endDictionaryEncoding(t)}visitFixedSizeBinary(e,t){return Ym.startFixedSizeBinary(t),Ym.addByteWidth(t,e.byteWidth),Ym.endFixedSizeBinary(t)}visitFixedSizeList(e,t){return Xm.startFixedSizeList(t),Xm.addListSize(t,e.listSize),Xm.endFixedSizeList(t)}visitMap(e,t){return nh.startMap(t),nh.addKeysSorted(t,e.keysSorted),nh.endMap(t)}};const Bb=new zb;function Vb(e,t=new Map){return new My(Wb(e,t),Xb(e.metadata),t)}function Hb(e){return new nx(e.count,Kb(e.columns),qb(e.columns))}function Ub(e){return new rx(Hb(e.data),e.id,e.isDelta)}function Wb(e,t){return(e.fields||[]).filter(Boolean).map(e=>Ny.fromJSON(e,t))}function Gb(e,t){return(e.children||[]).filter(Boolean).map(e=>Ny.fromJSON(e,t))}function Kb(e){return(e||[]).reduce((e,t)=>[...e,new ax(t.count,Jb(t.VALIDITY)),...Kb(t.children)],[])}function qb(e,t=[]){for(let n=-1,r=(e||[]).length;++ne+ +(t===0),0)}function Yb(e,t){let n,r,i,a,o,s;return!t||!(a=e.dictionary)?(o=Qb(e,Gb(e,t)),i=new Ny(e.name,o,e.nullable,Xb(e.metadata))):t.has(n=a.id)?(r=(r=a.indexType)?Zb(r):new ng,s=new Ag(t.get(n),r,n,a.isOrdered),i=new Ny(e.name,s,e.nullable,Xb(e.metadata))):(r=(r=a.indexType)?Zb(r):new ng,t.set(n,o=Qb(e,Gb(e,t))),s=new Ag(o,r,n,a.isOrdered),i=new Ny(e.name,s,e.nullable,Xb(e.metadata))),i||null}function Xb(e=[]){return new Map(e.map(({key:e,value:t})=>[e,t]))}function Zb(e){return new $h(e.isSigned,e.bitWidth)}function Qb(e,t){let n=e.type.name;switch(n){case`NONE`:return new Qh;case`null`:return new Qh;case`binary`:return new fg;case`largebinary`:return new pg;case`utf8`:return new mg;case`largeutf8`:return new hg;case`bool`:return new gg;case`list`:return new Cg((t||[])[0]);case`struct`:return new wg(t||[]);case`struct_`:return new wg(t||[])}switch(n){case`int`:{let t=e.type;return new $h(t.isSigned,t.bitWidth)}case`floatingpoint`:{let t=e.type;return new cg(_m[t.precision])}case`decimal`:{let t=e.type;return new _g(t.scale,t.precision,t.bitWidth)}case`date`:{let t=e.type;return new vg(vm[t.unit])}case`time`:{let t=e.type;return new yg(ym[t.unit],t.bitWidth)}case`timestamp`:{let t=e.type;return new bg(ym[t.unit],t.timezone)}case`interval`:{let t=e.type;return new xg(bm[t.unit])}case`duration`:{let t=e.type;return new Sg(ym[t.unit])}case`union`:{let n=e.type,[r,...i]=(n.mode+``).toLowerCase(),a=r.toUpperCase()+i.join(``);return new Tg(gm[a],n.typeIds||[],t||[])}case`fixedsizebinary`:{let t=e.type;return new Eg(t.byteWidth)}case`fixedsizelist`:{let n=e.type;return new Dg(n.listSize,(t||[])[0])}case`map`:{let n=e.type;return new Og((t||[])[0],n.keysSorted)}}throw Error(`Unrecognized type: "${n}"`)}var $b=jm,ex=Am,tx=class e{static fromJSON(t,n){let r=new e(0,hm.V5,n);return r._createHeader=ox(t,n),r}static decode(t){t=new ex($p(t));let n=Rb.getRootAsMessage(t),r=n.bodyLength(),i=n.version(),a=n.headerType(),o=new e(r,i,a);return o._createHeader=sx(n,a),o}static encode(e){let t=new $b,n=-1;return e.isSchema()?n=My.encode(t,e.header()):e.isRecordBatch()?n=nx.encode(t,e.header()):e.isDictionaryBatch()&&(n=rx.encode(t,e.header())),Rb.startMessage(t),Rb.addVersion(t,hm.V5),Rb.addHeader(t,n),Rb.addHeaderType(t,e.headerType),Rb.addBodyLength(t,BigInt(e.bodyLength)),Rb.finishMessageBuffer(t,Rb.endMessage(t)),t.asUint8Array()}static from(t,n=0){if(t instanceof My)return new e(0,hm.V5,fh.Schema,t);if(t instanceof nx)return new e(n,hm.V5,fh.RecordBatch,t);if(t instanceof rx)return new e(n,hm.V5,fh.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===fh.Schema}isRecordBatch(){return this.headerType===fh.RecordBatch}isDictionaryBatch(){return this.headerType===fh.DictionaryBatch}constructor(e,t,n,r){this._version=t,this._headerType=n,this.body=new Uint8Array,r&&(this._createHeader=()=>r),this._bodyLength=gh(e)}},nx=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=gh(e)}},rx=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=gh(t)}},ix=class{constructor(e,t){this.offset=gh(e),this.length=gh(t)}},ax=class{constructor(e,t){this.length=gh(e),this.nullCount=gh(t)}};function ox(e,t){return()=>{switch(t){case fh.Schema:return My.fromJSON(e);case fh.RecordBatch:return nx.fromJSON(e);case fh.DictionaryBatch:return rx.fromJSON(e)}throw Error(`Unrecognized Message type: { name: ${fh[t]}, type: ${t} }`)}}function sx(e,t){return()=>{switch(t){case fh.Schema:return My.decode(e.header(new dh),new Map,e.version());case fh.RecordBatch:return nx.decode(e.header(new Lm),e.version());case fh.DictionaryBatch:return rx.decode(e.header(new Rm),e.version())}throw Error(`Unrecognized Message type: { name: ${fh[t]}, type: ${t} }`)}}Ny.encode=Sx,Ny.decode=_x,Ny.fromJSON=Yb,My.encode=xx,My.decode=cx,My.fromJSON=Vb,nx.encode=Cx,nx.decode=lx,nx.fromJSON=Hb,rx.encode=wx,rx.decode=ux,rx.fromJSON=Ub,ax.encode=Tx,ax.decode=fx,ix.encode=Ex,ix.decode=dx;function cx(e,t=new Map,n=hm.V5){let r=hx(e,t);return new My(r,vx(e),t,n)}function lx(e,t=hm.V5){if(e.compression()!==null)throw Error(`Record batch compression not implemented`);return new nx(e.length(),px(e),mx(e,t))}function ux(e,t=hm.V5){return new rx(nx.decode(e.data(),t),e.id(),e.isDelta())}function dx(e){return new ix(e.offset(),e.length())}function fx(e){return new ax(e.length(),e.nullCount())}function px(e){let t=[];for(let n,r=-1,i=-1,a=e.nodesLength();++rNy.encode(e,t));dh.startFieldsVector(e,n.length);let r=dh.createFieldsVector(e,n),i=t.metadata&&t.metadata.size>0?dh.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 dh.startSchema(e),dh.addFields(e,r),dh.addEndianness(e,Dx?zm.Little:zm.Big),i!==-1&&dh.addCustomMetadata(e,i),dh.endSchema(e)}function Sx(e,t){let n=-1,r=-1,i=-1,a=t.type,o=t.typeId;R.isDictionary(a)?(o=a.dictionary.typeId,i=Bb.visit(a,e),r=Bb.visit(a.dictionary,e)):r=Bb.visit(a,e);let s=(a.children||[]).map(t=>Ny.encode(e,t)),c=uh.createChildrenVector(e,s),l=t.metadata&&t.metadata.size>0?uh.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)),uh.startField(e),uh.addType(e,r),uh.addTypeType(e,o),uh.addChildren(e,c),uh.addNullable(e,!!t.nullable),n!==-1&&uh.addName(e,n),i!==-1&&uh.addDictionary(e,i),l!==-1&&uh.addCustomMetadata(e,l),uh.endField(e)}function Cx(e,t){let n=t.nodes||[],r=t.buffers||[];Lm.startNodesVector(e,n.length);for(let t of n.slice().reverse())ax.encode(e,t);let i=e.endVector();Lm.startBuffersVector(e,r.length);for(let t of r.slice().reverse())ix.encode(e,t);let a=e.endVector();return Lm.startRecordBatch(e),Lm.addLength(e,BigInt(t.length)),Lm.addNodes(e,i),Lm.addBuffers(e,a),Lm.endRecordBatch(e)}function wx(e,t){let n=nx.encode(e,t.data);return Rm.startDictionaryBatch(e),Rm.addId(e,BigInt(t.id)),Rm.addIsDelta(e,t.isDelta),Rm.addData(e,n),Rm.endDictionaryBatch(e)}function Tx(e,t){return Im.createFieldNode(e,BigInt(t.length),BigInt(t.nullCount))}function Ex(e,t){return Fm.createBuffer(e,BigInt(t.offset),BigInt(t.length))}const Dx=(()=>{let e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),new Int16Array(e)[0]===256})(),Ox=e=>`Expected ${fh[e]} Message in stream, but was null or length 0.`,kx=e=>`Header pointer of flatbuffer-encoded ${fh[e]} Message is null or length 0.`,Ax=(e,t)=>`Expected to read ${e} metadata bytes, but only read ${t}.`,jx=(e,t)=>`Expected to read ${e} bytes for message body, but only read ${t}.`;var Mx=class{constructor(e){this.source=e instanceof Ky?e:new Ky(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?Vy: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(Ox(e));return t.value}readMessageBody(e){if(e<=0)return new Uint8Array;let t=$p(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(Ox(e));return t.value}readSchema(){let e=fh.Schema,t=this.readMessage(e),n=t?.header();if(!t||!n)throw Error(kx(e));return n}};const Fx=4,Ix=`ARROW1`,Lx=new Uint8Array(6);for(let e=0;e<6;e+=1)Lx[e]=Ix.codePointAt(e);function Rx(e,t=0){for(let n=-1,r=Lx.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 sm.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return sm.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)?nS(t):Rp(t)?aS(t):Np(t)?(()=>yp(this,void 0,void 0,function*(){return yield e.from(yield t)}))():zp(t)||Hp(t)||Wp(t)||Fp(t)?iS(new qy(t)):rS(new Ky(t))}static readAll(t){return t instanceof e?t.isSync()?eS(t):tS(t):Ip(t)||ArrayBuffer.isView(t)||Pp(t)||Lp(t)?eS(t):tS(t)}},Ux=class extends Hx{constructor(e){super(e),this._impl=e}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return Sp(this,arguments,function*(){yield xp(yield*Cp(wp(this[Symbol.iterator]())))})}},Wx=class extends Hx{constructor(e){super(e),this._impl=e}readAll(){return yp(this,void 0,void 0,function*(){var e,t,n,r;let i=[];try{for(var a=!0,o=wp(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]()}},Gx=class extends Ux{constructor(e){super(e),this._impl=e}},Kx=class extends Wx{constructor(e){super(e),this._impl=e}},qx=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=oy({type:new wg(this.schema.fields),length:e.length,children:n});return new Pb(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 Oy(c)):new Oy(c)).memoize()}_loadVectors(e,t,n){return new ob(t,e.nodes,e.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(n)}},Jx=class extends qx{constructor(e,t){super(t),this._reader=Ip(e)?new Px(this._handle=e):new Mx(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=$x(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):Vy}return(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(e):Vy}next(){if(this.closed)return Vy;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 Lb(this.schema)}):this.return()}_readNextMessageAndValidate(e){return this._reader.readMessage(e)}},Yx=class extends qx{constructor(e,t){super(t),this._reader=new Nx(this._handle=e)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return yp(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 yp(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=$x(this,e),(this.schema||=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(e){return yp(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(e):Vy})}return(e){return yp(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(e):Vy})}next(){return yp(this,void 0,void 0,function*(){if(this.closed)return Vy;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 Lb(this.schema)}):yield this.return()})}_readNextMessageAndValidate(e){return yp(this,void 0,void 0,function*(){return yield this._reader.readMessage(e)})}},Xx=class extends Jx{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 Xy?e:new Xy(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(fh.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(fh.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-Bx,n=e.readInt32(t),r=e.readAt(t-n,n);return Ry.decode(r)}_readNextMessageAndValidate(e){var t;if(this._footer||this.open(),this._footer&&this._recordBatchIndexsuper.open}});return yp(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 yp(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(fh.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 yp(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(fh.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 yp(this,void 0,void 0,function*(){let{_handle:e}=this;e._pending&&(yield e._pending);let t=e.size-Bx,n=yield e.readInt32(t),r=yield e.readAt(t-n,n);return Ry.decode(r)})}_readNextMessageAndValidate(e){return yp(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex=4?Rx(t)?new Gx(new Xx(e.read())):new Ux(new Jx(e)):new Ux(new Jx(function*(){}()))}function iS(e){return yp(this,void 0,void 0,function*(){let t=yield e.peek(zx+7&-8);return t&&t.byteLength>=4?Rx(t)?new Gx(new Xx(yield e.read())):new Wx(new Yx(e)):new Wx(new Yx(function(){return Sp(this,arguments,function*(){})}()))})}function aS(e){return yp(this,void 0,void 0,function*(){let{size:t}=yield e.stat(),n=new Zy(e,t);return t>=Vx&&Rx(yield n.readAt(0,zx+7&-8))?new Kx(new Zx(n)):new Wx(new Yx(n))})}var oS=class e extends Mg{static assemble(...t){let n=e=>e.flatMap(e=>Array.isArray(e)?n(e):e instanceof Pb?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 Oy)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 ax(n,0));else{let{nullCount:r}=e;R.isNull(t)||sS.call(this,r<=0?new Uint8Array:Xv(e.offset,n,e.nullBitmap)),this.nodes.push(new ax(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 sS(e){let t=e.byteLength+7&-8;return this.buffers.push(e),this.bufferRegions.push(new ix(this._byteLength,t)),this._byteLength+=t,this}function cS(e){var t;let{type:n,length:r,typeIds:i,valueOffsets:a}=e;if(sS.call(this,i),n.mode===gm.Sparse)return pS.call(this,e);if(n.mode===gm.Dense){if(e.offset<=0)return sS.call(this,a),pS.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 lS(e){let t;return e.nullCount>=e.length?sS.call(this,new Uint8Array):(t=e.values)instanceof Uint8Array?sS.call(this,Xv(e.offset,e.length,t)):sS.call(this,Zv(e.values))}function uS(e){return sS.call(this,e.values.subarray(0,e.length*e.stride))}function dS(e){let{length:t,values:n,valueOffsets:r}=e,i=gh(r[0]),a=gh(r[t]),o=Math.min(a-i,n.byteLength-i);return sS.call(this,am(-i,t+1,r)),sS.call(this,n.subarray(i,i+o)),this}function fS(e){let{length:t,valueOffsets:n}=e;if(n){let{0:r,[t]:i}=n;return sS.call(this,am(-r,t+1,n)),this.visit(e.children[0].slice(r,i-r))}return this.visit(e.children[0])}function pS(e){return this.visitMany(e.type.children.map((t,n)=>e.children[n]).filter(Boolean))[0]}oS.prototype.visitBool=lS,oS.prototype.visitInt=uS,oS.prototype.visitFloat=uS,oS.prototype.visitUtf8=dS,oS.prototype.visitLargeUtf8=dS,oS.prototype.visitBinary=dS,oS.prototype.visitLargeBinary=dS,oS.prototype.visitFixedSizeBinary=uS,oS.prototype.visitDate=uS,oS.prototype.visitTimestamp=uS,oS.prototype.visitTime=uS,oS.prototype.visitDecimal=uS,oS.prototype.visitList=fS,oS.prototype.visitStruct=pS,oS.prototype.visitUnion=cS,oS.prototype.visitInterval=uS,oS.prototype.visitDuration=uS,oS.prototype.visitFixedSizeList=fS,oS.prototype.visitMap=fS;var mS=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 Gy,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,Mp(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 Np(e)?e.then(e=>this.writeAll(e)):Fp(e)?vS(this,e):_S(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 Gy?this._sink=e:(this._sink=new Gy,e&&Vp(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||!Db(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 Mb&&!(t=e.schema)||e instanceof Pb&&!(t=e.schema))return this.finish()&&void 0}else throw Error(`RecordBatchWriter is closed`);if(t&&!Db(t,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,t)}e instanceof Pb?e instanceof Lb||this._writeRecordBatch(e):e instanceof Mb?this.writeAll(e.batches):Pp(e)&&this.writeAll(e)}_writeMessage(e,t=8){let n=t-1,r=tx.encode(e),i=r.byteLength,a=this._writeLegacyIpcFormat?4:8,o=i+a+n&~n,s=o-i-a;return e.headerType===fh.RecordBatch?this._recordBatchBlocks.push(new By(o,e.bodyLength,this._position)):e.headerType===fh.DictionaryBatch&&this._dictionaryBlocks.push(new By(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=$p(e);t&&t.byteLength>0&&(this._sink.write(t),this._position+=t.byteLength)}return this}_writeSchema(e){return this._writeMessage(tx.from(e))}_writeFooter(e){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(Lx)}_writePadding(e){return e>0?this._write(new Uint8Array(e)):this}_writeRecordBatch(e){let{byteLength:t,nodes:n,bufferRegions:r,buffers:i}=oS.assemble(e),a=new nx(e.numRows,n,r),o=tx.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}=oS.assemble(new Oy([e])),s=new nx(e.length,i,a),c=new rx(s,t,n),l=tx.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)):Fp(t)?vS(r,t):_S(r,t)}},gS=class e extends mS{static writeAll(t){let n=new e;return Np(t)?t.then(e=>n.writeAll(e)):Fp(t)?vS(n,t):_S(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=Ry.encode(new Ry(e,hm.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(e)._write(t)._write(Int32Array.of(t.byteLength))._writeMagic()}};function _S(e,t){let n=t;t instanceof Mb&&(n=t.batches,e.reset(void 0,t.schema));for(let t of n)e.write(t);return e.finish()}function vS(e,t){return yp(this,void 0,void 0,function*(){var n,r,i,a,o,s,c;try{for(n=!0,r=wp(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 yS(e,t=`stream`){return(t===`stream`?hS:gS).writeAll(e).toUint8Array(!0)}var bS=Object.create,xS=Object.defineProperty,SS=Object.getOwnPropertyDescriptor,CS=Object.getOwnPropertyNames,wS=Object.getPrototypeOf,TS=Object.prototype.hasOwnProperty,ES=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),DS=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of CS(t))!TS.call(e,i)&&i!==n&&xS(e,i,{get:()=>t[i],enumerable:!(r=SS(t,i))||r.enumerable});return e},OS=(e,t,n)=>(n=e==null?{}:bS(wS(e)),DS(t||!e||!e.__esModule?xS(n,`default`,{value:e,enumerable:!0}):n,e)),kS=ES((e,t)=>{t.exports=Worker}),AS=(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))(AS||{}),jS=(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))(jS||{}),MS=(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))(MS||{}),NS=(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))(NS||{}),PS=(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))(PS||{}),FS=(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))(FS||{}),IS=class{log(e){}},LS=class{constructor(e=2){this.level=e}log(e){e.level>=this.level&&console.log(e)}},RS=(e=>(e[e.SUCCESS=0]=`SUCCESS`,e))(RS||{}),zS=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=Hx.from(t);return console.assert(n.isSync(),`Reader is not sync`),console.assert(n.isFile(),`Reader is not file`),new Mb(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 BS(this._bindings,this._conn,n),i=await Hx.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 VS(this._bindings,this._conn,t)}async insertArrowTable(e,t){let n=yS(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)}},BS=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}},VS=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=Hx.from(t);return console.assert(n.isSync()),console.assert(n.isFile()),new Mb(n)}async send(...e){let t=await this.bindings.sendPrepared(this.connectionId,this.statementId,e),n=new BS(this.bindings,this.connectionId,t),r=await Hx.from(n);return console.assert(r.isAsync()),console.assert(r.isStream()),r}},HS=(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))(HS||{}),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||{}),WS=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 GS(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:GS(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=>KS(e.name,e.type))};case L.Map:{let t=e;return{sqlType:`map`,keyType:GS(t.keyType),valueType:GS(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 KS(e,t){let n=GS(t);return n.name=e,n}var qS=new TextEncoder,JS=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 WS(`RESET`,null);return await this.postTask(e)}async ping(){let e=new WS(`PING`,null);await this.postTask(e)}async dropFile(e){let t=new WS(`DROP_FILE`,e);return await this.postTask(t)}async dropFiles(){let e=new WS(`DROP_FILES`,null);return await this.postTask(e)}async flushFiles(){let e=new WS(`FLUSH_FILES`,null);return await this.postTask(e)}async instantiate(e,t=null,n=e=>{}){this._onInstantiationProgress.push(n);let r=new WS(`INSTANTIATE`,[e,t]);return await this.postTask(r)}async getVersion(){let e=new WS(`GET_VERSION`,null);return await this.postTask(e)}async getFeatureFlags(){let e=new WS(`GET_FEATURE_FLAGS`,null);return await this.postTask(e)}async open(e){let t=new WS(`OPEN`,e);await this.postTask(t)}async tokenize(e){let t=new WS(`TOKENIZE`,e);return await this.postTask(t)}async connectInternal(){let e=new WS(`CONNECT`,null);return await this.postTask(e)}async connect(){let e=await this.connectInternal();return new zS(this,e)}async disconnect(e){let t=new WS(`DISCONNECT`,e);await this.postTask(t)}async runQuery(e,t){let n=new WS(`RUN_QUERY`,[e,t]);return await this.postTask(n)}async startPendingQuery(e,t,n=!1){let r=new WS(`START_PENDING_QUERY`,[e,t,n]);return await this.postTask(r)}async pollPendingQuery(e){let t=new WS(`POLL_PENDING_QUERY`,e);return await this.postTask(t)}async cancelPendingQuery(e){let t=new WS(`CANCEL_PENDING_QUERY`,e);return await this.postTask(t)}async fetchQueryResults(e){let t=new WS(`FETCH_QUERY_RESULTS`,e);return await this.postTask(t)}async getTableNames(e,t){let n=new WS(`GET_TABLE_NAMES`,[e,t]);return await this.postTask(n)}async createPrepared(e,t){let n=new WS(`CREATE_PREPARED`,[e,t]);return await this.postTask(n)}async closePrepared(e,t){let n=new WS(`CLOSE_PREPARED`,[e,t]);await this.postTask(n)}async runPrepared(e,t,n){let r=new WS(`RUN_PREPARED`,[e,t,n]);return await this.postTask(r)}async sendPrepared(e,t,n){let r=new WS(`SEND_PREPARED`,[e,t,n]);return await this.postTask(r)}async globFiles(e){let t=new WS(`GLOB_FILE_INFOS`,e);return await this.postTask(t)}async registerFileText(e,t){let n=qS.encode(t);await this.registerFileBuffer(e,n)}async registerFileURL(e,t,n,r){t===void 0&&(t=e);let i=new WS(`REGISTER_FILE_URL`,[e,t,n,r]);await this.postTask(i)}async registerEmptyFileBuffer(e){}async registerFileBuffer(e,t){let n=new WS(`REGISTER_FILE_BUFFER`,[e,t]);await this.postTask(n,[t.buffer])}async registerFileHandle(e,t,n,r){let i=new WS(`REGISTER_FILE_HANDLE`,[e,t,n,r]);await this.postTask(i,[])}async registerOPFSFileName(e){let t=new WS(`REGISTER_OPFS_FILE_NAME`,[e]);await this.postTask(t,[])}async collectFileStatistics(e,t){let n=new WS(`COLLECT_FILE_STATISTICS`,[e,t]);await this.postTask(n,[])}async exportFileStatistics(e){let t=new WS(`EXPORT_FILE_STATISTICS`,e);return await this.postTask(t,[])}async copyFileToBuffer(e){let t=new WS(`COPY_FILE_TO_BUFFER`,e);return await this.postTask(t)}async copyFileToPath(e,t){let n=new WS(`COPY_FILE_TO_PATH`,[e,t]);await this.postTask(n)}async insertArrowFromIPCStream(e,t,n){if(t.length==0)return;let r=new WS(`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(KS(t,r))}n.columnsFlat=e,delete n.columns}let r=new WS(`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(KS(t,r))}n.columnsFlat=e,delete n.columns}let r=new WS(`IMPORT_JSON_FROM_PATH`,[e,t,n]);await this.postTask(r)}};function YS(){let e=new TextDecoder;return t=>(typeof SharedArrayBuffer<`u`&&t.buffer instanceof SharedArrayBuffer&&(t=new Uint8Array(t)),e.decode(t))}var XS=YS(),ZS=(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))(ZS||{}),QS=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])),$S=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])),eC=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])),tC=()=>(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])),nC={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`}}},rC=nC.name,iC=nC.version,aC=nC.version.split(`.`),oC=aC[0],sC=aC[1],cC=aC[2],lC=()=>typeof navigator>`u`,uC=()=>lC()?`node`:navigator.userAgent,dC=()=>uC().includes(`Firefox`),fC=()=>/^((?!chrome|android).)*safari/i.test(uC()),pC=null,mC=null,hC=null,gC=null,_C=null;async function vC(){return pC??=typeof BigInt64Array<`u`,mC??=await $S(),hC??=await tC(),gC??=await eC(),_C??=await QS(),{bigInt64Array:pC,crossOriginIsolated:lC()||globalThis.crossOriginIsolated||!1,wasmExceptions:mC,wasmSIMD:gC,wasmThreads:hC,wasmBulkMemory:_C}}async function yC(e){let t=await vC();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}}var bC=OS(kS());const xC=Symbol.for(`constructDateFrom`),SC={},CC={};function wC(e,t){try{let n=SC[e]||=new Intl.DateTimeFormat(`en-GB`,{timeZone:e,hour:`numeric`,timeZoneName:`longOffset`}).format,r=n(t).split(`GMT`)[1]||``;return r in CC?CC[r]:EC(r,r.split(`:`))}catch{if(e in CC)return CC[e];let t=e?.match(TC);return t?EC(e,t.slice(1)):NaN}}const TC=/([+-]\d\d):?(\d\d)?/;function EC(e,t){let n=+t[0],r=+(t[1]||0);return CC[e]=n>0?n*60+r:n*60-r}var DC=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(wC(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)),jC(this,NaN),kC(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-wC(this.timeZone,this)}setTime(e){return Date.prototype.setTime.apply(this,arguments),kC(this),+this}[Symbol.for(`constructDateFrom`)](t){return new e(+new Date(t),this.timeZone)}};const OC=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!OC.test(e))return;let t=e.replace(OC,`$1UTC`);DC.prototype[t]&&(e.startsWith(`get`)?DC.prototype[e]=function(){return this.internal[t]()}:(DC.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),AC(this),+this},DC.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),kC(this),+this}))});function kC(e){e.internal.setTime(+e),e.internal.setUTCMinutes(e.internal.getUTCMinutes()-e.getTimezoneOffset())}function AC(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()),jC(e)}function jC(e){let t=wC(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=wC(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=wC(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))}}var MC=class e extends DC{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} (${NC(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 NC(e,t){return new Intl.DateTimeFormat(`en-GB`,{timeZone:e,timeZoneName:`long`}).format(t).slice(12)}const PC=new TextDecoder(`utf-8`),FC=e=>PC.decode(e),IC=new TextEncoder,LC=e=>IC.encode(e),RC=e=>typeof e==`function`,zC=e=>e!=null&&Object(e)===e,BC=e=>zC(e)&&RC(e.then),VC=e=>zC(e)&&RC(e[Symbol.iterator]),HC=e=>zC(e)&&RC(e[Symbol.asyncIterator]),UC=e=>zC(e)&&`done`in e&&`value`in e,WC=e=>zC(e)&&RC(e.clear)&&RC(e.bytes)&&RC(e.position)&&RC(e.setPosition)&&RC(e.capacity)&&RC(e.getBufferIdentifier)&&RC(e.createLong);var GC={};Re(GC,{compareArrayLike:()=>Aw,joinUint8Arrays:()=>YC,memcpy:()=>JC,rebaseValueOffsets:()=>kw,toArrayBufferView:()=>XC,toArrayBufferViewAsyncIterator:()=>yw,toArrayBufferViewIterator:()=>lw,toBigInt64Array:()=>ew,toBigUint64Array:()=>iw,toFloat32Array:()=>aw,toFloat32ArrayAsyncIterator:()=>Ew,toFloat32ArrayIterator:()=>gw,toFloat64Array:()=>ow,toFloat64ArrayAsyncIterator:()=>Dw,toFloat64ArrayIterator:()=>_w,toInt16Array:()=>QC,toInt16ArrayAsyncIterator:()=>xw,toInt16ArrayIterator:()=>dw,toInt32Array:()=>$C,toInt32ArrayAsyncIterator:()=>Sw,toInt32ArrayIterator:()=>fw,toInt8Array:()=>ZC,toInt8ArrayAsyncIterator:()=>bw,toInt8ArrayIterator:()=>uw,toUint16Array:()=>nw,toUint16ArrayAsyncIterator:()=>ww,toUint16ArrayIterator:()=>mw,toUint32Array:()=>rw,toUint32ArrayAsyncIterator:()=>Tw,toUint32ArrayIterator:()=>hw,toUint8Array:()=>tw,toUint8ArrayAsyncIterator:()=>Cw,toUint8ArrayIterator:()=>pw,toUint8ClampedArray:()=>sw,toUint8ClampedArrayAsyncIterator:()=>Ow,toUint8ClampedArrayIterator:()=>vw});const KC=typeof SharedArrayBuffer<`u`?SharedArrayBuffer:ArrayBuffer;function qC(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;++cXC(Int8Array,e),QC=e=>XC(Int16Array,e),$C=e=>XC(Int32Array,e),ew=e=>XC(BigInt64Array,e),tw=e=>XC(Uint8Array,e),nw=e=>XC(Uint16Array,e),rw=e=>XC(Uint32Array,e),iw=e=>XC(BigUint64Array,e),aw=e=>XC(Float32Array,e),ow=e=>XC(Float64Array,e),sw=e=>XC(Uint8ClampedArray,e),cw=e=>(e.next(),e);function*lw(e,t){let n=function*(e){yield e},r=typeof t==`string`||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof KC?n(t):VC(t)?t:n(t);return yield*cw(function*(t){let n=null;do n=t.next(yield XC(e,n));while(!n.done)}(r[Symbol.iterator]())),new e}const uw=e=>lw(Int8Array,e),dw=e=>lw(Int16Array,e),fw=e=>lw(Int32Array,e),pw=e=>lw(Uint8Array,e),mw=e=>lw(Uint16Array,e),hw=e=>lw(Uint32Array,e),gw=e=>lw(Float32Array,e),_w=e=>lw(Float64Array,e),vw=e=>lw(Uint8ClampedArray,e);function yw(e,t){return Sp(this,arguments,function*(){if(BC(t))return yield xp(yield xp(yield*Cp(wp(yw(e,yield xp(t))))));let n=function(e){return Sp(this,arguments,function*(){yield yield xp(yield xp(e))})},r=function(e){return Sp(this,arguments,function*(){yield xp(yield*Cp(wp(cw(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 KC?n(t):VC(t)?r(t):HC(t)?t:n(t);return yield xp(yield*Cp(wp(cw(function(t){return Sp(this,arguments,function*(){let n=null;do n=yield xp(t.next(yield yield xp(XC(e,n))));while(!n.done)})}(i[Symbol.asyncIterator]()))))),yield xp(new e)})}const bw=e=>yw(Int8Array,e),xw=e=>yw(Int16Array,e),Sw=e=>yw(Int32Array,e),Cw=e=>yw(Uint8Array,e),ww=e=>yw(Uint16Array,e),Tw=e=>yw(Uint32Array,e),Ew=e=>yw(Float32Array,e),Dw=e=>yw(Float64Array,e),Ow=e=>yw(Uint8ClampedArray,e);function kw(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(++nzw});const Rw=void 0;function zw(e){if(e===null)return`null`;if(e===Rw)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=>zw(e))}]`:`[${e}]`:ArrayBuffer.isView(e)?`[${e}]`:JSON.stringify(e,(e,t)=>typeof t==`bigint`?`${t}`:t)}function Bw(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 Vw(e,t){return Bw(e/t)+Bw(e%t)/Bw(t)}var Hw={};Re(Hw,{BN:()=>eT,bigNumToBigInt:()=>Qw,bigNumToNumber:()=>Xw,bigNumToString:()=>Zw,isArrowBigNumSymbol:()=>Uw});const Uw=Symbol.for(`isArrowBigNum`);function Ww(e,...t){return t.length===0?Object.setPrototypeOf(XC(this.TypedArray,e),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(e,...t),this.constructor.prototype)}Ww.prototype[Uw]=!0,Ww.prototype.toJSON=function(){return`"${Zw(this)}"`},Ww.prototype.valueOf=function(e){return Xw(this,e)},Ww.prototype.toString=function(){return Zw(this)},Ww.prototype[Symbol.toPrimitive]=function(e=`default`){switch(e){case`number`:return Xw(this);case`string`:return Zw(this);case`default`:return Qw(this)}return Zw(this)};function Gw(...e){return Ww.apply(this,e)}function Kw(...e){return Ww.apply(this,e)}function qw(...e){return Ww.apply(this,e)}Object.setPrototypeOf(Gw.prototype,Object.create(Int32Array.prototype)),Object.setPrototypeOf(Kw.prototype,Object.create(Uint32Array.prototype)),Object.setPrototypeOf(qw.prototype,Object.create(Uint32Array.prototype)),Object.assign(Gw.prototype,Ww.prototype,{constructor:Gw,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array}),Object.assign(Kw.prototype,Ww.prototype,{constructor:Kw,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array}),Object.assign(qw.prototype,Ww.prototype,{constructor:qw,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});const Jw=BigInt(4294967296)*BigInt(4294967296),Yw=Jw-BigInt(1);function Xw(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=Bw(n),a=`${r}`.padStart(t,`0`),o=s&&i===0?`-`:``;return+`${o}${i}.${a}`}return Bw(c)}function Zw(e){if(e.byteLength===8){let t=new e.BigIntArray(e.buffer,e.byteOffset,1);return`${t[0]}`}if(!e.signed)return $w(e);let t=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2),n=new Int16Array([t.at(-1)])[0];if(n>=0)return $w(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`))(U.prototype);var CT=class extends U{constructor(){super(H.Null)}toString(){return`Null`}};nT=Symbol.toStringTag,CT[nT]=(e=>e[Symbol.toStringTag]=`Null`)(CT.prototype);var wT=class extends U{constructor(e,t){super(H.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}`}};rT=Symbol.toStringTag,wT[rT]=(e=>(e.isSigned=null,e.bitWidth=null,e[Symbol.toStringTag]=`Int`))(wT.prototype);var TT=class extends wT{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},ET=class extends wT{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},DT=class extends wT{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},OT=class extends wT{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},kT=class extends wT{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},AT=class extends wT{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},jT=class extends wT{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},MT=class extends wT{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(TT.prototype,`ArrayType`,{value:Int8Array}),Object.defineProperty(ET.prototype,`ArrayType`,{value:Int16Array}),Object.defineProperty(DT.prototype,`ArrayType`,{value:Int32Array}),Object.defineProperty(OT.prototype,`ArrayType`,{value:BigInt64Array}),Object.defineProperty(kT.prototype,`ArrayType`,{value:Uint8Array}),Object.defineProperty(AT.prototype,`ArrayType`,{value:Uint16Array}),Object.defineProperty(jT.prototype,`ArrayType`,{value:Uint32Array}),Object.defineProperty(MT.prototype,`ArrayType`,{value:BigUint64Array});var NT=class extends U{constructor(e){super(H.Float),this.precision=e}get ArrayType(){switch(this.precision){case Mw.HALF:return Uint16Array;case Mw.SINGLE:return Float32Array;case Mw.DOUBLE:return Float64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};iT=Symbol.toStringTag,NT[iT]=(e=>(e.precision=null,e[Symbol.toStringTag]=`Float`))(NT.prototype);var PT=class extends NT{constructor(){super(Mw.HALF)}},FT=class extends NT{constructor(){super(Mw.SINGLE)}},IT=class extends NT{constructor(){super(Mw.DOUBLE)}};Object.defineProperty(PT.prototype,`ArrayType`,{value:Uint16Array}),Object.defineProperty(FT.prototype,`ArrayType`,{value:Float32Array}),Object.defineProperty(IT.prototype,`ArrayType`,{value:Float64Array});var LT=class extends U{constructor(){super(H.Binary)}toString(){return`Binary`}};aT=Symbol.toStringTag,LT[aT]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Binary`))(LT.prototype);var RT=class extends U{constructor(){super(H.LargeBinary)}toString(){return`LargeBinary`}};oT=Symbol.toStringTag,RT[oT]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]=`LargeBinary`))(RT.prototype);var zT=class extends U{constructor(){super(H.Utf8)}toString(){return`Utf8`}};sT=Symbol.toStringTag,zT[sT]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Utf8`))(zT.prototype);var BT=class extends U{constructor(){super(H.LargeUtf8)}toString(){return`LargeUtf8`}};cT=Symbol.toStringTag,BT[cT]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]=`LargeUtf8`))(BT.prototype);var VT=class extends U{constructor(){super(H.Bool)}toString(){return`Bool`}};lT=Symbol.toStringTag,VT[lT]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Bool`))(VT.prototype);var HT=class extends U{constructor(e,t,n=128){super(H.Decimal),this.scale=e,this.precision=t,this.bitWidth=n}toString(){return`Decimal[${this.precision}e${this.scale>0?`+`:``}${this.scale}]`}};uT=Symbol.toStringTag,HT[uT]=(e=>(e.scale=null,e.precision=null,e.ArrayType=Uint32Array,e[Symbol.toStringTag]=`Decimal`))(HT.prototype);var UT=class extends U{constructor(e){super(H.Date),this.unit=e}toString(){return`Date${(this.unit+1)*32}<${Nw[this.unit]}>`}get ArrayType(){return this.unit===Nw.DAY?Int32Array:BigInt64Array}};dT=Symbol.toStringTag,UT[dT]=(e=>(e.unit=null,e[Symbol.toStringTag]=`Date`))(UT.prototype);var WT=class extends U{constructor(e,t){super(H.Time),this.unit=e,this.bitWidth=t}toString(){return`Time${this.bitWidth}<${Pw[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};fT=Symbol.toStringTag,WT[fT]=(e=>(e.unit=null,e.bitWidth=null,e[Symbol.toStringTag]=`Time`))(WT.prototype);var GT=class extends U{constructor(e,t){super(H.Timestamp),this.unit=e,this.timezone=t}toString(){return`Timestamp<${Pw[this.unit]}${this.timezone?`, ${this.timezone}`:``}>`}};pT=Symbol.toStringTag,GT[pT]=(e=>(e.unit=null,e.timezone=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]=`Timestamp`))(GT.prototype);var KT=class extends U{constructor(e){super(H.Interval),this.unit=e}toString(){return`Interval<${Fw[this.unit]}>`}};mT=Symbol.toStringTag,KT[mT]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]=`Interval`))(KT.prototype);var qT=class extends U{constructor(e){super(H.Duration),this.unit=e}toString(){return`Duration<${Pw[this.unit]}>`}};hT=Symbol.toStringTag,qT[hT]=(e=>(e.unit=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]=`Duration`))(qT.prototype);var JT=class extends U{constructor(e){super(H.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}};gT=Symbol.toStringTag,JT[gT]=(e=>(e.children=null,e[Symbol.toStringTag]=`List`))(JT.prototype);var YT=class extends U{constructor(e){super(H.Struct),this.children=e}toString(){return`Struct<{${this.children.map(e=>`${e.name}:${e.type}`).join(`, `)}}>`}};_T=Symbol.toStringTag,YT[_T]=(e=>(e.children=null,e[Symbol.toStringTag]=`Struct`))(YT.prototype);var XT=class extends U{constructor(e,t,n){super(H.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(` | `)}>`}};vT=Symbol.toStringTag,XT[vT]=(e=>(e.mode=null,e.typeIds=null,e.children=null,e.typeIdToChildIndex=null,e.ArrayType=Int8Array,e[Symbol.toStringTag]=`Union`))(XT.prototype);var ZT=class extends U{constructor(e){super(H.FixedSizeBinary),this.byteWidth=e}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};yT=Symbol.toStringTag,ZT[yT]=(e=>(e.byteWidth=null,e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`FixedSizeBinary`))(ZT.prototype);var QT=class extends U{constructor(e,t){super(H.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}>`}};bT=Symbol.toStringTag,QT[bT]=(e=>(e.children=null,e.listSize=null,e[Symbol.toStringTag]=`FixedSizeList`))(QT.prototype);var $T=class extends U{constructor(e,t=!1){var n,r,i;if(super(H.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(`, `)}}>`}};xT=Symbol.toStringTag,$T[xT]=(e=>(e.children=null,e.keysSorted=null,e[Symbol.toStringTag]=`Map_`))($T.prototype);const eE=(e=>()=>++e)(-1);var tE=class extends U{constructor(e,t,n,r){super(H.Dictionary),this.indices=t,this.dictionary=e,this.isOrdered=r||!1,this.id=n==null?eE():Bw(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}>`}};ST=Symbol.toStringTag,tE[ST]=(e=>(e.id=null,e.indices=null,e.isOrdered=null,e.dictionary=null,e[Symbol.toStringTag]=`Dictionary`))(tE.prototype);function nE(e){let t=e;switch(e.typeId){case H.Decimal:return e.bitWidth/32;case H.Interval:return t.unit===Fw.MONTH_DAY_NANO?4:1+t.unit;case H.FixedSizeList:return t.listSize;case H.FixedSizeBinary:return t.byteWidth;default:return 1}}var rE=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 iE(this,e,t)}getVisitFnByTypeId(e,t=!0){return aE(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 iE(e,t,n=!0){return typeof t==`number`?aE(e,t,n):typeof t==`string`&&t in H?aE(e,H[t],n):t&&t instanceof U?aE(e,oE(t),n):t?.type&&t.type instanceof U?aE(e,oE(t.type),n):aE(e,H.NONE,n)}function aE(e,t,n=!0){let r=null;switch(t){case H.Null:r=e.visitNull;break;case H.Bool:r=e.visitBool;break;case H.Int:r=e.visitInt;break;case H.Int8:r=e.visitInt8||e.visitInt;break;case H.Int16:r=e.visitInt16||e.visitInt;break;case H.Int32:r=e.visitInt32||e.visitInt;break;case H.Int64:r=e.visitInt64||e.visitInt;break;case H.Uint8:r=e.visitUint8||e.visitInt;break;case H.Uint16:r=e.visitUint16||e.visitInt;break;case H.Uint32:r=e.visitUint32||e.visitInt;break;case H.Uint64:r=e.visitUint64||e.visitInt;break;case H.Float:r=e.visitFloat;break;case H.Float16:r=e.visitFloat16||e.visitFloat;break;case H.Float32:r=e.visitFloat32||e.visitFloat;break;case H.Float64:r=e.visitFloat64||e.visitFloat;break;case H.Utf8:r=e.visitUtf8;break;case H.LargeUtf8:r=e.visitLargeUtf8;break;case H.Binary:r=e.visitBinary;break;case H.LargeBinary:r=e.visitLargeBinary;break;case H.FixedSizeBinary:r=e.visitFixedSizeBinary;break;case H.Date:r=e.visitDate;break;case H.DateDay:r=e.visitDateDay||e.visitDate;break;case H.DateMillisecond:r=e.visitDateMillisecond||e.visitDate;break;case H.Timestamp:r=e.visitTimestamp;break;case H.TimestampSecond:r=e.visitTimestampSecond||e.visitTimestamp;break;case H.TimestampMillisecond:r=e.visitTimestampMillisecond||e.visitTimestamp;break;case H.TimestampMicrosecond:r=e.visitTimestampMicrosecond||e.visitTimestamp;break;case H.TimestampNanosecond:r=e.visitTimestampNanosecond||e.visitTimestamp;break;case H.Time:r=e.visitTime;break;case H.TimeSecond:r=e.visitTimeSecond||e.visitTime;break;case H.TimeMillisecond:r=e.visitTimeMillisecond||e.visitTime;break;case H.TimeMicrosecond:r=e.visitTimeMicrosecond||e.visitTime;break;case H.TimeNanosecond:r=e.visitTimeNanosecond||e.visitTime;break;case H.Decimal:r=e.visitDecimal;break;case H.List:r=e.visitList;break;case H.Struct:r=e.visitStruct;break;case H.Union:r=e.visitUnion;break;case H.DenseUnion:r=e.visitDenseUnion||e.visitUnion;break;case H.SparseUnion:r=e.visitSparseUnion||e.visitUnion;break;case H.Dictionary:r=e.visitDictionary;break;case H.Interval:r=e.visitInterval;break;case H.IntervalDayTime:r=e.visitIntervalDayTime||e.visitInterval;break;case H.IntervalYearMonth:r=e.visitIntervalYearMonth||e.visitInterval;break;case H.IntervalMonthDayNano:r=e.visitIntervalMonthDayNano||e.visitInterval;break;case H.Duration:r=e.visitDuration;break;case H.DurationSecond:r=e.visitDurationSecond||e.visitDuration;break;case H.DurationMillisecond:r=e.visitDurationMillisecond||e.visitDuration;break;case H.DurationMicrosecond:r=e.visitDurationMicrosecond||e.visitDuration;break;case H.DurationNanosecond:r=e.visitDurationNanosecond||e.visitDuration;break;case H.FixedSizeList:r=e.visitFixedSizeList;break;case H.Map:r=e.visitMap;break}if(typeof r==`function`)return r;if(!n)return()=>null;throw Error(`Unrecognized type '${H[t]}'`)}function oE(e){switch(e.typeId){case H.Null:return H.Null;case H.Int:{let{bitWidth:t,isSigned:n}=e;switch(t){case 8:return n?H.Int8:H.Uint8;case 16:return n?H.Int16:H.Uint16;case 32:return n?H.Int32:H.Uint32;case 64:return n?H.Int64:H.Uint64}return H.Int}case H.Float:switch(e.precision){case Mw.HALF:return H.Float16;case Mw.SINGLE:return H.Float32;case Mw.DOUBLE:return H.Float64}return H.Float;case H.Binary:return H.Binary;case H.LargeBinary:return H.LargeBinary;case H.Utf8:return H.Utf8;case H.LargeUtf8:return H.LargeUtf8;case H.Bool:return H.Bool;case H.Decimal:return H.Decimal;case H.Time:switch(e.unit){case Pw.SECOND:return H.TimeSecond;case Pw.MILLISECOND:return H.TimeMillisecond;case Pw.MICROSECOND:return H.TimeMicrosecond;case Pw.NANOSECOND:return H.TimeNanosecond}return H.Time;case H.Timestamp:switch(e.unit){case Pw.SECOND:return H.TimestampSecond;case Pw.MILLISECOND:return H.TimestampMillisecond;case Pw.MICROSECOND:return H.TimestampMicrosecond;case Pw.NANOSECOND:return H.TimestampNanosecond}return H.Timestamp;case H.Date:switch(e.unit){case Nw.DAY:return H.DateDay;case Nw.MILLISECOND:return H.DateMillisecond}return H.Date;case H.Interval:switch(e.unit){case Fw.DAY_TIME:return H.IntervalDayTime;case Fw.YEAR_MONTH:return H.IntervalYearMonth;case Fw.MONTH_DAY_NANO:return H.IntervalMonthDayNano}return H.Interval;case H.Duration:switch(e.unit){case Pw.SECOND:return H.DurationSecond;case Pw.MILLISECOND:return H.DurationMillisecond;case Pw.MICROSECOND:return H.DurationMicrosecond;case Pw.NANOSECOND:return H.DurationNanosecond}return H.Duration;case H.Map:return H.Map;case H.List:return H.List;case H.Struct:return H.Struct;case H.Union:switch(e.mode){case jw.Dense:return H.DenseUnion;case jw.Sparse:return H.SparseUnion}return H.Union;case H.FixedSizeBinary:return H.FixedSizeBinary;case H.FixedSizeList:return H.FixedSizeList;case H.Dictionary:return H.Dictionary}throw Error(`Unrecognized type '${H[e.typeId]}'`)}rE.prototype.visitInt8=null,rE.prototype.visitInt16=null,rE.prototype.visitInt32=null,rE.prototype.visitInt64=null,rE.prototype.visitUint8=null,rE.prototype.visitUint16=null,rE.prototype.visitUint32=null,rE.prototype.visitUint64=null,rE.prototype.visitFloat16=null,rE.prototype.visitFloat32=null,rE.prototype.visitFloat64=null,rE.prototype.visitDateDay=null,rE.prototype.visitDateMillisecond=null,rE.prototype.visitTimestampSecond=null,rE.prototype.visitTimestampMillisecond=null,rE.prototype.visitTimestampMicrosecond=null,rE.prototype.visitTimestampNanosecond=null,rE.prototype.visitTimeSecond=null,rE.prototype.visitTimeMillisecond=null,rE.prototype.visitTimeMicrosecond=null,rE.prototype.visitTimeNanosecond=null,rE.prototype.visitDenseUnion=null,rE.prototype.visitSparseUnion=null,rE.prototype.visitIntervalDayTime=null,rE.prototype.visitIntervalYearMonth=null,rE.prototype.visitIntervalMonthDayNano=null,rE.prototype.visitDuration=null,rE.prototype.visitDurationSecond=null,rE.prototype.visitDurationMillisecond=null,rE.prototype.visitDurationMicrosecond=null,rE.prototype.visitDurationNanosecond=null;var sE={};Re(sE,{float64ToUint16:()=>dE,uint16ToFloat64:()=>uE});const cE=new Float64Array(1),lE=new Uint32Array(cE.buffer);function uE(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 dE(e){if(e!==e)return 32256;cE[0]=e;let t=(lE[1]&2147483648)>>16&65535,n=lE[1]&2146435072,r=0;return n>=1089470464?lE[0]>0?n=31744:(n=(n&2080374784)>>16,r=(lE[1]&1048575)>>10):n<=1056964608?(r=1048576+(lE[1]&1048575),r=1048576+(r<<(n>>20)-998)>>21,n=0):(n=n-1056964608>>10,r=(lE[1]&1048575)+512>>10),t|n|r&65535}var fE=class extends rE{};function pE(e){return(t,n,r)=>{if(t.setValid(n,r!=null))return e(t,n,r)}}const mE=(e,t,n)=>{e[t]=Math.floor(n/864e5)},hE=(e,t,n,r)=>{if(n+1{let i=e+n;r?t[i>>3]|=1<>3]&=~(1<{e[t]=n},vE=({values:e},t,n)=>{e[t]=n},yE=({values:e},t,n)=>{e[t]=dE(n)},bE=(e,t,n)=>{switch(e.type.precision){case Mw.HALF:return yE(e,t,n);case Mw.SINGLE:case Mw.DOUBLE:return vE(e,t,n)}},xE=({values:e},t,n)=>{mE(e,t,n.valueOf())},SE=({values:e},t,n)=>{e[t]=BigInt(n)},CE=({stride:e,values:t},n,r)=>{t.set(r.subarray(0,e),e*n)},wE=({values:e,valueOffsets:t},n,r)=>hE(e,t,n,r),TE=({values:e,valueOffsets:t},n,r)=>hE(e,t,n,LC(r)),EE=(e,t,n)=>{e.type.unit===Nw.DAY?xE(e,t,n):SE(e,t,n)},DE=({values:e},t,n)=>{e[t]=BigInt(n/1e3)},OE=({values:e},t,n)=>{e[t]=BigInt(n)},kE=({values:e},t,n)=>{e[t]=BigInt(n*1e3)},AE=({values:e},t,n)=>{e[t]=BigInt(n*1e6)},jE=(e,t,n)=>{switch(e.type.unit){case Pw.SECOND:return DE(e,t,n);case Pw.MILLISECOND:return OE(e,t,n);case Pw.MICROSECOND:return kE(e,t,n);case Pw.NANOSECOND:return AE(e,t,n)}},ME=({values:e},t,n)=>{e[t]=n},NE=({values:e},t,n)=>{e[t]=n},PE=({values:e},t,n)=>{e[t]=n},FE=({values:e},t,n)=>{e[t]=n},IE=(e,t,n)=>{switch(e.type.unit){case Pw.SECOND:return ME(e,t,n);case Pw.MILLISECOND:return NE(e,t,n);case Pw.MICROSECOND:return PE(e,t,n);case Pw.NANOSECOND:return FE(e,t,n)}},LE=({values:e,stride:t},n,r)=>{e.set(r.subarray(0,t),t*n)},RE=(e,t,n)=>{let r=e.children[0],i=e.valueOffsets,a=aD.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=aD.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},BE=(e,t)=>(n,r,i,a)=>r&&n(r,e,t[a]),VE=(e,t)=>(n,r,i,a)=>r&&n(r,e,t.get(a)),HE=(e,t)=>(n,r,i,a)=>r&&n(r,e,t.get(i.name)),UE=(e,t)=>(n,r,i,a)=>r&&n(r,e,t[i.name]),WE=(e,t,n)=>{let r=e.type.children.map(e=>aD.getVisitFn(e.type)),i=n instanceof Map?HE(t,n):n instanceof rk?VE(t,n):Array.isArray(n)?BE(t,n):UE(t,n);e.type.children.forEach((t,n)=>i(r[n],e.children[n],t,n))},GE=(e,t,n)=>{e.type.mode===jw.Dense?KE(e,t,n):qE(e,t,n)},KE=(e,t,n)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];aD.visit(i,e.valueOffsets[t],n)},qE=(e,t,n)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];aD.visit(i,t,n)},JE=(e,t,n)=>{var r;(r=e.dictionary)==null||r.set(e.values[t],n)},YE=(e,t,n)=>{switch(e.type.unit){case Fw.YEAR_MONTH:return ZE(e,t,n);case Fw.DAY_TIME:return XE(e,t,n);case Fw.MONTH_DAY_NANO:return QE(e,t,n)}},XE=({values:e},t,n)=>{e.set(n.subarray(0,2),2*t)},ZE=({values:e},t,n)=>{e[t]=n[0]*12+n[1]%12},QE=({values:e,stride:t},n,r)=>{e.set(r.subarray(0,t),t*n)},$E=({values:e},t,n)=>{e[t]=n},eD=({values:e},t,n)=>{e[t]=n},tD=({values:e},t,n)=>{e[t]=n},nD=({values:e},t,n)=>{e[t]=n},rD=(e,t,n)=>{switch(e.type.unit){case Pw.SECOND:return $E(e,t,n);case Pw.MILLISECOND:return eD(e,t,n);case Pw.MICROSECOND:return tD(e,t,n);case Pw.NANOSECOND:return nD(e,t,n)}},iD=(e,t,n)=>{let{stride:r}=e,i=e.children[0],a=aD.getVisitFn(i);if(Array.isArray(n))for(let e=-1,o=t*r;++e`${zw(e)}: ${zw(t)}`).join(`, `)}}`}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.toString()}[Symbol.iterator](){return new lD(this[oD],this[sD])}},lD=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[oD].type.children.some(e=>e.name===t)}getOwnPropertyDescriptor(e,t){if(e[oD].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[oD].type.children.findIndex(e=>e.name===t);if(n!==-1){let r=tO.visit(e[oD].children[n],e[sD]);return Reflect.set(e,t,r),r}}set(e,t,n){let r=e[oD].type.children.findIndex(e=>e.name===t);return r===-1?Reflect.has(e,t)||typeof t==`symbol`?Reflect.set(e,t,n):!1:(aD.visit(e[oD].children[r],e[sD],n),Reflect.set(e,t,n))}};const dD=new uD;var W=class extends rE{};function G(e){return(t,n)=>t.getValid(n)?e(t,n):null}const fD=(e,t)=>864e5*e[t],pD=(e,t)=>null,mD=(e,t,n)=>{if(n+1>=t.length)return null;let r=Bw(t[n]),i=Bw(t[n+1]);return e.subarray(r,i)},hD=({offset:e,values:t},n)=>{let r=e+n,i=t[r>>3];return(i&1<fD(e,t),_D=({values:e},t)=>Bw(e[t]),vD=({stride:e,values:t},n)=>t[e*n],yD=({stride:e,values:t},n)=>uE(t[e*n]),bD=({values:e},t)=>e[t],xD=({stride:e,values:t},n)=>t.subarray(e*n,e*(n+1)),SD=({values:e,valueOffsets:t},n)=>mD(e,t,n),CD=({values:e,valueOffsets:t},n)=>{let r=mD(e,t,n);return r===null?null:FC(r)},wD=({values:e},t)=>e[t],TD=({type:e,values:t},n)=>e.precision===Mw.HALF?uE(t[n]):t[n],ED=(e,t)=>e.type.unit===Nw.DAY?gD(e,t):_D(e,t),DD=({values:e},t)=>1e3*Bw(e[t]),OD=({values:e},t)=>Bw(e[t]),kD=({values:e},t)=>Vw(e[t],BigInt(1e3)),AD=({values:e},t)=>Vw(e[t],BigInt(1e6)),jD=(e,t)=>{switch(e.type.unit){case Pw.SECOND:return DD(e,t);case Pw.MILLISECOND:return OD(e,t);case Pw.MICROSECOND:return kD(e,t);case Pw.NANOSECOND:return AD(e,t)}},MD=({values:e},t)=>e[t],ND=({values:e},t)=>e[t],PD=({values:e},t)=>e[t],FD=({values:e},t)=>e[t],ID=(e,t)=>{switch(e.type.unit){case Pw.SECOND:return MD(e,t);case Pw.MILLISECOND:return ND(e,t);case Pw.MICROSECOND:return PD(e,t);case Pw.NANOSECOND:return FD(e,t)}},LD=({values:e,stride:t},n)=>eT.decimal(e.subarray(t*n,t*(n+1))),RD=(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 rk([c])},zD=(e,t)=>{let{valueOffsets:n,children:r}=e,{[t]:i,[t+1]:a}=n,o=r[0];return new oO(o.slice(i,a-i))},BD=(e,t)=>new cD(e,t),VD=(e,t)=>e.type.mode===jw.Dense?HD(e,t):UD(e,t),HD=(e,t)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return tO.visit(r,e.valueOffsets[t])},UD=(e,t)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return tO.visit(r,t)},WD=(e,t)=>{var n;return(n=e.dictionary)?.get(e.values[t])},GD=(e,t)=>e.type.unit===Fw.MONTH_DAY_NANO?JD(e,t):e.type.unit===Fw.DAY_TIME?KD(e,t):qD(e,t),KD=({values:e},t)=>e.subarray(2*t,2*(t+1)),qD=({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},JD=({values:e},t)=>e.subarray(4*t,4*(t+1)),YD=({values:e},t)=>e[t],XD=({values:e},t)=>e[t],ZD=({values:e},t)=>e[t],QD=({values:e},t)=>e[t],$D=(e,t)=>{switch(e.type.unit){case Pw.SECOND:return YD(e,t);case Pw.MILLISECOND:return XD(e,t);case Pw.MICROSECOND:return ZD(e,t);case Pw.NANOSECOND:return QD(e,t)}},eO=(e,t)=>{let{stride:n,children:r}=e,i=r[0],a=i.slice(t*n,n);return new rk([a])};W.prototype.visitNull=G(pD),W.prototype.visitBool=G(hD),W.prototype.visitInt=G(wD),W.prototype.visitInt8=G(vD),W.prototype.visitInt16=G(vD),W.prototype.visitInt32=G(vD),W.prototype.visitInt64=G(bD),W.prototype.visitUint8=G(vD),W.prototype.visitUint16=G(vD),W.prototype.visitUint32=G(vD),W.prototype.visitUint64=G(bD),W.prototype.visitFloat=G(TD),W.prototype.visitFloat16=G(yD),W.prototype.visitFloat32=G(vD),W.prototype.visitFloat64=G(vD),W.prototype.visitUtf8=G(CD),W.prototype.visitLargeUtf8=G(CD),W.prototype.visitBinary=G(SD),W.prototype.visitLargeBinary=G(SD),W.prototype.visitFixedSizeBinary=G(xD),W.prototype.visitDate=G(ED),W.prototype.visitDateDay=G(gD),W.prototype.visitDateMillisecond=G(_D),W.prototype.visitTimestamp=G(jD),W.prototype.visitTimestampSecond=G(DD),W.prototype.visitTimestampMillisecond=G(OD),W.prototype.visitTimestampMicrosecond=G(kD),W.prototype.visitTimestampNanosecond=G(AD),W.prototype.visitTime=G(ID),W.prototype.visitTimeSecond=G(MD),W.prototype.visitTimeMillisecond=G(ND),W.prototype.visitTimeMicrosecond=G(PD),W.prototype.visitTimeNanosecond=G(FD),W.prototype.visitDecimal=G(LD),W.prototype.visitList=G(RD),W.prototype.visitStruct=G(BD),W.prototype.visitUnion=G(VD),W.prototype.visitDenseUnion=G(HD),W.prototype.visitSparseUnion=G(UD),W.prototype.visitDictionary=G(WD),W.prototype.visitInterval=G(GD),W.prototype.visitIntervalDayTime=G(KD),W.prototype.visitIntervalYearMonth=G(qD),W.prototype.visitIntervalMonthDayNano=G(JD),W.prototype.visitDuration=G($D),W.prototype.visitDurationSecond=G(YD),W.prototype.visitDurationMillisecond=G(XD),W.prototype.visitDurationMicrosecond=G(ZD),W.prototype.visitDurationNanosecond=G(QD),W.prototype.visitFixedSizeList=G(eO),W.prototype.visitMap=G(zD);const tO=new W,nO=Symbol.for(`keys`),rO=Symbol.for(`vals`),iO=Symbol.for(`kKeysAsStrings`),aO=Symbol.for(`_kKeysAsStrings`);var oO=class{constructor(e){return this[nO]=new rk([e.children[0]]).memoize(),this[rO]=e.children[1],new Proxy(this,new cO)}get[iO](){return this[aO]||(this[aO]=Array.from(this[nO].toArray(),String))}[Symbol.iterator](){return new sO(this[nO],this[rO])}get size(){return this[nO].length}toArray(){return Object.values(this.toJSON())}toJSON(){let e=this[nO],t=this[rO],n={};for(let r=-1,i=e.length;++r`${zw(e)}: ${zw(t)}`).join(`, `)}}`}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.toString()}},sO=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),tO.visit(this.vals,e)]})}},cO=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[iO]}has(e,t){return e[iO].includes(t)}getOwnPropertyDescriptor(e,t){let n=e[iO].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[iO].indexOf(t);if(n!==-1){let r=tO.visit(Reflect.get(e,rO),n);return Reflect.set(e,t,r),r}}set(e,t,n){let r=e[iO].indexOf(t);return r===-1?Reflect.has(e,t)?Reflect.set(e,t,n):!1:(aD.visit(Reflect.get(e,rO),r,n),Reflect.set(e,t,n))}};Object.defineProperties(oO.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:`Row`},[nO]:{writable:!0,enumerable:!1,configurable:!1,value:null},[rO]:{writable:!0,enumerable:!1,configurable:!1,value:null},[aO]:{writable:!0,enumerable:!1,configurable:!1,value:null}});var lO={};Re(lO,{clampRange:()=>dO,createElementComparator:()=>mO,wrapIndex:()=>fO});let uO;function dO(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 fO=(e,t)=>e<0?t+e:e,pO=e=>e!==e;function mO(e){let t=typeof e;if(t!==`object`||e===null)return pO(e)?pO: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?Aw(e,t):!1:e instanceof Map?gO(e):Array.isArray(e)?hO(e):e instanceof rk?_O(e):vO(e,!0)}function hO(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 bO(e,n);case Map:return SO(e,n,n.keys());case oO:case cD:case Object:case void 0:return SO(e,n,t||Object.keys(n))}return n instanceof rk?xO(e,n):!1}}function bO(e,t){let n=e.length;if(t.length!==n)return!1;for(let r=-1;++rkO,getBit:()=>TO,getBool:()=>wO,packBools:()=>OO,popcnt_array:()=>jO,popcnt_bit_range:()=>AO,popcnt_uint32:()=>MO,setBool:()=>EO,truncateBitmap:()=>DO});function wO(e,t,n,r){return(n&1<>r}function EO(e,t,n){return n?!!(e[t>>3]|=1<>3]&=~(1<0||n.byteLength>3):OO(new kO(n,e,t,null,wO)).subarray(0,r)),i}return n}function OO(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 kO=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 AO(e,t,i)+AO(e,r,n)+jO(e,i>>3,r-i>>3)}function jO(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+=MO(a.getUint32(i)),i+=4;for(;o-i>=2;)r+=MO(a.getUint16(i)),i+=2;for(;o-i>=1;)r+=MO(a.getUint8(i)),i+=1;return r}function MO(e){let t=Math.trunc(e);return t-=t>>>1&1431655765,t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}const NO=-1;var PO=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 U.isSparseUnion(e)||U.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(U.isUnion(this.type))return this.children.reduce((e,t)=>e+t.nullCount,0);let e=this._nullCount,t;return e<=NO&&(t=this.nullBitmap)&&(this._nullCount=e=t.length===0?0:this.length-AO(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=nE(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(U.isUnion(t)){let n=t,r=this.children[n.typeIdToChildIndex[this.typeIds[e]]],i=n.mode===jw.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(DO(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===H.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(DO(this.offset,t,this.nullBitmap),0);let i=this.buffers;return i[Iw.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[Iw.TYPE])&&(a[Iw.TYPE]=i.subarray(e,e+t)),(i=a[Iw.OFFSET])&&(a[Iw.OFFSET]=i.subarray(e,e+t+1))||(i=a[Iw.DATA])&&(a[Iw.DATA]=r===6?i:i.subarray(n*e,n*(e+t))),a}_sliceChildren(e,t,n){return e.map(e=>e.slice(t,n))}};PO.prototype.children=Object.freeze([]);var FO=class e extends rE{visit(e){return this.getVisitFn(e.type).call(this,e)}visitNull(e){let{type:t,offset:n=0,length:r=0}=e;return new PO(t,n,r,r)}visitBool(e){let{type:t,offset:n=0}=e,r=tw(e.nullBitmap),i=XC(t.ArrayType,e.data),{length:a=i.length>>3,nullCount:o=e.nullBitmap?-1:0}=e;return new PO(t,n,a,o,[void 0,i,r])}visitInt(e){let{type:t,offset:n=0}=e,r=tw(e.nullBitmap),i=XC(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new PO(t,n,a,o,[void 0,i,r])}visitFloat(e){let{type:t,offset:n=0}=e,r=tw(e.nullBitmap),i=XC(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new PO(t,n,a,o,[void 0,i,r])}visitUtf8(e){let{type:t,offset:n=0}=e,r=tw(e.data),i=tw(e.nullBitmap),a=$C(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new PO(t,n,o,s,[a,r,i])}visitLargeUtf8(e){let{type:t,offset:n=0}=e,r=tw(e.data),i=tw(e.nullBitmap),a=ew(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new PO(t,n,o,s,[a,r,i])}visitBinary(e){let{type:t,offset:n=0}=e,r=tw(e.data),i=tw(e.nullBitmap),a=$C(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new PO(t,n,o,s,[a,r,i])}visitLargeBinary(e){let{type:t,offset:n=0}=e,r=tw(e.data),i=tw(e.nullBitmap),a=ew(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new PO(t,n,o,s,[a,r,i])}visitFixedSizeBinary(e){let{type:t,offset:n=0}=e,r=tw(e.nullBitmap),i=XC(t.ArrayType,e.data),{length:a=i.length/nE(t),nullCount:o=e.nullBitmap?-1:0}=e;return new PO(t,n,a,o,[void 0,i,r])}visitDate(e){let{type:t,offset:n=0}=e,r=tw(e.nullBitmap),i=XC(t.ArrayType,e.data),{length:a=i.length/nE(t),nullCount:o=e.nullBitmap?-1:0}=e;return new PO(t,n,a,o,[void 0,i,r])}visitTimestamp(e){let{type:t,offset:n=0}=e,r=tw(e.nullBitmap),i=XC(t.ArrayType,e.data),{length:a=i.length/nE(t),nullCount:o=e.nullBitmap?-1:0}=e;return new PO(t,n,a,o,[void 0,i,r])}visitTime(e){let{type:t,offset:n=0}=e,r=tw(e.nullBitmap),i=XC(t.ArrayType,e.data),{length:a=i.length/nE(t),nullCount:o=e.nullBitmap?-1:0}=e;return new PO(t,n,a,o,[void 0,i,r])}visitDecimal(e){let{type:t,offset:n=0}=e,r=tw(e.nullBitmap),i=XC(t.ArrayType,e.data),{length:a=i.length/nE(t),nullCount:o=e.nullBitmap?-1:0}=e;return new PO(t,n,a,o,[void 0,i,r])}visitList(e){let{type:t,offset:n=0,child:r}=e,i=tw(e.nullBitmap),a=$C(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new PO(t,n,o,s,[a,void 0,i],[r])}visitStruct(e){let{type:t,offset:n=0,children:r=[]}=e,i=tw(e.nullBitmap),{length:a=r.reduce((e,{length:t})=>Math.max(e,t),0),nullCount:o=e.nullBitmap?-1:0}=e;return new PO(t,n,a,o,[void 0,void 0,i],r)}visitUnion(e){let{type:t,offset:n=0,children:r=[]}=e,i=XC(t.ArrayType,e.typeIds),{length:a=i.length,nullCount:o=-1}=e;if(U.isSparseUnion(t))return new PO(t,n,a,o,[void 0,void 0,void 0,i],r);let s=$C(e.valueOffsets);return new PO(t,n,a,o,[s,void 0,void 0,i],r)}visitDictionary(t){let{type:n,offset:r=0}=t,i=tw(t.nullBitmap),a=XC(n.indices.ArrayType,t.data),{dictionary:o=new rk([new e().visit({type:n.dictionary})])}=t,{length:s=a.length,nullCount:c=t.nullBitmap?-1:0}=t;return new PO(n,r,s,c,[void 0,a,i],[],o)}visitInterval(e){let{type:t,offset:n=0}=e,r=tw(e.nullBitmap),i=XC(t.ArrayType,e.data),{length:a=i.length/nE(t),nullCount:o=e.nullBitmap?-1:0}=e;return new PO(t,n,a,o,[void 0,i,r])}visitDuration(e){let{type:t,offset:n=0}=e,r=tw(e.nullBitmap),i=XC(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new PO(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=tw(t.nullBitmap),{length:o=i.length/nE(n),nullCount:s=t.nullBitmap?-1:0}=t;return new PO(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=tw(t.nullBitmap),o=$C(t.valueOffsets),{length:s=o.length-1,nullCount:c=t.nullBitmap?-1:0}=t;return new PO(n,r,s,c,[o,void 0,a],[i])}};const IO=new FO;var LO=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 zO(e){return e.reduce((e,t)=>e+t.nullCount,0)}function BO(e){return e.reduce((e,t,n)=>(e[n+1]=e[n]+t.length,e),new Uint32Array(e.length+1))}function VO(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 HO(e,t,n,r){let i=0,a=0,o=t.length-1;do{if(i>=o-1)return n0?0:-1}function JO(e,t){let{nullBitmap:n}=e;if(!n||e.nullCount<=0)return-1;let r=0;for(let i of new kO(n,e.offset+(t||0),e.length,n,wO)){if(!i)return r;++r}return-1}function YO(e,t,n){if(t===void 0)return-1;if(t===null)switch(e.typeId){case H.Union:break;case H.Dictionary:break;default:return JO(e,n)}let r=tO.getVisitFn(e),i=mO(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 LO(e.data.length,t=>{let r=e.data[t],i=r.length,a=e.slice(n,n+i);return n+=i,new QO(a)})}var QO=class{constructor(e){this.vector=e,this.index=0}next(){return this.indexe.data):t;if(a.length===0||a.some(e=>!(e instanceof PO)))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}=tk[o.typeId],r=a[0];this.isValid=e=>UO(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,nk[o.typeId]),this._offsets=BO(a);break}this.data=a,this.type=o,this.stride=nE(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 RO(this.data)}get nullCount(){return zO(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${H[this.type.typeId]}Vector`}isValid(e){return!1}get(e){return null}at(e){return this.get(fO(e,this.length))}set(e,t){}indexOf(e,t){return-1}includes(e,t){return this.indexOf(e,t)>-1}[Symbol.iterator](){return $O.visit(this)}concat(...t){return new e(this.data.concat(t.flatMap(e=>e.data).flat(1/0)))}slice(t,n){return new e(dO(this,t,n,({data:e,_offsets:t},n,r)=>VO(e,t,n,r)))}toJSON(){return[...this]}toArray(){let{type:e,data:t,length:n,stride:r,ArrayType:i}=this;switch(e.typeId){case H.Int:case H.Float:case H.Decimal:case H.Time:case H.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 U.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(U.isDictionary(this.type)){let t=new ik(this.data[0].dictionary),n=this.data.map(e=>{let n=e.clone();return n.dictionary=t,n});return new e(n)}return new ik(this)}unmemoize(){if(U.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}};ek=Symbol.toStringTag,rk[ek]=(e=>{e.type=U.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(H).map(e=>H[e]).filter(e=>typeof e==`number`&&e!==H.NONE);for(let n of t){let t=tO.getVisitFnByTypeId(n),r=aD.getVisitFnByTypeId(n),i=ZO.getVisitFnByTypeId(n);tk[n]={get:t,set:r,indexOf:i},nk[n]=Object.create(e,{isValid:{value:WO(UO)},get:{value:WO(tO.getVisitFnByTypeId(n))},set:{value:GO(aD.getVisitFnByTypeId(n))},indexOf:{value:KO(ZO.getVisitFnByTypeId(n))}})}return`Vector`})(rk.prototype);var ik=class e extends rk{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 rk(this.data)}),Object.defineProperty(this,`memoize`,{value:()=>this})}},ak={};Re(ak,{BaseInt64:()=>uk,Int128:()=>pk,Int64:()=>fk,Uint64:()=>dk});const ok=65536;function sk(e){return e<0&&(e=4294967295+e+1),`0x${e.toString(16)}`}const ck=8,lk=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];var uk=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`${sk(this.buffer[3])} ${sk(this.buffer[2])} ${sk(this.buffer[1])} ${sk(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;nhk,toIntervalDayTimeObjects:()=>_k,toIntervalMonthDayNanoInt32Array:()=>gk,toIntervalMonthDayNanoObjects:()=>vk});function hk(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 _k(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 rE{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 yk(e,t){return t instanceof e.constructor}function bk(e,t){return e===t||yk(e,t)}function xk(e,t){return e===t||yk(e,t)&&e.bitWidth===t.bitWidth&&e.isSigned===t.isSigned}function Sk(e,t){return e===t||yk(e,t)&&e.precision===t.precision}function Ck(e,t){return e===t||yk(e,t)&&e.byteWidth===t.byteWidth}function wk(e,t){return e===t||yk(e,t)&&e.unit===t.unit}function Tk(e,t){return e===t||yk(e,t)&&e.unit===t.unit&&e.timezone===t.timezone}function Ek(e,t){return e===t||yk(e,t)&&e.unit===t.unit&&e.bitWidth===t.bitWidth}function Dk(e,t){return e===t||yk(e,t)&&e.children.length===t.children.length&&Fk.compareManyFields(e.children,t.children)}function Ok(e,t){return e===t||yk(e,t)&&e.children.length===t.children.length&&Fk.compareManyFields(e.children,t.children)}function kk(e,t){return e===t||yk(e,t)&&e.mode===t.mode&&e.typeIds.every((e,n)=>e===t.typeIds[n])&&Fk.compareManyFields(e.children,t.children)}function Ak(e,t){return e===t||yk(e,t)&&e.id===t.id&&e.isOrdered===t.isOrdered&&Fk.visit(e.indices,t.indices)&&Fk.visit(e.dictionary,t.dictionary)}function jk(e,t){return e===t||yk(e,t)&&e.unit===t.unit}function Mk(e,t){return e===t||yk(e,t)&&e.unit===t.unit}function Nk(e,t){return e===t||yk(e,t)&&e.listSize===t.listSize&&e.children.length===t.children.length&&Fk.compareManyFields(e.children,t.children)}function Pk(e,t){return e===t||yk(e,t)&&e.keysSorted===t.keysSorted&&e.children.length===t.children.length&&Fk.compareManyFields(e.children,t.children)}Y.prototype.visitNull=bk,Y.prototype.visitBool=bk,Y.prototype.visitInt=xk,Y.prototype.visitInt8=xk,Y.prototype.visitInt16=xk,Y.prototype.visitInt32=xk,Y.prototype.visitInt64=xk,Y.prototype.visitUint8=xk,Y.prototype.visitUint16=xk,Y.prototype.visitUint32=xk,Y.prototype.visitUint64=xk,Y.prototype.visitFloat=Sk,Y.prototype.visitFloat16=Sk,Y.prototype.visitFloat32=Sk,Y.prototype.visitFloat64=Sk,Y.prototype.visitUtf8=bk,Y.prototype.visitLargeUtf8=bk,Y.prototype.visitBinary=bk,Y.prototype.visitLargeBinary=bk,Y.prototype.visitFixedSizeBinary=Ck,Y.prototype.visitDate=wk,Y.prototype.visitDateDay=wk,Y.prototype.visitDateMillisecond=wk,Y.prototype.visitTimestamp=Tk,Y.prototype.visitTimestampSecond=Tk,Y.prototype.visitTimestampMillisecond=Tk,Y.prototype.visitTimestampMicrosecond=Tk,Y.prototype.visitTimestampNanosecond=Tk,Y.prototype.visitTime=Ek,Y.prototype.visitTimeSecond=Ek,Y.prototype.visitTimeMillisecond=Ek,Y.prototype.visitTimeMicrosecond=Ek,Y.prototype.visitTimeNanosecond=Ek,Y.prototype.visitDecimal=bk,Y.prototype.visitList=Dk,Y.prototype.visitStruct=Ok,Y.prototype.visitUnion=kk,Y.prototype.visitDenseUnion=kk,Y.prototype.visitSparseUnion=kk,Y.prototype.visitDictionary=Ak,Y.prototype.visitInterval=jk,Y.prototype.visitIntervalDayTime=jk,Y.prototype.visitIntervalYearMonth=jk,Y.prototype.visitIntervalMonthDayNano=jk,Y.prototype.visitDuration=Mk,Y.prototype.visitDurationSecond=Mk,Y.prototype.visitDurationMillisecond=Mk,Y.prototype.visitDurationMicrosecond=Mk,Y.prototype.visitDurationNanosecond=Mk,Y.prototype.visitFixedSizeList=Nk,Y.prototype.visitMap=Pk;const Fk=new Y;function Ik(e,t){return Fk.compareSchemas(e,t)}function Lk(e,t){return Fk.compareFields(e,t)}function Rk(e,t){return Fk.visit(e,t)}const zk=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Hw),ak),CO),sE),GC),lO),Lw),mk),{compareSchemas:Ik,compareFields:Lk,compareTypes:Rk}),Bk=365.2425,Vk=10**8*24*60*60*1e3,Hk=6048e5,Uk=864e5,Wk=3600,Gk=Wk*24,Kk=Gk*7,qk=Gk*Bk,Jk=qk/12,Yk=Jk*3,Xk=Symbol.for(`constructDateFrom`);function Zk(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&Xk in e?e[Xk](t):e instanceof Date?new e.constructor(t):new Date(t)}function Qk(e,t){return Zk(t||e,e)}let $k={};function eA(){return $k}function tA(e,t){let n=eA(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=Qk(e,t?.in),a=i.getDay(),o=(a=a.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function iA(e){let t=Qk(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 aA(e,...t){let n=Zk.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}function oA(e,t){let n=Qk(e,t?.in);return n.setHours(0,0,0,0),n}function sA(e,t,n){let[r,i]=aA(n?.in,e,t),a=oA(r),o=oA(i),s=+a-iA(a),c=+o-iA(o);return Math.round((s-c)/Uk)}function cA(e,t){let n=rA(e,t),r=Zk(t?.in||e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),nA(r)}function lA(e){return e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`}function uA(e){return!(!lA(e)&&typeof e!=`number`||isNaN(+Qk(e)))}function dA(e,t){let n=Qk(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const fA={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`}},pA=(e,t,n)=>{let r,i=fA[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 mA(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth,r=e.formats[n]||e.formats[e.defaultWidth];return r}}const hA={full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},gA={full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},_A={full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},vA={date:mA({formats:hA,defaultWidth:`full`}),time:mA({formats:gA,defaultWidth:`full`}),dateTime:mA({formats:_A,defaultWidth:`full`})},yA={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},bA=(e,t,n,r)=>yA[e];function xA(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 SA={narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},CA={narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},wA={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`]},TA={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`]},EA={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`}},DA={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`}},OA=(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`},kA={ordinalNumber:OA,era:xA({values:SA,defaultWidth:`wide`}),quarter:xA({values:CA,defaultWidth:`wide`,argumentCallback:e=>e-1}),month:xA({values:wA,defaultWidth:`wide`}),day:xA({values:TA,defaultWidth:`wide`}),dayPeriod:xA({values:EA,defaultWidth:`wide`,formattingValues:DA,defaultFormattingWidth:`wide`})};function AA(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)?MA(s,e=>e.test(o)):jA(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 jA(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function MA(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 PA=/^(\d+)(th|st|nd|rd)?/i,FA=/\d+/i,IA={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},LA={any:[/^b/i,/^(a|c)/i]},RA={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},zA={any:[/1/i,/2/i,/3/i,/4/i]},BA={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},VA={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]},HA={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},UA={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]},WA={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},GA={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}},KA={ordinalNumber:NA({matchPattern:PA,parsePattern:FA,valueCallback:e=>parseInt(e,10)}),era:AA({matchPatterns:IA,defaultMatchWidth:`wide`,parsePatterns:LA,defaultParseWidth:`any`}),quarter:AA({matchPatterns:RA,defaultMatchWidth:`wide`,parsePatterns:zA,defaultParseWidth:`any`,valueCallback:e=>e+1}),month:AA({matchPatterns:BA,defaultMatchWidth:`wide`,parsePatterns:VA,defaultParseWidth:`any`}),day:AA({matchPatterns:HA,defaultMatchWidth:`wide`,parsePatterns:UA,defaultParseWidth:`any`}),dayPeriod:AA({matchPatterns:WA,defaultMatchWidth:`any`,parsePatterns:GA,defaultParseWidth:`any`})},qA={code:`en-US`,formatDistance:pA,formatLong:vA,formatRelative:bA,localize:kA,match:KA,options:{weekStartsOn:0,firstWeekContainsDate:1}};function JA(e,t){let n=Qk(e,t?.in),r=sA(n,dA(n)),i=r+1;return i}function YA(e,t){let n=Qk(e,t?.in),r=nA(n)-+cA(n);return Math.round(r/Hk)+1}function XA(e,t){let n=Qk(e,t?.in),r=n.getFullYear(),i=eA(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=Zk(t?.in||e,0);o.setFullYear(r+1,0,a),o.setHours(0,0,0,0);let s=tA(o,t),c=Zk(t?.in||e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);let l=tA(c,t);return+n>=+s?r+1:+n>=+l?r:r-1}function ZA(e,t){let n=eA(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=XA(e,t),a=Zk(t?.in||e,0);a.setFullYear(i,0,r),a.setHours(0,0,0,0);let o=tA(a,t);return o}function QA(e,t){let n=Qk(e,t?.in),r=tA(n,t)-+ZA(n,t);return Math.round(r/Hk)+1}function $A(e,t){let n=e<0?`-`:``,r=Math.abs(e).toString().padStart(t,`0`);return n+r}const ej={y(e,t){let n=e.getFullYear(),r=n>0?n:1-n;return $A(t===`yy`?r%100:r,t.length)},M(e,t){let n=e.getMonth();return t===`M`?String(n+1):$A(n+1,2)},d(e,t){return $A(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 $A(e.getHours()%12||12,t.length)},H(e,t){return $A(e.getHours(),t.length)},m(e,t){return $A(e.getMinutes(),t.length)},s(e,t){return $A(e.getSeconds(),t.length)},S(e,t){let n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*10**(n-3));return $A(i,t.length)}},tj={am:`am`,pm:`pm`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},nj={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 ej.y(e,t)},Y:function(e,t,n,r){let i=XA(e,r),a=i>0?i:1-i;if(t===`YY`){let e=a%100;return $A(e,2)}return t===`Yo`?n.ordinalNumber(a,{unit:`year`}):$A(a,t.length)},R:function(e,t){let n=rA(e);return $A(n,t.length)},u:function(e,t){let n=e.getFullYear();return $A(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 $A(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 $A(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 ej.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 $A(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=QA(e,r);return t===`wo`?n.ordinalNumber(i,{unit:`week`}):$A(i,t.length)},I:function(e,t,n){let r=YA(e);return t===`Io`?n.ordinalNumber(r,{unit:`week`}):$A(r,t.length)},d:function(e,t,n){return t===`do`?n.ordinalNumber(e.getDate(),{unit:`date`}):ej.d(e,t)},D:function(e,t,n){let r=JA(e);return t===`Do`?n.ordinalNumber(r,{unit:`dayOfYear`}):$A(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 $A(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 $A(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 $A(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?tj.noon:r===0?tj.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?tj.evening:r>=12?tj.afternoon:r>=4?tj.morning:tj.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 ej.h(e,t)},H:function(e,t,n){return t===`Ho`?n.ordinalNumber(e.getHours(),{unit:`hour`}):ej.H(e,t)},K:function(e,t,n){let r=e.getHours()%12;return t===`Ko`?n.ordinalNumber(r,{unit:`hour`}):$A(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t===`ko`?n.ordinalNumber(r,{unit:`hour`}):$A(r,t.length)},m:function(e,t,n){return t===`mo`?n.ordinalNumber(e.getMinutes(),{unit:`minute`}):ej.m(e,t)},s:function(e,t,n){return t===`so`?n.ordinalNumber(e.getSeconds(),{unit:`second`}):ej.s(e,t)},S:function(e,t){return ej.S(e,t)},X:function(e,t,n){let r=e.getTimezoneOffset();if(r===0)return`Z`;switch(t){case`X`:return ij(r);case`XXXX`:case`XX`:return aj(r);case`XXXXX`:case`XXX`:default:return aj(r,`:`)}},x:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`x`:return ij(r);case`xxxx`:case`xx`:return aj(r);case`xxxxx`:case`xxx`:default:return aj(r,`:`)}},O:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`O`:case`OO`:case`OOO`:return`GMT`+rj(r,`:`);case`OOOO`:default:return`GMT`+aj(r,`:`)}},z:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`z`:case`zz`:case`zzz`:return`GMT`+rj(r,`:`);case`zzzz`:default:return`GMT`+aj(r,`:`)}},t:function(e,t,n){let r=Math.trunc(e/1e3);return $A(r,t.length)},T:function(e,t,n){return $A(+e,t.length)}};function rj(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+$A(a,2)}function ij(e,t){if(e%60==0){let t=e>0?`-`:`+`;return t+$A(Math.abs(e)/60,2)}return aj(e,t)}function aj(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=$A(Math.trunc(r/60),2),a=$A(r%60,2);return n+i+t+a}const oj=(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`})}},sj=(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`})}},cj=(e,t)=>{let n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return oj(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}}`,oj(r,t)).replace(`{{time}}`,sj(i,t))},lj={p:sj,P:cj},uj=/^D+$/,dj=/^Y+$/,fj=[`D`,`DD`,`YY`,`YYYY`];function pj(e){return uj.test(e)}function mj(e){return dj.test(e)}function hj(e,t,n){let r=gj(e,t,n);if(console.warn(r),fj.includes(e))throw RangeError(r)}function gj(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 _j=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,vj=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,yj=/^'([^]*?)'?$/,bj=/''/g,xj=/[a-zA-Z]/;function Sj(e,t,n){let r=eA(),i=n?.locale??r.locale??qA,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=Qk(e,n?.in);if(!uA(s))throw RangeError(`Invalid time value`);let c=t.match(vj).map(e=>{let t=e[0];if(t===`p`||t===`P`){let n=lj[t];return n(e,i.formatLong)}return e}).join(``).match(_j).map(e=>{if(e===`''`)return{isToken:!1,value:`'`};let t=e[0];if(t===`'`)return{isToken:!1,value:Cj(e)};if(nj[t])return{isToken:!0,value:e};if(t.match(xj))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&&mj(a)||!n?.useAdditionalDayOfYearTokens&&pj(a))&&hj(a,t,String(e));let o=nj[a[0]];return o(s,a,i.localize,l)}).join(``)}function Cj(e){let t=e.match(yj);return t?t[1].replace(bj,`'`):e}function wj(e,t){return Qk(e*1e3,t?.in)}function Tj(e,t){let n=Ej(t)?new t(0):Zk(t,0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}function Ej(e){return typeof e==`function`&&e.prototype?.constructor===e}function Dj(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 Oj(e){return e==null}function kj(e){return e!=null}async function Aj(){if(typeof window<`u`&&window!==null)return`browser`;try{let e=await D(()=>import(`./__vite-browser-external-CKGmuslh.js`).then(ze(1)),__vite__mapDeps([0,1,2]));return e!==void 0&&e.versions!=null&&e.versions.node!=null?`node`:`unknown`}catch{return`unknown`}}function jj(e){return Oj(e)?!1:U.isInt(e.type)&&!Lj(e)||Mj(e)}function Mj(e){return Oj(e)?!1:U.isInt(e.type)&&e.type.isSigned===!1}function Nj(e){return Oj(e)?!1:U.isFloat(e.type)??!1}function Pj(e){return Oj(e)?!1:U.isDecimal(e.type)}function Fj(e){return Oj(e)?!1:U.isBool(e.type)}function Ij(e){return Oj(e)?!1:U.isDuration(e.type)}function Lj(e){return Oj(e)?!1:U.isInt(e.type)&&e.metadata.get(`ARROW:extension:name`)===`period`}function Rj(e){return Oj(e)?!1:U.isTimestamp(e.type)}function zj(e){return Oj(e)?!1:U.isDate(e.type)}function Bj(e){return Oj(e)?!1:U.isTime(e.type)}function Vj(e){return Oj(e)?!1:U.isList(e.type)||U.isFixedSizeList(e.type)}function Hj(e){return Oj(e)?!1:U.isStruct(e.type)||U.isMap(e.type)}function Uj(e){return Oj(e)?!1:U.isStruct(e.type)&&e.metadata.get(`ARROW:extension:name`)===`interval`||U.isInterval(e.type)}const Wj=new Date(1970,0,1);function Gj(e,t){let n;if(t===Pw.MILLISECOND)n=1e3;else if(t===Pw.MICROSECOND)n=1e3*1e3;else if(t===Pw.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 Kj(e,t){let n=Gj(e,t?.type?.unit??Pw.SECOND);return wj(n)}function qj(e,t){let n=Kj(e,t);return Sj(n,n.getMilliseconds()===0?`HH:mm:ss`:`HH:mm:ss.SSS`)}function Jj(e){let t=`yyyy-MM-dd`;return e instanceof Date||typeof e==`number`&&Number.isFinite(e)?Sj(e,t):(console.warn(`Unsupported date value: ${e}`),String(e))}function Yj(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 DC(e,r):new DC(e),Tj(n,Date)}function Xj(e,t){let n=t?.type?.scale||0,r=zk.bigNumToString(new zk.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=Dj(r.slice(-n),`0`)||``;return`${i}${a}${o?`.${o}`:``}`}const Zj=new Intl.NumberFormat(`en-US`,{style:`decimal`,maximumFractionDigits:4,minimumFractionDigits:4,useGrouping:!0});function Qj(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 $j(e,t){if(U.isInterval(t?.type))return Qj(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=tM(i.left,t.type?.children?.[0]),c=tM(i.right,t.type?.children?.[1]);return`${a+s}, ${c+o}`}return String(e)}function eM(e,t){return t?.type instanceof YT?JSON.parse(JSON.stringify(e,(e,t)=>{if(kj(t))return typeof t==`bigint`?Number(t):t})):JSON.parse(JSON.stringify(e,(e,t)=>typeof t==`bigint`?Number(t):t))}function tM(e,t){if(Oj(e))return null;let n=e instanceof Date||Number.isFinite(e);if(n&&zj(t))return Jj(e);if(typeof e==`bigint`&&Bj(t))return qj(Number(e),t);if(n&&Rj(t))return Yj(e,t);if(Lj(t))throw Error(`Period type is not supported yet`);if(Uj(t))return $j(e,t);if(Ij(t))throw Error(`Duration type is not supported yet`);return Pj(t)?Xj(e,t):Nj(t)&&Number.isFinite(e)||jj(t)?e:Hj(t)||Vj(t)?eM(e,t):Fj(t)?!!e:String(e)}function nM(e){let t=(e.toArray()||[]).map(e=>e.toJSON())||[],n=t.map(t=>(e.schema.fields.forEach(e=>t[e.name]=tM(t[e.name],e)),t));return n}let rM=function(e){return e.ORIGIN_PRIVATE_FS=`origin-private-fs`,e.NODE_FS=`node-fs`,e}({});async function iM(e){let t=ye(e,{logger:!1}),n,r,i=await Aj();if(i===`browser`){if(t.bundles===void 0){let{getBundles:e}=await D(async()=>{let{getBundles:e}=await import(`./default-browser-BsyDD-mc.js`);return{getBundles:e}},[]);t.bundles=await e()}r=await yC(await t.bundles),n=new Worker(r.mainWorker)}else if(i===`node`){if(t.bundles===void 0){let{getBundles:e}=await D(async()=>{let{getBundles:e}=await import(`./default-node-C7L-dwjz.js`);return{getBundles:e}},__vite__mapDeps([3,1,2]));t.bundles=await e()}r=await yC(await t.bundles);let e=r.mainWorker;e.startsWith(`/@fs/`)&&(e=e.replace(`/@fs/`,`file://`));let i=await D(()=>import(`./browser-CoZYwbon.js`),[]);n=new i.default(e,{type:`module`})}else throw Error(`Unsupported environment: ${i}`);let a;a=t.logger===!0?new LS:t.logger===!1?new IS:t.logger;let o=new JS(a,n);if(await o.instantiate(r.mainModule,r.pthreadWorker),t.storage)switch(t.storage.type){case rM.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 rM.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:nM(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:nM(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 aM(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 oM(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`),sM=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 cM=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`}},lM=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 uM=Symbol.for(`drizzle:Name`);var dM=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 fM(e,this)}},fM=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[uM],...r,n[0].table[uM],...i];return e??`${a.join(`_`)}_fk`}};function pM(e,...t){return e(...t)}function mM(e,t){return`${e[uM]}_${t.join(`_`)}_unique`}var hM=class{constructor(e,t){this.name=t,this.columns=e}static[X]=`PgUniqueConstraintBuilder`;columns;nullsNotDistinctConfig=!1;nullsNotDistinct(){return this.nullsNotDistinctConfig=!0,this}build(e){return new _M(e,this.columns,this.nullsNotDistinctConfig,this.name)}},gM=class{static[X]=`PgUniqueOnConstraintBuilder`;name;constructor(e){this.name=e}on(...e){return new hM(e,this.name)}},_M=class{constructor(e,t,n,r){this.table=e,this.columns=t,this.name=r??mM(this.table,this.columns.map(e=>e.name)),this.nullsNotDistinct=n}static[X]=`PgUniqueConstraint`;columns;name;nullsNotDistinct=!1;getName(){return this.name}};function vM(e,t,n){for(let r=t;rArray.isArray(e)?xM(e):typeof e==`string`?`"${e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`:`${e}`).join(`,`)}}`}var SM=class extends lM{foreignKeyConfigs=[];static[X]=`PgColumnBuilder`;array(e){return new EM(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})=>pM((n,r)=>{let i=new dM(()=>{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 wM(e,this.config)}},CM=class extends cM{constructor(e,t){t.uniqueName||=mM(e,[t.name]),super(e,t),this.table=e}static[X]=`PgColumn`},wM=class extends CM{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}},TM=class{static[X]=`IndexedColumn`;constructor(e,t,n,r){this.name=e,this.keyAsName=t,this.type=n,this.indexConfig=r}name;keyAsName;type;indexConfig},EM=class extends SM{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 DM(e,this.config,t)}},DM=class e extends CM{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=bM(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:xM(r)}},OM=class extends SM{static[X]=`PgEnumObjectColumnBuilder`;constructor(e,t){super(e,`string`,`PgEnumObjectColumn`),this.config.enum=t}build(e){return new kM(e,this.config)}},kM=class extends CM{static[X]=`PgEnumObjectColumn`;enum;enumValues=this.config.enum.enumValues;constructor(e,t){super(e,t),this.enum=t.enum}getSQLType(){return this.enum.enumName}};const AM=Symbol.for(`drizzle:isPgEnum`);function jM(e){return!!e&&typeof e==`function`&&AM in e&&e[AM]===!0}var MM=class extends SM{static[X]=`PgEnumColumnBuilder`;constructor(e,t){super(e,`string`,`PgEnumColumn`),this.config.enum=t}build(e){return new NM(e,this.config)}},NM=class extends CM{static[X]=`PgEnumColumn`;enum=this.config.enum;enumValues=this.config.enum.enumValues;constructor(e,t){super(e,t),this.enum=t.enum}getSQLType(){return this.enum.enumName}},PM=class{static[X]=`Subquery`;constructor(e,t,n,r=!1,i=[]){this._={brand:`Subquery`,sql:e,selectedFields:t,alias:n,isWith:r,usedTables:i}}},FM=class extends PM{static[X]=`WithSubquery`},IM=`0.44.2`;let LM,RM;const zM={startActiveSpan(e,t){return LM?(RM||=LM.trace.getTracer(`drizzle-orm`,IM),pM((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()}}),LM,RM)):t()}},BM=Symbol.for(`drizzle:ViewBaseConfig`),VM=Symbol.for(`drizzle:Schema`),HM=Symbol.for(`drizzle:Columns`),UM=Symbol.for(`drizzle:ExtraConfigColumns`),WM=Symbol.for(`drizzle:OriginalName`),GM=Symbol.for(`drizzle:BaseName`),KM=Symbol.for(`drizzle:IsAlias`),qM=Symbol.for(`drizzle:ExtraConfigBuilder`),JM=Symbol.for(`drizzle:IsDrizzleTable`);var Q=class{static[X]=`Table`;static Symbol={Name:uM,Schema:VM,OriginalName:WM,Columns:HM,ExtraConfigColumns:UM,BaseName:GM,IsAlias:KM,ExtraConfigBuilder:qM};[uM];[WM];[VM];[HM];[UM];[GM];[KM]=!1;[JM]=!0;[qM]=void 0;constructor(e,t,n){this[uM]=this[WM]=e,this[VM]=t,this[GM]=n}};function YM(e){return e[uM]}function XM(e){return`${e[VM]??`public`}.${e[uM]}`}var ZM=class{static[X]=`FakePrimitiveParam`};function QM(e){return e!=null&&typeof e.getSQL==`function`}function $M(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 eN=class{static[X]=`StringChunk`;value;constructor(e){this.value=Array.isArray(e)?e:[e]}getSQL(){return new tN([this])}},tN=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=iN;shouldInlineParams=!1;usedTables=[];append(e){return this.queryChunks.push(...e.queryChunks),this}toQuery(e){return zM.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 $M(t.map(t=>{if(Z(t,eN))return{sql:t.value.join(``),params:[]};if(Z(t,nN))return{sql:a(t.value),params:[]};if(t===void 0)return{sql:``,params:[]};if(Array.isArray(t)){let e=[new eN(`(`)];for(let[n,r]of t.entries())e.push(r),ne},aN={mapToDriverValue:e=>e},oN={...iN,...aN};var sN=class{constructor(e,t=aN){this.value=e,this.encoder=t}static[X]=`Param`;brand;getSQL(){return new tN([this])}};function $(e,...t){let n=[];(t.length>0||e.length>0&&e[0]!==``)&&n.push(new eN(e[0]));for(let[r,i]of t.entries())n.push(i,new eN(e[r+1]));return new tN(n)}(e=>{function t(){return new tN([])}e.empty=t;function n(e){return new tN(e)}e.fromList=n;function r(e){return new tN([new eN(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 tN(n)}e.join=i;function a(e){return new nN(e)}e.identifier=a;function o(e){return new cN(e)}e.placeholder=o;function s(e,t){return new sN(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})(tN||={});var cN=class{constructor(e){this.name=e}static[X]=`Placeholder`;getSQL(){return new tN([this])}};function lN(e,t){return e.map(e=>{if(Z(e,cN)){if(!(e.name in t))throw Error(`No value for placeholder "${e.name}" was provided`);return t[e.name]}if(Z(e,sN)&&Z(e.value,cN)){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 uN=Symbol.for(`drizzle:IsDrizzleView`);var dN=class{static[X]=`View`;[BM];[uN]=!0;constructor({name:e,schema:t,selectedFields:n,query:r}){this[BM]={name:e,originalName:e,schema:t,selectedFields:n,query:r,isExisting:!r,isAlias:!1}}getSQL(){return new tN([this])}};cM.prototype.getSQL=function(){return new tN([this])},Q.prototype.getSQL=function(){return new tN([this])},PM.prototype.getSQL=function(){return new tN([this])};var fN=class{constructor(e){this.table=e}static[X]=`ColumnAliasProxyHandler`;get(e,t){return t===`table`?this.table:e[t]}},pN=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===BM)return{...e[BM],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 fN(new Proxy(e,this)))}),n}let n=e[t];return Z(n,cM)?new Proxy(n,new fN(new Proxy(e,this))):n}},mN=class{constructor(e){this.alias=e}static[X]=`RelationTableAliasProxyHandler`;get(e,t){return t===`sourceTable`?hN(e.sourceTable,this.alias):e[t]}};function hN(e,t){return new Proxy(e,new pN(t,!1))}function gN(e,t){return new Proxy(e,new fN(new Proxy(e.table,new pN(t,!1))))}function _N(e,t){return new tN.Aliased(vN(e.sql,t),e.fieldAlias)}function vN(e,t){return $.join(e.queryChunks.map(e=>Z(e,cM)?gN(e,t):Z(e,tN)?vN(e,t):Z(e,tN.Aliased)?_N(e,t):e))}var yN=class extends Error{static[X]=`DrizzleError`;constructor({message:e,cause:t}){super(e),this.name=`DrizzleError`,this.cause=t}},bN=class extends yN{static[X]=`TransactionRollbackError`;constructor(){super({message:`Rollback`})}},xN=class{static[X]=`ConsoleLogWriter`;write(e){console.log(e)}},SN=class{static[X]=`DefaultLogger`;writer;constructor(e){this.writer=e?.writer??new xN}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}`)}},CN=class{static[X]=`NoopLogger`;logQuery(){}},wN=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 TN(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,cM)||Z(r,tN)||Z(r,tN.Aliased)?e.push({path:i,field:r}):Z(r,Q)?e.push(...TN(r[Q.Symbol.Columns],i)):e.push(...TN(r,i)),e},[])}function EN(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 DN(e,t){let n=Object.entries(t).filter(([,e])=>e!==void 0).map(([t,n])=>Z(n,tN)||Z(n,cM)?[t,n]:[t,new sN(n,e[Q.Symbol.Columns][t])]);if(n.length===0)throw Error(`No values to set`);return Object.fromEntries(n)}function ON(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 kN(e){return e[Q.Symbol.Columns]}function AN(e){return Z(e,PM)?e._.alias:Z(e,dN)?e[BM].name:Z(e,tN)?void 0:e[Q.Symbol.IsAlias]?e[Q.Symbol.Name]:e[Q.Symbol.BaseName]}function jN(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 MN=class extends SM{static[X]=`PgDateColumnBaseBuilder`;defaultNow(){return this.default($`now()`)}},NN=class extends MN{static[X]=`PgDateBuilder`;constructor(e){super(e,`date`,`PgDate`)}build(e){return new PN(e,this.config)}},PN=class extends CM{static[X]=`PgDate`;getSQLType(){return`date`}mapFromDriverValue(e){return new Date(e)}mapToDriverValue(e){return e.toISOString()}},FN=class extends MN{static[X]=`PgDateStringBuilder`;constructor(e){super(e,`string`,`PgDateString`)}build(e){return new IN(e,this.config)}},IN=class extends CM{static[X]=`PgDateString`;getSQLType(){return`date`}},LN=class extends SM{static[X]=`PgJsonBuilder`;constructor(e){super(e,`json`,`PgJson`)}build(e){return new RN(e,this.config)}},RN=class extends CM{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}},zN=class extends SM{static[X]=`PgJsonbBuilder`;constructor(e){super(e,`json`,`PgJsonb`)}build(e){return new BN(e,this.config)}},BN=class extends CM{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}},VN=class extends SM{static[X]=`PgNumericBuilder`;constructor(e,t,n){super(e,`string`,`PgNumeric`),this.config.precision=t,this.config.scale=n}build(e){return new HN(e,this.config)}},HN=class extends CM{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})`}},UN=class extends SM{static[X]=`PgNumericNumberBuilder`;constructor(e,t,n){super(e,`number`,`PgNumericNumber`),this.config.precision=t,this.config.scale=n}build(e){return new WN(e,this.config)}},WN=class extends CM{static[X]=`PgNumericNumber`;precision;scale;constructor(e,t){super(e,t),this.precision=t.precision,this.scale=t.scale}mapFromDriverValue(e){return typeof e==`number`?e:Number(e)}mapToDriverValue=String;getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?`numeric`:`numeric(${this.precision})`}},GN=class extends SM{static[X]=`PgNumericBigIntBuilder`;constructor(e,t,n){super(e,`bigint`,`PgNumericBigInt`),this.config.precision=t,this.config.scale=n}build(e){return new KN(e,this.config)}},KN=class extends CM{static[X]=`PgNumericBigInt`;precision;scale;constructor(e,t){super(e,t),this.precision=t.precision,this.scale=t.scale}mapFromDriverValue=BigInt;mapToDriverValue=String;getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?`numeric`:`numeric(${this.precision})`}},qN=class extends MN{constructor(e,t,n){super(e,`string`,`PgTime`),this.withTimezone=t,this.precision=n,this.config.withTimezone=t,this.config.precision=n}static[X]=`PgTimeBuilder`;build(e){return new JN(e,this.config)}},JN=class extends CM{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`:``}`}},YN=class extends MN{static[X]=`PgTimestampBuilder`;constructor(e,t,n){super(e,`date`,`PgTimestamp`),this.config.withTimezone=t,this.config.precision=n}build(e){return new XN(e,this.config)}},XN=class extends CM{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()},ZN=class extends MN{static[X]=`PgTimestampStringBuilder`;constructor(e,t,n){super(e,`string`,`PgTimestampString`),this.config.withTimezone=t,this.config.precision=n}build(e){return new QN(e,this.config)}},QN=class extends CM{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`:``}`}},$N=class extends SM{static[X]=`PgUUIDBuilder`;constructor(e){super(e,`string`,`PgUUID`)}defaultRandom(){return this.default($`gen_random_uuid()`)}build(e){return new eP(e,this.config)}},eP=class extends CM{static[X]=`PgUUID`;getSQLType(){return`uuid`}};const tP=Symbol.for(`drizzle:PgInlineForeignKeys`),nP=Symbol.for(`drizzle:EnableRLS`);var rP=class extends Q{static[X]=`PgTable`;static Symbol=Object.assign({},Q.Symbol,{InlineForeignKeys:tP,EnableRLS:nP});[tP]=[];[nP]=!1;[Q.Symbol.ExtraConfigBuilder]=void 0;[Q.Symbol.ExtraConfigColumns]={}},iP=class{static[X]=`PgPrimaryKeyBuilder`;columns;name;constructor(e,t){this.columns=e,this.name=t}build(e){return new aP(e,this.columns,this.name)}},aP=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[rP.Symbol.Name]}_${this.columns.map(e=>e.name).join(`_`)}_pk`}};function oP(e,t){return rN(t)&&!QM(e)&&!Z(e,sN)&&!Z(e,cN)&&!Z(e,cM)&&!Z(e,Q)&&!Z(e,dN)?new sN(e,t):e}const sP=(e,t)=>$`${e} = ${oP(t,e)}`,cP=(e,t)=>$`${e} <> ${oP(t,e)}`;function lP(...e){let t=e.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new tN(t):new tN([new eN(`(`),$.join(t,new eN(` and `)),new eN(`)`)])}function uP(...e){let t=e.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new tN(t):new tN([new eN(`(`),$.join(t,new eN(` or `)),new eN(`)`)])}function dP(e){return $`not ${e}`}const fP=(e,t)=>$`${e} > ${oP(t,e)}`,pP=(e,t)=>$`${e} >= ${oP(t,e)}`,mP=(e,t)=>$`${e} < ${oP(t,e)}`,hP=(e,t)=>$`${e} <= ${oP(t,e)}`;function gP(e,t){return Array.isArray(t)?t.length===0?$`false`:$`${e} in ${t.map(t=>oP(t,e))}`:$`${e} in ${oP(t,e)}`}function _P(e,t){return Array.isArray(t)?t.length===0?$`true`:$`${e} not in ${t.map(t=>oP(t,e))}`:$`${e} not in ${oP(t,e)}`}function vP(e){return $`${e} is null`}function yP(e){return $`${e} is not null`}function bP(e){return $`exists ${e}`}function xP(e){return $`not exists ${e}`}function SP(e,t,n){return $`${e} between ${oP(t,e)} and ${oP(n,e)}`}function CP(e,t,n){return $`${e} not between ${oP(t,e)} and ${oP(n,e)}`}function wP(e,t){return $`${e} like ${t}`}function TP(e,t){return $`${e} not like ${t}`}function EP(e,t){return $`${e} ilike ${t}`}function DP(e,t){return $`${e} not ilike ${t}`}function OP(e){return $`${e} asc`}function kP(e){return $`${e} desc`}var AP=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},jP=class{constructor(e,t){this.table=e,this.config=t}static[X]=`Relations`},MP=class e extends AP{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}},NP=class e extends AP{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 PP(){return{and:lP,between:SP,eq:sP,exists:bP,gt:fP,gte:pP,ilike:EP,inArray:gP,isNull:vP,isNotNull:yP,like:wP,lt:mP,lte:hP,ne:cP,not:dP,notBetween:CP,notExists:xP,notLike:TP,notIlike:DP,notInArray:_P,or:uP,sql:$}}function FP(){return{sql:$,asc:OP,desc:kP}}function IP(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=XM(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,iP)&&i[a].primaryKey.push(...e.columns)}else if(Z(o,jP)){let e=XM(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 LP(e){return function(t,n){return new MP(e,t,n,n?.fields.reduce((e,t)=>e&&t.notNull,!0)??!1)}}function RP(e){return function(t,n){return new NP(e,t,n)}}function zP(e,t,n){if(Z(n,MP)&&n.config)return{fields:n.config.fields,references:n.config.references};let r=t[XM(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[XM(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],MP)&&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 BP(e){return{one:LP(e),many:RP(e)}}function VP(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,MP)?l&&VP(e,e[s.relationTableTsKey],l,s.selection,i):l.map(t=>VP(e,e[s.relationTableTsKey],t,s.selection,i))}else{let e=i(n[o]),t=s.field,r;r=Z(t,cM)?t:Z(t,tN)?t.decoder:t.sql.decoder,a[s.tsKey]=e===null?null:r.mapFromDriverValue(e)}return a}var HP=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===BM)return{...t[BM],selectedFields:new Proxy(t[BM].selectedFields,this)};if(typeof n==`symbol`)return t[n];let r=Z(t,PM)?t._.selectedFields:Z(t,dN)?t[BM].selectedFields:t,i=r[n];if(Z(i,tN.Aliased)){if(this.config.sqlAliasedBehavior===`sql`&&!i.isSelectionField)return i.sql;let e=i.clone();return e.isSelectionField=!0,e}if(Z(i,tN)){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,cM)?this.config.alias?new Proxy(i,new fN(new Proxy(i.table,new pN(this.config.alias,this.config.replaceOriginalName??!1)))):i:typeof i!=`object`||!i?i:new Proxy(i,new e(this.config))}};function UP(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 WP(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 GP(e){return e}var KP=class{static[X]=`CasingCache`;cache={};cachedTables={};convert;constructor(e){this.convert=e===`snake_case`?UP:e===`camelCase`?WP:GP}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={}}},qP=class extends dN{static[X]=`PgViewBase`},JP=class{static[X]=`PgDialect`;casing;constructor(e){this.casing=new KP(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=$` +\0`,M+=r(k,2),M+=m.magic,M+=r(d,2),M+=r(f,2),M+=r(O.crc32,4),M+=r(O.compressedSize,4),M+=r(O.uncompressedSize,4),M+=r(g.length,2),M+=r(C.length,2),{fileRecord:l.LOCAL_FILE_HEADER+M+g+C,dirRecord:l.CENTRAL_FILE_HEADER+r(j,2)+M+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,j=4;function M(e,t){return e.msg=c[t],t}function ee(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 ne(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,N(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,ne(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-T&&(ne(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(ne(e,!0),e.strm.avail_out===0?A:j):(e.strstart>e.block_start&&(ne(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)),N(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)),N(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)),N(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&&N(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(N(e),e.avail_out===0)return i.last_flush=-1,d}else if(e.avail_in===0&&ee(t)<=ee(n)&&t!==u)return M(e,-5);if(i.status===666&&e.avail_in!==0)return M(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&&(ne(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(ne(e,!0),e.strm.avail_out===0?A:j):e.last_lit&&(ne(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&&(ne(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(ne(e,!0),e.strm.avail_out===0?A:j):e.last_lit&&(ne(e,!1),e.strm.avail_out===0)?O:k}(i,t):r[i.level].func(i,t);if(m!==A&&m!==j||(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&&(te(i.head),i.lookahead===0&&(i.strstart=0,i.block_start=0,i.insert=0))),N(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)),N(e),0=n.w_size&&(s===0&&(te(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,N=8+(15&(b>>>=4)),n.wbits===0)n.wbits=N;else if(N>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&&(N=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,N)),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;N=p[g+ E++],n.head&&N&&n.length<65536&&(n.head.name+=String.fromCharCode(N)),N&&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},ne=s(0,n.lens,0,19,n.lencode,0,n.work,P),n.lenbits=P.bits,ne){e.msg=`invalid code lengths set`,n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have>>16&255,j=65535&ie,!((k=ie>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>>=k,x-=k,n.lens[n.have++]=j;else{if(j===16){for(re=k+2;x>>=k,x-=k,n.have===0){e.msg=`invalid bit length repeat`,n.mode=30;break}N=n.lens[n.have-1],E=3+(3&b),b>>>=2,x-=2}else if(j===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++]=N}}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},ne=s(c,n.lens,0,n.nlen,n.lencode,0,n.work,P),n.lenbits=P.bits,ne){e.msg=`invalid literal/lengths set`,n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,P={bits:n.distbits},ne=s(l,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,P),n.distbits=P.bits,ne){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,j=65535&ie,!((k=ie>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>M)])>>>16&255,j=65535&ie,!(M+(k=ie>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>>=M,x-=M,n.back+=M}if(b>>>=k,x-=k,n.back+=k,n.length=j,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,j=65535&ie,!((k=ie>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>M)])>>>16&255,j=65535&ie,!(M+(k=ie>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>>=M,x-=M,n.back+=M}if(b>>>=k,x-=k,n.back+=k,64&A){e.msg=`invalid distance code`,n.mode=30;break}n.offset=j,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]],ee[te+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?M=0:(M&=p-1,M+=p),w++,--N[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*ne(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)})}),dp=Ve(up());gl.zipReader=(e,t)=>dp.default.loadAsync(e);const fp=gl.createSettings;gl.createSettings=async e=>{let t=Object.keys(e.files);return t.find(e=>pp(e))?fp(e):gp(t)};function pp(e){return e.endsWith(`model3.json`)}function mp(e){return e.endsWith(`.moc3`)}function hp(e){return e.split(/[\\/]/).pop()}function gp(e){let t=e.filter(e=>mp(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=hp(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 vl({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}gl.readText=(e,t)=>{let n=e.file(t);if(!n)throw Error(`Cannot find file: ${t}`);return n.async(`text`)},gl.getFilePaths=e=>{let t=[];return e.forEach(e=>t.push(e)),Promise.resolve(t)},gl.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 _p=se({__name:`Live2D`,props:{paused:{type:Boolean,default:!1},mouthOpenSize:{default:0},focusAt:{default:()=>({x:0,y:0})},xOffset:{},yOffset:{},scale:{default:1}},setup(e){return(e,t)=>(me(),P(te,{relative:``},{default:le(({width:t,height:n})=>[fe(Ol,{width:t,height:n,resolution:2,"max-h":`100dvh`},{default:le(({app:r})=>[fe(lp,{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},null,8,[`app`,`mouth-open-size`,`width`,`height`,`paused`,`focus-at`,`x-offset`,`y-offset`,`scale`])]),_:2},1032,[`width`,`height`])]),_:1}))}}),vp=_p;function yp(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 bp(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 L(e){return this instanceof L?(this.v=e,this):new L(e)}function xp(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 L?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 Sp(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:L(e[r](t)),done:!1}:i?i(t):t}:i}}function Cp(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof bp==`function`?bp(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 wp=new TextDecoder(`utf-8`),Tp=e=>wp.decode(e),Ep=new TextEncoder,Dp=e=>Ep.encode(e),Op=e=>typeof e==`number`,kp=e=>typeof e==`boolean`,Ap=e=>typeof e==`function`,jp=e=>e!=null&&Object(e)===e,Mp=e=>jp(e)&&Ap(e.then),Np=e=>jp(e)&&Ap(e[Symbol.iterator]),Pp=e=>jp(e)&&Ap(e[Symbol.asyncIterator]),Fp=e=>jp(e)&&jp(e.schema),Ip=e=>jp(e)&&`done`in e&&`value`in e,Lp=e=>jp(e)&&Ap(e.stat)&&Op(e.fd),Rp=e=>jp(e)&&Vp(e.body),zp=e=>`_getDOMStream`in e&&`_getNodeStream`in e,Bp=e=>jp(e)&&Ap(e.abort)&&Ap(e.getWriter)&&!zp(e),Vp=e=>jp(e)&&Ap(e.cancel)&&Ap(e.getReader)&&!zp(e),Hp=e=>jp(e)&&Ap(e.end)&&Ap(e.write)&&kp(e.writable)&&!zp(e),Up=e=>jp(e)&&Ap(e.read)&&Ap(e.pipe)&&kp(e.readable)&&!zp(e),Wp=e=>jp(e)&&Ap(e.clear)&&Ap(e.bytes)&&Ap(e.position)&&Ap(e.setPosition)&&Ap(e.capacity)&&Ap(e.getBufferIdentifier)&&Ap(e.createLong),Gp=typeof SharedArrayBuffer<`u`?SharedArrayBuffer:ArrayBuffer;function Kp(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;++cYp(Int32Array,e),Zp=e=>Yp(BigInt64Array,e),Qp=e=>Yp(Uint8Array,e),$p=e=>(e.next(),e);function*em(e,t){let n=function*(e){yield e},r=typeof t==`string`||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Gp?n(t):Np(t)?t:n(t);return yield*$p(function*(t){let n=null;do n=t.next(yield Yp(e,n));while(!n.done)}(r[Symbol.iterator]())),new e}const tm=e=>em(Uint8Array,e);function nm(e,t){return xp(this,arguments,function*(){if(Mp(t))return yield L(yield L(yield*Sp(Cp(nm(e,yield L(t))))));let n=function(e){return xp(this,arguments,function*(){yield yield L(yield L(e))})},r=function(e){return xp(this,arguments,function*(){yield L(yield*Sp(Cp($p(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 Gp?n(t):Np(t)?r(t):Pp(t)?t:n(t);return yield L(yield*Sp(Cp($p(function(t){return xp(this,arguments,function*(){let n=null;do n=yield L(t.next(yield yield L(Yp(e,n))));while(!n.done)})}(i[Symbol.asyncIterator]()))))),yield L(new e)})}const rm=e=>nm(Uint8Array,e);function im(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*cm(e){let t,n=!1,r=[],i,a,o,s=0;function c(){return a===`peek`?Jp(r,o)[0]:([i,r,s]=Jp(r,o),i)}({cmd:a,size:o}=(yield(()=>null)())||{cmd:`read`,size:0});let l=tm(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=rm(e)[Symbol.asyncIterator]();try{do if({done:t,value:i}=Number.isNaN(o-s)?yield L(l.next()):yield L(l.next(o-s)),!t&&i.byteLength>0&&(r.push(i),s+=i.byteLength),t||o<=s)do({cmd:a,size:o}=yield yield L(c()));while(onull)()))||{cmd:`read`,size:0});let l=new dm(e);try{do if({done:t,value:i}=Number.isNaN(o-s)?yield L(l.read()):yield L(l.read(o-s)),!t&&i.byteLength>0&&(r.push(Qp(i)),s+=i.byteLength),t||o<=s)do({cmd:a,size:o}=yield yield L(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 yp(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 yp(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=Qp(t)),t})}};const fm=(e,t)=>{let n=e=>r([t,e]),r;return[t,n,new Promise(i=>(r=i)&&e.once(t,n))]};function pm(e){return xp(this,arguments,function*(){let t=[],n=`error`,r=!1,i=null,a,o,s=0,c=[],l;function u(){return a===`peek`?Jp(c,o)[0]:([l,c,s]=Jp(c,o),l)}if({cmd:a,size:o}=(yield yield L((()=>null)()))||{cmd:`read`,size:0},e.isTTY)return yield yield L(new Uint8Array),yield L(null);try{t[0]=fm(e,`end`),t[1]=fm(e,`error`);do{if(t[2]=fm(e,`readable`),[n,i]=yield L(Promise.race(t.map(e=>e[2]))),n===`error`)break;if((r=n===`end`)||(Number.isFinite(o-s)?(l=Qp(e.read(o-s)),l.byteLength0&&(c.push(l),s+=l.byteLength)),r||o<=s)do({cmd:a,size:o}=yield yield L(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 mm;(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`})(mm||={});var hm;(function(e){e[e.Sparse=0]=`Sparse`,e[e.Dense=1]=`Dense`})(hm||={});var gm;(function(e){e[e.HALF=0]=`HALF`,e[e.SINGLE=1]=`SINGLE`,e[e.DOUBLE=2]=`DOUBLE`})(gm||={});var _m;(function(e){e[e.DAY=0]=`DAY`,e[e.MILLISECOND=1]=`MILLISECOND`})(_m||={});var vm;(function(e){e[e.SECOND=0]=`SECOND`,e[e.MILLISECOND=1]=`MILLISECOND`,e[e.MICROSECOND=2]=`MICROSECOND`,e[e.NANOSECOND=3]=`NANOSECOND`})(vm||={});var ym;(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`})(ym||={});const bm=2,xm=4,Sm=4,Cm=4,wm=new Int32Array(2),Tm=new Float32Array(wm.buffer),Em=new Float64Array(wm.buffer),Dm=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var Om;(function(e){e[e.UTF8_BYTES=1]=`UTF8_BYTES`,e[e.UTF16_STRING=2]=`UTF16_STRING`})(Om||={});var km=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){Tm[0]=t,this.writeInt32(e,wm[0])}writeFloat64(e,t){Em[0]=t,this.writeInt32(e,wm[Dm?0:1]),this.writeInt32(e+4,wm[Dm?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)*bm;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,xm+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)}},sh=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()+Cm),(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)}},ch;(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`})(ch||={});var lh=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()+Cm),(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):ch.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 Vm).__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 Hm).__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,ch.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}},uh=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()+Cm),(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):Rm.Little}fields(e,t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new lh).__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 Hm).__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,Rm.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)}},dh;(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`})(dh||={});var R;(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`})(R||={});var fh;(function(e){e[e.OFFSET=0]=`OFFSET`,e[e.DATA=1]=`DATA`,e[e.VALIDITY=2]=`VALIDITY`,e[e.TYPE=3]=`TYPE`})(fh||={});const ph=void 0;function mh(e){if(e===null)return`null`;if(e===ph)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=>mh(e))}]`:`[${e}]`:ArrayBuffer.isView(e)?`[${e}]`:JSON.stringify(e,(e,t)=>typeof t==`bigint`?`${t}`:t)}function hh(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 gh(e,t){return hh(e/t)+hh(e%t)/hh(t)}const _h=Symbol.for(`isArrowBigNum`);function vh(e,...t){return t.length===0?Object.setPrototypeOf(Yp(this.TypedArray,e),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(e,...t),this.constructor.prototype)}vh.prototype[_h]=!0,vh.prototype.toJSON=function(){return`"${Th(this)}"`},vh.prototype.valueOf=function(e){return wh(this,e)},vh.prototype.toString=function(){return Th(this)},vh.prototype[Symbol.toPrimitive]=function(e=`default`){switch(e){case`number`:return wh(this);case`string`:return Th(this);case`default`:return Eh(this)}return Th(this)};function yh(...e){return vh.apply(this,e)}function bh(...e){return vh.apply(this,e)}function xh(...e){return vh.apply(this,e)}Object.setPrototypeOf(yh.prototype,Object.create(Int32Array.prototype)),Object.setPrototypeOf(bh.prototype,Object.create(Uint32Array.prototype)),Object.setPrototypeOf(xh.prototype,Object.create(Uint32Array.prototype)),Object.assign(yh.prototype,vh.prototype,{constructor:yh,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array}),Object.assign(bh.prototype,vh.prototype,{constructor:bh,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array}),Object.assign(xh.prototype,vh.prototype,{constructor:xh,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});const Sh=BigInt(4294967296)*BigInt(4294967296),Ch=Sh-BigInt(1);function wh(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 Dh(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`))(z.prototype);var Zh=class extends z{constructor(){super(R.Null)}toString(){return`Null`}};Ah=Symbol.toStringTag,Zh[Ah]=(e=>e[Symbol.toStringTag]=`Null`)(Zh.prototype);var Qh=class extends z{constructor(e,t){super(R.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}`}};jh=Symbol.toStringTag,Qh[jh]=(e=>(e.isSigned=null,e.bitWidth=null,e[Symbol.toStringTag]=`Int`))(Qh.prototype);var $h=class extends Qh{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},eg=class extends Qh{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},tg=class extends Qh{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},ng=class extends Qh{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},rg=class extends Qh{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},ig=class extends Qh{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},ag=class extends Qh{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},og=class extends Qh{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty($h.prototype,`ArrayType`,{value:Int8Array}),Object.defineProperty(eg.prototype,`ArrayType`,{value:Int16Array}),Object.defineProperty(tg.prototype,`ArrayType`,{value:Int32Array}),Object.defineProperty(ng.prototype,`ArrayType`,{value:BigInt64Array}),Object.defineProperty(rg.prototype,`ArrayType`,{value:Uint8Array}),Object.defineProperty(ig.prototype,`ArrayType`,{value:Uint16Array}),Object.defineProperty(ag.prototype,`ArrayType`,{value:Uint32Array}),Object.defineProperty(og.prototype,`ArrayType`,{value:BigUint64Array});var sg=class extends z{constructor(e){super(R.Float),this.precision=e}get ArrayType(){switch(this.precision){case gm.HALF:return Uint16Array;case gm.SINGLE:return Float32Array;case gm.DOUBLE:return Float64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};Mh=Symbol.toStringTag,sg[Mh]=(e=>(e.precision=null,e[Symbol.toStringTag]=`Float`))(sg.prototype);var cg=class extends sg{constructor(){super(gm.HALF)}},lg=class extends sg{constructor(){super(gm.SINGLE)}},ug=class extends sg{constructor(){super(gm.DOUBLE)}};Object.defineProperty(cg.prototype,`ArrayType`,{value:Uint16Array}),Object.defineProperty(lg.prototype,`ArrayType`,{value:Float32Array}),Object.defineProperty(ug.prototype,`ArrayType`,{value:Float64Array});var dg=class extends z{constructor(){super(R.Binary)}toString(){return`Binary`}};Nh=Symbol.toStringTag,dg[Nh]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Binary`))(dg.prototype);var fg=class extends z{constructor(){super(R.LargeBinary)}toString(){return`LargeBinary`}};Ph=Symbol.toStringTag,fg[Ph]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]=`LargeBinary`))(fg.prototype);var pg=class extends z{constructor(){super(R.Utf8)}toString(){return`Utf8`}};Fh=Symbol.toStringTag,pg[Fh]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Utf8`))(pg.prototype);var mg=class extends z{constructor(){super(R.LargeUtf8)}toString(){return`LargeUtf8`}};Ih=Symbol.toStringTag,mg[Ih]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]=`LargeUtf8`))(mg.prototype);var hg=class extends z{constructor(){super(R.Bool)}toString(){return`Bool`}};Lh=Symbol.toStringTag,hg[Lh]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Bool`))(hg.prototype);var gg=class extends z{constructor(e,t,n=128){super(R.Decimal),this.scale=e,this.precision=t,this.bitWidth=n}toString(){return`Decimal[${this.precision}e${this.scale>0?`+`:``}${this.scale}]`}};Rh=Symbol.toStringTag,gg[Rh]=(e=>(e.scale=null,e.precision=null,e.ArrayType=Uint32Array,e[Symbol.toStringTag]=`Decimal`))(gg.prototype);var _g=class extends z{constructor(e){super(R.Date),this.unit=e}toString(){return`Date${(this.unit+1)*32}<${_m[this.unit]}>`}get ArrayType(){return this.unit===_m.DAY?Int32Array:BigInt64Array}};zh=Symbol.toStringTag,_g[zh]=(e=>(e.unit=null,e[Symbol.toStringTag]=`Date`))(_g.prototype);var vg=class extends z{constructor(e,t){super(R.Time),this.unit=e,this.bitWidth=t}toString(){return`Time${this.bitWidth}<${vm[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};Bh=Symbol.toStringTag,vg[Bh]=(e=>(e.unit=null,e.bitWidth=null,e[Symbol.toStringTag]=`Time`))(vg.prototype);var yg=class extends z{constructor(e,t){super(R.Timestamp),this.unit=e,this.timezone=t}toString(){return`Timestamp<${vm[this.unit]}${this.timezone?`, ${this.timezone}`:``}>`}};Vh=Symbol.toStringTag,yg[Vh]=(e=>(e.unit=null,e.timezone=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]=`Timestamp`))(yg.prototype);var bg=class extends z{constructor(e){super(R.Interval),this.unit=e}toString(){return`Interval<${ym[this.unit]}>`}};Hh=Symbol.toStringTag,bg[Hh]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]=`Interval`))(bg.prototype);var xg=class extends z{constructor(e){super(R.Duration),this.unit=e}toString(){return`Duration<${vm[this.unit]}>`}};Uh=Symbol.toStringTag,xg[Uh]=(e=>(e.unit=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]=`Duration`))(xg.prototype);var Sg=class extends z{constructor(e){super(R.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}};Wh=Symbol.toStringTag,Sg[Wh]=(e=>(e.children=null,e[Symbol.toStringTag]=`List`))(Sg.prototype);var Cg=class extends z{constructor(e){super(R.Struct),this.children=e}toString(){return`Struct<{${this.children.map(e=>`${e.name}:${e.type}`).join(`, `)}}>`}};Gh=Symbol.toStringTag,Cg[Gh]=(e=>(e.children=null,e[Symbol.toStringTag]=`Struct`))(Cg.prototype);var wg=class extends z{constructor(e,t,n){super(R.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(` | `)}>`}};Kh=Symbol.toStringTag,wg[Kh]=(e=>(e.mode=null,e.typeIds=null,e.children=null,e.typeIdToChildIndex=null,e.ArrayType=Int8Array,e[Symbol.toStringTag]=`Union`))(wg.prototype);var Tg=class extends z{constructor(e){super(R.FixedSizeBinary),this.byteWidth=e}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};qh=Symbol.toStringTag,Tg[qh]=(e=>(e.byteWidth=null,e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`FixedSizeBinary`))(Tg.prototype);var Eg=class extends z{constructor(e,t){super(R.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}>`}};Jh=Symbol.toStringTag,Eg[Jh]=(e=>(e.children=null,e.listSize=null,e[Symbol.toStringTag]=`FixedSizeList`))(Eg.prototype);var Dg=class extends z{constructor(e,t=!1){var n,r,i;if(super(R.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(`, `)}}>`}};Yh=Symbol.toStringTag,Dg[Yh]=(e=>(e.children=null,e.keysSorted=null,e[Symbol.toStringTag]=`Map_`))(Dg.prototype);const Og=(e=>()=>++e)(-1);var kg=class extends z{constructor(e,t,n,r){super(R.Dictionary),this.indices=t,this.dictionary=e,this.isOrdered=r||!1,this.id=n==null?Og():hh(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}>`}};Xh=Symbol.toStringTag,kg[Xh]=(e=>(e.id=null,e.indices=null,e.isOrdered=null,e.dictionary=null,e[Symbol.toStringTag]=`Dictionary`))(kg.prototype);function Ag(e){let t=e;switch(e.typeId){case R.Decimal:return e.bitWidth/32;case R.Interval:return 1+t.unit;case R.FixedSizeList:return t.listSize;case R.FixedSizeBinary:return t.byteWidth;default:return 1}}var jg=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 Mg(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 Mg(e,t,n=!0){return typeof t==`number`?Ng(e,t,n):typeof t==`string`&&t in R?Ng(e,R[t],n):t&&t instanceof z?Ng(e,Pg(t),n):t?.type&&t.type instanceof z?Ng(e,Pg(t.type),n):Ng(e,R.NONE,n)}function Ng(e,t,n=!0){let r=null;switch(t){case R.Null:r=e.visitNull;break;case R.Bool:r=e.visitBool;break;case R.Int:r=e.visitInt;break;case R.Int8:r=e.visitInt8||e.visitInt;break;case R.Int16:r=e.visitInt16||e.visitInt;break;case R.Int32:r=e.visitInt32||e.visitInt;break;case R.Int64:r=e.visitInt64||e.visitInt;break;case R.Uint8:r=e.visitUint8||e.visitInt;break;case R.Uint16:r=e.visitUint16||e.visitInt;break;case R.Uint32:r=e.visitUint32||e.visitInt;break;case R.Uint64:r=e.visitUint64||e.visitInt;break;case R.Float:r=e.visitFloat;break;case R.Float16:r=e.visitFloat16||e.visitFloat;break;case R.Float32:r=e.visitFloat32||e.visitFloat;break;case R.Float64:r=e.visitFloat64||e.visitFloat;break;case R.Utf8:r=e.visitUtf8;break;case R.LargeUtf8:r=e.visitLargeUtf8;break;case R.Binary:r=e.visitBinary;break;case R.LargeBinary:r=e.visitLargeBinary;break;case R.FixedSizeBinary:r=e.visitFixedSizeBinary;break;case R.Date:r=e.visitDate;break;case R.DateDay:r=e.visitDateDay||e.visitDate;break;case R.DateMillisecond:r=e.visitDateMillisecond||e.visitDate;break;case R.Timestamp:r=e.visitTimestamp;break;case R.TimestampSecond:r=e.visitTimestampSecond||e.visitTimestamp;break;case R.TimestampMillisecond:r=e.visitTimestampMillisecond||e.visitTimestamp;break;case R.TimestampMicrosecond:r=e.visitTimestampMicrosecond||e.visitTimestamp;break;case R.TimestampNanosecond:r=e.visitTimestampNanosecond||e.visitTimestamp;break;case R.Time:r=e.visitTime;break;case R.TimeSecond:r=e.visitTimeSecond||e.visitTime;break;case R.TimeMillisecond:r=e.visitTimeMillisecond||e.visitTime;break;case R.TimeMicrosecond:r=e.visitTimeMicrosecond||e.visitTime;break;case R.TimeNanosecond:r=e.visitTimeNanosecond||e.visitTime;break;case R.Decimal:r=e.visitDecimal;break;case R.List:r=e.visitList;break;case R.Struct:r=e.visitStruct;break;case R.Union:r=e.visitUnion;break;case R.DenseUnion:r=e.visitDenseUnion||e.visitUnion;break;case R.SparseUnion:r=e.visitSparseUnion||e.visitUnion;break;case R.Dictionary:r=e.visitDictionary;break;case R.Interval:r=e.visitInterval;break;case R.IntervalDayTime:r=e.visitIntervalDayTime||e.visitInterval;break;case R.IntervalYearMonth:r=e.visitIntervalYearMonth||e.visitInterval;break;case R.Duration:r=e.visitDuration;break;case R.DurationSecond:r=e.visitDurationSecond||e.visitDuration;break;case R.DurationMillisecond:r=e.visitDurationMillisecond||e.visitDuration;break;case R.DurationMicrosecond:r=e.visitDurationMicrosecond||e.visitDuration;break;case R.DurationNanosecond:r=e.visitDurationNanosecond||e.visitDuration;break;case R.FixedSizeList:r=e.visitFixedSizeList;break;case R.Map:r=e.visitMap;break}if(typeof r==`function`)return r;if(!n)return()=>null;throw Error(`Unrecognized type '${R[t]}'`)}function Pg(e){switch(e.typeId){case R.Null:return R.Null;case R.Int:{let{bitWidth:t,isSigned:n}=e;switch(t){case 8:return n?R.Int8:R.Uint8;case 16:return n?R.Int16:R.Uint16;case 32:return n?R.Int32:R.Uint32;case 64:return n?R.Int64:R.Uint64}return R.Int}case R.Float:switch(e.precision){case gm.HALF:return R.Float16;case gm.SINGLE:return R.Float32;case gm.DOUBLE:return R.Float64}return R.Float;case R.Binary:return R.Binary;case R.LargeBinary:return R.LargeBinary;case R.Utf8:return R.Utf8;case R.LargeUtf8:return R.LargeUtf8;case R.Bool:return R.Bool;case R.Decimal:return R.Decimal;case R.Time:switch(e.unit){case vm.SECOND:return R.TimeSecond;case vm.MILLISECOND:return R.TimeMillisecond;case vm.MICROSECOND:return R.TimeMicrosecond;case vm.NANOSECOND:return R.TimeNanosecond}return R.Time;case R.Timestamp:switch(e.unit){case vm.SECOND:return R.TimestampSecond;case vm.MILLISECOND:return R.TimestampMillisecond;case vm.MICROSECOND:return R.TimestampMicrosecond;case vm.NANOSECOND:return R.TimestampNanosecond}return R.Timestamp;case R.Date:switch(e.unit){case _m.DAY:return R.DateDay;case _m.MILLISECOND:return R.DateMillisecond}return R.Date;case R.Interval:switch(e.unit){case ym.DAY_TIME:return R.IntervalDayTime;case ym.YEAR_MONTH:return R.IntervalYearMonth}return R.Interval;case R.Duration:switch(e.unit){case vm.SECOND:return R.DurationSecond;case vm.MILLISECOND:return R.DurationMillisecond;case vm.MICROSECOND:return R.DurationMicrosecond;case vm.NANOSECOND:return R.DurationNanosecond}return R.Duration;case R.Map:return R.Map;case R.List:return R.List;case R.Struct:return R.Struct;case R.Union:switch(e.mode){case hm.Dense:return R.DenseUnion;case hm.Sparse:return R.SparseUnion}return R.Union;case R.FixedSizeBinary:return R.FixedSizeBinary;case R.FixedSizeList:return R.FixedSizeList;case R.Dictionary:return R.Dictionary}throw Error(`Unrecognized type '${R[e.typeId]}'`)}jg.prototype.visitInt8=null,jg.prototype.visitInt16=null,jg.prototype.visitInt32=null,jg.prototype.visitInt64=null,jg.prototype.visitUint8=null,jg.prototype.visitUint16=null,jg.prototype.visitUint32=null,jg.prototype.visitUint64=null,jg.prototype.visitFloat16=null,jg.prototype.visitFloat32=null,jg.prototype.visitFloat64=null,jg.prototype.visitDateDay=null,jg.prototype.visitDateMillisecond=null,jg.prototype.visitTimestampSecond=null,jg.prototype.visitTimestampMillisecond=null,jg.prototype.visitTimestampMicrosecond=null,jg.prototype.visitTimestampNanosecond=null,jg.prototype.visitTimeSecond=null,jg.prototype.visitTimeMillisecond=null,jg.prototype.visitTimeMicrosecond=null,jg.prototype.visitTimeNanosecond=null,jg.prototype.visitDenseUnion=null,jg.prototype.visitSparseUnion=null,jg.prototype.visitIntervalDayTime=null,jg.prototype.visitIntervalYearMonth=null,jg.prototype.visitDuration=null,jg.prototype.visitDurationSecond=null,jg.prototype.visitDurationMillisecond=null,jg.prototype.visitDurationMicrosecond=null,jg.prototype.visitDurationNanosecond=null;const Fg=new Float64Array(1),Ig=new Uint32Array(Fg.buffer);function Lg(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 Rg(e){if(e!==e)return 32256;Fg[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 zg=class extends jg{};function Bg(e){return(t,n,r)=>{if(t.setValid(n,r!=null))return e(t,n,r)}}const Vg=(e,t,n)=>{e[t]=Math.floor(n/864e5)},Hg=(e,t,n,r)=>{if(n+1{let i=e+n;r?t[i>>3]|=1<>3]&=~(1<{e[t]=n},Gg=({values:e},t,n)=>{e[t]=n},Kg=({values:e},t,n)=>{e[t]=Rg(n)},qg=(e,t,n)=>{switch(e.type.precision){case gm.HALF:return Kg(e,t,n);case gm.SINGLE:case gm.DOUBLE:return Gg(e,t,n)}},Jg=({values:e},t,n)=>{Vg(e,t,n.valueOf())},Yg=({values:e},t,n)=>{e[t]=BigInt(n)},Xg=({stride:e,values:t},n,r)=>{t.set(r.subarray(0,e),e*n)},Zg=({values:e,valueOffsets:t},n,r)=>Hg(e,t,n,r),Qg=({values:e,valueOffsets:t},n,r)=>Hg(e,t,n,Dp(r)),$g=(e,t,n)=>{e.type.unit===_m.DAY?Jg(e,t,n):Yg(e,t,n)},e_=({values:e},t,n)=>{e[t]=BigInt(n/1e3)},t_=({values:e},t,n)=>{e[t]=BigInt(n)},n_=({values:e},t,n)=>{e[t]=BigInt(n*1e3)},r_=({values:e},t,n)=>{e[t]=BigInt(n*1e6)},i_=(e,t,n)=>{switch(e.type.unit){case vm.SECOND:return e_(e,t,n);case vm.MILLISECOND:return t_(e,t,n);case vm.MICROSECOND:return n_(e,t,n);case vm.NANOSECOND:return r_(e,t,n)}},a_=({values:e},t,n)=>{e[t]=n},o_=({values:e},t,n)=>{e[t]=n},s_=({values:e},t,n)=>{e[t]=n},c_=({values:e},t,n)=>{e[t]=n},l_=(e,t,n)=>{switch(e.type.unit){case vm.SECOND:return a_(e,t,n);case vm.MILLISECOND:return o_(e,t,n);case vm.MICROSECOND:return s_(e,t,n);case vm.NANOSECOND:return c_(e,t,n)}},u_=({values:e,stride:t},n,r)=>{e.set(r.subarray(0,t),t*n)},d_=(e,t,n)=>{let r=e.children[0],i=e.valueOffsets,a=j_.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=j_.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},p_=(e,t)=>(n,r,i,a)=>r&&n(r,e,t[a]),m_=(e,t)=>(n,r,i,a)=>r&&n(r,e,t.get(a)),h_=(e,t)=>(n,r,i,a)=>r&&n(r,e,t.get(i.name)),g_=(e,t)=>(n,r,i,a)=>r&&n(r,e,t[i.name]),__=(e,t,n)=>{let r=e.type.children.map(e=>j_.getVisitFn(e.type)),i=n instanceof Map?h_(t,n):n instanceof Dy?m_(t,n):Array.isArray(n)?p_(t,n):g_(t,n);e.type.children.forEach((t,n)=>i(r[n],e.children[n],t,n))},v_=(e,t,n)=>{e.type.mode===hm.Dense?y_(e,t,n):b_(e,t,n)},y_=(e,t,n)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];j_.visit(i,e.valueOffsets[t],n)},b_=(e,t,n)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];j_.visit(i,t,n)},x_=(e,t,n)=>{var r;(r=e.dictionary)==null||r.set(e.values[t],n)},S_=(e,t,n)=>{e.type.unit===ym.DAY_TIME?C_(e,t,n):w_(e,t,n)},C_=({values:e},t,n)=>{e.set(n.subarray(0,2),2*t)},w_=({values:e},t,n)=>{e[t]=n[0]*12+n[1]%12},T_=({values:e},t,n)=>{e[t]=n},E_=({values:e},t,n)=>{e[t]=n},D_=({values:e},t,n)=>{e[t]=n},O_=({values:e},t,n)=>{e[t]=n},k_=(e,t,n)=>{switch(e.type.unit){case vm.SECOND:return T_(e,t,n);case vm.MILLISECOND:return E_(e,t,n);case vm.MICROSECOND:return D_(e,t,n);case vm.NANOSECOND:return O_(e,t,n)}},A_=(e,t,n)=>{let{stride:r}=e,i=e.children[0],a=j_.getVisitFn(i);if(Array.isArray(n))for(let e=-1,o=t*r;++e`${mh(e)}: ${mh(t)}`).join(`, `)}}`}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.toString()}[Symbol.iterator](){return new F_(this[M_],this[N_])}},F_=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[M_].type.children.findIndex(e=>e.name===t)!==-1}getOwnPropertyDescriptor(e,t){if(e[M_].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[M_].type.children.findIndex(e=>e.name===t);if(n!==-1){let r=Ev.visit(e[M_].children[n],e[N_]);return Reflect.set(e,t,r),r}}set(e,t,n){let r=e[M_].type.children.findIndex(e=>e.name===t);return r===-1?Reflect.has(e,t)||typeof t==`symbol`?Reflect.set(e,t,n):!1:(j_.visit(e[M_].children[r],e[N_],n),Reflect.set(e,t,n))}},B=class extends jg{};function L_(e){return(t,n)=>t.getValid(n)?e(t,n):null}const R_=(e,t)=>864e5*e[t],z_=(e,t)=>null,B_=(e,t,n)=>{if(n+1>=t.length)return null;let r=hh(t[n]),i=hh(t[n+1]);return e.subarray(r,i)},V_=({offset:e,values:t},n)=>{let r=e+n,i=t[r>>3];return(i&1<R_(e,t),U_=({values:e},t)=>hh(e[t]),W_=({stride:e,values:t},n)=>t[e*n],G_=({stride:e,values:t},n)=>Lg(t[e*n]),K_=({values:e},t)=>e[t],q_=({stride:e,values:t},n)=>t.subarray(e*n,e*(n+1)),J_=({values:e,valueOffsets:t},n)=>B_(e,t,n),Y_=({values:e,valueOffsets:t},n)=>{let r=B_(e,t,n);return r===null?null:Tp(r)},X_=({values:e},t)=>e[t],Z_=({type:e,values:t},n)=>e.precision===gm.HALF?Lg(t[n]):t[n],Q_=(e,t)=>e.type.unit===_m.DAY?H_(e,t):U_(e,t),$_=({values:e},t)=>1e3*hh(e[t]),ev=({values:e},t)=>hh(e[t]),tv=({values:e},t)=>gh(e[t],BigInt(1e3)),nv=({values:e},t)=>gh(e[t],BigInt(1e6)),rv=(e,t)=>{switch(e.type.unit){case vm.SECOND:return $_(e,t);case vm.MILLISECOND:return ev(e,t);case vm.MICROSECOND:return tv(e,t);case vm.NANOSECOND:return nv(e,t)}},iv=({values:e},t)=>e[t],av=({values:e},t)=>e[t],ov=({values:e},t)=>e[t],sv=({values:e},t)=>e[t],cv=(e,t)=>{switch(e.type.unit){case vm.SECOND:return iv(e,t);case vm.MILLISECOND:return av(e,t);case vm.MICROSECOND:return ov(e,t);case vm.NANOSECOND:return sv(e,t)}},lv=({values:e,stride:t},n)=>Oh.decimal(e.subarray(t*n,t*(n+1))),uv=(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 Dy([c])},dv=(e,t)=>{let{valueOffsets:n,children:r}=e,{[t]:i,[t+1]:a}=n,o=r[0];return new jv(o.slice(i,a-i))},fv=(e,t)=>new P_(e,t),pv=(e,t)=>e.type.mode===hm.Dense?mv(e,t):hv(e,t),mv=(e,t)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return Ev.visit(r,e.valueOffsets[t])},hv=(e,t)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return Ev.visit(r,t)},gv=(e,t)=>{var n;return(n=e.dictionary)?.get(e.values[t])},_v=(e,t)=>e.type.unit===ym.DAY_TIME?vv(e,t):yv(e,t),vv=({values:e},t)=>e.subarray(2*t,2*(t+1)),yv=({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},bv=({values:e},t)=>e[t],xv=({values:e},t)=>e[t],Sv=({values:e},t)=>e[t],Cv=({values:e},t)=>e[t],wv=(e,t)=>{switch(e.type.unit){case vm.SECOND:return bv(e,t);case vm.MILLISECOND:return xv(e,t);case vm.MICROSECOND:return Sv(e,t);case vm.NANOSECOND:return Cv(e,t)}},Tv=(e,t)=>{let{stride:n,children:r}=e,i=r[0],a=i.slice(t*n,n);return new Dy([a])};B.prototype.visitNull=L_(z_),B.prototype.visitBool=L_(V_),B.prototype.visitInt=L_(X_),B.prototype.visitInt8=L_(W_),B.prototype.visitInt16=L_(W_),B.prototype.visitInt32=L_(W_),B.prototype.visitInt64=L_(K_),B.prototype.visitUint8=L_(W_),B.prototype.visitUint16=L_(W_),B.prototype.visitUint32=L_(W_),B.prototype.visitUint64=L_(K_),B.prototype.visitFloat=L_(Z_),B.prototype.visitFloat16=L_(G_),B.prototype.visitFloat32=L_(W_),B.prototype.visitFloat64=L_(W_),B.prototype.visitUtf8=L_(Y_),B.prototype.visitLargeUtf8=L_(Y_),B.prototype.visitBinary=L_(J_),B.prototype.visitLargeBinary=L_(J_),B.prototype.visitFixedSizeBinary=L_(q_),B.prototype.visitDate=L_(Q_),B.prototype.visitDateDay=L_(H_),B.prototype.visitDateMillisecond=L_(U_),B.prototype.visitTimestamp=L_(rv),B.prototype.visitTimestampSecond=L_($_),B.prototype.visitTimestampMillisecond=L_(ev),B.prototype.visitTimestampMicrosecond=L_(tv),B.prototype.visitTimestampNanosecond=L_(nv),B.prototype.visitTime=L_(cv),B.prototype.visitTimeSecond=L_(iv),B.prototype.visitTimeMillisecond=L_(av),B.prototype.visitTimeMicrosecond=L_(ov),B.prototype.visitTimeNanosecond=L_(sv),B.prototype.visitDecimal=L_(lv),B.prototype.visitList=L_(uv),B.prototype.visitStruct=L_(fv),B.prototype.visitUnion=L_(pv),B.prototype.visitDenseUnion=L_(mv),B.prototype.visitSparseUnion=L_(hv),B.prototype.visitDictionary=L_(gv),B.prototype.visitInterval=L_(_v),B.prototype.visitIntervalDayTime=L_(vv),B.prototype.visitIntervalYearMonth=L_(yv),B.prototype.visitDuration=L_(wv),B.prototype.visitDurationSecond=L_(bv),B.prototype.visitDurationMillisecond=L_(xv),B.prototype.visitDurationMicrosecond=L_(Sv),B.prototype.visitDurationNanosecond=L_(Cv),B.prototype.visitFixedSizeList=L_(Tv),B.prototype.visitMap=L_(dv);const Ev=new B,Dv=Symbol.for(`keys`),Ov=Symbol.for(`vals`),kv=Symbol.for(`kKeysAsStrings`),Av=Symbol.for(`_kKeysAsStrings`);var jv=class{constructor(e){return this[Dv]=new Dy([e.children[0]]).memoize(),this[Ov]=e.children[1],new Proxy(this,new Nv)}get[kv](){return this[Av]||(this[Av]=Array.from(this[Dv].toArray(),String))}[Symbol.iterator](){return new Mv(this[Dv],this[Ov])}get size(){return this[Dv].length}toArray(){return Object.values(this.toJSON())}toJSON(){let e=this[Dv],t=this[Ov],n={};for(let r=-1,i=e.length;++r`${mh(e)}: ${mh(t)}`).join(`, `)}}`}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.toString()}},Mv=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),Ev.visit(this.vals,e)]})}},Nv=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[kv]}has(e,t){return e[kv].includes(t)}getOwnPropertyDescriptor(e,t){let n=e[kv].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[kv].indexOf(t);if(n!==-1){let r=Ev.visit(Reflect.get(e,Ov),n);return Reflect.set(e,t,r),r}}set(e,t,n){let r=e[kv].indexOf(t);return r===-1?Reflect.has(e,t)?Reflect.set(e,t,n):!1:(j_.visit(Reflect.get(e,Ov),r,n),Reflect.set(e,t,n))}};Object.defineProperties(jv.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:`Row`},[Dv]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Ov]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Av]:{writable:!0,enumerable:!1,configurable:!1,value:null}});let Pv;function Fv(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,Lv=e=>e!==e;function Rv(e){let t=typeof e;if(t!==`object`||e===null)return Lv(e)?Lv: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?am(e,t):!1:e instanceof Map?Bv(e):Array.isArray(e)?zv(e):e instanceof Dy?Vv(e):Hv(e,!0)}function zv(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 Wv(e,n);case Map:return Kv(e,n,n.keys());case jv:case P_:case Object:case void 0:return Kv(e,n,t||Object.keys(n))}return n instanceof Dy?Gv(e,n):!1}}function Wv(e,t){let n=e.length;if(t.length!==n)return!1;for(let r=-1;++r>r}function Yv(e,t,n){let r=n.byteLength+7&-8;if(e>0||n.byteLength>3):Xv(new Zv(n,e,t,null,qv)).subarray(0,r)),i}return n}function Xv(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 Zv=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 Qv(e,t,i)+Qv(e,r,n)+$v(e,i>>3,r-i>>3)}function $v(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+=ey(a.getUint32(i)),i+=4;for(;o-i>=2;)r+=ey(a.getUint16(i)),i+=2;for(;o-i>=1;)r+=ey(a.getUint8(i)),i+=1;return r}function ey(e){let t=Math.trunc(e);return t-=t>>>1&1431655765,t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}const ty=-1;var ny=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 z.isSparseUnion(e)||z.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(z.isUnion(this.type))return this.children.reduce((e,t)=>e+t.nullCount,0);let e=this._nullCount,t;return e<=ty&&(t=this.nullBitmap)&&(this._nullCount=e=t.length===0?0:this.length-Qv(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=Ag(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(z.isUnion(t)){let n=t,r=this.children[n.typeIdToChildIndex[this.typeIds[e]]],i=n.mode===hm.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(Yv(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===R.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(Yv(this.offset,t,this.nullBitmap),0);let i=this.buffers;return i[fh.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[fh.TYPE])&&(a[fh.TYPE]=i.subarray(e,e+t)),(i=a[fh.OFFSET])&&(a[fh.OFFSET]=i.subarray(e,e+t+1))||(i=a[fh.DATA])&&(a[fh.DATA]=r===6?i:i.subarray(n*e,n*(e+t))),a}_sliceChildren(e,t,n){return e.map(e=>e.slice(t,n))}};ny.prototype.children=Object.freeze([]);var ry=class e extends jg{visit(e){return this.getVisitFn(e.type).call(this,e)}visitNull(e){let{type:t,offset:n=0,length:r=0}=e;return new ny(t,n,r,r)}visitBool(e){let{type:t,offset:n=0}=e,r=Qp(e.nullBitmap),i=Yp(t.ArrayType,e.data),{length:a=i.length>>3,nullCount:o=e.nullBitmap?-1:0}=e;return new ny(t,n,a,o,[void 0,i,r])}visitInt(e){let{type:t,offset:n=0}=e,r=Qp(e.nullBitmap),i=Yp(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new ny(t,n,a,o,[void 0,i,r])}visitFloat(e){let{type:t,offset:n=0}=e,r=Qp(e.nullBitmap),i=Yp(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new ny(t,n,a,o,[void 0,i,r])}visitUtf8(e){let{type:t,offset:n=0}=e,r=Qp(e.data),i=Qp(e.nullBitmap),a=Xp(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new ny(t,n,o,s,[a,r,i])}visitLargeUtf8(e){let{type:t,offset:n=0}=e,r=Qp(e.data),i=Qp(e.nullBitmap),a=Zp(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new ny(t,n,o,s,[a,r,i])}visitBinary(e){let{type:t,offset:n=0}=e,r=Qp(e.data),i=Qp(e.nullBitmap),a=Xp(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new ny(t,n,o,s,[a,r,i])}visitLargeBinary(e){let{type:t,offset:n=0}=e,r=Qp(e.data),i=Qp(e.nullBitmap),a=Zp(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new ny(t,n,o,s,[a,r,i])}visitFixedSizeBinary(e){let{type:t,offset:n=0}=e,r=Qp(e.nullBitmap),i=Yp(t.ArrayType,e.data),{length:a=i.length/Ag(t),nullCount:o=e.nullBitmap?-1:0}=e;return new ny(t,n,a,o,[void 0,i,r])}visitDate(e){let{type:t,offset:n=0}=e,r=Qp(e.nullBitmap),i=Yp(t.ArrayType,e.data),{length:a=i.length/Ag(t),nullCount:o=e.nullBitmap?-1:0}=e;return new ny(t,n,a,o,[void 0,i,r])}visitTimestamp(e){let{type:t,offset:n=0}=e,r=Qp(e.nullBitmap),i=Yp(t.ArrayType,e.data),{length:a=i.length/Ag(t),nullCount:o=e.nullBitmap?-1:0}=e;return new ny(t,n,a,o,[void 0,i,r])}visitTime(e){let{type:t,offset:n=0}=e,r=Qp(e.nullBitmap),i=Yp(t.ArrayType,e.data),{length:a=i.length/Ag(t),nullCount:o=e.nullBitmap?-1:0}=e;return new ny(t,n,a,o,[void 0,i,r])}visitDecimal(e){let{type:t,offset:n=0}=e,r=Qp(e.nullBitmap),i=Yp(t.ArrayType,e.data),{length:a=i.length/Ag(t),nullCount:o=e.nullBitmap?-1:0}=e;return new ny(t,n,a,o,[void 0,i,r])}visitList(e){let{type:t,offset:n=0,child:r}=e,i=Qp(e.nullBitmap),a=Xp(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new ny(t,n,o,s,[a,void 0,i],[r])}visitStruct(e){let{type:t,offset:n=0,children:r=[]}=e,i=Qp(e.nullBitmap),{length:a=r.reduce((e,{length:t})=>Math.max(e,t),0),nullCount:o=e.nullBitmap?-1:0}=e;return new ny(t,n,a,o,[void 0,void 0,i],r)}visitUnion(e){let{type:t,offset:n=0,children:r=[]}=e,i=Yp(t.ArrayType,e.typeIds),{length:a=i.length,nullCount:o=-1}=e;if(z.isSparseUnion(t))return new ny(t,n,a,o,[void 0,void 0,void 0,i],r);let s=Xp(e.valueOffsets);return new ny(t,n,a,o,[s,void 0,void 0,i],r)}visitDictionary(t){let{type:n,offset:r=0}=t,i=Qp(t.nullBitmap),a=Yp(n.indices.ArrayType,t.data),{dictionary:o=new Dy([new e().visit({type:n.dictionary})])}=t,{length:s=a.length,nullCount:c=t.nullBitmap?-1:0}=t;return new ny(n,r,s,c,[void 0,a,i],[],o)}visitInterval(e){let{type:t,offset:n=0}=e,r=Qp(e.nullBitmap),i=Yp(t.ArrayType,e.data),{length:a=i.length/Ag(t),nullCount:o=e.nullBitmap?-1:0}=e;return new ny(t,n,a,o,[void 0,i,r])}visitDuration(e){let{type:t,offset:n=0}=e,r=Qp(e.nullBitmap),i=Yp(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new ny(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=Qp(t.nullBitmap),{length:o=i.length/Ag(n),nullCount:s=t.nullBitmap?-1:0}=t;return new ny(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=Qp(t.nullBitmap),o=Xp(t.valueOffsets),{length:s=o.length-1,nullCount:c=t.nullBitmap?-1:0}=t;return new ny(n,r,s,c,[o,void 0,a],[i])}};const iy=new ry;function ay(e){return iy.visit(e)}var oy=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 cy(e){return e.reduce((e,t)=>e+t.nullCount,0)}function ly(e){return e.reduce((e,t,n)=>(e[n+1]=e[n]+t.length,e),new Uint32Array(e.length+1))}function uy(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 dy(e,t,n,r){let i=0,a=0,o=t.length-1;do{if(i>=o-1)return n0?0:-1}function _y(e,t){let{nullBitmap:n}=e;if(!n||e.nullCount<=0)return-1;let r=0;for(let i of new Zv(n,e.offset+(t||0),e.length,n,qv)){if(!i)return r;++r}return-1}function vy(e,t,n){if(t===void 0)return-1;if(t===null)switch(e.typeId){case R.Union:break;case R.Dictionary:break;default:return _y(e,n)}let r=Ev.getVisitFn(e),i=Rv(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 oy(e.data.length,t=>{let r=e.data[t],i=r.length,a=e.slice(n,n+i);return n+=i,new Sy(a)})}var Sy=class{constructor(e){this.vector=e,this.index=0}next(){return this.indexe.data):t;if(a.length===0||a.some(e=>!(e instanceof ny)))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}=Ty[o.typeId],r=a[0];this.isValid=e=>fy(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,Ey[o.typeId]),this._offsets=ly(a);break}this.data=a,this.type=o,this.stride=Ag(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 sy(this.data)}get nullCount(){return cy(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${R[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 Cy.visit(this)}concat(...t){return new e(this.data.concat(t.flatMap(e=>e.data).flat(1/0)))}slice(t,n){return new e(Fv(this,t,n,({data:e,_offsets:t},n,r)=>uy(e,t,n,r)))}toJSON(){return[...this]}toArray(){let{type:e,data:t,length:n,stride:r,ArrayType:i}=this;switch(e.typeId){case R.Int:case R.Float:case R.Decimal:case R.Time:case R.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 z.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(z.isDictionary(this.type)){let t=new Oy(this.data[0].dictionary),n=this.data.map(e=>{let n=e.clone();return n.dictionary=t,n});return new e(n)}return new Oy(this)}unmemoize(){if(z.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}};wy=Symbol.toStringTag,Dy[wy]=(e=>{e.type=z.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(R).map(e=>R[e]).filter(e=>typeof e==`number`&&e!==R.NONE);for(let n of t){let t=Ev.getVisitFnByTypeId(n),r=j_.getVisitFnByTypeId(n),i=by.getVisitFnByTypeId(n);Ty[n]={get:t,set:r,indexOf:i},Ey[n]=Object.create(e,{isValid:{value:py(fy)},get:{value:py(Ev.getVisitFnByTypeId(n))},set:{value:my(j_.getVisitFnByTypeId(n))},indexOf:{value:hy(by.getVisitFnByTypeId(n))}})}return`Vector`})(Dy.prototype);var Oy=class e extends Dy{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 Dy(this.data)}),Object.defineProperty(this,`memoize`,{value:()=>this})}},ky=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()}},Ay=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()+Cm),(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):mm.V1}schema(e){let t=this.bb.__offset(this.bb_pos,6);return t?(e||new uh).__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 ky).__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 ky).__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 Hm).__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,mm.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)}},jy=class e{constructor(e=[],t,n,r=mm.V5){this.fields=e||[],this.metadata=t||new Map,n||=Py(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=Py(a,new Map);return new e([...r,...a],i,new Map([...this.dictionaries,...o]))}};jy.prototype.fields=null,jy.prototype.metadata=null,jy.prototype.dictionaries=null;var My=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)}};My.prototype.type=null,My.prototype.name=null,My.prototype.nullable=null,My.prototype.metadata=null;function Ny(e,t){return new Map([...e||new Map,...t||new Map])}function Py(e,t=new Map){for(let n=-1,r=e.length;++n0&&Py(i.children,t)}return t}var Fy=Am,Iy=km,Ly=class{static decode(e){e=new Iy(Qp(e));let t=Ay.getRootAsFooter(e),n=jy.decode(t.schema(),new Map,t.version());return new Ry(n,t)}static encode(e){let t=new Fy,n=jy.encode(t,e.schema);Ay.startRecordBatchesVector(t,e.numRecordBatches);for(let n of[...e.recordBatches()].slice().reverse())zy.encode(t,n);let r=t.endVector();Ay.startDictionariesVector(t,e.numDictionaries);for(let n of[...e.dictionaryBatches()].slice().reverse())zy.encode(t,n);let i=t.endVector();return Ay.startFooter(t),Ay.addSchema(t,n),Ay.addVersion(t,mm.V5),Ay.addRecordBatches(t,r),Ay.addDictionaries(t,i),Ay.finishFooterBuffer(t,Ay.endFooter(t)),t.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(e,t=mm.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 yp(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(By);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(e){return om.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,e)}toNodeStream(e){return om.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,e)}throw(e){return yp(this,void 0,void 0,function*(){return yield this.abort(e),By})}return(e){return yp(this,void 0,void 0,function*(){return yield this.close(),By})}read(e){return yp(this,void 0,void 0,function*(){return(yield this.next(e,`read`)).value})}peek(e){return yp(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(By)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw Error(`AsyncQueue is closed`)}},Wy=class extends Uy{write(e){if((e=Qp(e)).byteLength>0)return super.write(e)}toString(e=!1){return e?Tp(this.toUint8Array(!0)):this.toUint8Array(!1).then(Tp)}toUint8Array(e=!1){return e?Jp(this._values)[0]:(()=>yp(this,void 0,void 0,function*(){var e,t,n,r;let i=[],a=0;try{for(var o=!0,s=Cp(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 Jp(i,a)[0]}))()}},Gy=class{constructor(e){e&&(this.source=new qy(om.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)}},Ky=class e{constructor(t){t instanceof e?this.source=t.source:t instanceof Wy?this.source=new Jy(om.fromAsyncIterable(t)):Up(t)?this.source=new Jy(om.fromNodeStream(t)):Vp(t)?this.source=new Jy(om.fromDOMStream(t)):Rp(t)?this.source=new Jy(om.fromDOMStream(t.body)):Np(t)?this.source=new Jy(om.fromIterable(t)):(Mp(t)||Pp(t))&&(this.source=new Jy(om.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)}},qy=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)||By)}return(e){return Object.create(this.source.return&&this.source.return(e)||By)}},Jy=class{constructor(e){this.source=e,this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}cancel(e){return yp(this,void 0,void 0,function*(){yield this.return(e)})}get closed(){return this._closedPromise}read(e){return yp(this,void 0,void 0,function*(){return(yield this.next(e,`read`)).value})}peek(e){return yp(this,void 0,void 0,function*(){return(yield this.next(e,`peek`)).value})}next(e){return yp(this,arguments,void 0,function*(e,t=`read`){return yield this.source.next({cmd:t,size:e})})}throw(e){return yp(this,void 0,void 0,function*(){let t=this.source.throw&&(yield this.source.throw(e))||By;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)})}return(e){return yp(this,void 0,void 0,function*(){let t=this.source.return&&(yield this.source.return(e))||By;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)})}},Yy=class extends Gy{constructor(e,t){super(),this.position=0,this.buffer=Qp(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),eyp(this,void 0,void 0,function*(){this.size=(yield e.stat()).size,delete this._pending}))()}readInt32(e){return yp(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 yp(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`${Qy(this.buffer[3])} ${Qy(this.buffer[2])} ${Qy(this.buffer[1])} ${Qy(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)}},ob=class extends ab{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:Xv(this.sources[n])}readOffsets(e,{offset:t}=this.nextBufferRange()){return Yp(Uint8Array,Yp(e.OffsetArrayType,this.sources[t]))}readTypeIds(e,{offset:t}=this.nextBufferRange()){return Yp(Uint8Array,Yp(e.ArrayType,this.sources[t]))}readData(e,{offset:t}=this.nextBufferRange()){let{sources:n}=this;return z.isTimestamp(e)||(z.isInt(e)||z.isTime(e))&&e.bitWidth===64||z.isDuration(e)||z.isDate(e)&&e.unit===_m.MILLISECOND?Yp(Uint8Array,rb.convertArray(n[t])):z.isDecimal(e)?Yp(Uint8Array,ib.convertArray(n[t])):z.isBinary(e)||z.isLargeBinary(e)||z.isFixedSizeBinary(e)?sb(n[t]):z.isBool(e)?Xv(n[t]):z.isUtf8(e)||z.isLargeUtf8(e)?Dp(n[t].join(``)):Yp(Uint8Array,Yp(e.ArrayType,n[t].map(e=>+e)))}};function sb(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 U=class extends jg{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 cb(e,t){return t instanceof e.constructor}function lb(e,t){return e===t||cb(e,t)}function ub(e,t){return e===t||cb(e,t)&&e.bitWidth===t.bitWidth&&e.isSigned===t.isSigned}function db(e,t){return e===t||cb(e,t)&&e.precision===t.precision}function fb(e,t){return e===t||cb(e,t)&&e.byteWidth===t.byteWidth}function pb(e,t){return e===t||cb(e,t)&&e.unit===t.unit}function mb(e,t){return e===t||cb(e,t)&&e.unit===t.unit&&e.timezone===t.timezone}function hb(e,t){return e===t||cb(e,t)&&e.unit===t.unit&&e.bitWidth===t.bitWidth}function gb(e,t){return e===t||cb(e,t)&&e.children.length===t.children.length&&wb.compareManyFields(e.children,t.children)}function _b(e,t){return e===t||cb(e,t)&&e.children.length===t.children.length&&wb.compareManyFields(e.children,t.children)}function vb(e,t){return e===t||cb(e,t)&&e.mode===t.mode&&e.typeIds.every((e,n)=>e===t.typeIds[n])&&wb.compareManyFields(e.children,t.children)}function yb(e,t){return e===t||cb(e,t)&&e.id===t.id&&e.isOrdered===t.isOrdered&&wb.visit(e.indices,t.indices)&&wb.visit(e.dictionary,t.dictionary)}function bb(e,t){return e===t||cb(e,t)&&e.unit===t.unit}function xb(e,t){return e===t||cb(e,t)&&e.unit===t.unit}function Sb(e,t){return e===t||cb(e,t)&&e.listSize===t.listSize&&e.children.length===t.children.length&&wb.compareManyFields(e.children,t.children)}function Cb(e,t){return e===t||cb(e,t)&&e.keysSorted===t.keysSorted&&e.children.length===t.children.length&&wb.compareManyFields(e.children,t.children)}U.prototype.visitNull=lb,U.prototype.visitBool=lb,U.prototype.visitInt=ub,U.prototype.visitInt8=ub,U.prototype.visitInt16=ub,U.prototype.visitInt32=ub,U.prototype.visitInt64=ub,U.prototype.visitUint8=ub,U.prototype.visitUint16=ub,U.prototype.visitUint32=ub,U.prototype.visitUint64=ub,U.prototype.visitFloat=db,U.prototype.visitFloat16=db,U.prototype.visitFloat32=db,U.prototype.visitFloat64=db,U.prototype.visitUtf8=lb,U.prototype.visitLargeUtf8=lb,U.prototype.visitBinary=lb,U.prototype.visitLargeBinary=lb,U.prototype.visitFixedSizeBinary=fb,U.prototype.visitDate=pb,U.prototype.visitDateDay=pb,U.prototype.visitDateMillisecond=pb,U.prototype.visitTimestamp=mb,U.prototype.visitTimestampSecond=mb,U.prototype.visitTimestampMillisecond=mb,U.prototype.visitTimestampMicrosecond=mb,U.prototype.visitTimestampNanosecond=mb,U.prototype.visitTime=hb,U.prototype.visitTimeSecond=hb,U.prototype.visitTimeMillisecond=hb,U.prototype.visitTimeMicrosecond=hb,U.prototype.visitTimeNanosecond=hb,U.prototype.visitDecimal=lb,U.prototype.visitList=gb,U.prototype.visitStruct=_b,U.prototype.visitUnion=vb,U.prototype.visitDenseUnion=vb,U.prototype.visitSparseUnion=vb,U.prototype.visitDictionary=yb,U.prototype.visitInterval=bb,U.prototype.visitIntervalDayTime=bb,U.prototype.visitIntervalYearMonth=bb,U.prototype.visitDuration=xb,U.prototype.visitDurationSecond=xb,U.prototype.visitDurationMillisecond=xb,U.prototype.visitDurationMicrosecond=xb,U.prototype.visitDurationNanosecond=xb,U.prototype.visitFixedSizeList=Sb,U.prototype.visitMap=Cb;const wb=new U;function Tb(e,t){return wb.compareSchemas(e,t)}function Eb(e,t){return Db(e,t.map(e=>e.data.concat()))}function Db(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++]=ay({type:new Cg(n),length:o,nullCount:0,children:u.slice()})))}return[e=e.assign(n),r.map(t=>new Mb(e,t))]}function Ob(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))??ay({type:r.type,length:t,nullCount:t,nullBitmap:new Uint8Array(o)})}}return n}var kb,Ab=class e{constructor(...t){var n,r;if(t.length===0)return this.batches=[],this.schema=new jy([]),this._offsets=[0],this;let i,a;t[0]instanceof jy&&(i=t.shift()),t.at(-1)instanceof Uint32Array&&(a=t.pop());let o=t=>{if(t){if(t instanceof Mb)return[t];if(t instanceof e)return t.batches;if(t instanceof ny){if(t.type instanceof Cg)return[new Mb(new jy(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 Dy([t[e]])),r=i??new jy(e.map((e,t)=>new My(String(e),n[t].type,n[t].nullable))),[,a]=Eb(r,n);return a.length===0?[new Mb(t)]:a}}return[]},s=t.flatMap(e=>o(e));if(i=(r=i??(n=s[0])?.schema)??new jy([]),!(i instanceof jy))throw TypeError(`Table constructor expects a [Schema, RecordBatch[]] pair.`);for(let e of s){if(!(e instanceof Mb))throw TypeError(`Table constructor expects a [Schema, RecordBatch[]] pair.`);if(!Tb(i,e.schema))throw TypeError(`Table and inner RecordBatch schemas must be equivalent.`)}this.schema=i,this.batches=s,this._offsets=a??ly(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=cy(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?Cy.visit(new Dy(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 Mb(n,e)))}slice(t,n){let r=this.schema;[t,n]=Fv({length:this.numRows},t,n);let i=uy(this.data,this._offsets,t,n);return new e(r,i.map(e=>new Mb(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=ay({type:n,length:0,nullCount:0});t.push(r._changeLengthAndBackfillNullBitmap(this.numRows))}return new Dy(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]=Eb(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(...Eb(a,o))}};kb=Symbol.toStringTag,Ab[kb]=(e=>(e.schema=null,e.batches=[],e._offsets=new Uint32Array([0]),e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,e.isValid=py(fy),e.get=py(Ev.getVisitFn(R.Struct)),e.set=my(j_.getVisitFn(R.Struct)),e.indexOf=hy(by.getVisitFn(R.Struct)),`Table`))(Ab.prototype);var jb,Mb=class e{constructor(...e){switch(e.length){case 2:if([this.schema]=e,!(this.schema instanceof jy)||([,this.data=ay({nullCount:0,type:new Cg(this.schema.fields),children:this.schema.fields.map(e=>ay({type:e.type,nullCount:0}))})]=e,!(this.data instanceof ny)))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]=My.new({name:n,type:t[n].type,nullable:!0}),e),{length:0,fields:[],children:[]}),a=new jy(n),o=ay({type:new Cg(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||=Pb(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 Ev.visit(this.data,e)}at(e){return this.get(Iv(e,this.numRows))}set(e,t){return j_.visit(this.data,e,t)}indexOf(e,t){return by.visit(this.data,e,t)}[Symbol.iterator](){return Cy.visit(new Dy([this.data]))}toArray(){return[...this]}concat(...e){return new Ab(this.schema,[this,...e])}slice(t,n){let[r]=new Dy([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,ay({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=ay({type:new Cg(n.fields),length:this.numRows,children:r});return new e(n,i)}};jb=Symbol.toStringTag,Mb[jb]=(e=>(e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,`RecordBatch`))(Mb.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))??ay({type:c.type,length:n,nullCount:n,nullBitmap:new Uint8Array(o)}))}return[e.assign(i),ay({type:new Cg(i),length:n,children:a})]}function Pb(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;++ray({type:e.type})),n=ay({type:new Cg(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()+Cm),(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):mm.V1}headerType(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb_pos+e):dh.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 Hm).__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,mm.V1)}static addHeaderType(e,t){e.addFieldInt8(1,t,dh.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)}},Lb=class extends jg{visit(e,t){return e==null||t==null?void 0:super.visit(e,t)}visitNull(e,t){return nh.startNull(t),nh.endNull(t)}visitInt(e,t){return Bm.startInt(t),Bm.addBitWidth(t,e.bitWidth),Bm.addIsSigned(t,e.isSigned),Bm.endInt(t)}visitFloat(e,t){return Xm.startFloatingPoint(t),Xm.addPrecision(t,e.precision),Xm.endFloatingPoint(t)}visitBinary(e,t){return Um.startBinary(t),Um.endBinary(t)}visitLargeBinary(e,t){return Qm.startLargeBinary(t),Qm.endLargeBinary(t)}visitBool(e,t){return Wm.startBool(t),Wm.endBool(t)}visitUtf8(e,t){return sh.startUtf8(t),sh.endUtf8(t)}visitLargeUtf8(e,t){return $m.startLargeUtf8(t),$m.endLargeUtf8(t)}visitDecimal(e,t){return Km.startDecimal(t),Km.addScale(t,e.scale),Km.addPrecision(t,e.precision),Km.addBitWidth(t,e.bitWidth),Km.endDecimal(t)}visitDate(e,t){return Gm.startDate(t),Gm.addUnit(t,e.unit),Gm.endDate(t)}visitTime(e,t){return ih.startTime(t),ih.addUnit(t,e.unit),ih.addBitWidth(t,e.bitWidth),ih.endTime(t)}visitTimestamp(e,t){let n=e.timezone&&t.createString(e.timezone)||void 0;return ah.startTimestamp(t),ah.addUnit(t,e.unit),n!==void 0&&ah.addTimezone(t,n),ah.endTimestamp(t)}visitInterval(e,t){return Zm.startInterval(t),Zm.addUnit(t,e.unit),Zm.endInterval(t)}visitDuration(e,t){return qm.startDuration(t),qm.addUnit(t,e.unit),qm.endDuration(t)}visitList(e,t){return eh.startList(t),eh.endList(t)}visitStruct(e,t){return rh.startStruct_(t),rh.endStruct_(t)}visitUnion(e,t){oh.startTypeIdsVector(t,e.typeIds.length);let n=oh.createTypeIdsVector(t,e.typeIds);return oh.startUnion(t),oh.addMode(t,e.mode),oh.addTypeIds(t,n),oh.endUnion(t)}visitDictionary(e,t){let n=this.visit(e.indices,t);return Vm.startDictionaryEncoding(t),Vm.addId(t,BigInt(e.id)),Vm.addIsOrdered(t,e.isOrdered),n!==void 0&&Vm.addIndexType(t,n),Vm.endDictionaryEncoding(t)}visitFixedSizeBinary(e,t){return Jm.startFixedSizeBinary(t),Jm.addByteWidth(t,e.byteWidth),Jm.endFixedSizeBinary(t)}visitFixedSizeList(e,t){return Ym.startFixedSizeList(t),Ym.addListSize(t,e.listSize),Ym.endFixedSizeList(t)}visitMap(e,t){return th.startMap(t),th.addKeysSorted(t,e.keysSorted),th.endMap(t)}};const Rb=new Lb;function zb(e,t=new Map){return new jy(Hb(e,t),Jb(e.metadata),t)}function Bb(e){return new ex(e.count,Wb(e.columns),Gb(e.columns))}function Vb(e){return new tx(Bb(e.data),e.id,e.isDelta)}function Hb(e,t){return(e.fields||[]).filter(Boolean).map(e=>My.fromJSON(e,t))}function Ub(e,t){return(e.children||[]).filter(Boolean).map(e=>My.fromJSON(e,t))}function Wb(e){return(e||[]).reduce((e,t)=>[...e,new rx(t.count,Kb(t.VALIDITY)),...Wb(t.children)],[])}function Gb(e,t=[]){for(let n=-1,r=(e||[]).length;++ne+ +(t===0),0)}function qb(e,t){let n,r,i,a,o,s;return!t||!(a=e.dictionary)?(o=Xb(e,Ub(e,t)),i=new My(e.name,o,e.nullable,Jb(e.metadata))):t.has(n=a.id)?(r=(r=a.indexType)?Yb(r):new tg,s=new kg(t.get(n),r,n,a.isOrdered),i=new My(e.name,s,e.nullable,Jb(e.metadata))):(r=(r=a.indexType)?Yb(r):new tg,t.set(n,o=Xb(e,Ub(e,t))),s=new kg(o,r,n,a.isOrdered),i=new My(e.name,s,e.nullable,Jb(e.metadata))),i||null}function Jb(e=[]){return new Map(e.map(({key:e,value:t})=>[e,t]))}function Yb(e){return new Qh(e.isSigned,e.bitWidth)}function Xb(e,t){let n=e.type.name;switch(n){case`NONE`:return new Zh;case`null`:return new Zh;case`binary`:return new dg;case`largebinary`:return new fg;case`utf8`:return new pg;case`largeutf8`:return new mg;case`bool`:return new hg;case`list`:return new Sg((t||[])[0]);case`struct`:return new Cg(t||[]);case`struct_`:return new Cg(t||[])}switch(n){case`int`:{let t=e.type;return new Qh(t.isSigned,t.bitWidth)}case`floatingpoint`:{let t=e.type;return new sg(gm[t.precision])}case`decimal`:{let t=e.type;return new gg(t.scale,t.precision,t.bitWidth)}case`date`:{let t=e.type;return new _g(_m[t.unit])}case`time`:{let t=e.type;return new vg(vm[t.unit],t.bitWidth)}case`timestamp`:{let t=e.type;return new yg(vm[t.unit],t.timezone)}case`interval`:{let t=e.type;return new bg(ym[t.unit])}case`duration`:{let t=e.type;return new xg(vm[t.unit])}case`union`:{let n=e.type,[r,...i]=(n.mode+``).toLowerCase(),a=r.toUpperCase()+i.join(``);return new wg(hm[a],n.typeIds||[],t||[])}case`fixedsizebinary`:{let t=e.type;return new Tg(t.byteWidth)}case`fixedsizelist`:{let n=e.type;return new Eg(n.listSize,(t||[])[0])}case`map`:{let n=e.type;return new Dg((t||[])[0],n.keysSorted)}}throw Error(`Unrecognized type: "${n}"`)}var Zb=Am,Qb=km,$b=class e{static fromJSON(t,n){let r=new e(0,mm.V5,n);return r._createHeader=ix(t,n),r}static decode(t){t=new Qb(Qp(t));let n=Ib.getRootAsMessage(t),r=n.bodyLength(),i=n.version(),a=n.headerType(),o=new e(r,i,a);return o._createHeader=ax(n,a),o}static encode(e){let t=new Zb,n=-1;return e.isSchema()?n=jy.encode(t,e.header()):e.isRecordBatch()?n=ex.encode(t,e.header()):e.isDictionaryBatch()&&(n=tx.encode(t,e.header())),Ib.startMessage(t),Ib.addVersion(t,mm.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 jy)return new e(0,mm.V5,dh.Schema,t);if(t instanceof ex)return new e(n,mm.V5,dh.RecordBatch,t);if(t instanceof tx)return new e(n,mm.V5,dh.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===dh.Schema}isRecordBatch(){return this.headerType===dh.RecordBatch}isDictionaryBatch(){return this.headerType===dh.DictionaryBatch}constructor(e,t,n,r){this._version=t,this._headerType=n,this.body=new Uint8Array,r&&(this._createHeader=()=>r),this._bodyLength=hh(e)}},ex=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=hh(e)}},tx=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=hh(t)}},nx=class{constructor(e,t){this.offset=hh(e),this.length=hh(t)}},rx=class{constructor(e,t){this.length=hh(e),this.nullCount=hh(t)}};function ix(e,t){return()=>{switch(t){case dh.Schema:return jy.fromJSON(e);case dh.RecordBatch:return ex.fromJSON(e);case dh.DictionaryBatch:return tx.fromJSON(e)}throw Error(`Unrecognized Message type: { name: ${dh[t]}, type: ${t} }`)}}function ax(e,t){return()=>{switch(t){case dh.Schema:return jy.decode(e.header(new uh),new Map,e.version());case dh.RecordBatch:return ex.decode(e.header(new Im),e.version());case dh.DictionaryBatch:return tx.decode(e.header(new Lm),e.version())}throw Error(`Unrecognized Message type: { name: ${dh[t]}, type: ${t} }`)}}My.encode=bx,My.decode=hx,My.fromJSON=qb,jy.encode=yx,jy.decode=ox,jy.fromJSON=zb,ex.encode=xx,ex.decode=sx,ex.fromJSON=Bb,tx.encode=Sx,tx.decode=cx,tx.fromJSON=Vb,rx.encode=Cx,rx.decode=ux,nx.encode=wx,nx.decode=lx;function ox(e,t=new Map,n=mm.V5){let r=px(e,t);return new jy(r,gx(e),t,n)}function sx(e,t=mm.V5){if(e.compression()!==null)throw Error(`Record batch compression not implemented`);return new ex(e.length(),dx(e),fx(e,t))}function cx(e,t=mm.V5){return new tx(ex.decode(e.data(),t),e.id(),e.isDelta())}function lx(e){return new nx(e.offset(),e.length())}function ux(e){return new rx(e.length(),e.nullCount())}function dx(e){let t=[];for(let n,r=-1,i=-1,a=e.nodesLength();++rMy.encode(e,t));uh.startFieldsVector(e,n.length);let r=uh.createFieldsVector(e,n),i=t.metadata&&t.metadata.size>0?uh.createCustomMetadataVector(e,[...t.metadata].map(([t,n])=>{let r=e.createString(`${t}`),i=e.createString(`${n}`);return Hm.startKeyValue(e),Hm.addKey(e,r),Hm.addValue(e,i),Hm.endKeyValue(e)})):-1;return uh.startSchema(e),uh.addFields(e,r),uh.addEndianness(e,Tx?Rm.Little:Rm.Big),i!==-1&&uh.addCustomMetadata(e,i),uh.endSchema(e)}function bx(e,t){let n=-1,r=-1,i=-1,a=t.type,o=t.typeId;z.isDictionary(a)?(o=a.dictionary.typeId,i=Rb.visit(a,e),r=Rb.visit(a.dictionary,e)):r=Rb.visit(a,e);let s=(a.children||[]).map(t=>My.encode(e,t)),c=lh.createChildrenVector(e,s),l=t.metadata&&t.metadata.size>0?lh.createCustomMetadataVector(e,[...t.metadata].map(([t,n])=>{let r=e.createString(`${t}`),i=e.createString(`${n}`);return Hm.startKeyValue(e),Hm.addKey(e,r),Hm.addValue(e,i),Hm.endKeyValue(e)})):-1;return t.name&&(n=e.createString(t.name)),lh.startField(e),lh.addType(e,r),lh.addTypeType(e,o),lh.addChildren(e,c),lh.addNullable(e,!!t.nullable),n!==-1&&lh.addName(e,n),i!==-1&&lh.addDictionary(e,i),l!==-1&&lh.addCustomMetadata(e,l),lh.endField(e)}function xx(e,t){let n=t.nodes||[],r=t.buffers||[];Im.startNodesVector(e,n.length);for(let t of n.slice().reverse())rx.encode(e,t);let i=e.endVector();Im.startBuffersVector(e,r.length);for(let t of r.slice().reverse())nx.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 Sx(e,t){let n=ex.encode(e,t.data);return Lm.startDictionaryBatch(e),Lm.addId(e,BigInt(t.id)),Lm.addIsDelta(e,t.isDelta),Lm.addData(e,n),Lm.endDictionaryBatch(e)}function Cx(e,t){return Fm.createFieldNode(e,BigInt(t.length),BigInt(t.nullCount))}function wx(e,t){return Pm.createBuffer(e,BigInt(t.offset),BigInt(t.length))}const Tx=(()=>{let e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),new Int16Array(e)[0]===256})(),Ex=e=>`Expected ${dh[e]} Message in stream, but was null or length 0.`,Dx=e=>`Header pointer of flatbuffer-encoded ${dh[e]} Message is null or length 0.`,Ox=(e,t)=>`Expected to read ${e} metadata bytes, but only read ${t}.`,kx=(e,t)=>`Expected to read ${e} bytes for message body, but only read ${t}.`;var Ax=class{constructor(e){this.source=e instanceof Gy?e:new Gy(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?By: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(Ex(e));return t.value}readMessageBody(e){if(e<=0)return new Uint8Array;let t=Qp(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(Ex(e));return t.value}readSchema(){let e=dh.Schema,t=this.readMessage(e),n=t?.header();if(!t||!n)throw Error(Dx(e));return n}};const Nx=4,Px=`ARROW1`,Fx=new Uint8Array(6);for(let e=0;e<6;e+=1)Fx[e]=Px.codePointAt(e);function Ix(e,t=0){for(let n=-1,r=Fx.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 om.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return om.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:Fp(t)?eS(t):Lp(t)?rS(t):Mp(t)?(()=>yp(this,void 0,void 0,function*(){return yield e.from(yield t)}))():Rp(t)||Vp(t)||Up(t)||Pp(t)?nS(new Ky(t)):tS(new Gy(t))}static readAll(t){return t instanceof e?t.isSync()?Qx(t):$x(t):Fp(t)||ArrayBuffer.isView(t)||Np(t)||Ip(t)?Qx(t):$x(t)}},Vx=class extends Bx{constructor(e){super(e),this._impl=e}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return xp(this,arguments,function*(){yield L(yield*Sp(Cp(this[Symbol.iterator]())))})}},Hx=class extends Bx{constructor(e){super(e),this._impl=e}readAll(){return yp(this,void 0,void 0,function*(){var e,t,n,r;let i=[];try{for(var a=!0,o=Cp(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]()}},Ux=class extends Vx{constructor(e){super(e),this._impl=e}},Wx=class extends Hx{constructor(e){super(e),this._impl=e}},Gx=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=ay({type:new Cg(this.schema.fields),length:e.length,children:n});return new Mb(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 Dy(c)):new Dy(c)).memoize()}_loadVectors(e,t,n){return new ab(t,e.nodes,e.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(n)}},Kx=class extends Gx{constructor(e,t){super(t),this._reader=Fp(e)?new Mx(this._handle=e):new Ax(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=Zx(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):By}return(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(e):By}next(){if(this.closed)return By;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 Fb(this.schema)}):this.return()}_readNextMessageAndValidate(e){return this._reader.readMessage(e)}},qx=class extends Gx{constructor(e,t){super(t),this._reader=new jx(this._handle=e)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return yp(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 yp(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=Zx(this,e),(this.schema||=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(e){return yp(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(e):By})}return(e){return yp(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(e):By})}next(){return yp(this,void 0,void 0,function*(){if(this.closed)return By;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 Fb(this.schema)}):yield this.return()})}_readNextMessageAndValidate(e){return yp(this,void 0,void 0,function*(){return yield this._reader.readMessage(e)})}},Jx=class extends Kx{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 Yy?e:new Yy(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(dh.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(dh.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-Rx,n=e.readInt32(t),r=e.readAt(t-n,n);return Ly.decode(r)}_readNextMessageAndValidate(e){var t;if(this._footer||this.open(),this._footer&&this._recordBatchIndexsuper.open}});return yp(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 yp(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(dh.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 yp(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(dh.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 yp(this,void 0,void 0,function*(){let{_handle:e}=this;e._pending&&(yield e._pending);let t=e.size-Rx,n=yield e.readInt32(t),r=yield e.readAt(t-n,n);return Ly.decode(r)})}_readNextMessageAndValidate(e){return yp(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex=4?Ix(t)?new Ux(new Jx(e.read())):new Vx(new Kx(e)):new Vx(new Kx(function*(){}()))}function nS(e){return yp(this,void 0,void 0,function*(){let t=yield e.peek(Lx+7&-8);return t&&t.byteLength>=4?Ix(t)?new Ux(new Jx(yield e.read())):new Hx(new qx(e)):new Hx(new qx(function(){return xp(this,arguments,function*(){})}()))})}function rS(e){return yp(this,void 0,void 0,function*(){let{size:t}=yield e.stat(),n=new Xy(e,t);return t>=zx&&Ix(yield n.readAt(0,Lx+7&-8))?new Wx(new Yx(n)):new Hx(new qx(n))})}var iS=class e extends jg{static assemble(...t){let n=e=>e.flatMap(e=>Array.isArray(e)?n(e):e instanceof Mb?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 Dy)return this.visitMany(e.data),this;let{type:t}=e;if(!z.isDictionary(t)){let{length:n}=e;if(n>2147483647)throw RangeError(`Cannot write arrays larger than 2^31 - 1 in length`);if(z.isUnion(t))this.nodes.push(new rx(n,0));else{let{nullCount:r}=e;z.isNull(t)||aS.call(this,r<=0?new Uint8Array:Yv(e.offset,n,e.nullBitmap)),this.nodes.push(new rx(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 aS(e){let t=e.byteLength+7&-8;return this.buffers.push(e),this.bufferRegions.push(new nx(this._byteLength,t)),this._byteLength+=t,this}function oS(e){var t;let{type:n,length:r,typeIds:i,valueOffsets:a}=e;if(aS.call(this,i),n.mode===hm.Sparse)return dS.call(this,e);if(n.mode===hm.Dense){if(e.offset<=0)return aS.call(this,a),dS.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 sS(e){let t;return e.nullCount>=e.length?aS.call(this,new Uint8Array):(t=e.values)instanceof Uint8Array?aS.call(this,Yv(e.offset,e.length,t)):aS.call(this,Xv(e.values))}function cS(e){return aS.call(this,e.values.subarray(0,e.length*e.stride))}function lS(e){let{length:t,values:n,valueOffsets:r}=e,i=hh(r[0]),a=hh(r[t]),o=Math.min(a-i,n.byteLength-i);return aS.call(this,im(-i,t+1,r)),aS.call(this,n.subarray(i,i+o)),this}function uS(e){let{length:t,valueOffsets:n}=e;if(n){let{0:r,[t]:i}=n;return aS.call(this,im(-r,t+1,n)),this.visit(e.children[0].slice(r,i-r))}return this.visit(e.children[0])}function dS(e){return this.visitMany(e.type.children.map((t,n)=>e.children[n]).filter(Boolean))[0]}iS.prototype.visitBool=sS,iS.prototype.visitInt=cS,iS.prototype.visitFloat=cS,iS.prototype.visitUtf8=lS,iS.prototype.visitLargeUtf8=lS,iS.prototype.visitBinary=lS,iS.prototype.visitLargeBinary=lS,iS.prototype.visitFixedSizeBinary=cS,iS.prototype.visitDate=cS,iS.prototype.visitTimestamp=cS,iS.prototype.visitTime=cS,iS.prototype.visitDecimal=cS,iS.prototype.visitList=uS,iS.prototype.visitStruct=dS,iS.prototype.visitUnion=oS,iS.prototype.visitInterval=cS,iS.prototype.visitDuration=cS,iS.prototype.visitFixedSizeList=uS,iS.prototype.visitMap=uS;var fS=class extends Hy{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 Wy,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,jp(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 Mp(e)?e.then(e=>this.writeAll(e)):Pp(e)?gS(this,e):hS(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 Wy?this._sink=e:(this._sink=new Wy,e&&Bp(e)?this.toDOMStream({type:`bytes`}).pipeTo(e):e&&Hp(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||!Tb(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 Ab&&!(t=e.schema)||e instanceof Mb&&!(t=e.schema))return this.finish()&&void 0}else throw Error(`RecordBatchWriter is closed`);if(t&&!Tb(t,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,t)}e instanceof Mb?e instanceof Fb||this._writeRecordBatch(e):e instanceof Ab?this.writeAll(e.batches):Np(e)&&this.writeAll(e)}_writeMessage(e,t=8){let n=t-1,r=$b.encode(e),i=r.byteLength,a=this._writeLegacyIpcFormat?4:8,o=i+a+n&~n,s=o-i-a;return e.headerType===dh.RecordBatch?this._recordBatchBlocks.push(new zy(o,e.bodyLength,this._position)):e.headerType===dh.DictionaryBatch&&this._dictionaryBlocks.push(new zy(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=Qp(e);t&&t.byteLength>0&&(this._sink.write(t),this._position+=t.byteLength)}return this}_writeSchema(e){return this._writeMessage($b.from(e))}_writeFooter(e){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(Fx)}_writePadding(e){return e>0?this._write(new Uint8Array(e)):this}_writeRecordBatch(e){let{byteLength:t,nodes:n,bufferRegions:r,buffers:i}=iS.assemble(e),a=new ex(e.numRows,n,r),o=$b.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}=iS.assemble(new Dy([e])),s=new ex(e.length,i,a),c=new tx(s,t,n),l=$b.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)):Pp(t)?gS(r,t):hS(r,t)}},mS=class e extends fS{static writeAll(t){let n=new e;return Mp(t)?t.then(e=>n.writeAll(e)):Pp(t)?gS(n,t):hS(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=Ly.encode(new Ly(e,mm.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(e)._write(t)._write(Int32Array.of(t.byteLength))._writeMagic()}};function hS(e,t){let n=t;t instanceof Ab&&(n=t.batches,e.reset(void 0,t.schema));for(let t of n)e.write(t);return e.finish()}function gS(e,t){return yp(this,void 0,void 0,function*(){var n,r,i,a,o,s,c;try{for(n=!0,r=Cp(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 _S(e,t=`stream`){return(t===`stream`?pS:mS).writeAll(e).toUint8Array(!0)}var vS=Object.create,yS=Object.defineProperty,bS=Object.getOwnPropertyDescriptor,xS=Object.getOwnPropertyNames,SS=Object.getPrototypeOf,CS=Object.prototype.hasOwnProperty,wS=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),TS=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of xS(t))!CS.call(e,i)&&i!==n&&yS(e,i,{get:()=>t[i],enumerable:!(r=bS(t,i))||r.enumerable});return e},ES=(e,t,n)=>(n=e==null?{}:vS(SS(e)),TS(t||!e||!e.__esModule?yS(n,`default`,{value:e,enumerable:!0}):n,e)),DS=wS((e,t)=>{t.exports=Worker}),OS=(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))(OS||{}),kS=(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))(kS||{}),AS=(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))(AS||{}),jS=(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))(jS||{}),MS=(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))(MS||{}),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||{}),PS=class{log(e){}},FS=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||{}),LS=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=Bx.from(t);return console.assert(n.isSync(),`Reader is not sync`),console.assert(n.isFile(),`Reader is not file`),new Ab(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 RS(this._bindings,this._conn,n),i=await Bx.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 zS(this._bindings,this._conn,t)}async insertArrowTable(e,t){let n=_S(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)}},RS=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}},zS=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=Bx.from(t);return console.assert(n.isSync()),console.assert(n.isFile()),new Ab(n)}async send(...e){let t=await this.bindings.sendPrepared(this.connectionId,this.statementId,e),n=new RS(this.bindings,this.connectionId,t),r=await Bx.from(n);return console.assert(r.isAsync()),console.assert(r.isStream()),r}},BS=(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))(BS||{}),VS=(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))(VS||{}),HS=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 US(e){switch(e.typeId){case R.Binary:return{sqlType:`binary`};case R.Bool:return{sqlType:`bool`};case R.Date:return{sqlType:`date`};case R.DateDay:return{sqlType:`date32[d]`};case R.DateMillisecond:return{sqlType:`date64[ms]`};case R.Decimal:{let t=e;return{sqlType:`decimal`,precision:t.precision,scale:t.scale}}case R.Float:return{sqlType:`float`};case R.Float16:return{sqlType:`float16`};case R.Float32:return{sqlType:`float32`};case R.Float64:return{sqlType:`float64`};case R.Int:return{sqlType:`int32`};case R.Int16:return{sqlType:`int16`};case R.Int32:return{sqlType:`int32`};case R.Int64:return{sqlType:`int64`};case R.Uint16:return{sqlType:`uint16`};case R.Uint32:return{sqlType:`uint32`};case R.Uint64:return{sqlType:`uint64`};case R.Uint8:return{sqlType:`uint8`};case R.IntervalDayTime:return{sqlType:`interval[dt]`};case R.IntervalYearMonth:return{sqlType:`interval[m]`};case R.List:return{sqlType:`list`,valueType:US(e.valueType)};case R.FixedSizeBinary:return{sqlType:`fixedsizebinary`,byteWidth:e.byteWidth};case R.Null:return{sqlType:`null`};case R.Utf8:return{sqlType:`utf8`};case R.Struct:return{sqlType:`struct`,fields:e.children.map(e=>WS(e.name,e.type))};case R.Map:{let t=e;return{sqlType:`map`,keyType:US(t.keyType),valueType:US(t.valueType)}}case R.Time:return{sqlType:`time[s]`};case R.TimeMicrosecond:return{sqlType:`time[us]`};case R.TimeMillisecond:return{sqlType:`time[ms]`};case R.TimeNanosecond:return{sqlType:`time[ns]`};case R.TimeSecond:return{sqlType:`time[s]`};case R.Timestamp:return{sqlType:`timestamp`,timezone:e.timezone||void 0};case R.TimestampSecond:return{sqlType:`timestamp[s]`,timezone:e.timezone||void 0};case R.TimestampMicrosecond:return{sqlType:`timestamp[us]`,timezone:e.timezone||void 0};case R.TimestampNanosecond:return{sqlType:`timestamp[ns]`,timezone:e.timezone||void 0};case R.TimestampMillisecond:return{sqlType:`timestamp[ms]`,timezone:e.timezone||void 0}}throw Error(`unsupported arrow type: ${e.toString()}`)}function WS(e,t){let n=US(t);return n.name=e,n}var GS=new TextEncoder,KS=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 HS(`RESET`,null);return await this.postTask(e)}async ping(){let e=new HS(`PING`,null);await this.postTask(e)}async dropFile(e){let t=new HS(`DROP_FILE`,e);return await this.postTask(t)}async dropFiles(){let e=new HS(`DROP_FILES`,null);return await this.postTask(e)}async flushFiles(){let e=new HS(`FLUSH_FILES`,null);return await this.postTask(e)}async instantiate(e,t=null,n=e=>{}){this._onInstantiationProgress.push(n);let r=new HS(`INSTANTIATE`,[e,t]);return await this.postTask(r)}async getVersion(){let e=new HS(`GET_VERSION`,null);return await this.postTask(e)}async getFeatureFlags(){let e=new HS(`GET_FEATURE_FLAGS`,null);return await this.postTask(e)}async open(e){let t=new HS(`OPEN`,e);await this.postTask(t)}async tokenize(e){let t=new HS(`TOKENIZE`,e);return await this.postTask(t)}async connectInternal(){let e=new HS(`CONNECT`,null);return await this.postTask(e)}async connect(){let e=await this.connectInternal();return new LS(this,e)}async disconnect(e){let t=new HS(`DISCONNECT`,e);await this.postTask(t)}async runQuery(e,t){let n=new HS(`RUN_QUERY`,[e,t]);return await this.postTask(n)}async startPendingQuery(e,t,n=!1){let r=new HS(`START_PENDING_QUERY`,[e,t,n]);return await this.postTask(r)}async pollPendingQuery(e){let t=new HS(`POLL_PENDING_QUERY`,e);return await this.postTask(t)}async cancelPendingQuery(e){let t=new HS(`CANCEL_PENDING_QUERY`,e);return await this.postTask(t)}async fetchQueryResults(e){let t=new HS(`FETCH_QUERY_RESULTS`,e);return await this.postTask(t)}async getTableNames(e,t){let n=new HS(`GET_TABLE_NAMES`,[e,t]);return await this.postTask(n)}async createPrepared(e,t){let n=new HS(`CREATE_PREPARED`,[e,t]);return await this.postTask(n)}async closePrepared(e,t){let n=new HS(`CLOSE_PREPARED`,[e,t]);await this.postTask(n)}async runPrepared(e,t,n){let r=new HS(`RUN_PREPARED`,[e,t,n]);return await this.postTask(r)}async sendPrepared(e,t,n){let r=new HS(`SEND_PREPARED`,[e,t,n]);return await this.postTask(r)}async globFiles(e){let t=new HS(`GLOB_FILE_INFOS`,e);return await this.postTask(t)}async registerFileText(e,t){let n=GS.encode(t);await this.registerFileBuffer(e,n)}async registerFileURL(e,t,n,r){t===void 0&&(t=e);let i=new HS(`REGISTER_FILE_URL`,[e,t,n,r]);await this.postTask(i)}async registerEmptyFileBuffer(e){}async registerFileBuffer(e,t){let n=new HS(`REGISTER_FILE_BUFFER`,[e,t]);await this.postTask(n,[t.buffer])}async registerFileHandle(e,t,n,r){let i=new HS(`REGISTER_FILE_HANDLE`,[e,t,n,r]);await this.postTask(i,[])}async registerOPFSFileName(e){let t=new HS(`REGISTER_OPFS_FILE_NAME`,[e]);await this.postTask(t,[])}async collectFileStatistics(e,t){let n=new HS(`COLLECT_FILE_STATISTICS`,[e,t]);await this.postTask(n,[])}async exportFileStatistics(e){let t=new HS(`EXPORT_FILE_STATISTICS`,e);return await this.postTask(t,[])}async copyFileToBuffer(e){let t=new HS(`COPY_FILE_TO_BUFFER`,e);return await this.postTask(t)}async copyFileToPath(e,t){let n=new HS(`COPY_FILE_TO_PATH`,[e,t]);await this.postTask(n)}async insertArrowFromIPCStream(e,t,n){if(t.length==0)return;let r=new HS(`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(WS(t,r))}n.columnsFlat=e,delete n.columns}let r=new HS(`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(WS(t,r))}n.columnsFlat=e,delete n.columns}let r=new HS(`IMPORT_JSON_FROM_PATH`,[e,t,n]);await this.postTask(r)}};function qS(){let e=new TextDecoder;return t=>(typeof SharedArrayBuffer<`u`&&t.buffer instanceof SharedArrayBuffer&&(t=new Uint8Array(t)),e.decode(t))}var JS=qS(),YS=(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))(YS||{}),XS=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])),ZS=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])),QS=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])),$S=()=>(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])),eC={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`}}},tC=eC.name,nC=eC.version,rC=eC.version.split(`.`),iC=rC[0],aC=rC[1],oC=rC[2],sC=()=>typeof navigator>`u`,cC=()=>sC()?`node`:navigator.userAgent,lC=()=>cC().includes(`Firefox`),uC=()=>/^((?!chrome|android).)*safari/i.test(cC()),dC=null,fC=null,pC=null,mC=null,hC=null;async function gC(){return dC??=typeof BigInt64Array<`u`,fC??=await ZS(),pC??=await $S(),mC??=await QS(),hC??=await XS(),{bigInt64Array:dC,crossOriginIsolated:sC()||globalThis.crossOriginIsolated||!1,wasmExceptions:fC,wasmSIMD:mC,wasmThreads:pC,wasmBulkMemory:hC}}async function _C(e){let t=await gC();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}}var vC=ES(DS());const yC=Symbol.for(`constructDateFrom`),bC={},xC={};function SC(e,t){try{let n=bC[e]||=new Intl.DateTimeFormat(`en-GB`,{timeZone:e,hour:`numeric`,timeZoneName:`longOffset`}).format,r=n(t).split(`GMT`)[1]||``;return r in xC?xC[r]:wC(r,r.split(`:`))}catch{if(e in xC)return xC[e];let t=e?.match(CC);return t?wC(e,t.slice(1)):NaN}}const CC=/([+-]\d\d):?(\d\d)?/;function wC(e,t){let n=+t[0],r=+(t[1]||0);return xC[e]=n>0?n*60+r:n*60-r}var TC=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(SC(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)),kC(this,NaN),DC(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-SC(this.timeZone,this)}setTime(e){return Date.prototype.setTime.apply(this,arguments),DC(this),+this}[Symbol.for(`constructDateFrom`)](t){return new e(+new Date(t),this.timeZone)}};const EC=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!EC.test(e))return;let t=e.replace(EC,`$1UTC`);TC.prototype[t]&&(e.startsWith(`get`)?TC.prototype[e]=function(){return this.internal[t]()}:(TC.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),OC(this),+this},TC.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),DC(this),+this}))});function DC(e){e.internal.setTime(+e),e.internal.setUTCMinutes(e.internal.getUTCMinutes()-e.getTimezoneOffset())}function OC(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()),kC(e)}function kC(e){let t=SC(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=SC(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=SC(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))}}var AC=class e extends TC{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} (${jC(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 jC(e,t){return new Intl.DateTimeFormat(`en-GB`,{timeZone:e,timeZoneName:`long`}).format(t).slice(12)}const MC=new TextDecoder(`utf-8`),NC=e=>MC.decode(e),PC=new TextEncoder,FC=e=>PC.encode(e),IC=e=>typeof e==`function`,LC=e=>e!=null&&Object(e)===e,RC=e=>LC(e)&&IC(e.then),zC=e=>LC(e)&&IC(e[Symbol.iterator]),BC=e=>LC(e)&&IC(e[Symbol.asyncIterator]),VC=e=>LC(e)&&`done`in e&&`value`in e,HC=e=>LC(e)&&IC(e.clear)&&IC(e.bytes)&&IC(e.position)&&IC(e.setPosition)&&IC(e.capacity)&&IC(e.getBufferIdentifier)&&IC(e.createLong);var UC={};Re(UC,{compareArrayLike:()=>Ow,joinUint8Arrays:()=>qC,memcpy:()=>KC,rebaseValueOffsets:()=>Dw,toArrayBufferView:()=>JC,toArrayBufferViewAsyncIterator:()=>_w,toArrayBufferViewIterator:()=>sw,toBigInt64Array:()=>QC,toBigUint64Array:()=>nw,toFloat32Array:()=>rw,toFloat32ArrayAsyncIterator:()=>ww,toFloat32ArrayIterator:()=>mw,toFloat64Array:()=>iw,toFloat64ArrayAsyncIterator:()=>Tw,toFloat64ArrayIterator:()=>hw,toInt16Array:()=>XC,toInt16ArrayAsyncIterator:()=>yw,toInt16ArrayIterator:()=>lw,toInt32Array:()=>ZC,toInt32ArrayAsyncIterator:()=>bw,toInt32ArrayIterator:()=>uw,toInt8Array:()=>YC,toInt8ArrayAsyncIterator:()=>vw,toInt8ArrayIterator:()=>cw,toUint16Array:()=>ew,toUint16ArrayAsyncIterator:()=>Sw,toUint16ArrayIterator:()=>fw,toUint32Array:()=>tw,toUint32ArrayAsyncIterator:()=>Cw,toUint32ArrayIterator:()=>pw,toUint8Array:()=>$C,toUint8ArrayAsyncIterator:()=>xw,toUint8ArrayIterator:()=>dw,toUint8ClampedArray:()=>aw,toUint8ClampedArrayAsyncIterator:()=>Ew,toUint8ClampedArrayIterator:()=>gw});const WC=typeof SharedArrayBuffer<`u`?SharedArrayBuffer:ArrayBuffer;function GC(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;++cJC(Int8Array,e),XC=e=>JC(Int16Array,e),ZC=e=>JC(Int32Array,e),QC=e=>JC(BigInt64Array,e),$C=e=>JC(Uint8Array,e),ew=e=>JC(Uint16Array,e),tw=e=>JC(Uint32Array,e),nw=e=>JC(BigUint64Array,e),rw=e=>JC(Float32Array,e),iw=e=>JC(Float64Array,e),aw=e=>JC(Uint8ClampedArray,e),ow=e=>(e.next(),e);function*sw(e,t){let n=function*(e){yield e},r=typeof t==`string`||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof WC?n(t):zC(t)?t:n(t);return yield*ow(function*(t){let n=null;do n=t.next(yield JC(e,n));while(!n.done)}(r[Symbol.iterator]())),new e}const cw=e=>sw(Int8Array,e),lw=e=>sw(Int16Array,e),uw=e=>sw(Int32Array,e),dw=e=>sw(Uint8Array,e),fw=e=>sw(Uint16Array,e),pw=e=>sw(Uint32Array,e),mw=e=>sw(Float32Array,e),hw=e=>sw(Float64Array,e),gw=e=>sw(Uint8ClampedArray,e);function _w(e,t){return xp(this,arguments,function*(){if(RC(t))return yield L(yield L(yield*Sp(Cp(_w(e,yield L(t))))));let n=function(e){return xp(this,arguments,function*(){yield yield L(yield L(e))})},r=function(e){return xp(this,arguments,function*(){yield L(yield*Sp(Cp(ow(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 WC?n(t):zC(t)?r(t):BC(t)?t:n(t);return yield L(yield*Sp(Cp(ow(function(t){return xp(this,arguments,function*(){let n=null;do n=yield L(t.next(yield yield L(JC(e,n))));while(!n.done)})}(i[Symbol.asyncIterator]()))))),yield L(new e)})}const vw=e=>_w(Int8Array,e),yw=e=>_w(Int16Array,e),bw=e=>_w(Int32Array,e),xw=e=>_w(Uint8Array,e),Sw=e=>_w(Uint16Array,e),Cw=e=>_w(Uint32Array,e),ww=e=>_w(Float32Array,e),Tw=e=>_w(Float64Array,e),Ew=e=>_w(Uint8ClampedArray,e);function Dw(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(++nLw});const Iw=void 0;function Lw(e){if(e===null)return`null`;if(e===Iw)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=>Lw(e))}]`:`[${e}]`:ArrayBuffer.isView(e)?`[${e}]`:JSON.stringify(e,(e,t)=>typeof t==`bigint`?`${t}`:t)}function Rw(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 zw(e,t){return Rw(e/t)+Rw(e%t)/Rw(t)}var Bw={};Re(Bw,{BN:()=>Qw,bigNumToBigInt:()=>Xw,bigNumToNumber:()=>Jw,bigNumToString:()=>Yw,isArrowBigNumSymbol:()=>Vw});const Vw=Symbol.for(`isArrowBigNum`);function Hw(e,...t){return t.length===0?Object.setPrototypeOf(JC(this.TypedArray,e),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(e,...t),this.constructor.prototype)}Hw.prototype[Vw]=!0,Hw.prototype.toJSON=function(){return`"${Yw(this)}"`},Hw.prototype.valueOf=function(e){return Jw(this,e)},Hw.prototype.toString=function(){return Yw(this)},Hw.prototype[Symbol.toPrimitive]=function(e=`default`){switch(e){case`number`:return Jw(this);case`string`:return Yw(this);case`default`:return Xw(this)}return Yw(this)};function Uw(...e){return Hw.apply(this,e)}function Ww(...e){return Hw.apply(this,e)}function Gw(...e){return Hw.apply(this,e)}Object.setPrototypeOf(Uw.prototype,Object.create(Int32Array.prototype)),Object.setPrototypeOf(Ww.prototype,Object.create(Uint32Array.prototype)),Object.setPrototypeOf(Gw.prototype,Object.create(Uint32Array.prototype)),Object.assign(Uw.prototype,Hw.prototype,{constructor:Uw,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array}),Object.assign(Ww.prototype,Hw.prototype,{constructor:Ww,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array}),Object.assign(Gw.prototype,Hw.prototype,{constructor:Gw,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});const Kw=BigInt(4294967296)*BigInt(4294967296),qw=Kw-BigInt(1);function Jw(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=Rw(n),a=`${r}`.padStart(t,`0`),o=s&&i===0?`-`:``;return+`${o}${i}.${a}`}return Rw(c)}function Yw(e){if(e.byteLength===8){let t=new e.BigIntArray(e.buffer,e.byteOffset,1);return`${t[0]}`}if(!e.signed)return Zw(e);let t=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2),n=new Int16Array([t.at(-1)])[0];if(n>=0)return Zw(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`))(G.prototype);var xT=class extends G{constructor(){super(W.Null)}toString(){return`Null`}};eT=Symbol.toStringTag,xT[eT]=(e=>e[Symbol.toStringTag]=`Null`)(xT.prototype);var ST=class extends G{constructor(e,t){super(W.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}`}};tT=Symbol.toStringTag,ST[tT]=(e=>(e.isSigned=null,e.bitWidth=null,e[Symbol.toStringTag]=`Int`))(ST.prototype);var CT=class extends ST{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},wT=class extends ST{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},TT=class extends ST{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},ET=class extends ST{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},DT=class extends ST{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},OT=class extends ST{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},kT=class extends ST{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},AT=class extends ST{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(CT.prototype,`ArrayType`,{value:Int8Array}),Object.defineProperty(wT.prototype,`ArrayType`,{value:Int16Array}),Object.defineProperty(TT.prototype,`ArrayType`,{value:Int32Array}),Object.defineProperty(ET.prototype,`ArrayType`,{value:BigInt64Array}),Object.defineProperty(DT.prototype,`ArrayType`,{value:Uint8Array}),Object.defineProperty(OT.prototype,`ArrayType`,{value:Uint16Array}),Object.defineProperty(kT.prototype,`ArrayType`,{value:Uint32Array}),Object.defineProperty(AT.prototype,`ArrayType`,{value:BigUint64Array});var jT=class extends G{constructor(e){super(W.Float),this.precision=e}get ArrayType(){switch(this.precision){case Aw.HALF:return Uint16Array;case Aw.SINGLE:return Float32Array;case Aw.DOUBLE:return Float64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};nT=Symbol.toStringTag,jT[nT]=(e=>(e.precision=null,e[Symbol.toStringTag]=`Float`))(jT.prototype);var MT=class extends jT{constructor(){super(Aw.HALF)}},NT=class extends jT{constructor(){super(Aw.SINGLE)}},PT=class extends jT{constructor(){super(Aw.DOUBLE)}};Object.defineProperty(MT.prototype,`ArrayType`,{value:Uint16Array}),Object.defineProperty(NT.prototype,`ArrayType`,{value:Float32Array}),Object.defineProperty(PT.prototype,`ArrayType`,{value:Float64Array});var FT=class extends G{constructor(){super(W.Binary)}toString(){return`Binary`}};rT=Symbol.toStringTag,FT[rT]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Binary`))(FT.prototype);var IT=class extends G{constructor(){super(W.LargeBinary)}toString(){return`LargeBinary`}};iT=Symbol.toStringTag,IT[iT]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]=`LargeBinary`))(IT.prototype);var LT=class extends G{constructor(){super(W.Utf8)}toString(){return`Utf8`}};aT=Symbol.toStringTag,LT[aT]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Utf8`))(LT.prototype);var RT=class extends G{constructor(){super(W.LargeUtf8)}toString(){return`LargeUtf8`}};oT=Symbol.toStringTag,RT[oT]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]=`LargeUtf8`))(RT.prototype);var zT=class extends G{constructor(){super(W.Bool)}toString(){return`Bool`}};sT=Symbol.toStringTag,zT[sT]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Bool`))(zT.prototype);var BT=class extends G{constructor(e,t,n=128){super(W.Decimal),this.scale=e,this.precision=t,this.bitWidth=n}toString(){return`Decimal[${this.precision}e${this.scale>0?`+`:``}${this.scale}]`}};cT=Symbol.toStringTag,BT[cT]=(e=>(e.scale=null,e.precision=null,e.ArrayType=Uint32Array,e[Symbol.toStringTag]=`Decimal`))(BT.prototype);var VT=class extends G{constructor(e){super(W.Date),this.unit=e}toString(){return`Date${(this.unit+1)*32}<${jw[this.unit]}>`}get ArrayType(){return this.unit===jw.DAY?Int32Array:BigInt64Array}};lT=Symbol.toStringTag,VT[lT]=(e=>(e.unit=null,e[Symbol.toStringTag]=`Date`))(VT.prototype);var HT=class extends G{constructor(e,t){super(W.Time),this.unit=e,this.bitWidth=t}toString(){return`Time${this.bitWidth}<${Mw[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};uT=Symbol.toStringTag,HT[uT]=(e=>(e.unit=null,e.bitWidth=null,e[Symbol.toStringTag]=`Time`))(HT.prototype);var UT=class extends G{constructor(e,t){super(W.Timestamp),this.unit=e,this.timezone=t}toString(){return`Timestamp<${Mw[this.unit]}${this.timezone?`, ${this.timezone}`:``}>`}};dT=Symbol.toStringTag,UT[dT]=(e=>(e.unit=null,e.timezone=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]=`Timestamp`))(UT.prototype);var WT=class extends G{constructor(e){super(W.Interval),this.unit=e}toString(){return`Interval<${Nw[this.unit]}>`}};fT=Symbol.toStringTag,WT[fT]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]=`Interval`))(WT.prototype);var GT=class extends G{constructor(e){super(W.Duration),this.unit=e}toString(){return`Duration<${Mw[this.unit]}>`}};pT=Symbol.toStringTag,GT[pT]=(e=>(e.unit=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]=`Duration`))(GT.prototype);var KT=class extends G{constructor(e){super(W.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}};mT=Symbol.toStringTag,KT[mT]=(e=>(e.children=null,e[Symbol.toStringTag]=`List`))(KT.prototype);var qT=class extends G{constructor(e){super(W.Struct),this.children=e}toString(){return`Struct<{${this.children.map(e=>`${e.name}:${e.type}`).join(`, `)}}>`}};hT=Symbol.toStringTag,qT[hT]=(e=>(e.children=null,e[Symbol.toStringTag]=`Struct`))(qT.prototype);var JT=class extends G{constructor(e,t,n){super(W.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(` | `)}>`}};gT=Symbol.toStringTag,JT[gT]=(e=>(e.mode=null,e.typeIds=null,e.children=null,e.typeIdToChildIndex=null,e.ArrayType=Int8Array,e[Symbol.toStringTag]=`Union`))(JT.prototype);var YT=class extends G{constructor(e){super(W.FixedSizeBinary),this.byteWidth=e}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};_T=Symbol.toStringTag,YT[_T]=(e=>(e.byteWidth=null,e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`FixedSizeBinary`))(YT.prototype);var XT=class extends G{constructor(e,t){super(W.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}>`}};vT=Symbol.toStringTag,XT[vT]=(e=>(e.children=null,e.listSize=null,e[Symbol.toStringTag]=`FixedSizeList`))(XT.prototype);var ZT=class extends G{constructor(e,t=!1){var n,r,i;if(super(W.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(`, `)}}>`}};yT=Symbol.toStringTag,ZT[yT]=(e=>(e.children=null,e.keysSorted=null,e[Symbol.toStringTag]=`Map_`))(ZT.prototype);const QT=(e=>()=>++e)(-1);var $T=class extends G{constructor(e,t,n,r){super(W.Dictionary),this.indices=t,this.dictionary=e,this.isOrdered=r||!1,this.id=n==null?QT():Rw(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}>`}};bT=Symbol.toStringTag,$T[bT]=(e=>(e.id=null,e.indices=null,e.isOrdered=null,e.dictionary=null,e[Symbol.toStringTag]=`Dictionary`))($T.prototype);function eE(e){let t=e;switch(e.typeId){case W.Decimal:return e.bitWidth/32;case W.Interval:return t.unit===Nw.MONTH_DAY_NANO?4:1+t.unit;case W.FixedSizeList:return t.listSize;case W.FixedSizeBinary:return t.byteWidth;default:return 1}}var tE=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 nE(this,e,t)}getVisitFnByTypeId(e,t=!0){return rE(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 nE(e,t,n=!0){return typeof t==`number`?rE(e,t,n):typeof t==`string`&&t in W?rE(e,W[t],n):t&&t instanceof G?rE(e,iE(t),n):t?.type&&t.type instanceof G?rE(e,iE(t.type),n):rE(e,W.NONE,n)}function rE(e,t,n=!0){let r=null;switch(t){case W.Null:r=e.visitNull;break;case W.Bool:r=e.visitBool;break;case W.Int:r=e.visitInt;break;case W.Int8:r=e.visitInt8||e.visitInt;break;case W.Int16:r=e.visitInt16||e.visitInt;break;case W.Int32:r=e.visitInt32||e.visitInt;break;case W.Int64:r=e.visitInt64||e.visitInt;break;case W.Uint8:r=e.visitUint8||e.visitInt;break;case W.Uint16:r=e.visitUint16||e.visitInt;break;case W.Uint32:r=e.visitUint32||e.visitInt;break;case W.Uint64:r=e.visitUint64||e.visitInt;break;case W.Float:r=e.visitFloat;break;case W.Float16:r=e.visitFloat16||e.visitFloat;break;case W.Float32:r=e.visitFloat32||e.visitFloat;break;case W.Float64:r=e.visitFloat64||e.visitFloat;break;case W.Utf8:r=e.visitUtf8;break;case W.LargeUtf8:r=e.visitLargeUtf8;break;case W.Binary:r=e.visitBinary;break;case W.LargeBinary:r=e.visitLargeBinary;break;case W.FixedSizeBinary:r=e.visitFixedSizeBinary;break;case W.Date:r=e.visitDate;break;case W.DateDay:r=e.visitDateDay||e.visitDate;break;case W.DateMillisecond:r=e.visitDateMillisecond||e.visitDate;break;case W.Timestamp:r=e.visitTimestamp;break;case W.TimestampSecond:r=e.visitTimestampSecond||e.visitTimestamp;break;case W.TimestampMillisecond:r=e.visitTimestampMillisecond||e.visitTimestamp;break;case W.TimestampMicrosecond:r=e.visitTimestampMicrosecond||e.visitTimestamp;break;case W.TimestampNanosecond:r=e.visitTimestampNanosecond||e.visitTimestamp;break;case W.Time:r=e.visitTime;break;case W.TimeSecond:r=e.visitTimeSecond||e.visitTime;break;case W.TimeMillisecond:r=e.visitTimeMillisecond||e.visitTime;break;case W.TimeMicrosecond:r=e.visitTimeMicrosecond||e.visitTime;break;case W.TimeNanosecond:r=e.visitTimeNanosecond||e.visitTime;break;case W.Decimal:r=e.visitDecimal;break;case W.List:r=e.visitList;break;case W.Struct:r=e.visitStruct;break;case W.Union:r=e.visitUnion;break;case W.DenseUnion:r=e.visitDenseUnion||e.visitUnion;break;case W.SparseUnion:r=e.visitSparseUnion||e.visitUnion;break;case W.Dictionary:r=e.visitDictionary;break;case W.Interval:r=e.visitInterval;break;case W.IntervalDayTime:r=e.visitIntervalDayTime||e.visitInterval;break;case W.IntervalYearMonth:r=e.visitIntervalYearMonth||e.visitInterval;break;case W.IntervalMonthDayNano:r=e.visitIntervalMonthDayNano||e.visitInterval;break;case W.Duration:r=e.visitDuration;break;case W.DurationSecond:r=e.visitDurationSecond||e.visitDuration;break;case W.DurationMillisecond:r=e.visitDurationMillisecond||e.visitDuration;break;case W.DurationMicrosecond:r=e.visitDurationMicrosecond||e.visitDuration;break;case W.DurationNanosecond:r=e.visitDurationNanosecond||e.visitDuration;break;case W.FixedSizeList:r=e.visitFixedSizeList;break;case W.Map:r=e.visitMap;break}if(typeof r==`function`)return r;if(!n)return()=>null;throw Error(`Unrecognized type '${W[t]}'`)}function iE(e){switch(e.typeId){case W.Null:return W.Null;case W.Int:{let{bitWidth:t,isSigned:n}=e;switch(t){case 8:return n?W.Int8:W.Uint8;case 16:return n?W.Int16:W.Uint16;case 32:return n?W.Int32:W.Uint32;case 64:return n?W.Int64:W.Uint64}return W.Int}case W.Float:switch(e.precision){case Aw.HALF:return W.Float16;case Aw.SINGLE:return W.Float32;case Aw.DOUBLE:return W.Float64}return W.Float;case W.Binary:return W.Binary;case W.LargeBinary:return W.LargeBinary;case W.Utf8:return W.Utf8;case W.LargeUtf8:return W.LargeUtf8;case W.Bool:return W.Bool;case W.Decimal:return W.Decimal;case W.Time:switch(e.unit){case Mw.SECOND:return W.TimeSecond;case Mw.MILLISECOND:return W.TimeMillisecond;case Mw.MICROSECOND:return W.TimeMicrosecond;case Mw.NANOSECOND:return W.TimeNanosecond}return W.Time;case W.Timestamp:switch(e.unit){case Mw.SECOND:return W.TimestampSecond;case Mw.MILLISECOND:return W.TimestampMillisecond;case Mw.MICROSECOND:return W.TimestampMicrosecond;case Mw.NANOSECOND:return W.TimestampNanosecond}return W.Timestamp;case W.Date:switch(e.unit){case jw.DAY:return W.DateDay;case jw.MILLISECOND:return W.DateMillisecond}return W.Date;case W.Interval:switch(e.unit){case Nw.DAY_TIME:return W.IntervalDayTime;case Nw.YEAR_MONTH:return W.IntervalYearMonth;case Nw.MONTH_DAY_NANO:return W.IntervalMonthDayNano}return W.Interval;case W.Duration:switch(e.unit){case Mw.SECOND:return W.DurationSecond;case Mw.MILLISECOND:return W.DurationMillisecond;case Mw.MICROSECOND:return W.DurationMicrosecond;case Mw.NANOSECOND:return W.DurationNanosecond}return W.Duration;case W.Map:return W.Map;case W.List:return W.List;case W.Struct:return W.Struct;case W.Union:switch(e.mode){case kw.Dense:return W.DenseUnion;case kw.Sparse:return W.SparseUnion}return W.Union;case W.FixedSizeBinary:return W.FixedSizeBinary;case W.FixedSizeList:return W.FixedSizeList;case W.Dictionary:return W.Dictionary}throw Error(`Unrecognized type '${W[e.typeId]}'`)}tE.prototype.visitInt8=null,tE.prototype.visitInt16=null,tE.prototype.visitInt32=null,tE.prototype.visitInt64=null,tE.prototype.visitUint8=null,tE.prototype.visitUint16=null,tE.prototype.visitUint32=null,tE.prototype.visitUint64=null,tE.prototype.visitFloat16=null,tE.prototype.visitFloat32=null,tE.prototype.visitFloat64=null,tE.prototype.visitDateDay=null,tE.prototype.visitDateMillisecond=null,tE.prototype.visitTimestampSecond=null,tE.prototype.visitTimestampMillisecond=null,tE.prototype.visitTimestampMicrosecond=null,tE.prototype.visitTimestampNanosecond=null,tE.prototype.visitTimeSecond=null,tE.prototype.visitTimeMillisecond=null,tE.prototype.visitTimeMicrosecond=null,tE.prototype.visitTimeNanosecond=null,tE.prototype.visitDenseUnion=null,tE.prototype.visitSparseUnion=null,tE.prototype.visitIntervalDayTime=null,tE.prototype.visitIntervalYearMonth=null,tE.prototype.visitIntervalMonthDayNano=null,tE.prototype.visitDuration=null,tE.prototype.visitDurationSecond=null,tE.prototype.visitDurationMillisecond=null,tE.prototype.visitDurationMicrosecond=null,tE.prototype.visitDurationNanosecond=null;var aE={};Re(aE,{float64ToUint16:()=>lE,uint16ToFloat64:()=>cE});const oE=new Float64Array(1),sE=new Uint32Array(oE.buffer);function cE(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 lE(e){if(e!==e)return 32256;oE[0]=e;let t=(sE[1]&2147483648)>>16&65535,n=sE[1]&2146435072,r=0;return n>=1089470464?sE[0]>0?n=31744:(n=(n&2080374784)>>16,r=(sE[1]&1048575)>>10):n<=1056964608?(r=1048576+(sE[1]&1048575),r=1048576+(r<<(n>>20)-998)>>21,n=0):(n=n-1056964608>>10,r=(sE[1]&1048575)+512>>10),t|n|r&65535}var uE=class extends tE{};function dE(e){return(t,n,r)=>{if(t.setValid(n,r!=null))return e(t,n,r)}}const fE=(e,t,n)=>{e[t]=Math.floor(n/864e5)},pE=(e,t,n,r)=>{if(n+1{let i=e+n;r?t[i>>3]|=1<>3]&=~(1<{e[t]=n},gE=({values:e},t,n)=>{e[t]=n},_E=({values:e},t,n)=>{e[t]=lE(n)},vE=(e,t,n)=>{switch(e.type.precision){case Aw.HALF:return _E(e,t,n);case Aw.SINGLE:case Aw.DOUBLE:return gE(e,t,n)}},yE=({values:e},t,n)=>{fE(e,t,n.valueOf())},bE=({values:e},t,n)=>{e[t]=BigInt(n)},xE=({stride:e,values:t},n,r)=>{t.set(r.subarray(0,e),e*n)},SE=({values:e,valueOffsets:t},n,r)=>pE(e,t,n,r),CE=({values:e,valueOffsets:t},n,r)=>pE(e,t,n,FC(r)),wE=(e,t,n)=>{e.type.unit===jw.DAY?yE(e,t,n):bE(e,t,n)},TE=({values:e},t,n)=>{e[t]=BigInt(n/1e3)},EE=({values:e},t,n)=>{e[t]=BigInt(n)},DE=({values:e},t,n)=>{e[t]=BigInt(n*1e3)},OE=({values:e},t,n)=>{e[t]=BigInt(n*1e6)},kE=(e,t,n)=>{switch(e.type.unit){case Mw.SECOND:return TE(e,t,n);case Mw.MILLISECOND:return EE(e,t,n);case Mw.MICROSECOND:return DE(e,t,n);case Mw.NANOSECOND:return OE(e,t,n)}},AE=({values:e},t,n)=>{e[t]=n},jE=({values:e},t,n)=>{e[t]=n},ME=({values:e},t,n)=>{e[t]=n},NE=({values:e},t,n)=>{e[t]=n},PE=(e,t,n)=>{switch(e.type.unit){case Mw.SECOND:return AE(e,t,n);case Mw.MILLISECOND:return jE(e,t,n);case Mw.MICROSECOND:return ME(e,t,n);case Mw.NANOSECOND:return NE(e,t,n)}},FE=({values:e,stride:t},n,r)=>{e.set(r.subarray(0,t),t*n)},IE=(e,t,n)=>{let r=e.children[0],i=e.valueOffsets,a=rD.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=rD.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},RE=(e,t)=>(n,r,i,a)=>r&&n(r,e,t[a]),zE=(e,t)=>(n,r,i,a)=>r&&n(r,e,t.get(a)),BE=(e,t)=>(n,r,i,a)=>r&&n(r,e,t.get(i.name)),VE=(e,t)=>(n,r,i,a)=>r&&n(r,e,t[i.name]),HE=(e,t,n)=>{let r=e.type.children.map(e=>rD.getVisitFn(e.type)),i=n instanceof Map?BE(t,n):n instanceof rk?zE(t,n):Array.isArray(n)?RE(t,n):VE(t,n);e.type.children.forEach((t,n)=>i(r[n],e.children[n],t,n))},UE=(e,t,n)=>{e.type.mode===kw.Dense?WE(e,t,n):GE(e,t,n)},WE=(e,t,n)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];rD.visit(i,e.valueOffsets[t],n)},GE=(e,t,n)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];rD.visit(i,t,n)},KE=(e,t,n)=>{var r;(r=e.dictionary)==null||r.set(e.values[t],n)},qE=(e,t,n)=>{switch(e.type.unit){case Nw.YEAR_MONTH:return YE(e,t,n);case Nw.DAY_TIME:return JE(e,t,n);case Nw.MONTH_DAY_NANO:return XE(e,t,n)}},JE=({values:e},t,n)=>{e.set(n.subarray(0,2),2*t)},YE=({values:e},t,n)=>{e[t]=n[0]*12+n[1]%12},XE=({values:e,stride:t},n,r)=>{e.set(r.subarray(0,t),t*n)},ZE=({values:e},t,n)=>{e[t]=n},QE=({values:e},t,n)=>{e[t]=n},$E=({values:e},t,n)=>{e[t]=n},eD=({values:e},t,n)=>{e[t]=n},tD=(e,t,n)=>{switch(e.type.unit){case Mw.SECOND:return ZE(e,t,n);case Mw.MILLISECOND:return QE(e,t,n);case Mw.MICROSECOND:return $E(e,t,n);case Mw.NANOSECOND:return eD(e,t,n)}},nD=(e,t,n)=>{let{stride:r}=e,i=e.children[0],a=rD.getVisitFn(i);if(Array.isArray(n))for(let e=-1,o=t*r;++e`${Lw(e)}: ${Lw(t)}`).join(`, `)}}`}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.toString()}[Symbol.iterator](){return new sD(this[iD],this[aD])}},sD=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[iD].type.children.some(e=>e.name===t)}getOwnPropertyDescriptor(e,t){if(e[iD].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[iD].type.children.findIndex(e=>e.name===t);if(n!==-1){let r=eO.visit(e[iD].children[n],e[aD]);return Reflect.set(e,t,r),r}}set(e,t,n){let r=e[iD].type.children.findIndex(e=>e.name===t);return r===-1?Reflect.has(e,t)||typeof t==`symbol`?Reflect.set(e,t,n):!1:(rD.visit(e[iD].children[r],e[aD],n),Reflect.set(e,t,n))}};const lD=new cD;var K=class extends tE{};function uD(e){return(t,n)=>t.getValid(n)?e(t,n):null}const dD=(e,t)=>864e5*e[t],fD=(e,t)=>null,pD=(e,t,n)=>{if(n+1>=t.length)return null;let r=Rw(t[n]),i=Rw(t[n+1]);return e.subarray(r,i)},mD=({offset:e,values:t},n)=>{let r=e+n,i=t[r>>3];return(i&1<dD(e,t),gD=({values:e},t)=>Rw(e[t]),_D=({stride:e,values:t},n)=>t[e*n],vD=({stride:e,values:t},n)=>cE(t[e*n]),yD=({values:e},t)=>e[t],bD=({stride:e,values:t},n)=>t.subarray(e*n,e*(n+1)),xD=({values:e,valueOffsets:t},n)=>pD(e,t,n),SD=({values:e,valueOffsets:t},n)=>{let r=pD(e,t,n);return r===null?null:NC(r)},CD=({values:e},t)=>e[t],wD=({type:e,values:t},n)=>e.precision===Aw.HALF?cE(t[n]):t[n],TD=(e,t)=>e.type.unit===jw.DAY?hD(e,t):gD(e,t),ED=({values:e},t)=>1e3*Rw(e[t]),DD=({values:e},t)=>Rw(e[t]),OD=({values:e},t)=>zw(e[t],BigInt(1e3)),kD=({values:e},t)=>zw(e[t],BigInt(1e6)),AD=(e,t)=>{switch(e.type.unit){case Mw.SECOND:return ED(e,t);case Mw.MILLISECOND:return DD(e,t);case Mw.MICROSECOND:return OD(e,t);case Mw.NANOSECOND:return kD(e,t)}},jD=({values:e},t)=>e[t],MD=({values:e},t)=>e[t],ND=({values:e},t)=>e[t],PD=({values:e},t)=>e[t],FD=(e,t)=>{switch(e.type.unit){case Mw.SECOND:return jD(e,t);case Mw.MILLISECOND:return MD(e,t);case Mw.MICROSECOND:return ND(e,t);case Mw.NANOSECOND:return PD(e,t)}},ID=({values:e,stride:t},n)=>Qw.decimal(e.subarray(t*n,t*(n+1))),LD=(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 rk([c])},RD=(e,t)=>{let{valueOffsets:n,children:r}=e,{[t]:i,[t+1]:a}=n,o=r[0];return new aO(o.slice(i,a-i))},zD=(e,t)=>new oD(e,t),BD=(e,t)=>e.type.mode===kw.Dense?VD(e,t):HD(e,t),VD=(e,t)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return eO.visit(r,e.valueOffsets[t])},HD=(e,t)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return eO.visit(r,t)},UD=(e,t)=>{var n;return(n=e.dictionary)?.get(e.values[t])},WD=(e,t)=>e.type.unit===Nw.MONTH_DAY_NANO?qD(e,t):e.type.unit===Nw.DAY_TIME?GD(e,t):KD(e,t),GD=({values:e},t)=>e.subarray(2*t,2*(t+1)),KD=({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},qD=({values:e},t)=>e.subarray(4*t,4*(t+1)),JD=({values:e},t)=>e[t],YD=({values:e},t)=>e[t],XD=({values:e},t)=>e[t],ZD=({values:e},t)=>e[t],QD=(e,t)=>{switch(e.type.unit){case Mw.SECOND:return JD(e,t);case Mw.MILLISECOND:return YD(e,t);case Mw.MICROSECOND:return XD(e,t);case Mw.NANOSECOND:return ZD(e,t)}},$D=(e,t)=>{let{stride:n,children:r}=e,i=r[0],a=i.slice(t*n,n);return new rk([a])};K.prototype.visitNull=uD(fD),K.prototype.visitBool=uD(mD),K.prototype.visitInt=uD(CD),K.prototype.visitInt8=uD(_D),K.prototype.visitInt16=uD(_D),K.prototype.visitInt32=uD(_D),K.prototype.visitInt64=uD(yD),K.prototype.visitUint8=uD(_D),K.prototype.visitUint16=uD(_D),K.prototype.visitUint32=uD(_D),K.prototype.visitUint64=uD(yD),K.prototype.visitFloat=uD(wD),K.prototype.visitFloat16=uD(vD),K.prototype.visitFloat32=uD(_D),K.prototype.visitFloat64=uD(_D),K.prototype.visitUtf8=uD(SD),K.prototype.visitLargeUtf8=uD(SD),K.prototype.visitBinary=uD(xD),K.prototype.visitLargeBinary=uD(xD),K.prototype.visitFixedSizeBinary=uD(bD),K.prototype.visitDate=uD(TD),K.prototype.visitDateDay=uD(hD),K.prototype.visitDateMillisecond=uD(gD),K.prototype.visitTimestamp=uD(AD),K.prototype.visitTimestampSecond=uD(ED),K.prototype.visitTimestampMillisecond=uD(DD),K.prototype.visitTimestampMicrosecond=uD(OD),K.prototype.visitTimestampNanosecond=uD(kD),K.prototype.visitTime=uD(FD),K.prototype.visitTimeSecond=uD(jD),K.prototype.visitTimeMillisecond=uD(MD),K.prototype.visitTimeMicrosecond=uD(ND),K.prototype.visitTimeNanosecond=uD(PD),K.prototype.visitDecimal=uD(ID),K.prototype.visitList=uD(LD),K.prototype.visitStruct=uD(zD),K.prototype.visitUnion=uD(BD),K.prototype.visitDenseUnion=uD(VD),K.prototype.visitSparseUnion=uD(HD),K.prototype.visitDictionary=uD(UD),K.prototype.visitInterval=uD(WD),K.prototype.visitIntervalDayTime=uD(GD),K.prototype.visitIntervalYearMonth=uD(KD),K.prototype.visitIntervalMonthDayNano=uD(qD),K.prototype.visitDuration=uD(QD),K.prototype.visitDurationSecond=uD(JD),K.prototype.visitDurationMillisecond=uD(YD),K.prototype.visitDurationMicrosecond=uD(XD),K.prototype.visitDurationNanosecond=uD(ZD),K.prototype.visitFixedSizeList=uD($D),K.prototype.visitMap=uD(RD);const eO=new K,tO=Symbol.for(`keys`),nO=Symbol.for(`vals`),rO=Symbol.for(`kKeysAsStrings`),iO=Symbol.for(`_kKeysAsStrings`);var aO=class{constructor(e){return this[tO]=new rk([e.children[0]]).memoize(),this[nO]=e.children[1],new Proxy(this,new sO)}get[rO](){return this[iO]||(this[iO]=Array.from(this[tO].toArray(),String))}[Symbol.iterator](){return new oO(this[tO],this[nO])}get size(){return this[tO].length}toArray(){return Object.values(this.toJSON())}toJSON(){let e=this[tO],t=this[nO],n={};for(let r=-1,i=e.length;++r`${Lw(e)}: ${Lw(t)}`).join(`, `)}}`}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.toString()}},oO=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),eO.visit(this.vals,e)]})}},sO=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[rO]}has(e,t){return e[rO].includes(t)}getOwnPropertyDescriptor(e,t){let n=e[rO].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[rO].indexOf(t);if(n!==-1){let r=eO.visit(Reflect.get(e,nO),n);return Reflect.set(e,t,r),r}}set(e,t,n){let r=e[rO].indexOf(t);return r===-1?Reflect.has(e,t)?Reflect.set(e,t,n):!1:(rD.visit(Reflect.get(e,nO),r,n),Reflect.set(e,t,n))}};Object.defineProperties(aO.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:`Row`},[tO]:{writable:!0,enumerable:!1,configurable:!1,value:null},[nO]:{writable:!0,enumerable:!1,configurable:!1,value:null},[iO]:{writable:!0,enumerable:!1,configurable:!1,value:null}});var cO={};Re(cO,{clampRange:()=>uO,createElementComparator:()=>pO,wrapIndex:()=>dO});let lO;function uO(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 dO=(e,t)=>e<0?t+e:e,fO=e=>e!==e;function pO(e){let t=typeof e;if(t!==`object`||e===null)return fO(e)?fO: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?Ow(e,t):!1:e instanceof Map?hO(e):Array.isArray(e)?mO(e):e instanceof rk?gO(e):_O(e,!0)}function mO(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 yO(e,n);case Map:return xO(e,n,n.keys());case aO:case oD:case Object:case void 0:return xO(e,n,t||Object.keys(n))}return n instanceof rk?bO(e,n):!1}}function yO(e,t){let n=e.length;if(t.length!==n)return!1;for(let r=-1;++rOO,getBit:()=>wO,getBool:()=>CO,packBools:()=>DO,popcnt_array:()=>AO,popcnt_bit_range:()=>kO,popcnt_uint32:()=>jO,setBool:()=>TO,truncateBitmap:()=>EO});function CO(e,t,n,r){return(n&1<>r}function TO(e,t,n){return n?!!(e[t>>3]|=1<>3]&=~(1<0||n.byteLength>3):DO(new OO(n,e,t,null,CO)).subarray(0,r)),i}return n}function DO(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 OO=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 kO(e,t,i)+kO(e,r,n)+AO(e,i>>3,r-i>>3)}function AO(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+=jO(a.getUint32(i)),i+=4;for(;o-i>=2;)r+=jO(a.getUint16(i)),i+=2;for(;o-i>=1;)r+=jO(a.getUint8(i)),i+=1;return r}function jO(e){let t=Math.trunc(e);return t-=t>>>1&1431655765,t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}const MO=-1;var NO=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 G.isSparseUnion(e)||G.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(G.isUnion(this.type))return this.children.reduce((e,t)=>e+t.nullCount,0);let e=this._nullCount,t;return e<=MO&&(t=this.nullBitmap)&&(this._nullCount=e=t.length===0?0:this.length-kO(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=eE(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(G.isUnion(t)){let n=t,r=this.children[n.typeIdToChildIndex[this.typeIds[e]]],i=n.mode===kw.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(EO(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===W.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(EO(this.offset,t,this.nullBitmap),0);let i=this.buffers;return i[Pw.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[Pw.TYPE])&&(a[Pw.TYPE]=i.subarray(e,e+t)),(i=a[Pw.OFFSET])&&(a[Pw.OFFSET]=i.subarray(e,e+t+1))||(i=a[Pw.DATA])&&(a[Pw.DATA]=r===6?i:i.subarray(n*e,n*(e+t))),a}_sliceChildren(e,t,n){return e.map(e=>e.slice(t,n))}};NO.prototype.children=Object.freeze([]);var PO=class e extends tE{visit(e){return this.getVisitFn(e.type).call(this,e)}visitNull(e){let{type:t,offset:n=0,length:r=0}=e;return new NO(t,n,r,r)}visitBool(e){let{type:t,offset:n=0}=e,r=$C(e.nullBitmap),i=JC(t.ArrayType,e.data),{length:a=i.length>>3,nullCount:o=e.nullBitmap?-1:0}=e;return new NO(t,n,a,o,[void 0,i,r])}visitInt(e){let{type:t,offset:n=0}=e,r=$C(e.nullBitmap),i=JC(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new NO(t,n,a,o,[void 0,i,r])}visitFloat(e){let{type:t,offset:n=0}=e,r=$C(e.nullBitmap),i=JC(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new NO(t,n,a,o,[void 0,i,r])}visitUtf8(e){let{type:t,offset:n=0}=e,r=$C(e.data),i=$C(e.nullBitmap),a=ZC(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new NO(t,n,o,s,[a,r,i])}visitLargeUtf8(e){let{type:t,offset:n=0}=e,r=$C(e.data),i=$C(e.nullBitmap),a=QC(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new NO(t,n,o,s,[a,r,i])}visitBinary(e){let{type:t,offset:n=0}=e,r=$C(e.data),i=$C(e.nullBitmap),a=ZC(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new NO(t,n,o,s,[a,r,i])}visitLargeBinary(e){let{type:t,offset:n=0}=e,r=$C(e.data),i=$C(e.nullBitmap),a=QC(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new NO(t,n,o,s,[a,r,i])}visitFixedSizeBinary(e){let{type:t,offset:n=0}=e,r=$C(e.nullBitmap),i=JC(t.ArrayType,e.data),{length:a=i.length/eE(t),nullCount:o=e.nullBitmap?-1:0}=e;return new NO(t,n,a,o,[void 0,i,r])}visitDate(e){let{type:t,offset:n=0}=e,r=$C(e.nullBitmap),i=JC(t.ArrayType,e.data),{length:a=i.length/eE(t),nullCount:o=e.nullBitmap?-1:0}=e;return new NO(t,n,a,o,[void 0,i,r])}visitTimestamp(e){let{type:t,offset:n=0}=e,r=$C(e.nullBitmap),i=JC(t.ArrayType,e.data),{length:a=i.length/eE(t),nullCount:o=e.nullBitmap?-1:0}=e;return new NO(t,n,a,o,[void 0,i,r])}visitTime(e){let{type:t,offset:n=0}=e,r=$C(e.nullBitmap),i=JC(t.ArrayType,e.data),{length:a=i.length/eE(t),nullCount:o=e.nullBitmap?-1:0}=e;return new NO(t,n,a,o,[void 0,i,r])}visitDecimal(e){let{type:t,offset:n=0}=e,r=$C(e.nullBitmap),i=JC(t.ArrayType,e.data),{length:a=i.length/eE(t),nullCount:o=e.nullBitmap?-1:0}=e;return new NO(t,n,a,o,[void 0,i,r])}visitList(e){let{type:t,offset:n=0,child:r}=e,i=$C(e.nullBitmap),a=ZC(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new NO(t,n,o,s,[a,void 0,i],[r])}visitStruct(e){let{type:t,offset:n=0,children:r=[]}=e,i=$C(e.nullBitmap),{length:a=r.reduce((e,{length:t})=>Math.max(e,t),0),nullCount:o=e.nullBitmap?-1:0}=e;return new NO(t,n,a,o,[void 0,void 0,i],r)}visitUnion(e){let{type:t,offset:n=0,children:r=[]}=e,i=JC(t.ArrayType,e.typeIds),{length:a=i.length,nullCount:o=-1}=e;if(G.isSparseUnion(t))return new NO(t,n,a,o,[void 0,void 0,void 0,i],r);let s=ZC(e.valueOffsets);return new NO(t,n,a,o,[s,void 0,void 0,i],r)}visitDictionary(t){let{type:n,offset:r=0}=t,i=$C(t.nullBitmap),a=JC(n.indices.ArrayType,t.data),{dictionary:o=new rk([new e().visit({type:n.dictionary})])}=t,{length:s=a.length,nullCount:c=t.nullBitmap?-1:0}=t;return new NO(n,r,s,c,[void 0,a,i],[],o)}visitInterval(e){let{type:t,offset:n=0}=e,r=$C(e.nullBitmap),i=JC(t.ArrayType,e.data),{length:a=i.length/eE(t),nullCount:o=e.nullBitmap?-1:0}=e;return new NO(t,n,a,o,[void 0,i,r])}visitDuration(e){let{type:t,offset:n=0}=e,r=$C(e.nullBitmap),i=JC(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new NO(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=$C(t.nullBitmap),{length:o=i.length/eE(n),nullCount:s=t.nullBitmap?-1:0}=t;return new NO(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=$C(t.nullBitmap),o=ZC(t.valueOffsets),{length:s=o.length-1,nullCount:c=t.nullBitmap?-1:0}=t;return new NO(n,r,s,c,[o,void 0,a],[i])}};const FO=new PO;var IO=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 RO(e){return e.reduce((e,t)=>e+t.nullCount,0)}function zO(e){return e.reduce((e,t,n)=>(e[n+1]=e[n]+t.length,e),new Uint32Array(e.length+1))}function BO(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 VO(e,t,n,r){let i=0,a=0,o=t.length-1;do{if(i>=o-1)return n0?0:-1}function qO(e,t){let{nullBitmap:n}=e;if(!n||e.nullCount<=0)return-1;let r=0;for(let i of new OO(n,e.offset+(t||0),e.length,n,CO)){if(!i)return r;++r}return-1}function JO(e,t,n){if(t===void 0)return-1;if(t===null)switch(e.typeId){case W.Union:break;case W.Dictionary:break;default:return qO(e,n)}let r=eO.getVisitFn(e),i=pO(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 IO(e.data.length,t=>{let r=e.data[t],i=r.length,a=e.slice(n,n+i);return n+=i,new QO(a)})}var QO=class{constructor(e){this.vector=e,this.index=0}next(){return this.indexe.data):t;if(a.length===0||a.some(e=>!(e instanceof NO)))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}=tk[o.typeId],r=a[0];this.isValid=e=>HO(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,nk[o.typeId]),this._offsets=zO(a);break}this.data=a,this.type=o,this.stride=eE(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 LO(this.data)}get nullCount(){return RO(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${W[this.type.typeId]}Vector`}isValid(e){return!1}get(e){return null}at(e){return this.get(dO(e,this.length))}set(e,t){}indexOf(e,t){return-1}includes(e,t){return this.indexOf(e,t)>-1}[Symbol.iterator](){return $O.visit(this)}concat(...t){return new e(this.data.concat(t.flatMap(e=>e.data).flat(1/0)))}slice(t,n){return new e(uO(this,t,n,({data:e,_offsets:t},n,r)=>BO(e,t,n,r)))}toJSON(){return[...this]}toArray(){let{type:e,data:t,length:n,stride:r,ArrayType:i}=this;switch(e.typeId){case W.Int:case W.Float:case W.Decimal:case W.Time:case W.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 G.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(G.isDictionary(this.type)){let t=new ik(this.data[0].dictionary),n=this.data.map(e=>{let n=e.clone();return n.dictionary=t,n});return new e(n)}return new ik(this)}unmemoize(){if(G.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}};ek=Symbol.toStringTag,rk[ek]=(e=>{e.type=G.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(W).map(e=>W[e]).filter(e=>typeof e==`number`&&e!==W.NONE);for(let n of t){let t=eO.getVisitFnByTypeId(n),r=rD.getVisitFnByTypeId(n),i=XO.getVisitFnByTypeId(n);tk[n]={get:t,set:r,indexOf:i},nk[n]=Object.create(e,{isValid:{value:UO(HO)},get:{value:UO(eO.getVisitFnByTypeId(n))},set:{value:WO(rD.getVisitFnByTypeId(n))},indexOf:{value:GO(XO.getVisitFnByTypeId(n))}})}return`Vector`})(rk.prototype);var ik=class e extends rk{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 rk(this.data)}),Object.defineProperty(this,`memoize`,{value:()=>this})}},ak={};Re(ak,{BaseInt64:()=>uk,Int128:()=>pk,Int64:()=>fk,Uint64:()=>dk});const ok=65536;function sk(e){return e<0&&(e=4294967295+e+1),`0x${e.toString(16)}`}const ck=8,lk=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];var uk=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`${sk(this.buffer[3])} ${sk(this.buffer[2])} ${sk(this.buffer[1])} ${sk(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;nhk,toIntervalDayTimeObjects:()=>_k,toIntervalMonthDayNanoInt32Array:()=>gk,toIntervalMonthDayNanoObjects:()=>vk});function hk(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 _k(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 tE{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 yk(e,t){return t instanceof e.constructor}function bk(e,t){return e===t||yk(e,t)}function xk(e,t){return e===t||yk(e,t)&&e.bitWidth===t.bitWidth&&e.isSigned===t.isSigned}function Sk(e,t){return e===t||yk(e,t)&&e.precision===t.precision}function Ck(e,t){return e===t||yk(e,t)&&e.byteWidth===t.byteWidth}function wk(e,t){return e===t||yk(e,t)&&e.unit===t.unit}function Tk(e,t){return e===t||yk(e,t)&&e.unit===t.unit&&e.timezone===t.timezone}function Ek(e,t){return e===t||yk(e,t)&&e.unit===t.unit&&e.bitWidth===t.bitWidth}function Dk(e,t){return e===t||yk(e,t)&&e.children.length===t.children.length&&Fk.compareManyFields(e.children,t.children)}function Ok(e,t){return e===t||yk(e,t)&&e.children.length===t.children.length&&Fk.compareManyFields(e.children,t.children)}function kk(e,t){return e===t||yk(e,t)&&e.mode===t.mode&&e.typeIds.every((e,n)=>e===t.typeIds[n])&&Fk.compareManyFields(e.children,t.children)}function Ak(e,t){return e===t||yk(e,t)&&e.id===t.id&&e.isOrdered===t.isOrdered&&Fk.visit(e.indices,t.indices)&&Fk.visit(e.dictionary,t.dictionary)}function jk(e,t){return e===t||yk(e,t)&&e.unit===t.unit}function Mk(e,t){return e===t||yk(e,t)&&e.unit===t.unit}function Nk(e,t){return e===t||yk(e,t)&&e.listSize===t.listSize&&e.children.length===t.children.length&&Fk.compareManyFields(e.children,t.children)}function Pk(e,t){return e===t||yk(e,t)&&e.keysSorted===t.keysSorted&&e.children.length===t.children.length&&Fk.compareManyFields(e.children,t.children)}Y.prototype.visitNull=bk,Y.prototype.visitBool=bk,Y.prototype.visitInt=xk,Y.prototype.visitInt8=xk,Y.prototype.visitInt16=xk,Y.prototype.visitInt32=xk,Y.prototype.visitInt64=xk,Y.prototype.visitUint8=xk,Y.prototype.visitUint16=xk,Y.prototype.visitUint32=xk,Y.prototype.visitUint64=xk,Y.prototype.visitFloat=Sk,Y.prototype.visitFloat16=Sk,Y.prototype.visitFloat32=Sk,Y.prototype.visitFloat64=Sk,Y.prototype.visitUtf8=bk,Y.prototype.visitLargeUtf8=bk,Y.prototype.visitBinary=bk,Y.prototype.visitLargeBinary=bk,Y.prototype.visitFixedSizeBinary=Ck,Y.prototype.visitDate=wk,Y.prototype.visitDateDay=wk,Y.prototype.visitDateMillisecond=wk,Y.prototype.visitTimestamp=Tk,Y.prototype.visitTimestampSecond=Tk,Y.prototype.visitTimestampMillisecond=Tk,Y.prototype.visitTimestampMicrosecond=Tk,Y.prototype.visitTimestampNanosecond=Tk,Y.prototype.visitTime=Ek,Y.prototype.visitTimeSecond=Ek,Y.prototype.visitTimeMillisecond=Ek,Y.prototype.visitTimeMicrosecond=Ek,Y.prototype.visitTimeNanosecond=Ek,Y.prototype.visitDecimal=bk,Y.prototype.visitList=Dk,Y.prototype.visitStruct=Ok,Y.prototype.visitUnion=kk,Y.prototype.visitDenseUnion=kk,Y.prototype.visitSparseUnion=kk,Y.prototype.visitDictionary=Ak,Y.prototype.visitInterval=jk,Y.prototype.visitIntervalDayTime=jk,Y.prototype.visitIntervalYearMonth=jk,Y.prototype.visitIntervalMonthDayNano=jk,Y.prototype.visitDuration=Mk,Y.prototype.visitDurationSecond=Mk,Y.prototype.visitDurationMillisecond=Mk,Y.prototype.visitDurationMicrosecond=Mk,Y.prototype.visitDurationNanosecond=Mk,Y.prototype.visitFixedSizeList=Nk,Y.prototype.visitMap=Pk;const Fk=new Y;function Ik(e,t){return Fk.compareSchemas(e,t)}function Lk(e,t){return Fk.compareFields(e,t)}function Rk(e,t){return Fk.visit(e,t)}const zk=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Bw),ak),SO),aE),UC),cO),Fw),mk),{compareSchemas:Ik,compareFields:Lk,compareTypes:Rk}),Bk=365.2425,Vk=10**8*24*60*60*1e3,Hk=6048e5,Uk=864e5,Wk=3600,Gk=Wk*24,Kk=Gk*7,qk=Gk*Bk,Jk=qk/12,Yk=Jk*3,Xk=Symbol.for(`constructDateFrom`);function Zk(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&Xk in e?e[Xk](t):e instanceof Date?new e.constructor(t):new Date(t)}function Qk(e,t){return Zk(t||e,e)}let $k={};function eA(){return $k}function tA(e,t){let n=eA(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=Qk(e,t?.in),a=i.getDay(),o=(a=a.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function iA(e){let t=Qk(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 aA(e,...t){let n=Zk.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}function oA(e,t){let n=Qk(e,t?.in);return n.setHours(0,0,0,0),n}function sA(e,t,n){let[r,i]=aA(n?.in,e,t),a=oA(r),o=oA(i),s=+a-iA(a),c=+o-iA(o);return Math.round((s-c)/Uk)}function cA(e,t){let n=rA(e,t),r=Zk(t?.in||e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),nA(r)}function lA(e){return e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`}function uA(e){return!(!lA(e)&&typeof e!=`number`||isNaN(+Qk(e)))}function dA(e,t){let n=Qk(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const fA={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`}},pA=(e,t,n)=>{let r,i=fA[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 mA(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth,r=e.formats[n]||e.formats[e.defaultWidth];return r}}const hA={full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},gA={full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},_A={full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},vA={date:mA({formats:hA,defaultWidth:`full`}),time:mA({formats:gA,defaultWidth:`full`}),dateTime:mA({formats:_A,defaultWidth:`full`})},yA={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},bA=(e,t,n,r)=>yA[e];function xA(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 SA={narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},CA={narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},wA={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`]},TA={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`]},EA={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`}},DA={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`}},OA=(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`},kA={ordinalNumber:OA,era:xA({values:SA,defaultWidth:`wide`}),quarter:xA({values:CA,defaultWidth:`wide`,argumentCallback:e=>e-1}),month:xA({values:wA,defaultWidth:`wide`}),day:xA({values:TA,defaultWidth:`wide`}),dayPeriod:xA({values:EA,defaultWidth:`wide`,formattingValues:DA,defaultFormattingWidth:`wide`})};function AA(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)?MA(s,e=>e.test(o)):jA(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 jA(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function MA(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 PA=/^(\d+)(th|st|nd|rd)?/i,FA=/\d+/i,IA={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},LA={any:[/^b/i,/^(a|c)/i]},RA={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},zA={any:[/1/i,/2/i,/3/i,/4/i]},BA={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},VA={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]},HA={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},UA={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]},WA={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},GA={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}},KA={ordinalNumber:NA({matchPattern:PA,parsePattern:FA,valueCallback:e=>parseInt(e,10)}),era:AA({matchPatterns:IA,defaultMatchWidth:`wide`,parsePatterns:LA,defaultParseWidth:`any`}),quarter:AA({matchPatterns:RA,defaultMatchWidth:`wide`,parsePatterns:zA,defaultParseWidth:`any`,valueCallback:e=>e+1}),month:AA({matchPatterns:BA,defaultMatchWidth:`wide`,parsePatterns:VA,defaultParseWidth:`any`}),day:AA({matchPatterns:HA,defaultMatchWidth:`wide`,parsePatterns:UA,defaultParseWidth:`any`}),dayPeriod:AA({matchPatterns:WA,defaultMatchWidth:`any`,parsePatterns:GA,defaultParseWidth:`any`})},qA={code:`en-US`,formatDistance:pA,formatLong:vA,formatRelative:bA,localize:kA,match:KA,options:{weekStartsOn:0,firstWeekContainsDate:1}};function JA(e,t){let n=Qk(e,t?.in),r=sA(n,dA(n)),i=r+1;return i}function YA(e,t){let n=Qk(e,t?.in),r=nA(n)-+cA(n);return Math.round(r/Hk)+1}function XA(e,t){let n=Qk(e,t?.in),r=n.getFullYear(),i=eA(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=Zk(t?.in||e,0);o.setFullYear(r+1,0,a),o.setHours(0,0,0,0);let s=tA(o,t),c=Zk(t?.in||e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);let l=tA(c,t);return+n>=+s?r+1:+n>=+l?r:r-1}function ZA(e,t){let n=eA(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=XA(e,t),a=Zk(t?.in||e,0);a.setFullYear(i,0,r),a.setHours(0,0,0,0);let o=tA(a,t);return o}function QA(e,t){let n=Qk(e,t?.in),r=tA(n,t)-+ZA(n,t);return Math.round(r/Hk)+1}function $A(e,t){let n=e<0?`-`:``,r=Math.abs(e).toString().padStart(t,`0`);return n+r}const ej={y(e,t){let n=e.getFullYear(),r=n>0?n:1-n;return $A(t===`yy`?r%100:r,t.length)},M(e,t){let n=e.getMonth();return t===`M`?String(n+1):$A(n+1,2)},d(e,t){return $A(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 $A(e.getHours()%12||12,t.length)},H(e,t){return $A(e.getHours(),t.length)},m(e,t){return $A(e.getMinutes(),t.length)},s(e,t){return $A(e.getSeconds(),t.length)},S(e,t){let n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*10**(n-3));return $A(i,t.length)}},tj={am:`am`,pm:`pm`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},nj={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 ej.y(e,t)},Y:function(e,t,n,r){let i=XA(e,r),a=i>0?i:1-i;if(t===`YY`){let e=a%100;return $A(e,2)}return t===`Yo`?n.ordinalNumber(a,{unit:`year`}):$A(a,t.length)},R:function(e,t){let n=rA(e);return $A(n,t.length)},u:function(e,t){let n=e.getFullYear();return $A(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 $A(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 $A(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 ej.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 $A(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=QA(e,r);return t===`wo`?n.ordinalNumber(i,{unit:`week`}):$A(i,t.length)},I:function(e,t,n){let r=YA(e);return t===`Io`?n.ordinalNumber(r,{unit:`week`}):$A(r,t.length)},d:function(e,t,n){return t===`do`?n.ordinalNumber(e.getDate(),{unit:`date`}):ej.d(e,t)},D:function(e,t,n){let r=JA(e);return t===`Do`?n.ordinalNumber(r,{unit:`dayOfYear`}):$A(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 $A(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 $A(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 $A(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?tj.noon:r===0?tj.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?tj.evening:r>=12?tj.afternoon:r>=4?tj.morning:tj.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 ej.h(e,t)},H:function(e,t,n){return t===`Ho`?n.ordinalNumber(e.getHours(),{unit:`hour`}):ej.H(e,t)},K:function(e,t,n){let r=e.getHours()%12;return t===`Ko`?n.ordinalNumber(r,{unit:`hour`}):$A(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t===`ko`?n.ordinalNumber(r,{unit:`hour`}):$A(r,t.length)},m:function(e,t,n){return t===`mo`?n.ordinalNumber(e.getMinutes(),{unit:`minute`}):ej.m(e,t)},s:function(e,t,n){return t===`so`?n.ordinalNumber(e.getSeconds(),{unit:`second`}):ej.s(e,t)},S:function(e,t){return ej.S(e,t)},X:function(e,t,n){let r=e.getTimezoneOffset();if(r===0)return`Z`;switch(t){case`X`:return ij(r);case`XXXX`:case`XX`:return aj(r);case`XXXXX`:case`XXX`:default:return aj(r,`:`)}},x:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`x`:return ij(r);case`xxxx`:case`xx`:return aj(r);case`xxxxx`:case`xxx`:default:return aj(r,`:`)}},O:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`O`:case`OO`:case`OOO`:return`GMT`+rj(r,`:`);case`OOOO`:default:return`GMT`+aj(r,`:`)}},z:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`z`:case`zz`:case`zzz`:return`GMT`+rj(r,`:`);case`zzzz`:default:return`GMT`+aj(r,`:`)}},t:function(e,t,n){let r=Math.trunc(e/1e3);return $A(r,t.length)},T:function(e,t,n){return $A(+e,t.length)}};function rj(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+$A(a,2)}function ij(e,t){if(e%60==0){let t=e>0?`-`:`+`;return t+$A(Math.abs(e)/60,2)}return aj(e,t)}function aj(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=$A(Math.trunc(r/60),2),a=$A(r%60,2);return n+i+t+a}const oj=(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`})}},sj=(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`})}},cj=(e,t)=>{let n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return oj(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}}`,oj(r,t)).replace(`{{time}}`,sj(i,t))},lj={p:sj,P:cj},uj=/^D+$/,dj=/^Y+$/,fj=[`D`,`DD`,`YY`,`YYYY`];function pj(e){return uj.test(e)}function mj(e){return dj.test(e)}function hj(e,t,n){let r=gj(e,t,n);if(console.warn(r),fj.includes(e))throw RangeError(r)}function gj(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 _j=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,vj=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,yj=/^'([^]*?)'?$/,bj=/''/g,xj=/[a-zA-Z]/;function Sj(e,t,n){let r=eA(),i=n?.locale??r.locale??qA,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=Qk(e,n?.in);if(!uA(s))throw RangeError(`Invalid time value`);let c=t.match(vj).map(e=>{let t=e[0];if(t===`p`||t===`P`){let n=lj[t];return n(e,i.formatLong)}return e}).join(``).match(_j).map(e=>{if(e===`''`)return{isToken:!1,value:`'`};let t=e[0];if(t===`'`)return{isToken:!1,value:Cj(e)};if(nj[t])return{isToken:!0,value:e};if(t.match(xj))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&&mj(a)||!n?.useAdditionalDayOfYearTokens&&pj(a))&&hj(a,t,String(e));let o=nj[a[0]];return o(s,a,i.localize,l)}).join(``)}function Cj(e){let t=e.match(yj);return t?t[1].replace(bj,`'`):e}function wj(e,t){return Qk(e*1e3,t?.in)}function Tj(e,t){let n=Ej(t)?new t(0):Zk(t,0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}function Ej(e){return typeof e==`function`&&e.prototype?.constructor===e}function Dj(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 Oj(e){return e==null}function kj(e){return e!=null}async function Aj(){if(typeof window<`u`&&window!==null)return`browser`;try{let e=await D(()=>import(`./__vite-browser-external-MQa0rNba.js`).then(ze(1)),__vite__mapDeps([0,1,2]));return e!==void 0&&e.versions!=null&&e.versions.node!=null?`node`:`unknown`}catch{return`unknown`}}function jj(e){return Oj(e)?!1:G.isInt(e.type)&&!Lj(e)||Mj(e)}function Mj(e){return Oj(e)?!1:G.isInt(e.type)&&e.type.isSigned===!1}function Nj(e){return Oj(e)?!1:G.isFloat(e.type)??!1}function Pj(e){return Oj(e)?!1:G.isDecimal(e.type)}function Fj(e){return Oj(e)?!1:G.isBool(e.type)}function Ij(e){return Oj(e)?!1:G.isDuration(e.type)}function Lj(e){return Oj(e)?!1:G.isInt(e.type)&&e.metadata.get(`ARROW:extension:name`)===`period`}function Rj(e){return Oj(e)?!1:G.isTimestamp(e.type)}function zj(e){return Oj(e)?!1:G.isDate(e.type)}function Bj(e){return Oj(e)?!1:G.isTime(e.type)}function Vj(e){return Oj(e)?!1:G.isList(e.type)||G.isFixedSizeList(e.type)}function Hj(e){return Oj(e)?!1:G.isStruct(e.type)||G.isMap(e.type)}function Uj(e){return Oj(e)?!1:G.isStruct(e.type)&&e.metadata.get(`ARROW:extension:name`)===`interval`||G.isInterval(e.type)}const Wj=new Date(1970,0,1);function Gj(e,t){let n;if(t===Mw.MILLISECOND)n=1e3;else if(t===Mw.MICROSECOND)n=1e3*1e3;else if(t===Mw.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 Kj(e,t){let n=Gj(e,t?.type?.unit??Mw.SECOND);return wj(n)}function qj(e,t){let n=Kj(e,t);return Sj(n,n.getMilliseconds()===0?`HH:mm:ss`:`HH:mm:ss.SSS`)}function Jj(e){let t=`yyyy-MM-dd`;return e instanceof Date||typeof e==`number`&&Number.isFinite(e)?Sj(e,t):(console.warn(`Unsupported date value: ${e}`),String(e))}function Yj(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 TC(e,r):new TC(e),Tj(n,Date)}function Xj(e,t){let n=t?.type?.scale||0,r=zk.bigNumToString(new zk.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=Dj(r.slice(-n),`0`)||``;return`${i}${a}${o?`.${o}`:``}`}const Zj=new Intl.NumberFormat(`en-US`,{style:`decimal`,maximumFractionDigits:4,minimumFractionDigits:4,useGrouping:!0});function Qj(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 $j(e,t){if(G.isInterval(t?.type))return Qj(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=tM(i.left,t.type?.children?.[0]),c=tM(i.right,t.type?.children?.[1]);return`${a+s}, ${c+o}`}return String(e)}function eM(e,t){return t?.type instanceof qT?JSON.parse(JSON.stringify(e,(e,t)=>{if(kj(t))return typeof t==`bigint`?Number(t):t})):JSON.parse(JSON.stringify(e,(e,t)=>typeof t==`bigint`?Number(t):t))}function tM(e,t){if(Oj(e))return null;let n=e instanceof Date||Number.isFinite(e);if(n&&zj(t))return Jj(e);if(typeof e==`bigint`&&Bj(t))return qj(Number(e),t);if(n&&Rj(t))return Yj(e,t);if(Lj(t))throw Error(`Period type is not supported yet`);if(Uj(t))return $j(e,t);if(Ij(t))throw Error(`Duration type is not supported yet`);return Pj(t)?Xj(e,t):Nj(t)&&Number.isFinite(e)||jj(t)?e:Hj(t)||Vj(t)?eM(e,t):Fj(t)?!!e:String(e)}function nM(e){let t=(e.toArray()||[]).map(e=>e.toJSON())||[],n=t.map(t=>(e.schema.fields.forEach(e=>t[e.name]=tM(t[e.name],e)),t));return n}let rM=function(e){return e.ORIGIN_PRIVATE_FS=`origin-private-fs`,e.NODE_FS=`node-fs`,e}({});async function iM(e){let t=be(e,{logger:!1}),n,r,i=await Aj();if(i===`browser`){if(t.bundles===void 0){let{getBundles:e}=await D(async()=>{let{getBundles:e}=await import(`./default-browser-fG6G3mbs.js`);return{getBundles:e}},[]);t.bundles=await e()}r=await _C(await t.bundles),n=new Worker(r.mainWorker)}else if(i===`node`){if(t.bundles===void 0){let{getBundles:e}=await D(async()=>{let{getBundles:e}=await import(`./default-node-DnFRZ-9a.js`);return{getBundles:e}},__vite__mapDeps([3,1,2]));t.bundles=await e()}r=await _C(await t.bundles);let e=r.mainWorker;e.startsWith(`/@fs/`)&&(e=e.replace(`/@fs/`,`file://`));let i=await D(()=>import(`./browser-CoZYwbon.js`),[]);n=new i.default(e,{type:`module`})}else throw Error(`Unsupported environment: ${i}`);let a;a=t.logger===!0?new FS:t.logger===!1?new PS:t.logger;let o=new KS(a,n);if(await o.instantiate(r.mainModule,r.pthreadWorker),t.storage)switch(t.storage.type){case rM.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 rM.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:nM(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:nM(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 aM(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 oM(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`),sM=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 cM=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`}},lM=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 uM=Symbol.for(`drizzle:Name`);var dM=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 fM(e,this)}},fM=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[uM],...r,n[0].table[uM],...i];return e??`${a.join(`_`)}_fk`}};function pM(e,...t){return e(...t)}function mM(e,t){return`${e[uM]}_${t.join(`_`)}_unique`}var hM=class{constructor(e,t){this.name=t,this.columns=e}static[X]=`PgUniqueConstraintBuilder`;columns;nullsNotDistinctConfig=!1;nullsNotDistinct(){return this.nullsNotDistinctConfig=!0,this}build(e){return new _M(e,this.columns,this.nullsNotDistinctConfig,this.name)}},gM=class{static[X]=`PgUniqueOnConstraintBuilder`;name;constructor(e){this.name=e}on(...e){return new hM(e,this.name)}},_M=class{constructor(e,t,n,r){this.table=e,this.columns=t,this.name=r??mM(this.table,this.columns.map(e=>e.name)),this.nullsNotDistinct=n}static[X]=`PgUniqueConstraint`;columns;name;nullsNotDistinct=!1;getName(){return this.name}};function vM(e,t,n){for(let r=t;rArray.isArray(e)?xM(e):typeof e==`string`?`"${e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`:`${e}`).join(`,`)}}`}var SM=class extends lM{foreignKeyConfigs=[];static[X]=`PgColumnBuilder`;array(e){return new EM(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})=>pM((n,r)=>{let i=new dM(()=>{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 wM(e,this.config)}},CM=class extends cM{constructor(e,t){t.uniqueName||=mM(e,[t.name]),super(e,t),this.table=e}static[X]=`PgColumn`},wM=class extends CM{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}},TM=class{static[X]=`IndexedColumn`;constructor(e,t,n,r){this.name=e,this.keyAsName=t,this.type=n,this.indexConfig=r}name;keyAsName;type;indexConfig},EM=class extends SM{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 DM(e,this.config,t)}},DM=class e extends CM{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=bM(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:xM(r)}},OM=class extends SM{static[X]=`PgEnumObjectColumnBuilder`;constructor(e,t){super(e,`string`,`PgEnumObjectColumn`),this.config.enum=t}build(e){return new kM(e,this.config)}},kM=class extends CM{static[X]=`PgEnumObjectColumn`;enum;enumValues=this.config.enum.enumValues;constructor(e,t){super(e,t),this.enum=t.enum}getSQLType(){return this.enum.enumName}};const AM=Symbol.for(`drizzle:isPgEnum`);function jM(e){return!!e&&typeof e==`function`&&AM in e&&e[AM]===!0}var MM=class extends SM{static[X]=`PgEnumColumnBuilder`;constructor(e,t){super(e,`string`,`PgEnumColumn`),this.config.enum=t}build(e){return new NM(e,this.config)}},NM=class extends CM{static[X]=`PgEnumColumn`;enum=this.config.enum;enumValues=this.config.enum.enumValues;constructor(e,t){super(e,t),this.enum=t.enum}getSQLType(){return this.enum.enumName}},PM=class{static[X]=`Subquery`;constructor(e,t,n,r=!1,i=[]){this._={brand:`Subquery`,sql:e,selectedFields:t,alias:n,isWith:r,usedTables:i}}},FM=class extends PM{static[X]=`WithSubquery`},IM=`0.44.3`;let LM,RM;const zM={startActiveSpan(e,t){return LM?(RM||=LM.trace.getTracer(`drizzle-orm`,IM),pM((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()}}),LM,RM)):t()}},BM=Symbol.for(`drizzle:ViewBaseConfig`),VM=Symbol.for(`drizzle:Schema`),HM=Symbol.for(`drizzle:Columns`),UM=Symbol.for(`drizzle:ExtraConfigColumns`),WM=Symbol.for(`drizzle:OriginalName`),GM=Symbol.for(`drizzle:BaseName`),KM=Symbol.for(`drizzle:IsAlias`),qM=Symbol.for(`drizzle:ExtraConfigBuilder`),JM=Symbol.for(`drizzle:IsDrizzleTable`);var Q=class{static[X]=`Table`;static Symbol={Name:uM,Schema:VM,OriginalName:WM,Columns:HM,ExtraConfigColumns:UM,BaseName:GM,IsAlias:KM,ExtraConfigBuilder:qM};[uM];[WM];[VM];[HM];[UM];[GM];[KM]=!1;[JM]=!0;[qM]=void 0;constructor(e,t,n){this[uM]=this[WM]=e,this[VM]=t,this[GM]=n}};function YM(e){return e[uM]}function XM(e){return`${e[VM]??`public`}.${e[uM]}`}var ZM=class{static[X]=`FakePrimitiveParam`};function QM(e){return e!=null&&typeof e.getSQL==`function`}function $M(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 eN=class{static[X]=`StringChunk`;value;constructor(e){this.value=Array.isArray(e)?e:[e]}getSQL(){return new tN([this])}},tN=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=iN;shouldInlineParams=!1;usedTables=[];append(e){return this.queryChunks.push(...e.queryChunks),this}toQuery(e){return zM.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 $M(t.map(t=>{if(Z(t,eN))return{sql:t.value.join(``),params:[]};if(Z(t,nN))return{sql:a(t.value),params:[]};if(t===void 0)return{sql:``,params:[]};if(Array.isArray(t)){let e=[new eN(`(`)];for(let[n,r]of t.entries())e.push(r),ne},aN={mapToDriverValue:e=>e},oN={...iN,...aN};var sN=class{constructor(e,t=aN){this.value=e,this.encoder=t}static[X]=`Param`;brand;getSQL(){return new tN([this])}};function $(e,...t){let n=[];(t.length>0||e.length>0&&e[0]!==``)&&n.push(new eN(e[0]));for(let[r,i]of t.entries())n.push(i,new eN(e[r+1]));return new tN(n)}(e=>{function t(){return new tN([])}e.empty=t;function n(e){return new tN(e)}e.fromList=n;function r(e){return new tN([new eN(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 tN(n)}e.join=i;function a(e){return new nN(e)}e.identifier=a;function o(e){return new cN(e)}e.placeholder=o;function s(e,t){return new sN(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})(tN||={});var cN=class{constructor(e){this.name=e}static[X]=`Placeholder`;getSQL(){return new tN([this])}};function lN(e,t){return e.map(e=>{if(Z(e,cN)){if(!(e.name in t))throw Error(`No value for placeholder "${e.name}" was provided`);return t[e.name]}if(Z(e,sN)&&Z(e.value,cN)){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 uN=Symbol.for(`drizzle:IsDrizzleView`);var dN=class{static[X]=`View`;[BM];[uN]=!0;constructor({name:e,schema:t,selectedFields:n,query:r}){this[BM]={name:e,originalName:e,schema:t,selectedFields:n,query:r,isExisting:!r,isAlias:!1}}getSQL(){return new tN([this])}};cM.prototype.getSQL=function(){return new tN([this])},Q.prototype.getSQL=function(){return new tN([this])},PM.prototype.getSQL=function(){return new tN([this])};var fN=class{constructor(e){this.table=e}static[X]=`ColumnAliasProxyHandler`;get(e,t){return t===`table`?this.table:e[t]}},pN=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===BM)return{...e[BM],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 fN(new Proxy(e,this)))}),n}let n=e[t];return Z(n,cM)?new Proxy(n,new fN(new Proxy(e,this))):n}},mN=class{constructor(e){this.alias=e}static[X]=`RelationTableAliasProxyHandler`;get(e,t){return t===`sourceTable`?hN(e.sourceTable,this.alias):e[t]}};function hN(e,t){return new Proxy(e,new pN(t,!1))}function gN(e,t){return new Proxy(e,new fN(new Proxy(e.table,new pN(t,!1))))}function _N(e,t){return new tN.Aliased(vN(e.sql,t),e.fieldAlias)}function vN(e,t){return $.join(e.queryChunks.map(e=>Z(e,cM)?gN(e,t):Z(e,tN)?vN(e,t):Z(e,tN.Aliased)?_N(e,t):e))}var yN=class extends Error{static[X]=`DrizzleError`;constructor({message:e,cause:t}){super(e),this.name=`DrizzleError`,this.cause=t}},bN=class extends yN{static[X]=`TransactionRollbackError`;constructor(){super({message:`Rollback`})}},xN=class{static[X]=`ConsoleLogWriter`;write(e){console.log(e)}},SN=class{static[X]=`DefaultLogger`;writer;constructor(e){this.writer=e?.writer??new xN}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}`)}},CN=class{static[X]=`NoopLogger`;logQuery(){}},wN=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 TN(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,cM)||Z(r,tN)||Z(r,tN.Aliased)?e.push({path:i,field:r}):Z(r,Q)?e.push(...TN(r[Q.Symbol.Columns],i)):e.push(...TN(r,i)),e},[])}function EN(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 DN(e,t){let n=Object.entries(t).filter(([,e])=>e!==void 0).map(([t,n])=>Z(n,tN)||Z(n,cM)?[t,n]:[t,new sN(n,e[Q.Symbol.Columns][t])]);if(n.length===0)throw Error(`No values to set`);return Object.fromEntries(n)}function ON(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 kN(e){return e[Q.Symbol.Columns]}function AN(e){return Z(e,PM)?e._.alias:Z(e,dN)?e[BM].name:Z(e,tN)?void 0:e[Q.Symbol.IsAlias]?e[Q.Symbol.Name]:e[Q.Symbol.BaseName]}function jN(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 MN=class extends SM{static[X]=`PgDateColumnBaseBuilder`;defaultNow(){return this.default($`now()`)}},NN=class extends MN{static[X]=`PgDateBuilder`;constructor(e){super(e,`date`,`PgDate`)}build(e){return new PN(e,this.config)}},PN=class extends CM{static[X]=`PgDate`;getSQLType(){return`date`}mapFromDriverValue(e){return new Date(e)}mapToDriverValue(e){return e.toISOString()}},FN=class extends MN{static[X]=`PgDateStringBuilder`;constructor(e){super(e,`string`,`PgDateString`)}build(e){return new IN(e,this.config)}},IN=class extends CM{static[X]=`PgDateString`;getSQLType(){return`date`}},LN=class extends SM{static[X]=`PgJsonBuilder`;constructor(e){super(e,`json`,`PgJson`)}build(e){return new RN(e,this.config)}},RN=class extends CM{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}},zN=class extends SM{static[X]=`PgJsonbBuilder`;constructor(e){super(e,`json`,`PgJsonb`)}build(e){return new BN(e,this.config)}},BN=class extends CM{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}},VN=class extends SM{static[X]=`PgNumericBuilder`;constructor(e,t,n){super(e,`string`,`PgNumeric`),this.config.precision=t,this.config.scale=n}build(e){return new HN(e,this.config)}},HN=class extends CM{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})`}},UN=class extends SM{static[X]=`PgNumericNumberBuilder`;constructor(e,t,n){super(e,`number`,`PgNumericNumber`),this.config.precision=t,this.config.scale=n}build(e){return new WN(e,this.config)}},WN=class extends CM{static[X]=`PgNumericNumber`;precision;scale;constructor(e,t){super(e,t),this.precision=t.precision,this.scale=t.scale}mapFromDriverValue(e){return typeof e==`number`?e:Number(e)}mapToDriverValue=String;getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?`numeric`:`numeric(${this.precision})`}},GN=class extends SM{static[X]=`PgNumericBigIntBuilder`;constructor(e,t,n){super(e,`bigint`,`PgNumericBigInt`),this.config.precision=t,this.config.scale=n}build(e){return new KN(e,this.config)}},KN=class extends CM{static[X]=`PgNumericBigInt`;precision;scale;constructor(e,t){super(e,t),this.precision=t.precision,this.scale=t.scale}mapFromDriverValue=BigInt;mapToDriverValue=String;getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?`numeric`:`numeric(${this.precision})`}},qN=class extends MN{constructor(e,t,n){super(e,`string`,`PgTime`),this.withTimezone=t,this.precision=n,this.config.withTimezone=t,this.config.precision=n}static[X]=`PgTimeBuilder`;build(e){return new JN(e,this.config)}},JN=class extends CM{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`:``}`}},YN=class extends MN{static[X]=`PgTimestampBuilder`;constructor(e,t,n){super(e,`date`,`PgTimestamp`),this.config.withTimezone=t,this.config.precision=n}build(e){return new XN(e,this.config)}},XN=class extends CM{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()},ZN=class extends MN{static[X]=`PgTimestampStringBuilder`;constructor(e,t,n){super(e,`string`,`PgTimestampString`),this.config.withTimezone=t,this.config.precision=n}build(e){return new QN(e,this.config)}},QN=class extends CM{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`:``}`}},$N=class extends SM{static[X]=`PgUUIDBuilder`;constructor(e){super(e,`string`,`PgUUID`)}defaultRandom(){return this.default($`gen_random_uuid()`)}build(e){return new eP(e,this.config)}},eP=class extends CM{static[X]=`PgUUID`;getSQLType(){return`uuid`}};const tP=Symbol.for(`drizzle:PgInlineForeignKeys`),nP=Symbol.for(`drizzle:EnableRLS`);var rP=class extends Q{static[X]=`PgTable`;static Symbol=Object.assign({},Q.Symbol,{InlineForeignKeys:tP,EnableRLS:nP});[tP]=[];[nP]=!1;[Q.Symbol.ExtraConfigBuilder]=void 0;[Q.Symbol.ExtraConfigColumns]={}},iP=class{static[X]=`PgPrimaryKeyBuilder`;columns;name;constructor(e,t){this.columns=e,this.name=t}build(e){return new aP(e,this.columns,this.name)}},aP=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[rP.Symbol.Name]}_${this.columns.map(e=>e.name).join(`_`)}_pk`}};function oP(e,t){return rN(t)&&!QM(e)&&!Z(e,sN)&&!Z(e,cN)&&!Z(e,cM)&&!Z(e,Q)&&!Z(e,dN)?new sN(e,t):e}const sP=(e,t)=>$`${e} = ${oP(t,e)}`,cP=(e,t)=>$`${e} <> ${oP(t,e)}`;function lP(...e){let t=e.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new tN(t):new tN([new eN(`(`),$.join(t,new eN(` and `)),new eN(`)`)])}function uP(...e){let t=e.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new tN(t):new tN([new eN(`(`),$.join(t,new eN(` or `)),new eN(`)`)])}function dP(e){return $`not ${e}`}const fP=(e,t)=>$`${e} > ${oP(t,e)}`,pP=(e,t)=>$`${e} >= ${oP(t,e)}`,mP=(e,t)=>$`${e} < ${oP(t,e)}`,hP=(e,t)=>$`${e} <= ${oP(t,e)}`;function gP(e,t){return Array.isArray(t)?t.length===0?$`false`:$`${e} in ${t.map(t=>oP(t,e))}`:$`${e} in ${oP(t,e)}`}function _P(e,t){return Array.isArray(t)?t.length===0?$`true`:$`${e} not in ${t.map(t=>oP(t,e))}`:$`${e} not in ${oP(t,e)}`}function vP(e){return $`${e} is null`}function yP(e){return $`${e} is not null`}function bP(e){return $`exists ${e}`}function xP(e){return $`not exists ${e}`}function SP(e,t,n){return $`${e} between ${oP(t,e)} and ${oP(n,e)}`}function CP(e,t,n){return $`${e} not between ${oP(t,e)} and ${oP(n,e)}`}function wP(e,t){return $`${e} like ${t}`}function TP(e,t){return $`${e} not like ${t}`}function EP(e,t){return $`${e} ilike ${t}`}function DP(e,t){return $`${e} not ilike ${t}`}function OP(e){return $`${e} asc`}function kP(e){return $`${e} desc`}var AP=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},jP=class{constructor(e,t){this.table=e,this.config=t}static[X]=`Relations`},MP=class e extends AP{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}},NP=class e extends AP{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 PP(){return{and:lP,between:SP,eq:sP,exists:bP,gt:fP,gte:pP,ilike:EP,inArray:gP,isNull:vP,isNotNull:yP,like:wP,lt:mP,lte:hP,ne:cP,not:dP,notBetween:CP,notExists:xP,notLike:TP,notIlike:DP,notInArray:_P,or:uP,sql:$}}function FP(){return{sql:$,asc:OP,desc:kP}}function IP(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=XM(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,iP)&&i[a].primaryKey.push(...e.columns)}else if(Z(o,jP)){let e=XM(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 LP(e){return function(t,n){return new MP(e,t,n,n?.fields.reduce((e,t)=>e&&t.notNull,!0)??!1)}}function RP(e){return function(t,n){return new NP(e,t,n)}}function zP(e,t,n){if(Z(n,MP)&&n.config)return{fields:n.config.fields,references:n.config.references};let r=t[XM(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[XM(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],MP)&&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 BP(e){return{one:LP(e),many:RP(e)}}function VP(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,MP)?l&&VP(e,e[s.relationTableTsKey],l,s.selection,i):l.map(t=>VP(e,e[s.relationTableTsKey],t,s.selection,i))}else{let e=i(n[o]),t=s.field,r;r=Z(t,cM)?t:Z(t,tN)?t.decoder:t.sql.decoder,a[s.tsKey]=e===null?null:r.mapFromDriverValue(e)}return a}var HP=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===BM)return{...t[BM],selectedFields:new Proxy(t[BM].selectedFields,this)};if(typeof n==`symbol`)return t[n];let r=Z(t,PM)?t._.selectedFields:Z(t,dN)?t[BM].selectedFields:t,i=r[n];if(Z(i,tN.Aliased)){if(this.config.sqlAliasedBehavior===`sql`&&!i.isSelectionField)return i.sql;let e=i.clone();return e.isSelectionField=!0,e}if(Z(i,tN)){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,cM)?this.config.alias?new Proxy(i,new fN(new Proxy(i.table,new pN(this.config.alias,this.config.replaceOriginalName??!1)))):i:typeof i!=`object`||!i?i:new Proxy(i,new e(this.config))}};function UP(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 WP(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 GP(e){return e}var KP=class{static[X]=`CasingCache`;cache={};cachedTables={};convert;constructor(e){this.convert=e===`snake_case`?UP:e===`camelCase`?WP:GP}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={}}},qP=class extends dN{static[X]=`PgViewBase`},JP=class{static[X]=`PgDialect`;casing;constructor(e){this.casing=new KP(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,tN.Aliased)&&e.isSelectionField)i.push($.identifier(e.fieldAlias));else if(Z(e,tN.Aliased)||Z(e,tN)){let n=Z(e,tN.Aliased)?e.sql:e;t?i.push(new tN(n.queryChunks.map(e=>Z(e,CM)?$.identifier(this.casing.getColumnCasing(e)):e))):i.push(n),Z(e,tN.Aliased)&&i.push($` as ${$.identifier(e.fieldAlias)}`)}else Z(e,cM)&&(t?i.push($.identifier(this.casing.getColumnCasing(e))):i.push(e));return ro?.some(({alias:t})=>t===(e[Q.Symbol.IsAlias]?YM(e):e[Q.Symbol.BaseName])))(e.field.table)){let t=YM(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,CM))e.push($.identifier(t.name));else if(Z(t,tN)){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,tN)?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,sN)&&i.value===void 0)if(t.defaultFn!==void 0){let e=t.defaultFn(),n=Z(e,tN)?e:$.param(e,t);r.push(n)}else if(!t.default&&t.onUpdateFn!==void 0){let e=t.onUpdateFn(),n=Z(e,tN)?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:gN(t,o),relationTableTsKey:void 0,isJson:!1,selection:[]}))}else{let r=Object.fromEntries(Object.entries(i.columns).map(([e,t])=>[e,gN(t,o)]));if(a.where){let e=typeof a.where==`function`?a.where(r,PP()):a.where;p=e&&vN(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:_N(t,o)})}for(let{tsKey:e,value:t}of s)l.push({dbKey:Z(t,tN.Aliased)?t.fieldAlias:i.columns[e].name,tsKey:e,field:Z(t,cM)?gN(t,o):t,relationTableTsKey:void 0,isJson:!1,selection:[]});let _=typeof a.orderBy==`function`?a.orderBy(r,FP()):a.orderBy??[];Array.isArray(_)||(_=[_]),f=_.map(e=>Z(e,cM)?gN(e,o):vN(e,o)),u=a.limit,d=a.offset;for(let{tsKey:r,queryConfig:i,relation:a}of h){let s=zP(t,n,a),c=XM(a.referencedTable),u=n[c],d=`${o}_${r}`,f=lP(...s.fields.map((e,t)=>sP(gN(s.references[t],d),gN(e,o)))),p=this.buildRelationalQueryWithoutPK({fullSchema:e,schema:t,tableNamesMap:n,table:e[u],tableConfig:t[u],queryConfig:Z(a,MP)?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 PM(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 yN({message:`No fields selected for table "${i.tsName}" ("${o}")`});let h;if(p=lP(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,tN.Aliased)?e.sql:e),$`, `)})`;Z(s,NP)&&(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:hN(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=hN(r,o),h=this.buildSelectQuery({table:Z(h,rP)?h:new PM(h,{},o),fields:{},fieldsFlat:t.map(({field:e})=>({path:[],field:Z(e,cM)?gN(e,o):e})),joins:m,where:p,limit:u,offset:d,orderBy:f,setOperators:[]})}else h=this.buildSelectQuery({table:hN(r,o),fields:{},fieldsFlat:l.map(({field:e})=>({path:[],field:Z(e,cM)?gN(e,o):e})),joins:m,where:p,limit:u,offset:d,orderBy:f,setOperators:[]});return{tableTsKey:i.tsName,sql:h,selection:l}}},YP=class{static[X]=`TypedQueryBuilder`;getSelectedFields(){return this._.selectedFields}},XP=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,PM)?Object.fromEntries(Object.keys(n._.selectedFields).map(e=>[e,n[e]])):Z(n,qP)?n[BM].selectedFields:Z(n,tN)?{}:kN(n),new QP({table:n,fields:r,isPartialSelect:t,session:this.session,dialect:this.dialect,withList:this.withList,distinct:this.distinct}).setToken(this.authToken)}},ZP=class extends YP{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=AN(e),this.joinsNotNullableMap=typeof this.tableName==`string`?{[this.tableName]:!0}:{};for(let t of cF(e))this.usedTables.add(t)}getUsedTables(){return[...this.usedTables]}createJoin(e,t){return(n,r)=>{let i=this.tableName,a=AN(n);for(let e of cF(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,tN))){let e=Z(n,PM)?n._.selectedFields:Z(n,dN)?n[BM].selectedFields:n[Q.Symbol.Columns];this.config.fields[a]=e}if(typeof r==`function`&&(r=r(new Proxy(this.config.fields,new HP({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(eF()):n;if(!EN(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 HP({sqlAliasedBehavior:`sql`,sqlBehavior:`sql`})))),this.config.where=e,this}having(e){return typeof e==`function`&&(e=e(new Proxy(this.config.fields,new HP({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 HP({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 HP({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(...cF(this.config.table)),this.config.joins)for(let e of this.config.joins)t.push(...cF(e.table));return new Proxy(new PM(this.getSQL(),this.config.fields,e,!1,[...new Set(t)]),new HP({alias:e,sqlAliasedBehavior:`alias`,sqlBehavior:`error`}))}getSelectedFields(){return new Proxy(this.config.fields,new HP({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}},QP=class extends ZP{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 zM.startActiveSpan(`drizzle.prepareQuery`,()=>{let n=TN(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=>zM.startActiveSpan(`drizzle.operation`,()=>this._prepare().execute(e,this.authToken))};ON(QP,[wN]);function $P(e,t){return(n,r,...i)=>{let a=[r,...i].map(n=>({type:e,isAll:t,rightSelect:n}));for(let e of a)if(!EN(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 eF=()=>({union:tF,unionAll:nF,intersect:rF,intersectAll:iF,except:aF,exceptAll:oF}),tF=$P(`union`,!1),nF=$P(`union`,!0),rF=$P(`intersect`,!1),iF=$P(`intersect`,!0),aF=$P(`except`,!1),oF=$P(`except`,!0);var sF=class{static[X]=`PgQueryBuilder`;dialect;dialectConfig;constructor(e){this.dialect=Z(e,JP)?e:void 0,this.dialectConfig=Z(e,JP)?void 0:e}$with=(e,t)=>{let n=this,r=r=>(typeof r==`function`&&(r=r(n)),new Proxy(new FM(r.getSQL(),t??(`getSelectedFields`in r?r.getSelectedFields()??{}:{}),e,!0),new HP({alias:e,sqlAliasedBehavior:`alias`,sqlBehavior:`error`})));return{as:r}};with(...e){let t=this;function n(n){return new XP({fields:n??void 0,session:void 0,dialect:t.getDialect(),withList:e})}function r(e){return new XP({fields:e??void 0,session:void 0,dialect:t.getDialect(),distinct:!0})}function i(e,n){return new XP({fields:n??void 0,session:void 0,dialect:t.getDialect(),distinct:{on:e}})}return{select:n,selectDistinct:r,selectDistinctOn:i}}select(e){return new XP({fields:e??void 0,session:void 0,dialect:this.getDialect()})}selectDistinct(e){return new XP({fields:e??void 0,session:void 0,dialect:this.getDialect(),distinct:!0})}selectDistinctOn(e,t){return new XP({fields:t??void 0,session:void 0,dialect:this.getDialect(),distinct:{on:e}})}getDialect(){return this.dialect||=new JP(this.dialectConfig),this.dialect}};function cF(e){return Z(e,rP)?[e[VM]?`${e[VM]}.${e[Q.Symbol.BaseName]}`:e[Q.Symbol.BaseName]]:Z(e,PM)?e._.usedTables??[]:Z(e,tN)?e.usedTables??[]:[]}var lF=class extends wN{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=TN(e),this}getSQL(){return this.dialect.buildDeleteQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}_prepare(e){return zM.startActiveSpan(`drizzle.prepareQuery`,()=>this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e,!0,void 0,{type:`delete`,tables:cF(this.config.table)},this.cacheConfig))}prepare(e){return this._prepare(e)}authToken;setToken(e){return this.authToken=e,this}execute=e=>zM.startActiveSpan(`drizzle.operation`,()=>this._prepare().execute(e,this.authToken));getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new HP({alias:YM(this.config.table),sqlAliasedBehavior:`alias`,sqlBehavior:`error`})):void 0}$dynamic(){return this}},uF=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,tN)?i:new sN(i,n[r])}return t});return new dF(this.table,t,this.session,this.dialect,this.withList,!1,this.overridingSystemValue_).setToken(this.authToken)}select(e){let t=typeof e==`function`?e(new sF):e;if(!Z(t,tN)&&!EN(this.table[HM],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 dF(this.table,t,this.session,this.dialect,this.withList,!0)}},dF=class extends wN{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=TN(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,DN(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 zM.startActiveSpan(`drizzle.prepareQuery`,()=>this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e,!0,void 0,{type:`insert`,tables:cF(this.config.table)},this.cacheConfig))}prepare(e){return this._prepare(e)}authToken;setToken(e){return this.authToken=e,this}execute=e=>zM.startActiveSpan(`drizzle.operation`,()=>this._prepare().execute(e,this.authToken));getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new HP({alias:YM(this.config.table),sqlAliasedBehavior:`alias`,sqlBehavior:`error`})):void 0}$dynamic(){return this}},fF=class extends wN{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 zM.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=>zM.startActiveSpan(`drizzle.operation`,()=>this._prepare().execute(e,this.authToken))},pF=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 mF(this.table,DN(this.table,e),this.session,this.dialect,this.withList).setToken(this.authToken)}},mF=class extends wN{constructor(e,t,n,r,i){super(),this.session=n,this.dialect=r,this.config={set:t,table:e,withList:i,joins:[]},this.tableName=AN(e),this.joinsNotNullableMap=typeof this.tableName==`string`?{[this.tableName]:!0}:{}}static[X]=`PgUpdate`;config;tableName;joinsNotNullableMap;cacheConfig;from(e){let t=e,n=AN(t);return typeof n==`string`&&(this.joinsNotNullableMap[n]=!0),this.config.from=t,this}getTableLikeFields(e){return Z(e,rP)?e[Q.Symbol.Columns]:Z(e,PM)?e._.selectedFields:e[BM].selectedFields}createJoin(e){return(t,n)=>{let r=AN(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,tN)?this.getTableLikeFields(this.config.from):void 0;n=n(new Proxy(this.config.table[Q.Symbol.Columns],new HP({sqlAliasedBehavior:`sql`,sqlBehavior:`sql`})),e&&new Proxy(e,new HP({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=AN(this.config.from);if(typeof t==`string`&&this.config.from&&!Z(this.config.from,tN)){let n=this.getTableLikeFields(this.config.from);e[t]=n}for(let t of this.config.joins){let n=AN(t.table);if(typeof n==`string`&&!Z(t.table,tN)){let r=this.getTableLikeFields(t.table);e[n]=r}}}return this.config.returningFields=e,this.config.returning=TN(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:cF(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 HP({alias:YM(this.config.table),sqlAliasedBehavior:`alias`,sqlBehavior:`error`})):void 0}$dynamic(){return this}},hF=class e extends tN{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})}},gF=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 _F(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,e||{},`many`)}findFirst(e){return new _F(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,e?{...e,limit:1}:{limit:1},`first`)}},_F=class extends wN{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 zM.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=>VP(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 zM.startActiveSpan(`drizzle.operation`,()=>this._prepare().execute(void 0,this.authToken))}},vF=class extends wN{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}},yF=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 gF(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 sF(n.dialect))),new Proxy(new FM(r.getSQL(),t??(`getSelectedFields`in r?r.getSelectedFields()??{}:{}),e,!0),new HP({alias:e,sqlAliasedBehavior:`alias`,sqlBehavior:`error`})));return{as:r}};$count(e,t){return new hF({source:e,filters:t,session:this.session})}$cache;with(...e){let t=this;function n(n){return new XP({fields:n??void 0,session:t.session,dialect:t.dialect,withList:e})}function r(n){return new XP({fields:n??void 0,session:t.session,dialect:t.dialect,withList:e,distinct:!0})}function i(n,r){return new XP({fields:r??void 0,session:t.session,dialect:t.dialect,withList:e,distinct:{on:n}})}function a(n){return new pF(n,t.session,t.dialect,e)}function o(n){return new uF(n,t.session,t.dialect,e)}function s(n){return new lF(n,t.session,t.dialect,e)}return{select:n,selectDistinct:r,selectDistinctOn:i,update:a,insert:o,delete:s}}select(e){return new XP({fields:e??void 0,session:this.session,dialect:this.dialect})}selectDistinct(e){return new XP({fields:e??void 0,session:this.session,dialect:this.dialect,distinct:!0})}selectDistinctOn(e,t){return new XP({fields:t??void 0,session:this.session,dialect:this.dialect,distinct:{on:e}})}update(e){return new pF(e,this.session,this.dialect)}insert(e){return new uF(e,this.session,this.dialect)}delete(e){return new lF(e,this.session,this.dialect)}refreshMaterializedView(e){return new fF(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 vF(()=>r.execute(void 0,this.authToken),t,n,e=>r.mapResult(e,!0))}transaction(e,t){return this.session.transaction(e,t)}},bF=class{static[X]=`Cache`},xF=class extends bF{strategy(){return`all`}static[X]=`NoopCache`;async get(e){}async put(e,t,n,r){}async onMutate(e){}};async function SF(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 CF=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)}},wF=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,xF)||this.queryMetadata===void 0)try{return await n()}catch(n){throw new CF(e,t,n)}if(this.cacheConfig&&!this.cacheConfig.enable)try{return await n()}catch(n){throw new CF(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 CF(e,t,n)}if(!this.cacheConfig)try{return await n()}catch(n){throw new CF(e,t,n)}if(this.queryMetadata.type===`select`){let r=await this.cache.get(this.cacheConfig.tag??await SF(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 CF(e,t,n)}return await this.cache.put(this.cacheConfig.tag??await SF(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 CF(e,t,n)}}},TF=class{constructor(e){this.dialect=e}static[X]=`PgSession`;execute(e,t){return zM.startActiveSpan(`drizzle.operation`,()=>{let n=zM.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)}},EF=class extends yF{constructor(e,t,n,r=0){super(e,t,n),this.schema=n,this.nestedIndex=r}static[X]=`PgTransaction`;rollback(){throw new bN}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 DF(e){return typeof e==`string`&&/^true$/i.test(e)}function OF(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&&DF(r)&&(t.logger=!0);let i=n.searchParams.get(`storage`);switch(i){case rM.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:rM.ORIGIN_PRIVATE_FS,path:n.pathname.startsWith(`/`)?n.pathname.slice(1):n.pathname,...e&&DF(e)&&{accessMode:AS.READ_WRITE}};break}case null:break;default:console.warn(`Unknown storage type "${i}"`);break}return t}var kF=class extends wF{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=lN(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=lN(this.params,e);this.logger.logQuery(this.queryString,t);let n=await this.client;return n.query(this.queryString,t)}},AF=class e extends TF{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 CN}prepareQuery(e,t,n,r,i){return new kF(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 aM(this.client,async r=>{let i=new e(r,this.dialect,this.schema,this.options),a=new jF(this.dialect,i,this.schema);return n&&await a.setTransaction(n),t(a)})}},jF=class e extends EF{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 oM(this.session.client,``,async n=>{let r=new AF(n,this.dialect,this.schema,this.session.options),i=new e(this.dialect,r,this.schema);return t(i)})}},MF=class extends yF{static[X]=`DuckDBWasmDatabase`};function NF(e,t={}){let n=new JP({casing:t.casing}),r;t.logger===!0?r=new SN:t.logger!==!1&&(r=t.logger);let i;if(t.schema){let e=IP(t.schema,BP);i={fullSchema:t.schema,schema:e.tables,tableNamesMap:e.tableNamesMap}}let a=new AF(e,n,i,{logger:r}),o=new MF(n,a,i);return o.$client=e,o}function PF(e,t){let n=OF(e),r;if(n.bundles===`import-url`){let e=async()=>{let e=await Aj();switch(e){case`browser`:return(await D(async()=>{let{getImportUrlBundles:e}=await import(`./import-url-browser-CkMcxt8_.js`);return{getImportUrlBundles:e}},__vite__mapDeps([4,5,6]))).getImportUrlBundles();case`node`:return await(await D(async()=>{let{getImportUrlBundles:e}=await import(`./import-url-node-DmUEwuAI.js`);return{getImportUrlBundles:e}},__vite__mapDeps([7,6]))).getImportUrlBundles();default:throw Error(`Unsupported environment: "${e}"`)}};r=e()}else{let e=async()=>{let e=await Aj();switch(e){case`browser`:return(await D(async()=>{let{getBundles:e}=await import(`./default-browser-BsyDD-mc.js`);return{getBundles:e}},[])).getBundles();case`node`:return await(await D(async()=>{let{getBundles:e}=await import(`./default-node-C7L-dwjz.js`);return{getBundles:e}},__vite__mapDeps([3,1,2]))).getBundles();default:throw Error(`Unsupported environment: "${e}"`)}};r=e()}return NF(iM({bundles:r,logger:n.logger?new LS:void 0,storage:n.storage}),t)}function FF(...e){if(typeof e[0]==`string`)return PF(e[0],e[1]);if(jN(e[0])){let{connection:t,client:n,...r}=e[0];if(n)return NF(n,r);if(typeof t==`string`)return PF(t,r);if(t===void 0)throw Error(`connection option is required`);return NF(iM({bundles:t.bundles,logger:t.logger,storage:t.storage}),r)}return NF(e[0],e[1])}(function(e){function t(e){return NF({options:{parsers:{},serializers:{}}},e)}e.mock=t})(FF||={});var IF=le({__name:`VRM`,emits:[`loadModelProgress`,`error`],setup(e,{expose:n,emit:r}){let i=r,a=ge(),{width:o,height:s}=ee(a),{selectedModel:c,cameraFOV:l,initialCameraPosition:u,cameraDistance:d}=O(t()),f=ge(),p=_e(new we),m=ge();return oe(()=>{a.value&&(p.value.aspect=o.value/s.value,p.value.fov=l.value,p.value.position.set(u.value.x,u.value.y,u.value.z),p.value.updateProjectionMatrix())}),Ie(l,e=>{p.value&&(p.value.fov=e,p.value.updateProjectionMatrix())}),Ie(c,()=>{p.value&&(p.value.position.set(u.value.x,u.value.y,u.value.z),p.value.updateProjectionMatrix())}),Ie(()=>m.value?.getDistance(),e=>{e!==void 0&&Math.abs(d.value-e)>1e-6&&(d.value=e,u.value={x:p.value.position.x,y:p.value.position.y,z:p.value.position.z})}),Ie(d,e=>{if(p.value&&m.value){let t=new Te;t.copy(p.value.position.normalize().multiplyScalar(e)),p.value.position.set(t.x,t.y,t.z),m.value.update(),u.value={x:t.x,y:t.y,z:t.z}}}),n({setExpression:e=>{f.value?.setExpression(e)}}),(e,t)=>(P(),fe(`div`,{ref_key:`vrmContainerRef`,ref:a,w:`100%`,h:`100%`},[p.value?(P(),ie(ve(xe),{key:0,camera:p.value,alpha:!0,antialias:!0,width:ve(o),height:ve(s)},{default:de(()=>[t[2]||=re(`TresAxesHelper`,{size:1},null,-1),t[3]||=re(`TresDirectionalLight`,{color:16777215,intensity:1.2,position:[1,1,1]},null,-1),t[4]||=re(`TresAmbientLight`,{color:16777215,intensity:1.5},null,-1),me(ve(mI),{ref_key:`controlsRef`,ref:m},null,512),(P(),ie(ve(UF),{ref_key:`modelRef`,ref:f,key:ve(c),model:ve(c),"idle-animation":`/assets/vrm/animations/idle_loop.vrma`,paused:!1,onLoadModelProgress:t[0]||=e=>i(`loadModelProgress`,e),onError:t[1]||=e=>i(`error`,e)},null,8,[`model`]))]),_:1,__:[2,3,4]},8,[`camera`,`width`,`height`])):ue(``,!0)],512))}}),LF=IF;const RF={relative:``},zF={"h-full":``,"w-full":``};var BF=le({__name:`Stage`,props:{paused:{type:Boolean,default:!1},focusAt:{},xOffset:{},yOffset:{},scale:{default:1}},setup(t){let c=ge(),l=ge(),{stageView:u,stageViewControlsEnabled:d}=O(n()),{mouthOpenSize:f}=O(j()),{audioContext:p,calculateVolume:m}=x(),{onBeforeMessageComposed:h,onBeforeSend:g,onTokenLiteral:_,onTokenSpecial:E,onStreamEnd:D,onAssistantResponseEnd:k}=i(),A=s(),M=ge(),ee=ge(!1),te=ge(!1),N=b({handlers:[e=>new Promise(t=>{let n=p.createBufferSource();n.buffer=e.data.audioBuffer,n.connect(p.destination),n.connect(M.value),ee.value=!0,n.start(0),n.onended=()=>{ee.value=!1,t()}})]}),ne=a(),{ssmlEnabled:ae,activeSpeechProvider:se,activeSpeechModel:ce,activeSpeechVoice:le,pitch:de}=O(ne);async function me(e){try{if(!se.value){console.warn(`No active speech provider configured`);return}if(!le.value){console.warn(`No active speech voice configured`);return}let t=await A.getProviderInstance(se.value);if(!t){console.error(`Failed to initialize speech provider`);return}let n=A.getProviderConfig(se.value),r=ae.value?ne.generateSSML(e.data,le.value,{...n,pitch:de.value}):e.data,i=await o({...t.speech(ce.value,n),input:r,voice:le.value.id}),a=await p.decodeAudioData(i);await N.add({audioBuffer:a,text:e.data})}catch(e){console.error(`Speech generation failed:`,e)}}let he=b({handlers:[me]});he.on(`add`,e=>{console.debug(`ttsQueue added`,e)});let _e=e(he),{currentMotion:ye}=O(r()),be=b({handlers:[async e=>{if(u.value===`3d`){let t=T[e.data];if(!t)return;await l.value.setExpression(t)}else u.value===`2d`&&(ye.value={group:w[e.data]})}]}),xe=y(be);xe.onHandlerEvent(`emotion`,e=>{console.debug(`emotion detected`,e)});let Se=v();Se.onHandlerEvent(`delay`,e=>{console.debug(`delay detected`,e)});function Ce(){requestAnimationFrame(Ce),ee.value&&(f.value=m(M.value,`linear`))}function we(){te.value||(Ce(),p.resume(),te.value=!0)}function Te(){M.value||=p.createAnalyser()}return h(async()=>{Te(),we()}),g(async()=>{ye.value={group:C}}),_(async e=>{await _e.add(e)}),E(async e=>{await Se.add(e),await xe.add(e)}),D(async()=>{await Se.add(S)}),k(async e=>{}),pe(()=>{te.value=!1}),oe(async()=>{c.value=FF({connection:{bundles:He()}}),await c.value.execute(`CREATE TABLE memory_test (vec FLOAT[768]);`)}),(e,t)=>(P(),fe(`div`,RF,[re(`div`,zF,[ve(u)===`2d`?(P(),ie(vp,{key:0,"focus-at":e.focusAt,"mouth-open-size":ve(f),"min-w":`50% {if(!g.value){console.warn(`Scene is not ready, cannot load VRM model.`);return}try{let e=await l(i.model,{scene:g.value,lookAt:!0,positionOffset:[S.value.x,S.value.y,S.value.z],onProgress:e=>a(`loadModelProgress`,Number((100*e.loaded/e.total).toFixed(2)))});if(!e||!e._vrm){console.warn(`No VRM model loaded`);return}let{_vrm:t,_vrmGroup:n,modelCenter:r,modelSize:u,initialCameraPosition:d}=e;A.value=n,E.value=d,C.value={x:r.x,y:r.y,z:r.z},w.value={x:u.x,y:u.y,z:u.z};let m=new Te(0,0,-1),x=t.lookAt;if(x){let e=x.faceFront,n=new Ae;n.setFromUnitVectors(e.normalize(),m.normalize()),t.scene.quaternion.premultiply(n),t.scene.updateMatrixWorld(!0)}else console.warn(`No look-at target found in VRM model`);k.value=0;function T(e){e.tracks=e.tracks.filter(e=>!e.name.endsWith(`.position`))}let O=await f(i.idleAnimation),j=await p(t,O);if(!j){console.warn(`No VRM animation loaded`);return}T(j),h.value=new Pe(t.scene),h.value.clipAction(j).play(),b.value=c(t),s.value=t,D.value=!1,o=_(({delta:e})=>{h.value?.update(e),s.value?.update(e),v.update(s.value,e),y.update(s.value,e),b.value?.update(e)}).off}catch(e){D.value=!1,a(`error`,e)}}),Ie(S,()=>{A.value&&A.value.position.set(T.value.x,T.value.y,T.value.z)},{deep:!0}),Ie(k,e=>{s.value&&A.value&&(A.value.rotation.y=Ne.degToRad(e))}),n({setExpression(e){b.value?.setEmotionWithResetAfter(e,1e3)},scene:ce(()=>s.value?.scene)});let{pause:j,resume:M}=be();return Ie(()=>i.paused,e=>{e?j():M()}),pe(()=>{o?.(),s.value&&(s.value.scene.removeFromParent(),m.deepDispose(s.value.scene))}),(e,t)=>ae(e.$slots,`default`)}}),UF=HF;const WF={type:`change`},GF={type:`start`},KF={type:`end`},qF=new De,JF=new ke,YF=Math.cos(70*Ne.DEG2RAD),XF=new Te,ZF=2*Math.PI,QF={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},$F=1e-6;var eI=class extends je{constructor(e,t=null){super(e,t),this.state=QF.NONE,this.target=new Te,this.cursor=new Te,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:Oe.ROTATE,MIDDLE:Oe.DOLLY,RIGHT:Oe.PAN},this.touches={ONE:Me.ROTATE,TWO:Me.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new Te,this._lastQuaternion=new Ae,this._lastTargetPosition=new Te,this._quat=new Ae().setFromUnitVectors(e.up,new Te(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new Ee,this._sphericalDelta=new Ee,this._scale=1,this._panOffset=new Te,this._rotateStart=new Fe,this._rotateEnd=new Fe,this._rotateDelta=new Fe,this._panStart=new Fe,this._panEnd=new Fe,this._panDelta=new Fe,this._dollyStart=new Fe,this._dollyEnd=new Fe,this._dollyDelta=new Fe,this._dollyDirection=new Te,this._mouse=new Fe,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=nI.bind(this),this._onPointerDown=tI.bind(this),this._onPointerUp=rI.bind(this),this._onContextMenu=uI.bind(this),this._onMouseWheel=oI.bind(this),this._onKeyDown=sI.bind(this),this._onTouchStart=cI.bind(this),this._onTouchMove=lI.bind(this),this._onMouseDown=iI.bind(this),this._onMouseMove=aI.bind(this),this._interceptControlDown=dI.bind(this),this._interceptControlUp=fI.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(WF),this.update(),this.state=QF.NONE}update(e=null){let t=this.object.position;XF.copy(t).sub(this.target),XF.applyQuaternion(this._quat),this._spherical.setFromVector3(XF),this.autoRotate&&this.state===QF.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+=ZF:n>Math.PI&&(n-=ZF),r<-Math.PI?r+=ZF:r>Math.PI&&(r-=ZF),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(XF.setFromSpherical(this._spherical),XF.applyQuaternion(this._quatInverse),t.copy(this.target).add(XF),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=XF.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 Te(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 Te(this._mouse.x,this._mouse.y,0);r.unproject(this.object),this.object.position.sub(r).add(t),this.object.updateMatrixWorld(),e=XF.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):(qF.origin.copy(this.object.position),qF.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(qF.direction))$F||8*(1-this._lastQuaternion.dot(this.object.quaternion))>$F||this._lastTargetPosition.distanceToSquared(this.target)>$F?(this.dispatchEvent(WF),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(e){return e===null?ZF/60/60*this.autoRotateSpeed:ZF/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){XF.setFromMatrixColumn(t,0),XF.multiplyScalar(-e),this._panOffset.add(XF)}_panUp(e,t){this.screenSpacePanning===!0?XF.setFromMatrixColumn(t,1):(XF.setFromMatrixColumn(t,0),XF.crossVectors(this.object.up,XF)),XF.multiplyScalar(e),this._panOffset.add(XF)}_pan(e,t){let n=this.domElement;if(this.object.isPerspectiveCamera){let r=this.object.position;XF.copy(r).sub(this.target);let i=XF.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(ZF*this._rotateDelta.x/t.clientHeight),this._rotateUp(ZF*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(ZF*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(-ZF*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(ZF*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(-ZF*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(ZF*this._rotateDelta.x/t.clientHeight),this._rotateUp(ZF*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{r.value&&i.value?.domElement&&(a.value=new eI(r.value,i.value.domElement),a.value.enableDamping=!0,a.value.dampingFactor=.5,a.value.mouseButtons={LEFT:Oe.ROTATE,MIDDLE:Oe.DOLLY,RIGHT:Oe.PAN},a.value.touches={ONE:Me.ROTATE,TWO:Me.DOLLY_PAN},a.value.enablePan=!1,a.value.minDistance=o.value.z,a.value.maxDistance=o.value.z*20,a.value.update(),s.value=a.value.getDistance())}),n({controls:a,getDistance:()=>a.value?.getDistance(),update:()=>a.value?.update()}),(e,t)=>ae(e.$slots,`default`)}}),mI=pI;export{VF as b,LF as c,$A as d,uA as e,Qk as f,vp as g,up as h,lp as i,kl as j,Ol as k}; \ No newline at end of file +params: ${n}`),this.query=t,this.params=n,this.cause=r,Error.captureStackTrace(this,e),r&&(this.cause=r)}},wF=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,xF)||this.queryMetadata===void 0)try{return await n()}catch(n){throw new CF(e,t,n)}if(this.cacheConfig&&!this.cacheConfig.enable)try{return await n()}catch(n){throw new CF(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 CF(e,t,n)}if(!this.cacheConfig)try{return await n()}catch(n){throw new CF(e,t,n)}if(this.queryMetadata.type===`select`){let r=await this.cache.get(this.cacheConfig.tag??await SF(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 CF(e,t,n)}return await this.cache.put(this.cacheConfig.tag??await SF(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 CF(e,t,n)}}},TF=class{constructor(e){this.dialect=e}static[X]=`PgSession`;execute(e,t){return zM.startActiveSpan(`drizzle.operation`,()=>{let n=zM.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)}},EF=class extends yF{constructor(e,t,n,r=0){super(e,t,n),this.schema=n,this.nestedIndex=r}static[X]=`PgTransaction`;rollback(){throw new bN}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 DF(e){return typeof e==`string`&&/^true$/i.test(e)}function OF(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&&DF(r)&&(t.logger=!0);let i=n.searchParams.get(`storage`);switch(i){case rM.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:rM.ORIGIN_PRIVATE_FS,path:n.pathname.startsWith(`/`)?n.pathname.slice(1):n.pathname,...e&&DF(e)&&{accessMode:OS.READ_WRITE}};break}case null:break;default:console.warn(`Unknown storage type "${i}"`);break}return t}var kF=class extends wF{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=lN(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=lN(this.params,e);this.logger.logQuery(this.queryString,t);let n=await this.client;return n.query(this.queryString,t)}},AF=class e extends TF{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 CN}prepareQuery(e,t,n,r,i){return new kF(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 aM(this.client,async r=>{let i=new e(r,this.dialect,this.schema,this.options),a=new jF(this.dialect,i,this.schema);return n&&await a.setTransaction(n),t(a)})}},jF=class e extends EF{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 oM(this.session.client,``,async n=>{let r=new AF(n,this.dialect,this.schema,this.session.options),i=new e(this.dialect,r,this.schema);return t(i)})}},MF=class extends yF{static[X]=`DuckDBWasmDatabase`};function NF(e,t={}){let n=new JP({casing:t.casing}),r;t.logger===!0?r=new SN:t.logger!==!1&&(r=t.logger);let i;if(t.schema){let e=IP(t.schema,BP);i={fullSchema:t.schema,schema:e.tables,tableNamesMap:e.tableNamesMap}}let a=new AF(e,n,i,{logger:r}),o=new MF(n,a,i);return o.$client=e,o}function PF(e,t){let n=OF(e),r;if(n.bundles===`import-url`){let e=async()=>{let e=await Aj();switch(e){case`browser`:return(await D(async()=>{let{getImportUrlBundles:e}=await import(`./import-url-browser-iGhQiEJs.js`);return{getImportUrlBundles:e}},__vite__mapDeps([4,5,6]))).getImportUrlBundles();case`node`:return await(await D(async()=>{let{getImportUrlBundles:e}=await import(`./import-url-node-DHMEAMi-.js`);return{getImportUrlBundles:e}},__vite__mapDeps([7,6]))).getImportUrlBundles();default:throw Error(`Unsupported environment: "${e}"`)}};r=e()}else{let e=async()=>{let e=await Aj();switch(e){case`browser`:return(await D(async()=>{let{getBundles:e}=await import(`./default-browser-fG6G3mbs.js`);return{getBundles:e}},[])).getBundles();case`node`:return await(await D(async()=>{let{getBundles:e}=await import(`./default-node-DnFRZ-9a.js`);return{getBundles:e}},__vite__mapDeps([3,1,2]))).getBundles();default:throw Error(`Unsupported environment: "${e}"`)}};r=e()}return NF(iM({bundles:r,logger:n.logger?new FS:void 0,storage:n.storage}),t)}function FF(...e){if(typeof e[0]==`string`)return PF(e[0],e[1]);if(jN(e[0])){let{connection:t,client:n,...r}=e[0];if(n)return NF(n,r);if(typeof t==`string`)return PF(t,r);if(t===void 0)throw Error(`connection option is required`);return NF(iM({bundles:t.bundles,logger:t.logger,storage:t.storage}),r)}return NF(e[0],e[1])}(function(e){function t(e){return NF({options:{parsers:{},serializers:{}}},e)}e.mock=t})(FF||={});var IF=se({__name:`VRM`,emits:[`loadModelProgress`,`error`],setup(e,{expose:n,emit:r}){let i=r,a=_e(),{width:o,height:s}=k(a),{selectedModel:c,cameraFOV:l,initialCameraPosition:u,cameraDistance:d}=O(t()),f=_e(),p=ve(new Te),m=_e();return ie(()=>{a.value&&(p.value.aspect=o.value/s.value,p.value.fov=l.value,p.value.position.set(u.value.x,u.value.y,u.value.z),p.value.updateProjectionMatrix())}),pe(l,e=>{p.value&&(p.value.fov=e,p.value.updateProjectionMatrix())}),pe(c,()=>{p.value&&(p.value.position.set(u.value.x,u.value.y,u.value.z),p.value.updateProjectionMatrix())}),pe(()=>m.value?.getDistance(),e=>{e!==void 0&&Math.abs(d.value-e)>1e-6&&(d.value=e,u.value={x:p.value.position.x,y:p.value.position.y,z:p.value.position.z})}),pe(d,e=>{if(p.value&&m.value){let t=new De;t.copy(p.value.position.normalize().multiplyScalar(e)),p.value.position.set(t.x,t.y,t.z),m.value.update(),u.value={x:t.x,y:t.y,z:t.z}}}),n({setExpression:e=>{f.value?.setExpression(e)}}),(e,t)=>(me(),ue(`div`,{ref_key:`vrmContainerRef`,ref:a,w:`100%`,h:`100%`},[p.value?(me(),P(ye(Se),{key:0,camera:p.value,alpha:!0,antialias:!0,width:ye(o),height:ye(s)},{default:le(()=>[t[2]||=he(`TresAxesHelper`,{size:1},null,-1),t[3]||=he(`TresDirectionalLight`,{color:16777215,intensity:1.2,position:[1,1,1]},null,-1),t[4]||=he(`TresAmbientLight`,{color:16777215,intensity:1.5},null,-1),fe(ye(mI),{ref_key:`controlsRef`,ref:m},null,512),(me(),P(ye(UF),{ref_key:`modelRef`,ref:f,key:ye(c),model:ye(c),"idle-animation":`/assets/vrm/animations/idle_loop.vrma`,paused:!1,onLoadModelProgress:t[0]||=e=>i(`loadModelProgress`,e),onError:t[1]||=e=>i(`error`,e)},null,8,[`model`]))]),_:1,__:[2,3,4]},8,[`camera`,`width`,`height`])):ce(``,!0)],512))}}),LF=IF;const RF={relative:``},zF={"h-full":``,"w-full":``};var BF=se({__name:`Stage`,props:{paused:{type:Boolean,default:!1},focusAt:{},xOffset:{},yOffset:{},scale:{default:1}},setup(t){let c=_e(),l=_e(),{stageView:u,stageViewControlsEnabled:d}=O(n()),{mouthOpenSize:f}=O(x()),{audioContext:p,calculateVolume:m}=ee(),{onBeforeMessageComposed:h,onBeforeSend:g,onTokenLiteral:_,onTokenSpecial:E,onStreamEnd:D,onAssistantResponseEnd:k}=i(),A=s(),j=_e(),M=_e(!1),te=_e(!1),N=b({handlers:[e=>new Promise(t=>{let n=p.createBufferSource();n.buffer=e.data.audioBuffer,n.connect(p.destination),n.connect(j.value),M.value=!0,n.start(0),n.onended=()=>{M.value=!1,t()}})]}),ne=a(),{ssmlEnabled:re,activeSpeechProvider:ae,activeSpeechModel:oe,activeSpeechVoice:se,pitch:le}=O(ne);async function fe(e){try{if(!ae.value){console.warn(`No active speech provider configured`);return}if(!se.value){console.warn(`No active speech voice configured`);return}let t=await A.getProviderInstance(ae.value);if(!t){console.error(`Failed to initialize speech provider`);return}let n=A.getProviderConfig(ae.value),r=re.value?ne.generateSSML(e.data,se.value,{...n,pitch:le.value}):e.data,i=await o({...t.speech(oe.value,n),input:r,voice:se.value.id}),a=await p.decodeAudioData(i);await N.add({audioBuffer:a,text:e.data})}catch(e){console.error(`Speech generation failed:`,e)}}let pe=b({handlers:[fe]});pe.on(`add`,e=>{console.debug(`ttsQueue added`,e)});let ge=y(pe),{currentMotion:ve}=O(r()),be=b({handlers:[async e=>{if(u.value===`3d`){let t=T[e.data];if(!t)return;await l.value.setExpression(t)}else u.value===`2d`&&(ve.value={group:w[e.data]})}]}),xe=v(be);xe.onHandlerEvent(`emotion`,e=>{console.debug(`emotion detected`,e)});let Se=e();Se.onHandlerEvent(`delay`,e=>{console.debug(`delay detected`,e)});function Ce(){requestAnimationFrame(Ce),M.value&&(f.value=m(j.value,`linear`))}function we(){te.value||(Ce(),p.resume(),te.value=!0)}function Te(){j.value||=p.createAnalyser()}return h(async()=>{Te(),we()}),g(async()=>{ve.value={group:C}}),_(async e=>{await ge.add(e)}),E(async e=>{await Se.add(e),await xe.add(e)}),D(async()=>{await Se.add(S)}),k(async e=>{}),de(()=>{te.value=!1}),ie(async()=>{c.value=FF({connection:{bundles:He()}}),await c.value.execute(`CREATE TABLE memory_test (vec FLOAT[768]);`)}),(e,t)=>(me(),ue(`div`,RF,[he(`div`,zF,[ye(u)===`2d`?(me(),P(vp,{key:0,"focus-at":e.focusAt,"mouth-open-size":ye(f),"min-w":`50% {if(!g.value){console.warn(`Scene is not ready, cannot load VRM model.`);return}try{let e=await l(i.model,{scene:g.value,lookAt:!0,positionOffset:[S.value.x,S.value.y,S.value.z],onProgress:e=>a(`loadModelProgress`,Number((100*e.loaded/e.total).toFixed(2)))});if(!e||!e._vrm){console.warn(`No VRM model loaded`);return}let{_vrm:t,_vrmGroup:n,modelCenter:r,modelSize:d,initialCameraPosition:f}=e;A.value=n,E.value=f,C.value={x:r.x,y:r.y,z:r.z},w.value={x:d.x,y:d.y,z:d.z};let m=new De(0,0,-1),x=t.lookAt;if(x){let e=x.faceFront,n=new Me;n.setFromUnitVectors(e.normalize(),m.normalize()),t.scene.quaternion.premultiply(n),t.scene.updateMatrixWorld(!0)}else console.warn(`No look-at target found in VRM model`);k.value=0;function T(e){e.tracks=e.tracks.filter(e=>!e.name.endsWith(`.position`))}let O=await p(i.idleAnimation),j=await u(t,O);if(!j){console.warn(`No VRM animation loaded`);return}T(j),h.value=new Fe(t.scene),h.value.clipAction(j).play(),b.value=c(t),s.value=t,D.value=!1,o=_(({delta:e})=>{h.value?.update(e),s.value?.update(e),v.update(s.value,e),y.update(s.value,e),b.value?.update(e)}).off}catch(e){D.value=!1,a(`error`,e)}}),pe(S,()=>{A.value&&A.value.position.set(T.value.x,T.value.y,T.value.z)},{deep:!0}),pe(k,e=>{s.value&&A.value&&(A.value.rotation.y=Pe.degToRad(e))}),n({setExpression(e){b.value?.setEmotionWithResetAfter(e,1e3)},scene:oe(()=>s.value?.scene)});let{pause:j,resume:M}=xe();return pe(()=>i.paused,e=>{e?j():M()}),de(()=>{o?.(),s.value&&(s.value.scene.removeFromParent(),m.deepDispose(s.value.scene))}),(e,t)=>re(e.$slots,`default`)}}),UF=HF;const WF={type:`change`},GF={type:`start`},KF={type:`end`},qF=new Oe,JF=new Ae,YF=Math.cos(70*Pe.DEG2RAD),XF=new De,ZF=2*Math.PI,QF={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},$F=1e-6;var eI=class extends Ne{constructor(e,t=null){super(e,t),this.state=QF.NONE,this.target=new De,this.cursor=new De,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:ke.ROTATE,MIDDLE:ke.DOLLY,RIGHT:ke.PAN},this.touches={ONE:je.ROTATE,TWO:je.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new De,this._lastQuaternion=new Me,this._lastTargetPosition=new De,this._quat=new Me().setFromUnitVectors(e.up,new De(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new Ee,this._sphericalDelta=new Ee,this._scale=1,this._panOffset=new De,this._rotateStart=new Ie,this._rotateEnd=new Ie,this._rotateDelta=new Ie,this._panStart=new Ie,this._panEnd=new Ie,this._panDelta=new Ie,this._dollyStart=new Ie,this._dollyEnd=new Ie,this._dollyDelta=new Ie,this._dollyDirection=new De,this._mouse=new Ie,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=nI.bind(this),this._onPointerDown=tI.bind(this),this._onPointerUp=rI.bind(this),this._onContextMenu=uI.bind(this),this._onMouseWheel=oI.bind(this),this._onKeyDown=sI.bind(this),this._onTouchStart=cI.bind(this),this._onTouchMove=lI.bind(this),this._onMouseDown=iI.bind(this),this._onMouseMove=aI.bind(this),this._interceptControlDown=dI.bind(this),this._interceptControlUp=fI.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(WF),this.update(),this.state=QF.NONE}update(e=null){let t=this.object.position;XF.copy(t).sub(this.target),XF.applyQuaternion(this._quat),this._spherical.setFromVector3(XF),this.autoRotate&&this.state===QF.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+=ZF:n>Math.PI&&(n-=ZF),r<-Math.PI?r+=ZF:r>Math.PI&&(r-=ZF),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(XF.setFromSpherical(this._spherical),XF.applyQuaternion(this._quatInverse),t.copy(this.target).add(XF),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=XF.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 De(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 De(this._mouse.x,this._mouse.y,0);r.unproject(this.object),this.object.position.sub(r).add(t),this.object.updateMatrixWorld(),e=XF.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):(qF.origin.copy(this.object.position),qF.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(qF.direction))$F||8*(1-this._lastQuaternion.dot(this.object.quaternion))>$F||this._lastTargetPosition.distanceToSquared(this.target)>$F?(this.dispatchEvent(WF),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(e){return e===null?ZF/60/60*this.autoRotateSpeed:ZF/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){XF.setFromMatrixColumn(t,0),XF.multiplyScalar(-e),this._panOffset.add(XF)}_panUp(e,t){this.screenSpacePanning===!0?XF.setFromMatrixColumn(t,1):(XF.setFromMatrixColumn(t,0),XF.crossVectors(this.object.up,XF)),XF.multiplyScalar(e),this._panOffset.add(XF)}_pan(e,t){let n=this.domElement;if(this.object.isPerspectiveCamera){let r=this.object.position;XF.copy(r).sub(this.target);let i=XF.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(ZF*this._rotateDelta.x/t.clientHeight),this._rotateUp(ZF*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(ZF*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(-ZF*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(ZF*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(-ZF*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(ZF*this._rotateDelta.x/t.clientHeight),this._rotateUp(ZF*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{r.value&&i.value?.domElement&&(a.value=new eI(r.value,i.value.domElement),a.value.enableDamping=!0,a.value.dampingFactor=.5,a.value.mouseButtons={LEFT:ke.ROTATE,MIDDLE:ke.DOLLY,RIGHT:ke.PAN},a.value.touches={ONE:je.ROTATE,TWO:je.DOLLY_PAN},a.value.enablePan=!1,a.value.minDistance=o.value.z,a.value.maxDistance=o.value.z*20,a.value.update(),s.value=a.value.getDistance())}),n({controls:a,getDistance:()=>a.value?.getDistance(),update:()=>a.value?.update()}),(e,t)=>re(e.$slots,`default`)}}),mI=pI;export{VF as b,LF as c,$A as d,uA as e,Qk as f,vp as g,up as h,lp as i,kl as j,Ol as k}; \ No newline at end of file diff --git a/assets/Textarea-DQ3UodrM.js b/assets/Textarea-C55W7JzB.js similarity index 66% rename from assets/Textarea-DQ3UodrM.js rename to assets/Textarea-C55W7JzB.js index 1da1581cae6cf9d9a402c715088b07c4518375c3..26637b13be3799fa2ff12e17840f738d99b08ff9 100644 --- a/assets/Textarea-DQ3UodrM.js +++ b/assets/Textarea-C55W7JzB.js @@ -1 +1 @@ -import{b as e}from"./Basic-CcFV8fg0.js";import{bA as t,bG as n,bH as r,bP as i}from"./index-BFym949y.js";var a=i({__name:`Textarea`,props:{modelValue:{default:``},modelModifiers:{}},emits:[`update:modelValue`],setup(i){let a=r(i,`modelValue`);return(r,i)=>(t(),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 +import{b as e}from"./Basic-Cwa2X3hA.js";import{bA as t,bB as n,bJ as r,bT as i}from"./index-J3uhnpYL.js";var a=r({__name:`Textarea`,props:{modelValue:{default:``},modelModifiers:{}},emits:[`update:modelValue`],setup(r){let a=n(r,`modelValue`);return(n,r)=>(i(),t(e,{modelValue:a.value,"onUpdate:modelValue":r[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_-B7_146pG.js b/assets/_...all_-B7_146pG.js new file mode 100644 index 0000000000000000000000000000000000000000..8bd28b50991cc571e2147155212139cff8a0037b --- /dev/null +++ b/assets/_...all_-B7_146pG.js @@ -0,0 +1 @@ +import{aL as e,bM as t,bT as n}from"./index-J3uhnpYL.js";const r={};function i(e,r){return n(),t(`div`,null,` 404 - Page not found `)}var a=e(r,[[`render`,i]]);export{a as default}; \ No newline at end of file diff --git a/assets/_...all_-TBhc7L19.js b/assets/_...all_-TBhc7L19.js deleted file mode 100644 index 2c6ff439680f38dbd9f06b6c59d35570c932acd1..0000000000000000000000000000000000000000 --- a/assets/_...all_-TBhc7L19.js +++ /dev/null @@ -1 +0,0 @@ -import{aL as e,bA as t,bS as n}from"./index-BFym949y.js";const r={};function i(e,r){return t(),n(`div`,null,` 404 - Page not found `)}var a=e(r,[[`render`,i]]);export{a as default}; \ No newline at end of file diff --git a/assets/__vite-browser-external-CKGmuslh.js b/assets/__vite-browser-external-CKGmuslh.js deleted file mode 100644 index e73d0aa2273273d6190fbd895c12c5fc4d68c99c..0000000000000000000000000000000000000000 --- a/assets/__vite-browser-external-CKGmuslh.js +++ /dev/null @@ -1 +0,0 @@ -import{c2 as e}from"./index-BFym949y.js";var t=e((exports,t)=>{t.exports={}});export default t(); \ No newline at end of file diff --git a/assets/__vite-browser-external-MQa0rNba.js b/assets/__vite-browser-external-MQa0rNba.js new file mode 100644 index 0000000000000000000000000000000000000000..1d3b621cffd85f20138ed3c2ab79dc876215f196 --- /dev/null +++ b/assets/__vite-browser-external-MQa0rNba.js @@ -0,0 +1 @@ +import{c2 as e}from"./index-J3uhnpYL.js";var t=e((exports,t)=>{t.exports={}});export default t(); \ No newline at end of file diff --git a/assets/airi-card-23m5t20W.js b/assets/airi-card-23m5t20W.js new file mode 100644 index 0000000000000000000000000000000000000000..079da5cdc797ac8be39fa7890d066de3045b63ed --- /dev/null +++ b/assets/airi-card-23m5t20W.js @@ -0,0 +1 @@ +import{b as e}from"./InputFile-DYGPp1hR.js";import{F as t,L as n,aS as r,ak as ee,ao as te,bA as i,bD as a,bG as o,bH as s,bJ as c,bK as l,bL as u,bM as d,bO as f,bQ as ne,bS as p,bT as m,bU as h,bX as g,b_ as _,bu as v,bx as y,by as b,c0 as x,c1 as re}from"./index-J3uhnpYL.js";import{b as S}from"./route-block-DVyt-3Cw.js";import{b as C}from"./CardCreate-BlTH4Xox.js";import{b as w}from"./CardCreationDialog-BV9G3q2c.js";import{b as T}from"./DeleteCardDialog-UKAwGyZQ.js";import{b as E}from"./CardDetailDialog-DkixqMs_.js";import{b as D}from"./CardListItem-CfAvmf_x.js";const ie={"rounded-xl":``,"p-4":``,flex:`~ col gap-4`},ae={flex:`~ row`,"flex-wrap":``,"items-center":``,"justify-between":``,"gap-4":``},oe={class:`relative min-w-[200px] flex-1`,"inline-flex":`~`,"w-full":``,"items-center":``},se=[`placeholder`],O={class:`relative flex flex-row justify-start gap-2 lg:flex-col`},k={class:`top-[-32px] whitespace-nowrap text-sm text-neutral-500 leading-10 lg:absolute dark:text-neutral-400`},A={key:0,flex:``,"flex-col":``,"items-center":``},j={"font-medium":``,text:`neutral-600 dark:neutral-300`},M={text:`neutral-500 dark:neutral-400`,"mt-2":``,"text-sm":``},N={key:1,flex:``,"flex-col":``,"items-center":``},P={"font-medium":``,text:`primary-600 dark:primary-300`},F={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`},I={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 L=c({__name:`index`,setup(c){let{t:S}=n(),L=t(),{addCard:R,removeCard:z}=L,{cards:B,activeCardId:V}=r(L),H=g(``),U=g(!1),W=g(!1),G=g(``),K=g(`nameAsc`),q=g([]);ne(q,async e=>{let t=e[0];if(t)try{let e=await t.text(),n=JSON.parse(e);H.value=R(n),U.value=!0}catch(e){console.error(`Error processing card file:`,e)}});let J=s(()=>Array.from(B.value.entries()).map(([e,t])=>({id:e,name:t.name,description:t.description}))),ce=s(()=>{if(!G.value)return J.value;let e=G.value.toLowerCase();return J.value.filter(t=>t.name.toLowerCase().includes(e)||t.description&&t.description.toLowerCase().includes(e))}),Y=s(()=>{let e=[...ce.value];return K.value===`nameAsc`?e.sort((e,t)=>e.name.localeCompare(t.name)):K.value===`nameDesc`?e.sort((e,t)=>t.name.localeCompare(e.name)):K.value===`recent`?e.sort((e,t)=>t.id.localeCompare(e.id)):e}),X=g(!1),Z=g(null);function Q(){Z.value&&(z(Z.value),Z.value=null,X.value=!1)}function le(e){Z.value=e,X.value=!0}function ue(e){H.value=e,U.value=!0}function de(){W.value=!0}function fe(e){V.value=e}function pe(e){let t=B.value.get(e);return t?.version||`1.0.0`}function $(e,t){let n=B.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(t,n)=>{let r=p(`motion`);return m(),d(o,null,[h(`div`,ie,[h(`div`,ae,[h(`div`,oe,[n[7]||=h(`div`,{class:`pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3`},[h(`div`,{"i-solar:magnifer-line-duotone":``,class:`text-neutral-500 dark:text-neutral-400`})],-1),a(h(`input`,{"onUpdate:modelValue":n[0]||=e=>G.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)(`settings.pages.card.search`)},null,8,se),[[v,G.value]])]),h(`div`,O,[h(`div`,k,x(_(S)(`settings.pages.card.sort_by`))+`: `,1),f(_(te),{modelValue:K.value,"onUpdate:modelValue":n[1]||=e=>K.value=e,options:[{value:`nameAsc`,label:_(S)(`settings.pages.card.name_asc`)},{value:`nameDesc`,label:_(S)(`settings.pages.card.name_desc`)},{value:`recent`,label:_(S)(`settings.pages.card.recent`)}],placeholder:`Select sort option`,class:`min-w-[150px]`},null,8,[`modelValue`,`options`])])]),h(`div`,{class:re([`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))]":_(B).size>0}])},[f(_(e),{modelValue:q.value,"onUpdate:modelValue":n[2]||=e=>q.value=e,accept:`*.json`},{default:u(({isDragging:e})=>[e?(m(),d(`div`,N,[n[9]||=h(`div`,{"i-solar:upload-minimalistic-bold":``,class:`mb-2 text-5xl text-primary-500 dark:text-primary-400`},null,-1),h(`p`,P,x(_(S)(`settings.pages.card.drop_here`)),1)])):(m(),d(`div`,A,[n[8]||=h(`div`,{"i-solar:upload-square-line-duotone":``,"mb-4":``,"text-5xl":``,text:`neutral-400 dark:neutral-500`},null,-1),h(`p`,j,x(_(S)(`settings.pages.card.upload`)),1),h(`p`,M,x(_(S)(`settings.pages.card.upload_desc`)),1)]))]),_:1},8,[`modelValue`]),f(C,{onClick:de}),_(B).size>0?(m(!0),d(o,{key:0},y(Y.value,e=>(m(),i(D,{id:e.id,key:e.id,name:e.name,description:e.description,"is-active":e.id===_(V),"is-selected":e.id===H.value&&U.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)):l(``,!0),_(B).size===0?(m(),d(`div`,F,[n[10]||=h(`div`,{"i-solar:card-search-broken":``,"mx-auto":``,"mb-3":``,"text-6xl":``,"text-neutral-400":``},null,-1),h(`p`,null,x(_(S)(`settings.pages.card.no_cards`)),1)])):l(``,!0),G.value&&Y.value.length===0?(m(),i(_(ee),{key:2,type:`warning`},{title:u(()=>[b(x(_(S)(`settings.pages.card.no_results`)),1)]),content:u(()=>[b(x(_(S)(`settings.pages.card.try_different_search`)),1)]),_:1})):l(``,!0)],2)]),f(T,{modelValue:X.value,"onUpdate:modelValue":n[3]||=e=>X.value=e,"card-name":Z.value?_(L).getCard(Z.value)?.name:``,onConfirm:Q,onCancel:n[4]||=e=>Z.value=null},null,8,[`modelValue`,`card-name`]),f(E,{modelValue:U.value,"onUpdate:modelValue":n[5]||=e=>U.value=e,"card-id":H.value},null,8,[`modelValue`,`card-id`]),f(w,{modelValue:W.value,"onUpdate:modelValue":n[6]||=e=>W.value=e},null,8,[`modelValue`]),a((m(),d(`div`,I,n[11]||=[h(`div`,{text:`60`,"i-solar:emoji-funny-square-bold-duotone":``},null,-1)])),[[r]])],64)}}});typeof S==`function`&&S(L);var R=L;export{R as default}; \ No newline at end of file diff --git a/assets/airi-card-DVINiKa7.js b/assets/airi-card-DVINiKa7.js deleted file mode 100644 index 5526cdc75477ea3f4ca8550f17dfa6d1fd693efc..0000000000000000000000000000000000000000 --- a/assets/airi-card-DVINiKa7.js +++ /dev/null @@ -1 +0,0 @@ -import{b as e}from"./InputFile-BA4DYXXI.js";import{F as t,L as n,aS as r,ak as i,ao as a,b$ as ee,bA as o,bB as s,bD as te,bE as c,bG as l,bJ as u,bM as d,bN as f,bP as p,bQ as m,bR as h,bS as g,bU as _,bX as v,b_ as y,bu as ne,by as re,bz as ie,c1 as b}from"./index-BFym949y.js";import{b as x}from"./route-block-DVyt-3Cw.js";import{b as S}from"./CardCreate-BOXHbJQd.js";import{b as C}from"./CardCreationDialog-BrvTqDsp.js";import{b as w}from"./DeleteCardDialog-Bm5B-ykC.js";import{b as T}from"./CardDetailDialog-CxE7smOI.js";import{b as E}from"./CardListItem-BBGsnLNq.js";const D={"rounded-xl":``,"p-4":``,flex:`~ col gap-4`},ae={flex:`~ row`,"flex-wrap":``,"items-center":``,"justify-between":``,"gap-4":``},oe={class:`relative min-w-[200px] flex-1`,"inline-flex":`~`,"w-full":``,"items-center":``},se=[`placeholder`],O={class:`relative flex flex-row justify-start gap-2 lg:flex-col`},k={class:`top-[-32px] whitespace-nowrap text-sm text-neutral-500 leading-10 lg:absolute dark:text-neutral-400`},A={key:0,flex:``,"flex-col":``,"items-center":``},j={"font-medium":``,text:`neutral-600 dark:neutral-300`},M={text:`neutral-500 dark:neutral-400`,"mt-2":``,"text-sm":``},N={key:1,flex:``,"flex-col":``,"items-center":``},P={"font-medium":``,text:`primary-600 dark:primary-300`},F={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`},I={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 L=p({__name:`index`,setup(p){let{t:x}=n(),L=t(),{addCard:R,removeCard:z}=L,{cards:B,activeCardId:V}=r(L),H=v(``),U=v(!1),W=v(!1),G=v(``),K=v(`nameAsc`),q=v([]);re(q,async e=>{let t=e[0];if(t)try{let e=await t.text(),n=JSON.parse(e);H.value=R(n),U.value=!0}catch(e){console.error(`Error processing card file:`,e)}});let J=f(()=>Array.from(B.value.entries()).map(([e,t])=>({id:e,name:t.name,description:t.description}))),ce=f(()=>{if(!G.value)return J.value;let e=G.value.toLowerCase();return J.value.filter(t=>t.name.toLowerCase().includes(e)||t.description&&t.description.toLowerCase().includes(e))}),Y=f(()=>{let e=[...ce.value];return K.value===`nameAsc`?e.sort((e,t)=>e.name.localeCompare(t.name)):K.value===`nameDesc`?e.sort((e,t)=>t.name.localeCompare(e.name)):K.value===`recent`?e.sort((e,t)=>t.id.localeCompare(e.id)):e}),X=v(!1),Z=v(null);function Q(){Z.value&&(z(Z.value),Z.value=null,X.value=!1)}function le(e){Z.value=e,X.value=!0}function ue(e){H.value=e,U.value=!0}function de(){W.value=!0}function fe(e){V.value=e}function pe(e){let t=B.value.get(e);return t?.version||`1.0.0`}function $(e,t){let n=B.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(t,n)=>{let r=ie(`motion`);return o(),g(d,null,[s(`div`,D,[s(`div`,ae,[s(`div`,oe,[n[7]||=s(`div`,{class:`pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3`},[s(`div`,{"i-solar:magnifer-line-duotone":``,class:`text-neutral-500 dark:text-neutral-400`})],-1),u(s(`input`,{"onUpdate:modelValue":n[0]||=e=>G.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:y(x)(`settings.pages.card.search`)},null,8,se),[[ne,G.value]])]),s(`div`,O,[s(`div`,k,b(y(x)(`settings.pages.card.sort_by`))+`: `,1),_(y(a),{modelValue:K.value,"onUpdate:modelValue":n[1]||=e=>K.value=e,options:[{value:`nameAsc`,label:y(x)(`settings.pages.card.name_asc`)},{value:`nameDesc`,label:y(x)(`settings.pages.card.name_desc`)},{value:`recent`,label:y(x)(`settings.pages.card.recent`)}],placeholder:`Select sort option`,class:`min-w-[150px]`},null,8,[`modelValue`,`options`])])]),s(`div`,{class:ee([`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))]":y(B).size>0}])},[_(y(e),{modelValue:q.value,"onUpdate:modelValue":n[2]||=e=>q.value=e,accept:`*.json`},{default:h(({isDragging:e})=>[e?(o(),g(`div`,N,[n[9]||=s(`div`,{"i-solar:upload-minimalistic-bold":``,class:`mb-2 text-5xl text-primary-500 dark:text-primary-400`},null,-1),s(`p`,P,b(y(x)(`settings.pages.card.drop_here`)),1)])):(o(),g(`div`,A,[n[8]||=s(`div`,{"i-solar:upload-square-line-duotone":``,"mb-4":``,"text-5xl":``,text:`neutral-400 dark:neutral-500`},null,-1),s(`p`,j,b(y(x)(`settings.pages.card.upload`)),1),s(`p`,M,b(y(x)(`settings.pages.card.upload_desc`)),1)]))]),_:1},8,[`modelValue`]),_(S,{onClick:de}),y(B).size>0?(o(!0),g(d,{key:0},te(Y.value,e=>(o(),l(E,{id:e.id,key:e.id,name:e.name,description:e.description,"is-active":e.id===y(V),"is-selected":e.id===H.value&&U.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)):m(``,!0),y(B).size===0?(o(),g(`div`,F,[n[10]||=s(`div`,{"i-solar:card-search-broken":``,"mx-auto":``,"mb-3":``,"text-6xl":``,"text-neutral-400":``},null,-1),s(`p`,null,b(y(x)(`settings.pages.card.no_cards`)),1)])):m(``,!0),G.value&&Y.value.length===0?(o(),l(y(i),{key:2,type:`warning`},{title:h(()=>[c(b(y(x)(`settings.pages.card.no_results`)),1)]),content:h(()=>[c(b(y(x)(`settings.pages.card.try_different_search`)),1)]),_:1})):m(``,!0)],2)]),_(w,{modelValue:X.value,"onUpdate:modelValue":n[3]||=e=>X.value=e,"card-name":Z.value?y(L).getCard(Z.value)?.name:``,onConfirm:Q,onCancel:n[4]||=e=>Z.value=null},null,8,[`modelValue`,`card-name`]),_(T,{modelValue:U.value,"onUpdate:modelValue":n[5]||=e=>U.value=e,"card-id":H.value},null,8,[`modelValue`,`card-id`]),_(C,{modelValue:W.value,"onUpdate:modelValue":n[6]||=e=>W.value=e},null,8,[`modelValue`]),u((o(),g(`div`,I,n[11]||=[s(`div`,{text:`60`,"i-solar:emoji-funny-square-bold-duotone":``},null,-1)])),[[r]])],64)}}});typeof x==`function`&&x(L);var R=L;export{R as default}; \ No newline at end of file diff --git a/assets/alibaba-cloud-model-studio-BJD00XEf.js b/assets/alibaba-cloud-model-studio-BJD00XEf.js deleted file mode 100644 index ea62be56aaf21a1a4546efd282a604558a7bbb2b..0000000000000000000000000000000000000000 --- a/assets/alibaba-cloud-model-studio-BJD00XEf.js +++ /dev/null @@ -1 +0,0 @@ -import{G as e,J as t,L as n,aS as r,au as i,bA as a,bB as o,bG as s,bK as c,bN as l,bP as u,bR as d,bU as f,bX as p,b_ as m,by as h,r as g,s as _}from"./index-BFym949y.js";import{b as v}from"./route-block-DVyt-3Cw.js";const y={flex:`~ col gap-4`},b=`alibaba-cloud-model-studio`,x=`cosyvoice-v1`;var S=u({__name:`alibaba-cloud-model-studio`,setup(u){let v={speed:1},S=p(0),C=p(1),w=p(0),T=e(),E=t(),{providers:D}=r(E),{t:O}=n(),k=l(()=>!!D.value[b]?.apiKey),A=l(()=>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 c(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)}),h(S,async()=>{let e=E.getProviderConfig(b);e.pitch=S.value}),h(C,async()=>{let e=E.getProviderConfig(b);e.speed=C.value}),h(w,async()=>{let e=E.getProviderConfig(b);e.volume=w.value}),h(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,t)=>(a(),s(m(g),{"provider-id":b,"default-model":x,"additional-settings":v},{"voice-settings":d(()=>[o(`div`,y,[f(m(i),{modelValue:S.value,"onUpdate:modelValue":t[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`]),f(m(i),{modelValue:C.value,"onUpdate:modelValue":t[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`]),f(m(i),{modelValue:w.value,"onUpdate:modelValue":t[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:d(()=>[f(m(_),{"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/alibaba-cloud-model-studio-Bc3aTr9J.js b/assets/alibaba-cloud-model-studio-Bc3aTr9J.js new file mode 100644 index 0000000000000000000000000000000000000000..b3f198fd7059508a423120ea687504ad3d8ff78a --- /dev/null +++ b/assets/alibaba-cloud-model-studio-Bc3aTr9J.js @@ -0,0 +1 @@ +import{G as e,J as t,L as n,aS as r,au as i,bA as a,bE as o,bH as s,bJ as c,bL as l,bO as u,bQ as d,bT as f,bU as p,bX as m,b_ as h,r as g,s as _}from"./index-J3uhnpYL.js";import{b as v}from"./route-block-DVyt-3Cw.js";const y={flex:`~ col gap-4`},b=`alibaba-cloud-model-studio`,x=`cosyvoice-v1`;var S=c({__name:`alibaba-cloud-model-studio`,setup(c){let v={speed:1},S=m(0),C=m(1),w=m(0),T=e(),E=t(),{providers:D}=r(E),{t:O}=n(),k=s(()=>!!D.value[b]?.apiKey),A=s(()=>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 o(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,t)=>(f(),a(h(g),{"provider-id":b,"default-model":x,"additional-settings":v},{"voice-settings":l(()=>[p(`div`,y,[u(h(i),{modelValue:S.value,"onUpdate:modelValue":t[0]||=e=>S.value=e,label:h(O)(`settings.pages.providers.provider.common.fields.field.pitch.label`),description:h(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`]),u(h(i),{modelValue:C.value,"onUpdate:modelValue":t[1]||=e=>C.value=e,label:h(O)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:h(O)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:2,step:.01},null,8,[`modelValue`,`label`,`description`]),u(h(i),{modelValue:w.value,"onUpdate:modelValue":t[2]||=e=>w.value=e,label:h(O)(`settings.pages.providers.provider.common.fields.field.volume.label`),description:h(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:l(()=>[u(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-Ds06Wuq-.js b/assets/anthropic-BY1KMERF.js similarity index 50% rename from assets/anthropic-Ds06Wuq-.js rename to assets/anthropic-BY1KMERF.js index 1e8797bfdd9de9bc360eed4ee0b51c47692495ef..e137ef911bdfa0f054f907e0f6979cc32bd88a9e 100644 --- a/assets/anthropic-Ds06Wuq-.js +++ b/assets/anthropic-BY1KMERF.js @@ -1 +1 @@ -import{J as e,L as t,aN as n,aS as r,bA as i,bB as a,bE as o,bG as s,bK as c,bN as l,bP as u,bR as d,bU as f,b_ as p,by as m,c1 as h,t as g,u as _,v,w as y,x as b,y as x}from"./index-BFym949y.js";import{b as S}from"./route-block-DVyt-3Cw.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=u({__name:`anthropic`,setup(u){let{t:S}=t(),D=n(),O=e(),{providers:k}=r(O),A=l(()=>O.getProviderMetadata(E)),j=l({get:()=>k.value[E]?.apiKey||``,set:e=>{k.value[E]||(k.value[E]={}),k.value[E].apiKey=e}}),M=l({get:()=>k.value[E]?.baseUrl||`https://api.anthropic.com/v1/`,set:e=>{k.value[E]||(k.value[E]={}),k.value[E].baseUrl=e}});c(()=>{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/`}),m([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)=>(i(),s(p(g),{"provider-name":A.value?.localizedName||`Anthropic | Claude`,"provider-icon":A.value?.icon,"on-back":()=>p(D).back()},{default:d(()=>[a(`div`,C,[a(`h2`,w,h(p(S)(`settings.pages.providers.provider.anthropic.helpinfo.title`)),1),a(`p`,null,[o(h(p(S)(`settings.pages.providers.provider.anthropic.helpinfo.description.part1`))+` `,1),a(`a`,T,h(p(S)(`settings.pages.providers.provider.anthropic.helpinfo.description.part2`)),1),o(`, `+h(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),o(` `+h(p(S)(`settings.pages.providers.provider.anthropic.helpinfo.description.part4`)),1)]),a(`p`,null,[o(h(p(S)(`settings.pages.providers.provider.anthropic.helpinfo.description.part5`))+` `,1),t[3]||=a(`a`,{underline:``,href:`https://workers.cloudflare.com/`},`Cloudflare Workers`,-1),o(` `+h(p(S)(`settings.pages.providers.provider.anthropic.helpinfo.description.part6`)),1)])]),f(p(_),null,{default:d(()=>[f(p(v),{title:p(S)(`settings.pages.providers.common.section.basic.title`),description:p(S)(`settings.pages.providers.common.section.basic.description`),"on-reset":N},{default:d(()=>[f(p(b),{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`]),f(p(x),{title:p(S)(`settings.pages.providers.common.section.advanced.title`)},{default:d(()=>[f(p(y),{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{J as e,L as t,aN as n,aS as r,bA as i,bE as a,bH as o,bJ as s,bL as c,bO as l,bQ as u,bT as d,bU as f,b_ as p,by as m,c0 as h,t as g,u as _,v,w as y,x as b,y as x}from"./index-J3uhnpYL.js";import{b as S}from"./route-block-DVyt-3Cw.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=s({__name:`anthropic`,setup(s){let{t:S}=t(),D=n(),O=e(),{providers:k}=r(O),A=o(()=>O.getProviderMetadata(E)),j=o({get:()=>k.value[E]?.apiKey||``,set:e=>{k.value[E]||(k.value[E]={}),k.value[E].apiKey=e}}),M=o({get:()=>k.value[E]?.baseUrl||`https://api.anthropic.com/v1/`,set:e=>{k.value[E]||(k.value[E]={}),k.value[E].baseUrl=e}});a(()=>{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/`}),u([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)=>(d(),i(p(g),{"provider-name":A.value?.localizedName||`Anthropic | Claude`,"provider-icon":A.value?.icon,"on-back":()=>p(D).back()},{default:c(()=>[f(`div`,C,[f(`h2`,w,h(p(S)(`settings.pages.providers.provider.anthropic.helpinfo.title`)),1),f(`p`,null,[m(h(p(S)(`settings.pages.providers.provider.anthropic.helpinfo.description.part1`))+` `,1),f(`a`,T,h(p(S)(`settings.pages.providers.provider.anthropic.helpinfo.description.part2`)),1),m(`, `+h(p(S)(`settings.pages.providers.provider.anthropic.helpinfo.description.part3`))+` `,1),t[2]||=f(`a`,{underline:``,href:`https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CORS`},`CORS`,-1),m(` `+h(p(S)(`settings.pages.providers.provider.anthropic.helpinfo.description.part4`)),1)]),f(`p`,null,[m(h(p(S)(`settings.pages.providers.provider.anthropic.helpinfo.description.part5`))+` `,1),t[3]||=f(`a`,{underline:``,href:`https://workers.cloudflare.com/`},`Cloudflare Workers`,-1),m(` `+h(p(S)(`settings.pages.providers.provider.anthropic.helpinfo.description.part6`)),1)])]),l(p(_),null,{default:c(()=>[l(p(v),{title:p(S)(`settings.pages.providers.common.section.basic.title`),description:p(S)(`settings.pages.providers.common.section.basic.description`),"on-reset":N},{default:c(()=>[l(p(b),{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`]),l(p(x),{title:p(S)(`settings.pages.providers.common.section.advanced.title`)},{default:c(()=>[l(p(y),{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-BKBvMHL0.js b/assets/appearance-CbLkQE_9.js similarity index 59% rename from assets/appearance-BKBvMHL0.js rename to assets/appearance-CbLkQE_9.js index 1860879c86a29e565755dd04197a17cafaf3cb6a..6c71a9c896e82ada376733ac9691e264aa3ce7ac 100644 --- a/assets/appearance-BKBvMHL0.js +++ b/assets/appearance-CbLkQE_9.js @@ -1 +1 @@ -import{L as e,am as t,bA as n,bB as r,bD as i,bG as a,bJ as o,bM as s,bN as c,bP as l,bS as u,b_ as d,bz as f,c0 as p}from"./index-BFym949y.js";import{b as m}from"./route-block-DVyt-3Cw.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=l({__name:`index`,setup(l){let{t:m}=e(),y=c(()=>[{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,c)=>{let l=f(`motion`);return n(),u(`div`,h,[c[0]||=r(`div`,null,null,-1),r(`div`,g,[(n(!0),u(s,null,i(y.value,(e,r)=>o((n(),a(d(t),{key:e.to,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250,style:p({transitionDelay:`${r*50}ms`}),title:e.title,description:e.description,icon:e.icon,to:e.to},null,8,[`style`,`title`,`description`,`icon`,`to`])),[[l]])),128))]),o((n(),u(`div`,_,[o(r(`div`,v,null,512),[[l]])])),[[l]])])}}});typeof m==`function`&&m(y);var b=y;export{b as default}; \ No newline at end of file +import{L as e,am as t,b$ as n,bA as r,bD as i,bG as a,bH as o,bJ as s,bM as c,bS as l,bT as u,bU as d,b_ as f,bx as p}from"./index-J3uhnpYL.js";import{b as m}from"./route-block-DVyt-3Cw.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=o(()=>[{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,o)=>{let s=l(`motion`);return u(),c(`div`,h,[o[0]||=d(`div`,null,null,-1),d(`div`,g,[(u(!0),c(a,null,p(y.value,(e,a)=>i((u(),r(f(t),{key:e.to,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250,style:n({transitionDelay:`${a*50}ms`}),title:e.title,description:e.description,icon:e.icon,to:e.to},null,8,[`style`,`title`,`description`,`icon`,`to`])),[[s]])),128))]),i((u(),c(`div`,_,[i(d(`div`,v,null,512),[[s]])])),[[s]])])}}});typeof m==`function`&&m(y);var b=y;export{b as default}; \ No newline at end of file diff --git a/assets/arktype-C-GObzDh-DWDEUAMn.js b/assets/arktype-C-GObzDh-BBIv_cP1.js similarity index 100% rename from assets/arktype-C-GObzDh-DWDEUAMn.js rename to assets/arktype-C-GObzDh-BBIv_cP1.js diff --git a/assets/audio-BlXLxr75.js b/assets/audio-BlXLxr75.js deleted file mode 100644 index c313c73ef63c8000452a5b2930be35c447a212a7..0000000000000000000000000000000000000000 --- a/assets/audio-BlXLxr75.js +++ /dev/null @@ -1 +0,0 @@ -import{bA as e,bB as t,bP as n,bS as r,bX as i}from"./index-BFym949y.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)=>(e(),r(`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-DYYSATQy.js b/assets/audio-DYYSATQy.js new file mode 100644 index 0000000000000000000000000000000000000000..bbae2c65e47aecba9eef9e6bb18bbbbd8d34e6a8 --- /dev/null +++ b/assets/audio-DYYSATQy.js @@ -0,0 +1 @@ +import{bJ as e,bM as t,bT as n,bU as r,bX as i}from"./index-J3uhnpYL.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)=>(n(),t(`div`,null,[r(`div`,null,[r(`div`,{ref_key:`containerRef`,ref:a},null,512),r(`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-Dpsb3s2S.js b/assets/audio-record-Dpsb3s2S.js new file mode 100644 index 0000000000000000000000000000000000000000..3cddaea3a845c77acf918d07b4ea9cf0f6ae2eb2 --- /dev/null +++ b/assets/audio-record-Dpsb3s2S.js @@ -0,0 +1 @@ +import{aU as e,ag as t,ao as n,ap as r,b3 as i,b5 as a,bA as o,bE as s,bG as c,bH as l,bJ as u,bL as d,bM as f,bN as p,bO as m,bQ as h,bT as g,bU as _,bV as v,bW as y,bX as b,b_ as x,bx as S,by as C,c0 as w}from"./index-J3uhnpYL.js";function T(){let t=i({constraints:{audio:!0},requestPermissions:!1}),n=b(t.audioInputs.value[0]?.deviceId||``),r=b(),a=l(()=>t.audioInputs.value),o=b({audio:!0}),s=e({constraints:o,autoSwitch:!0,enabled:!1});async function c(){t.permissionGranted.value||t.isSupported.value&&await t.ensurePermissions()}h(n,()=>{n.value&&(o.value={audio:{deviceId:{exact:n.value}}})},{immediate:!0}),h(t.audioInputs,()=>{r.value=a.value.find(e=>e.deviceId===n.value)},{immediate:!0}),h([t.permissionGranted,a,n],async()=>{await c(),t.permissionGranted.value&&a.value.length!==0&&(r.value||=a.value[0])},{immediate:!0});async function u(){await c(),t.permissionGranted.value&&r.value&&(s.enabled.value&&s.restart(),s.start())}function d(){s.stop()}return{selectedAudioInputId:n,selectedAudioInput:r,audioInputs:a,start:u,stop:d,request:c,media:s}}function E(e,t=()=>Promise.resolve()){let n=b(),r=y(e);async function i(){if(await t(),await a(r).toBeTruthy(),!r.value){console.error(`No media media available`);return}n.value=new MediaRecorder(r.value),n.value.start()}function o(){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:o}}const D={class:`mt-4 w-full flex justify-center gap-2`};var O=u({__name:`audio-record`,setup(e){let{audioInputs:i,selectedAudioInputId:a,start:l,stop:u,media:h,request:y}=T(),{startRecord:b,stopRecord:O}=E(h.stream,l);return s(()=>y()),p(()=>u()),(e,s)=>(g(),f(`div`,null,[m(x(n),{modelValue:x(a),"onUpdate:modelValue":s[0]||=e=>v(a)?a.value=e:null,onChange:s[1]||=()=>x(l)()},{default:d(({value:e})=>[_(`div`,null,w(e?x(i).find(t=>t.deviceId===e)?.label:`Select Audio Input`),1)]),options:d(({hide:e})=>[(g(!0),f(c,null,S(x(i),t=>(g(),o(x(r),{key:t.deviceId,value:t.deviceId,active:t.deviceId===x(a),onClick:t=>e()},{default:d(()=>[C(w(t.label),1)]),_:2},1032,[`value`,`active`,`onClick`]))),128))]),_:1},8,[`modelValue`]),_(`div`,D,[m(x(t),{onClick:x(b)},{default:d(()=>s[2]||=[C(` Start Recording `)]),_:1,__:[2]},8,[`onClick`]),m(x(t),{onClick:x(O)},{default:d(()=>s[3]||=[C(` Stop Recording `)]),_:1,__:[3]},8,[`onClick`])])]))}}),k=O;export{k as default}; \ No newline at end of file diff --git a/assets/audio-record-DrJXfolx.js b/assets/audio-record-DrJXfolx.js deleted file mode 100644 index cc80321f3b42d56ab87db7e99d7916931c80705a..0000000000000000000000000000000000000000 --- a/assets/audio-record-DrJXfolx.js +++ /dev/null @@ -1 +0,0 @@ -import{ag as e,ao as t,ap as n,b0 as r,b3 as i,b9 as a,bA as o,bB as s,bD as c,bE as l,bG as u,bK as d,bM as f,bN as p,bP as m,bR as h,bS as g,bT as _,bU as v,bV as y,bW as b,bX as x,b_ as S,by as C,c1 as w}from"./index-BFym949y.js";function T(){let e=r({constraints:{audio:!0},requestPermissions:!1}),t=x(e.audioInputs.value[0]?.deviceId||``),n=x(),a=p(()=>e.audioInputs.value),o=x({audio:!0}),s=i({constraints:o,autoSwitch:!0,enabled:!1});async function c(){e.permissionGranted.value||e.isSupported.value&&await e.ensurePermissions()}C(t,()=>{t.value&&(o.value={audio:{deviceId:{exact:t.value}}})},{immediate:!0}),C(e.audioInputs,()=>{n.value=a.value.find(e=>e.deviceId===t.value)},{immediate:!0}),C([e.permissionGranted,a,t],async()=>{await c(),e.permissionGranted.value&&a.value.length!==0&&(n.value||=a.value[0])},{immediate:!0});async function l(){await c(),e.permissionGranted.value&&n.value&&(s.enabled.value&&s.restart(),s.start())}function u(){s.stop()}return{selectedAudioInputId:t,selectedAudioInput:n,audioInputs:a,start:l,stop:u,request:c,media:s}}function E(e,t=()=>Promise.resolve()){let n=x(),r=b(e);async function i(){if(await t(),await a(r).toBeTruthy(),!r.value){console.error(`No media media available`);return}n.value=new MediaRecorder(r.value),n.value.start()}function o(){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:o}}const D={class:`mt-4 w-full flex justify-center gap-2`};var O=m({__name:`audio-record`,setup(r){let{audioInputs:i,selectedAudioInputId:a,start:p,stop:m,media:b,request:x}=T(),{startRecord:C,stopRecord:O}=E(b.stream,p);return d(()=>x()),_(()=>m()),(r,d)=>(o(),g(`div`,null,[v(S(t),{modelValue:S(a),"onUpdate:modelValue":d[0]||=e=>y(a)?a.value=e:null,onChange:d[1]||=()=>S(p)()},{default:h(({value:e})=>[s(`div`,null,w(e?S(i).find(t=>t.deviceId===e)?.label:`Select Audio Input`),1)]),options:h(({hide:e})=>[(o(!0),g(f,null,c(S(i),t=>(o(),u(S(n),{key:t.deviceId,value:t.deviceId,active:t.deviceId===S(a),onClick:t=>e()},{default:h(()=>[l(w(t.label),1)]),_:2},1032,[`value`,`active`,`onClick`]))),128))]),_:1},8,[`modelValue`]),s(`div`,D,[v(S(e),{onClick:S(C)},{default:h(()=>d[2]||=[l(` Start Recording `)]),_:1,__:[2]},8,[`onClick`]),v(S(e),{onClick:S(O)},{default:h(()=>d[3]||=[l(` Stop Recording `)]),_:1,__:[3]},8,[`onClick`])])]))}}),k=O;export{k as default}; \ No newline at end of file diff --git a/assets/azure-ai-foundry-CkLpWPUt.js b/assets/azure-ai-foundry-CkLpWPUt.js new file mode 100644 index 0000000000000000000000000000000000000000..514e724e29b42376f7b6b4b08be1d6783e43ea5a --- /dev/null +++ b/assets/azure-ai-foundry-CkLpWPUt.js @@ -0,0 +1 @@ +import{J as e,L as t,aN as n,aS as r,bA as i,bE as a,bH as o,bJ as s,bL as c,bO as l,bQ as u,bT as d,b_ as f,t as p,u as m,v as h,x as g,y as _,z as v}from"./index-J3uhnpYL.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b=`azure-ai-foundry`;var x=s({__name:`azure-ai-foundry`,setup(s){let{t:y}=t(),x=n(),S=e(),{providers:C}=r(S),w=o(()=>S.getProviderMetadata(b)),T=o({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=o({get:()=>C.value[b]?.resourceName||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].resourceName=e}}),D=o({get:()=>C.value[b]?.apiVersion||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiVersion=e}}),O=o({get:()=>C.value[b]?.modelId||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].modelId=e}});a(()=>{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||``}),u([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)=>(d(),i(f(p),{"provider-name":w.value?.localizedName||`Azure OpenAI`,"provider-icon":w.value?.icon,"on-back":()=>f(x).back()},{default:c(()=>[l(f(m),null,{default:c(()=>[l(f(h),{title:f(y)(`settings.pages.providers.common.section.basic.title`),description:f(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":k},{default:c(()=>[l(f(g),{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`]),l(f(v),{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`]),l(f(v),{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`]),l(f(_),{title:f(y)(`settings.pages.providers.common.section.advanced.title`)},{default:c(()=>[l(f(v),{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/azure-ai-foundry-D_2nNXRn.js b/assets/azure-ai-foundry-D_2nNXRn.js deleted file mode 100644 index 0b9f5783513452683674606e6c82f750272e1dbd..0000000000000000000000000000000000000000 --- a/assets/azure-ai-foundry-D_2nNXRn.js +++ /dev/null @@ -1 +0,0 @@ -import{J as e,L as t,aN as n,aS as r,bA as i,bG as a,bK as o,bN as s,bP as c,bR as l,bU as u,b_ as d,by as f,t as p,u as m,v as h,x as g,y as _,z as v}from"./index-BFym949y.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b=`azure-ai-foundry`;var x=c({__name:`azure-ai-foundry`,setup(c){let{t:y}=t(),x=n(),S=e(),{providers:C}=r(S),w=s(()=>S.getProviderMetadata(b)),T=s({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=s({get:()=>C.value[b]?.resourceName||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].resourceName=e}}),D=s({get:()=>C.value[b]?.apiVersion||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiVersion=e}}),O=s({get:()=>C.value[b]?.modelId||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].modelId=e}});o(()=>{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||``}),f([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)=>(i(),a(d(p),{"provider-name":w.value?.localizedName||`Azure OpenAI`,"provider-icon":w.value?.icon,"on-back":()=>d(x).back()},{default:l(()=>[u(d(m),null,{default:l(()=>[u(d(h),{title:d(y)(`settings.pages.providers.common.section.basic.title`),description:d(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":k},{default:l(()=>[u(d(g),{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`]),u(d(v),{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`]),u(d(v),{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`]),u(d(_),{title:d(y)(`settings.pages.providers.common.section.advanced.title`)},{default:l(()=>[u(d(v),{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-remove-BnlMlOvh.js b/assets/background-remove-Doptaj1n.js similarity index 57% rename from assets/background-remove-BnlMlOvh.js rename to assets/background-remove-Doptaj1n.js index 05ee141754f34a52e6b83e0ad0cf55287e6cd504..b9f51e7f702833e04061a5f1c5453b133a7ac93e 100644 --- a/assets/background-remove-BnlMlOvh.js +++ b/assets/background-remove-Doptaj1n.js @@ -1 +1 @@ -import{b as e}from"./InputFile-BA4DYXXI.js";import{K as t,bA as n,bB as r,bD as i,bK as a,bM as o,bN as s,bP as c,bQ as l,bS as u,bU as d,bX as f,b_ as p,c0 as m,c1 as h}from"./index-BFym949y.js";import{b as g,d as _,e as v,f as y}from"./transformers.web-B6jLny9T.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=c({__name:`background-remove`,setup(c){let N=f(),P=f(),F=f(),I=f(),L=f(!1),R=f(0),z=f(),B=f(),V=f([]),H=s(()=>V.value.map(e=>URL.createObjectURL(e)));a(async()=>{try{if(!(await t()).supported)throw Error(`WebGPU is not supported in this browser.`);let e=`Xenova/modnet`;_.backends.onnx.wasm.proxy=!1,N.value??=await y.from_pretrained(e,{device:`webgpu`}),P.value??=await v.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,a)=>(n(),u(`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},h(L.value?`Processing...`:`Process`),9,x),r(`div`,S,[r(`div`,C,[(n(!0),u(o,null,i(H.value,(e,t)=>(n(),u(`img`,{key:t,src:e,"h-full":``,"w-full":``,"object-cover":``},null,8,w))),128))]),r(`div`,T,[L.value?(n(),u(`div`,E,[r(`div`,D,h(R.value)+`% `,1),r(`div`,O,[r(`div`,{bg:`emerald-500`,"h-full":``,style:m({width:`${R.value}%`}),"transition-all":``,"duration-200":``},null,4)])])):l(``,!0),(n(!0),u(o,null,i(z.value,(e,t)=>(n(),u(`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)},a[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?(n(),u(`div`,M,[r(`button`,{bg:`emerald-500 hover:emerald-600`,"rounded-full":``,"p-2":``,"text-white":``,onClick:G},a[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)])])):l(``,!0)])]),d(p(e),{modelValue:V.value,"onUpdate:modelValue":a[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-DYGPp1hR.js";import{K as t,b$ as n,bE as r,bG as i,bH as a,bJ as o,bK as s,bM as c,bO as l,bT as u,bU as d,bX as f,b_ as p,bx as m,c0 as h}from"./index-J3uhnpYL.js";import{b as g,c as _,e as v,f as y}from"./transformers.web-DPuLqcmp.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=o({__name:`background-remove`,setup(o){let N=f(),P=f(),F=f(),I=f(),L=f(!1),R=f(0),z=f(),B=f(),V=f([]),H=a(()=>V.value.map(e=>URL.createObjectURL(e)));r(async()=>{try{if(!(await t()).supported)throw Error(`WebGPU is not supported in this browser.`);let e=`Xenova/modnet`;v.backends.onnx.wasm.proxy=!1,N.value??=await _.from_pretrained(e,{device:`webgpu`}),P.value??=await g.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)=>(u(),c(`div`,b,[d(`button`,{bg:`neutral-100 dark:neutral-800`,"w-full":``,"cursor-pointer":``,"rounded-lg":``,"px-3":``,"py-2":``,disabled:L.value,onClick:U},h(L.value?`Processing...`:`Process`),9,x),d(`div`,S,[d(`div`,C,[(u(!0),c(i,null,m(H.value,(e,t)=>(u(),c(`img`,{key:t,src:e,"h-full":``,"w-full":``,"object-cover":``},null,8,w))),128))]),d(`div`,T,[L.value?(u(),c(`div`,E,[d(`div`,D,h(R.value)+`% `,1),d(`div`,O,[d(`div`,{bg:`emerald-500`,"h-full":``,style:n({width:`${R.value}%`}),"transition-all":``,"duration-200":``},null,4)])])):s(``,!0),(u(!0),c(i,null,m(z.value,(e,t)=>(u(),c(`div`,{key:t,relative:``,class:`group`,"h-full":``,"w-full":``},[d(`img`,{src:e,"h-full":``,"w-full":``,"object-cover":``},null,8,k),d(`div`,A,[d(`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]||=[d(`svg`,{xmlns:`http://www.w3.org/2000/svg`,class:`h-5 w-5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`},[d(`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?(u(),c(`div`,M,[d(`button`,{bg:`emerald-500 hover:emerald-600`,"rounded-full":``,"p-2":``,"text-white":``,onClick:G},r[2]||=[d(`svg`,{xmlns:`http://www.w3.org/2000/svg`,class:`h-5 w-5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`},[d(`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)])])):s(``,!0)])]),l(p(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-BUZwRCyI.js b/assets/chat-BIP9jXlU.js similarity index 67% rename from assets/chat-BUZwRCyI.js rename to assets/chat-BIP9jXlU.js index f2fe0c346b01cded568f4a05745b87d123802258..0a70a54907d3ce0713b28f3acdff7416cc4e1ca5 100644 --- a/assets/chat-BUZwRCyI.js +++ b/assets/chat-BIP9jXlU.js @@ -1,3 +1,3 @@ -import{P as e,aY as t,bA as n,bB as r,bD as i,bJ as a,bM as o,bP as s,bQ as c,bS as l,bV as u,bX as d,bY as f,b_ as p,bu as m,c1 as h}from"./index-BFym949y.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{P as e,a$ as t,bD as n,bG as r,bJ as i,bK as a,bM as o,bT as s,bU as c,bV as l,bX as u,bY as d,b_ as f,bu as p,bx as m,c0 as h}from"./index-J3uhnpYL.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=s({__name:`chat`,setup(s){let g=t(`settings/llm/baseUrl`,`https://openrouter.ai/api/v1/`),_=t(`settings/llm/apiKey`,``),v=t(`settings/llm/model`,`openai/gpt-4o-mini`),y=d(``),b=d([]),S=d({role:`assistant`,content:``}),C=d(!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=>f(e))});for await(let e of r.chunkStream)n(T.with(e.choices[0].delta.content||``));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)=>(n(),l(`div`,V,[r(`div`,H,[r(`div`,U,[t[7]||=r(`div`,null,[r(`span`,{"text-neutral-500":``,"dark:text-neutral-400":``},`LLM`)],-1),r(`div`,W,[r(`label`,G,[t[4]||=r(`span`,{"text-nowrap":``},` Base URL `,-1),a(r(`input`,{"onUpdate:modelValue":t[0]||=e=>u(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),[[m,p(g)]])]),r(`label`,K,[t[5]||=r(`span`,{"text-nowrap":``},` API Key `,-1),a(r(`input`,{"onUpdate:modelValue":t[1]||=e=>u(_)?_.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),[[m,p(_)]])]),r(`label`,q,[t[6]||=r(`span`,{"text-nowrap":``},` Model `,-1),a(r(`input`,{"onUpdate:modelValue":t[2]||=e=>u(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),[[m,p(v)]])])])]),r(`div`,null,[a(r(`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),[[m,y.value]])]),r(`button`,{"rounded-lg":``,bg:`blue-100 dark:blue-900`,"px-4":``,"py-2":``,onClick:k},` Send `),r(`div`,null,[(n(!0),l(o,null,i(b.value,(e,t)=>(n(),l(`div`,{key:t},[e.role===`user`?(n(),l(`div`,J,[r(`span`,null,h(e.content),1)])):c(``,!0),e.role===`assistant`?(n(),l(`div`,Y,[r(`span`,null,h(e.content),1)])):c(``,!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=i({__name:`chat`,setup(i){let g=t(`settings/llm/baseUrl`,`https://openrouter.ai/api/v1/`),_=t(`settings/llm/apiKey`,``),v=t(`settings/llm/model`,`openai/gpt-4o-mini`),y=u(``),b=u([]),S=u({role:`assistant`,content:``}),C=u(!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=>d(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)=>(s(),o(`div`,V,[c(`div`,H,[c(`div`,U,[t[7]||=c(`div`,null,[c(`span`,{"text-neutral-500":``,"dark:text-neutral-400":``},`LLM`)],-1),c(`div`,W,[c(`label`,G,[t[4]||=c(`span`,{"text-nowrap":``},` Base URL `,-1),n(c(`input`,{"onUpdate:modelValue":t[0]||=e=>l(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),[[p,f(g)]])]),c(`label`,K,[t[5]||=c(`span`,{"text-nowrap":``},` API Key `,-1),n(c(`input`,{"onUpdate:modelValue":t[1]||=e=>l(_)?_.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),[[p,f(_)]])]),c(`label`,q,[t[6]||=c(`span`,{"text-nowrap":``},` Model `,-1),n(c(`input`,{"onUpdate:modelValue":t[2]||=e=>l(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),[[p,f(v)]])])])]),c(`div`,null,[n(c(`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),[[p,y.value]])]),c(`button`,{"rounded-lg":``,bg:`blue-100 dark:blue-900`,"px-4":``,"py-2":``,onClick:k},` Send `),c(`div`,null,[(s(!0),o(r,null,m(b.value,(e,t)=>(s(),o(`div`,{key:t},[e.role===`user`?(s(),o(`div`,J,[c(`span`,null,h(e.content),1)])):a(``,!0),e.role===`assistant`?(s(),o(`div`,Y,[c(`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-BaI_Rwef.js b/assets/cloudflare-workers-ai-BaI_Rwef.js new file mode 100644 index 0000000000000000000000000000000000000000..ef3f4b9d955cd448d18a7cd1f9e9095e5fab72ff --- /dev/null +++ b/assets/cloudflare-workers-ai-BaI_Rwef.js @@ -0,0 +1 @@ +import{J as e,L as t,aN as n,aS as r,bA as i,bE as a,bH as o,bJ as s,bL as c,bO as l,bQ as u,bT as d,b_ as f,t as p,u as m,v as h,x as g,z as _}from"./index-J3uhnpYL.js";import{b as v}from"./route-block-DVyt-3Cw.js";const y=`cloudflare-workers-ai`;var b=s({__name:`cloudflare-workers-ai`,setup(s){let{t:v}=t(),b=n(),x=e(),{providers:S}=r(x),C=o(()=>x.getProviderMetadata(y)),w=o({get:()=>S.value[y]?.apiKey||``,set:e=>{S.value[y]||(S.value[y]={}),S.value[y].apiKey=e}}),T=o({get:()=>S.value[y]?.accountId||``,set:e=>{S.value[y]||(S.value[y]={}),S.value[y].accountId=e}});a(()=>{x.initializeProvider(y),w.value=S.value[y]?.apiKey||``,T.value=S.value[y]?.accountId||``}),u([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)=>(d(),i(f(p),{"provider-name":C.value?.localizedName,"provider-icon-color":C.value?.iconColor,"on-back":()=>f(b).back()},{default:c(()=>[l(f(m),null,{default:c(()=>[l(f(h),{title:f(v)(`settings.pages.providers.common.section.basic.title`),description:f(v)(`settings.pages.providers.common.section.basic.description`),"on-reset":E},{default:c(()=>[l(f(g),{modelValue:w.value,"onUpdate:modelValue":t[0]||=e=>w.value=e,"provider-name":C.value?.localizedName,placeholder:f(v)(`settings.pages.providers.provider.cloudflare-workers-ai.fields.field.api-key.placeholder`)},null,8,[`modelValue`,`provider-name`,`placeholder`]),l(f(_),{modelValue:T.value,"onUpdate:modelValue":t[1]||=e=>T.value=e,label:f(v)(`settings.pages.providers.provider.cloudflare-workers-ai.fields.field.account-id.label`),description:f(v)(`settings.pages.providers.provider.cloudflare-workers-ai.fields.field.account-id.description`),placeholder:f(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/cloudflare-workers-ai-CL-TY-Cz.js b/assets/cloudflare-workers-ai-CL-TY-Cz.js deleted file mode 100644 index 5fb8462fd117aa02376e09e3c00cdd356b669dea..0000000000000000000000000000000000000000 --- a/assets/cloudflare-workers-ai-CL-TY-Cz.js +++ /dev/null @@ -1 +0,0 @@ -import{J as e,L as t,aN as n,aS as r,bA as i,bG as a,bK as o,bN as s,bP as c,bR as l,bU as u,b_ as d,by as f,t as p,u as m,v as h,x as g,z as _}from"./index-BFym949y.js";import{b as v}from"./route-block-DVyt-3Cw.js";const y=`cloudflare-workers-ai`;var b=c({__name:`cloudflare-workers-ai`,setup(c){let{t:v}=t(),b=n(),x=e(),{providers:S}=r(x),C=s(()=>x.getProviderMetadata(y)),w=s({get:()=>S.value[y]?.apiKey||``,set:e=>{S.value[y]||(S.value[y]={}),S.value[y].apiKey=e}}),T=s({get:()=>S.value[y]?.accountId||``,set:e=>{S.value[y]||(S.value[y]={}),S.value[y].accountId=e}});o(()=>{x.initializeProvider(y),w.value=S.value[y]?.apiKey||``,T.value=S.value[y]?.accountId||``}),f([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)=>(i(),a(d(p),{"provider-name":C.value?.localizedName,"provider-icon-color":C.value?.iconColor,"on-back":()=>d(b).back()},{default:l(()=>[u(d(m),null,{default:l(()=>[u(d(h),{title:d(v)(`settings.pages.providers.common.section.basic.title`),description:d(v)(`settings.pages.providers.common.section.basic.description`),"on-reset":E},{default:l(()=>[u(d(g),{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`]),u(d(_),{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-Cs2KuTF6.js b/assets/color-scheme-Dk37f8SX.js similarity index 50% rename from assets/color-scheme-Cs2KuTF6.js rename to assets/color-scheme-Dk37f8SX.js index 6d8ced2186bb7be8cc3ed686a4c6822515723938..4460b049da8f6cb8859a2a8ee9662d577576875c 100644 --- a/assets/color-scheme-Cs2KuTF6.js +++ b/assets/color-scheme-Dk37f8SX.js @@ -1 +1 @@ -import{B as e,L as t,aL as n,an as r,ar as i,b as a,bA as o,bB as s,bD as c,bE as l,bG as u,bJ as d,bM as f,bP as p,bR as m,bS as h,bU as g,b_ as _,br as v,bz as y,c1 as b}from"./index-BFym949y.js";import{b as x}from"./route-block-DVyt-3Cw.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:5*50,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:7*50,transition:`all ease-in-out duration-250`},D={"text-white":``,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:330,delay:8*50,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:9*50,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=p({__name:`color-scheme`,setup(n){let p=e(),{t:x}=t();return(e,t)=>{let n=y(`motion`);return o(),h(f,null,[d((o(),u(_(r),{"mb-2":``,title:_(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:4*50,transition:`all ease-in-out duration-250`},{default:m(()=>[d((o(),h(`div`,C,[s(`span`,w,b(e.$t(`settings.pages.themes.sections.section.custom-color.fields.field.primary-color.label`)),1),s(`label`,T,[d(s(`input`,{"onUpdate:modelValue":t[0]||=e=>_(p).themeColorsHueDynamic=e,type:`checkbox`,class:`peer sr-only`},null,512),[[v,_(p).themeColorsHueDynamic]]),t[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),l(` `+b(e.$t(`settings.pages.themes.sections.section.custom-color.fields.field.primary-color.rgb-on.title`)),1)])])),[[n]]),d(g(_(i),{modelValue:_(p).themeColorsHue,"onUpdate:modelValue":t[1]||=e=>_(p).themeColorsHue=e,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:310,delay:6*50,disabled:_(p).themeColorsHueDynamic},null,8,[`modelValue`,`disabled`]),[[n]]),d((o(),h(`div`,E,[t[4]||=s(`span`,{"bg-primary-50":``},`50`,-1),t[5]||=s(`span`,{"bg-primary-100":``},`100`,-1),t[6]||=s(`span`,{"bg-primary-200":``},`200`,-1),t[7]||=s(`span`,{"bg-primary-300":``},`300`,-1),t[8]||=s(`span`,{"bg-primary-400":``},`400`,-1),t[9]||=s(`span`,{"bg-primary-500":``},`500`,-1),d((o(),h(`div`,D,t[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)])),[[n]])])),[[n]]),d((o(),h(`div`,O,t[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)])),[[n]])]),_:1},8,[`title`])),[[n]]),d((o(),u(_(r),{"mb-2":``,title:_(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:10*50,transition:`all ease-in-out duration-250`},{default:m(()=>[(o(!0),h(f,null,c(e.$tm(`settings.pages.themes.sections.section.theme-presets.presets`),({title:t,description:r,colors:i},c)=>d((o(),h(`div`,{key:c,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+c*10,delay:11*50+c*50,transition:`all ease-in-out duration-250`},[s(`div`,null,[s(`span`,A,b(e.$rt(t)),1),s(`div`,j,b(e.$rt(r)),1)]),g(_(a),{colors:i.map((t,n)=>({hex:_(S)[c][n],name:e.$rt(t)}))},null,8,[`colors`])],8,k)),[[n]])),128))]),_:1},8,[`title`])),[[n]]),d((o(),h(`div`,M,t[11]||=[s(`div`,{text:`60`,"i-solar:pallete-2-bold-duotone":``},null,-1)])),[[n]])],64)}}});typeof x==`function`&&x(N);var P=n(N,[[`__scopeId`,`data-v-659ad349`]]);export{P as default}; \ No newline at end of file +import{B as e,L as t,aL as n,an as r,ar as i,b as a,bA as o,bD as s,bG as c,bJ as l,bL as u,bM as d,bO as f,bS as p,bT as m,bU as h,b_ as g,bs as _,bx as v,by as y,c0 as b}from"./index-J3uhnpYL.js";import{b as x}from"./route-block-DVyt-3Cw.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:5*50,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:7*50,transition:`all ease-in-out duration-250`},D={"text-white":``,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:330,delay:8*50,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:9*50,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=l({__name:`color-scheme`,setup(n){let l=e(),{t:x}=t();return(e,t)=>{let n=p(`motion`);return m(),d(c,null,[s((m(),o(g(r),{"mb-2":``,title:g(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:4*50,transition:`all ease-in-out duration-250`},{default:u(()=>[s((m(),d(`div`,C,[h(`span`,w,b(e.$t(`settings.pages.themes.sections.section.custom-color.fields.field.primary-color.label`)),1),h(`label`,T,[s(h(`input`,{"onUpdate:modelValue":t[0]||=e=>g(l).themeColorsHueDynamic=e,type:`checkbox`,class:`peer sr-only`},null,512),[[_,g(l).themeColorsHueDynamic]]),t[2]||=h(`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),y(` `+b(e.$t(`settings.pages.themes.sections.section.custom-color.fields.field.primary-color.rgb-on.title`)),1)])])),[[n]]),s(f(g(i),{modelValue:g(l).themeColorsHue,"onUpdate:modelValue":t[1]||=e=>g(l).themeColorsHue=e,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:310,delay:6*50,disabled:g(l).themeColorsHueDynamic},null,8,[`modelValue`,`disabled`]),[[n]]),s((m(),d(`div`,E,[t[4]||=h(`span`,{"bg-primary-50":``},`50`,-1),t[5]||=h(`span`,{"bg-primary-100":``},`100`,-1),t[6]||=h(`span`,{"bg-primary-200":``},`200`,-1),t[7]||=h(`span`,{"bg-primary-300":``},`300`,-1),t[8]||=h(`span`,{"bg-primary-400":``},`400`,-1),t[9]||=h(`span`,{"bg-primary-500":``},`500`,-1),s((m(),d(`div`,D,t[3]||=[h(`span`,{"bg-primary-600":``},`600`,-1),h(`span`,{"bg-primary-700":``},`700`,-1),h(`span`,{"bg-primary-800":``},`800`,-1),h(`span`,{"bg-primary-900":``},`900`,-1),h(`span`,{"bg-primary-950":``},`950`,-1)])),[[n]])])),[[n]]),s((m(),d(`div`,O,t[10]||=[h(`span`,{bg:`primary-500/5`},`500/5`,-1),h(`span`,{bg:`primary-500/10`},`500/10`,-1),h(`span`,{bg:`primary-500/20`},`500/20`,-1),h(`span`,{bg:`primary-500/30`},`500/30`,-1),h(`span`,{bg:`primary-500/40`},`500/40`,-1),h(`span`,{bg:`primary-500/50`},`500/50`,-1),h(`span`,{bg:`primary-500/60`},`500/60`,-1),h(`span`,{bg:`primary-500/70`},`500/70`,-1),h(`span`,{bg:`primary-500/80`},`500/80`,-1),h(`span`,{bg:`primary-500/90`},`500/90`,-1),h(`span`,{bg:`primary-500`},`500`,-1)])),[[n]])]),_:1},8,[`title`])),[[n]]),s((m(),o(g(r),{"mb-2":``,title:g(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:10*50,transition:`all ease-in-out duration-250`},{default:u(()=>[(m(!0),d(c,null,v(e.$tm(`settings.pages.themes.sections.section.theme-presets.presets`),({title:t,description:r,colors:i},o)=>s((m(),d(`div`,{key:o,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+o*10,delay:11*50+o*50,transition:`all ease-in-out duration-250`},[h(`div`,null,[h(`span`,A,b(e.$rt(t)),1),h(`div`,j,b(e.$rt(r)),1)]),f(g(a),{colors:i.map((t,n)=>({hex:g(S)[o][n],name:e.$rt(t)}))},null,8,[`colors`])],8,k)),[[n]])),128))]),_:1},8,[`title`])),[[n]]),s((m(),d(`div`,M,t[11]||=[h(`div`,{text:`60`,"i-solar:pallete-2-bold-duotone":``},null,-1)])),[[n]])],64)}}});typeof x==`function`&&x(N);var P=n(N,[[`__scopeId`,`data-v-659ad349`]]);export{P as default}; \ No newline at end of file diff --git a/assets/consciousness-BLecufPV.js b/assets/consciousness-BLecufPV.js deleted file mode 100644 index abd98db89a8ba6827b7696d22605ac81f874b211..0000000000000000000000000000000000000000 --- a/assets/consciousness-BLecufPV.js +++ /dev/null @@ -1 +0,0 @@ -import{I as e,J as t,L as n,aP as ee,aS as r,af as i,ai as te,aj as ne,ak as re,bA as a,bB as o,bD as s,bE as c,bG as l,bJ as u,bK as ie,bM as d,bP as f,bQ as p,bR as m,bS as h,bU as ae,bV as g,b_ as _,bu as oe,bz as se,c1 as v}from"./index-BFym949y.js";import{b as y}from"./route-block-DVyt-3Cw.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=f({__name:`consciousness`,setup(f){let y=t(),U=e(),{configuredChatProvidersMetadata:W}=r(y),{activeProvider:G,activeModel:K,customModelName:le,modelSearchQuery:q,supportsModelListing:J,providerModels:Y,isLoadingActiveProviderModels:X,activeProviderModelError:Z}=r(U),{t:Q}=n();ie(async()=>{await U.loadModelsForProvider(G.value)});function $(e){le.value=e}return(e,t)=>{let n=se(`motion`);return a(),h(d,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?(a(),h(`fieldset`,T,[(a(!0),h(d,null,s(_(W),e=>(a(),l(_(te),{id:e.id,key:e.id,modelValue:_(G),"onUpdate:modelValue":t[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))])):(a(),h(`div`,E,[ae(_(ee),{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(()=>t[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)?(a(),h(`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)?(a(),h(`div`,j,[t[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)?(a(),l(_(i),{key:1,title:_(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.error`),error:_(Z)},null,8,[`title`,`error`])):_(Y).length===0&&!_(X)?(a(),l(_(re),{key:2,type:`warning`},{title:m(()=>[c(v(_(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models`)),1)]),content:m(()=>[c(v(_(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models_description`)),1)]),_:1})):_(Y).length>0?(a(),l(_(ne),{key:3,modelValue:_(K),"onUpdate:modelValue":t[1]||=e=>g(K)?K.value=e:null,"search-query":_(q),"onUpdate:searchQuery":t[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`])):p(``,!0)])])):_(G)&&!_(J)?(a(),h(`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,[t[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),u(o(`input`,{"onUpdate:modelValue":t[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),[[oe,_(K)]])])])])):p(``,!0)]),u((a(),h(`div`,H,t[7]||=[o(`div`,{text:`60`,"i-solar:ghost-bold-duotone":``},null,-1)])),[[n]])],64)}}});typeof y==`function`&&y(U);var W=U;export{W as default}; \ No newline at end of file diff --git a/assets/consciousness-CYrl8QXs.js b/assets/consciousness-CYrl8QXs.js new file mode 100644 index 0000000000000000000000000000000000000000..49105c0ef9678b9a3fee6087cf98cdcb1a01b8a0 --- /dev/null +++ b/assets/consciousness-CYrl8QXs.js @@ -0,0 +1 @@ +import{I as e,J as t,L as n,aP as ee,aS as r,af as i,ai as te,aj as ne,ak as re,bA as a,bD as o,bE as ie,bG as s,bJ as ae,bK as c,bL as l,bM as u,bO as d,bS as f,bT as p,bU as m,bV as h,b_ as g,bu as oe,bx as se,by as _,c0 as v}from"./index-J3uhnpYL.js";import{b as y}from"./route-block-DVyt-3Cw.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=ae({__name:`consciousness`,setup(ae){let y=t(),U=e(),{configuredChatProvidersMetadata:W}=r(y),{activeProvider:G,activeModel:K,customModelName:le,modelSearchQuery:q,supportsModelListing:J,providerModels:Y,isLoadingActiveProviderModels:X,activeProviderModelError:Z}=r(U),{t:Q}=n();ie(async()=>{await U.loadModelsForProvider(G.value)});function $(e){le.value=e}return(e,t)=>{let n=f(`motion`);return p(),u(s,null,[m(`div`,b,[m(`div`,null,[m(`div`,x,[m(`div`,null,[m(`h2`,S,v(g(Q)(`settings.pages.providers.title`)),1),m(`div`,C,[m(`span`,null,v(g(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.description`)),1)])]),m(`div`,w,[g(W).length>0?(p(),u(`fieldset`,T,[(p(!0),u(s,null,se(g(W),e=>(p(),a(g(te),{id:e.id,key:e.id,modelValue:g(G),"onUpdate:modelValue":t[0]||=e=>h(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))])):(p(),u(`div`,E,[d(g(ee),{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:l(()=>t[4]||=[m(`div`,{"i-solar:warning-circle-line-duotone":``,class:`text-2xl text-amber-500 dark:text-amber-400`},null,-1),m(`div`,{class:`flex flex-col`},[m(`span`,{class:`font-medium`},`No Providers Configured`),m(`span`,{class:`text-sm text-neutral-400 dark:text-neutral-500`},`Click here to set up your LLM providers`)],-1),m(`div`,{"i-solar:arrow-right-line-duotone":``,class:`ml-auto text-xl text-neutral-400 dark:text-neutral-500`},null,-1)]),_:1,__:[4]})]))])])]),g(G)&&g(J)?(p(),u(`div`,D,[m(`div`,O,[m(`div`,null,[m(`h2`,k,v(g(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.title`)),1),m(`div`,A,[m(`span`,null,v(g(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle`)),1)])]),g(X)?(p(),u(`div`,j,[t[5]||=m(`div`,{class:`mr-2 animate-spin`},[m(`div`,{"i-solar:spinner-line-duotone":``,"text-xl":``})],-1),m(`span`,null,v(g(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.loading`)),1)])):g(Z)?(p(),a(g(i),{key:1,title:g(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.error`),error:g(Z)},null,8,[`title`,`error`])):g(Y).length===0&&!g(X)?(p(),a(g(re),{key:2,type:`warning`},{title:l(()=>[_(v(g(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models`)),1)]),content:l(()=>[_(v(g(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models_description`)),1)]),_:1})):g(Y).length>0?(p(),a(g(ne),{key:3,modelValue:g(K),"onUpdate:modelValue":t[1]||=e=>h(K)?K.value=e:null,"search-query":g(q),"onUpdate:searchQuery":t[2]||=e=>h(q)?q.value=e:null,items:g(Y).sort((e,t)=>e.id===g(K)?-1:t.id===g(K)?1:0),searchable:!0,"search-placeholder":g(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.search_placeholder`),"search-no-results-title":g(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results`),"search-no-results-description":g(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results_description`,{query:g(q)}),"search-results-text":g(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.search_results`,{count:`{count}`,total:`{total}`}),"custom-input-placeholder":g(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.custom_model_placeholder`),"expand-button-text":g(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.expand`),"collapse-button-text":g(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(G)&&!g(J)?(p(),u(`div`,M,[m(`div`,N,[m(`div`,null,[m(`h2`,P,v(g(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.title`)),1),m(`div`,F,[m(`span`,null,v(g(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle`)),1)])]),m(`div`,ce,[t[6]||=m(`div`,{"i-solar:info-circle-line-duotone":``,class:`text-2xl text-primary-500 dark:text-primary-400`},null,-1),m(`div`,I,[m(`span`,L,v(g(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.not_supported`)),1),m(`span`,R,v(g(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.not_supported_description`)),1)])]),m(`div`,z,[m(`label`,B,v(g(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.manual_model_name`)),1),o(m(`input`,{"onUpdate:modelValue":t[3]||=e=>h(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:g(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.manual_model_placeholder`)},null,8,V),[[oe,g(K)]])])])])):c(``,!0)]),o((p(),u(`div`,H,t[7]||=[m(`div`,{text:`60`,"i-solar:ghost-bold-duotone":``},null,-1)])),[[n]])],64)}}});typeof y==`function`&&y(U);var W=U;export{W as default}; \ No newline at end of file diff --git a/assets/core-52E9_3Ll.js b/assets/core-52E9_3Ll.js new file mode 100644 index 0000000000000000000000000000000000000000..b956f26b0dcb63648e8969fb2c985128b2e815b6 --- /dev/null +++ b/assets/core-52E9_3Ll.js @@ -0,0 +1,3 @@ +function e(e){let t=Object.values(e).filter(e=>typeof e==`number`),n=Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t);return n}function t(e){let t=!1;return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}}}}const n=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{},r=t(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{let e=Function;return new e(``),!0}catch{return!1}}),i={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},a=Symbol(`ZodOutput`),o=Symbol(`ZodInput`);var s=class{constructor(){this._map=new Map,this._idmap=new Map}add(e,...t){let n=t[0];if(this._map.set(e,n),n&&typeof n==`object`&&`id`in n){if(this._idmap.has(n.id))throw Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};return delete n.id,{...n,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}};function c(){return new s}const l=c();var u=class{constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??l,this.target=e?.target??`draft-2020-12`,this.unrepresentable=e?.unrepresentable??`throw`,this.override=e?.override??(()=>{}),this.io=e?.io??`output`,this.seen=new Map}process(t,n={path:[],schemaPath:[]}){var r;let i=t._zod.def,a={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},o=this.seen.get(t);if(o){o.count++;let e=n.schemaPath.includes(t);return e&&(o.cycle=n.path),o.schema}let s={schema:{},count:1,cycle:void 0,path:n.path};this.seen.set(t,s);let c=t._zod.toJSONSchema?.();if(c)s.schema=c;else{let r={...n,schemaPath:[...n.schemaPath,t],path:n.path},o=t._zod.parent;if(o)s.ref=o,this.process(o,r),this.seen.get(o).isParent=!0;else{let n=s.schema;switch(i.type){case`string`:{let e=n;e.type=`string`;let{minimum:r,maximum:i,format:o,patterns:c,contentEncoding:l}=t._zod.bag;if(typeof r==`number`&&(e.minLength=r),typeof i==`number`&&(e.maxLength=i),o&&(e.format=a[o]??o,e.format===``&&delete e.format),l&&(e.contentEncoding=l),c&&c.size>0){let t=[...c];t.length===1?e.pattern=t[0].source:t.length>1&&(s.schema.allOf=[...t.map(e=>({...this.target===`draft-7`?{type:`string`}:{},pattern:e.source}))])}break}case`number`:{let e=n,{minimum:r,maximum:i,format:a,multipleOf:o,exclusiveMaximum:s,exclusiveMinimum:c}=t._zod.bag;typeof a==`string`&&a.includes(`int`)?e.type=`integer`:e.type=`number`,typeof c==`number`&&(e.exclusiveMinimum=c),typeof r==`number`&&(e.minimum=r,typeof c==`number`&&(c>=r?delete e.minimum:delete e.exclusiveMinimum)),typeof s==`number`&&(e.exclusiveMaximum=s),typeof i==`number`&&(e.maximum=i,typeof s==`number`&&(s<=i?delete e.maximum:delete e.exclusiveMaximum)),typeof o==`number`&&(e.multipleOf=o);break}case`boolean`:{let e=n;e.type=`boolean`;break}case`bigint`:if(this.unrepresentable===`throw`)throw Error(`BigInt cannot be represented in JSON Schema`);break;case`symbol`:if(this.unrepresentable===`throw`)throw Error(`Symbols cannot be represented in JSON Schema`);break;case`null`:n.type=`null`;break;case`any`:break;case`unknown`:break;case`undefined`:if(this.unrepresentable===`throw`)throw Error(`Undefined cannot be represented in JSON Schema`);break;case`void`:if(this.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`);break;case`never`:n.not={};break;case`date`:if(this.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`);break;case`array`:{let e=n,{minimum:a,maximum:o}=t._zod.bag;typeof a==`number`&&(e.minItems=a),typeof o==`number`&&(e.maxItems=o),e.type=`array`,e.items=this.process(i.element,{...r,path:[...r.path,`items`]});break}case`object`:{let e=n;e.type=`object`,e.properties={};let t=i.shape;for(let n in t)e.properties[n]=this.process(t[n],{...r,path:[...r.path,`properties`,n]});let a=new Set(Object.keys(t)),o=new Set([...a].filter(e=>{let t=i.shape[e]._zod;return this.io===`input`?t.optin===void 0:t.optout===void 0}));o.size>0&&(e.required=Array.from(o)),i.catchall?._zod.def.type===`never`?e.additionalProperties=!1:i.catchall?i.catchall&&(e.additionalProperties=this.process(i.catchall,{...r,path:[...r.path,`additionalProperties`]})):this.io===`output`&&(e.additionalProperties=!1);break}case`union`:{let e=n;e.anyOf=i.options.map((e,t)=>this.process(e,{...r,path:[...r.path,`anyOf`,t]}));break}case`intersection`:{let e=n,t=this.process(i.left,{...r,path:[...r.path,`allOf`,0]}),a=this.process(i.right,{...r,path:[...r.path,`allOf`,1]}),o=e=>`allOf`in e&&Object.keys(e).length===1,s=[...o(t)?t.allOf:[t],...o(a)?a.allOf:[a]];e.allOf=s;break}case`tuple`:{let e=n;e.type=`array`;let a=i.items.map((e,t)=>this.process(e,{...r,path:[...r.path,`prefixItems`,t]}));if(this.target===`draft-2020-12`?e.prefixItems=a:e.items=a,i.rest){let t=this.process(i.rest,{...r,path:[...r.path,`items`]});this.target===`draft-2020-12`?e.items=t:e.additionalItems=t}i.rest&&(e.items=this.process(i.rest,{...r,path:[...r.path,`items`]}));let{minimum:o,maximum:s}=t._zod.bag;typeof o==`number`&&(e.minItems=o),typeof s==`number`&&(e.maxItems=s);break}case`record`:{let e=n;e.type=`object`,e.propertyNames=this.process(i.keyType,{...r,path:[...r.path,`propertyNames`]}),e.additionalProperties=this.process(i.valueType,{...r,path:[...r.path,`additionalProperties`]});break}case`map`:if(this.unrepresentable===`throw`)throw Error(`Map cannot be represented in JSON Schema`);break;case`set`:if(this.unrepresentable===`throw`)throw Error(`Set cannot be represented in JSON Schema`);break;case`enum`:{let t=n,r=e(i.entries);r.every(e=>typeof e==`number`)&&(t.type=`number`),r.every(e=>typeof e==`string`)&&(t.type=`string`),t.enum=r;break}case`literal`:{let e=n,t=[];for(let e of i.values)if(e===void 0){if(this.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(this.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);t.push(Number(e))}else t.push(e);if(t.length!==0)if(t.length===1){let n=t[0];e.type=n===null?`null`:typeof n,e.const=n}else t.every(e=>typeof e==`number`)&&(e.type=`number`),t.every(e=>typeof e==`string`)&&(e.type=`string`),t.every(e=>typeof e==`boolean`)&&(e.type=`string`),t.every(e=>e===null)&&(e.type=`null`),e.enum=t;break}case`file`:{let e=n,r={type:`string`,format:`binary`,contentEncoding:`binary`},{minimum:i,maximum:a,mime:o}=t._zod.bag;i!==void 0&&(r.minLength=i),a!==void 0&&(r.maxLength=a),o?o.length===1?(r.contentMediaType=o[0],Object.assign(e,r)):e.anyOf=o.map(e=>{let t={...r,contentMediaType:e};return t}):Object.assign(e,r);break}case`transform`:if(this.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`);break;case`nullable`:{let e=this.process(i.innerType,r);n.anyOf=[e,{type:`null`}];break}case`nonoptional`:this.process(i.innerType,r),s.ref=i.innerType;break;case`success`:{let e=n;e.type=`boolean`;break}case`default`:this.process(i.innerType,r),s.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue));break;case`prefault`:this.process(i.innerType,r),s.ref=i.innerType,this.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)));break;case`catch`:{this.process(i.innerType,r),s.ref=i.innerType;let e;try{e=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=e;break}case`nan`:if(this.unrepresentable===`throw`)throw Error(`NaN cannot be represented in JSON Schema`);break;case`template_literal`:{let e=n,r=t._zod.pattern;if(!r)throw Error(`Pattern not found in template literal`);e.type=`string`,e.pattern=r.source;break}case`pipe`:{let e=this.io===`input`?i.in._zod.def.type===`transform`?i.out:i.in:i.out;this.process(e,r),s.ref=e;break}case`readonly`:this.process(i.innerType,r),s.ref=i.innerType,n.readOnly=!0;break;case`promise`:this.process(i.innerType,r),s.ref=i.innerType;break;case`optional`:this.process(i.innerType,r),s.ref=i.innerType;break;case`lazy`:{let e=t._zod.innerType;this.process(e,r),s.ref=e;break}case`custom`:if(this.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`);break;default:}}}let l=this.metadataRegistry.get(t);l&&Object.assign(s.schema,l),this.io===`input`&&f(t)&&(delete s.schema.examples,delete s.schema.default),this.io===`input`&&s.schema._prefault&&((r=s.schema).default??(r.default=s.schema._prefault)),delete s.schema._prefault;let u=this.seen.get(t);return u.schema}emit(e,t){let n={cycles:t?.cycles??`ref`,reused:t?.reused??`inline`,external:t?.external??void 0},r=this.seen.get(e);if(!r)throw Error(`Unprocessed schema. This is a bug in Zod.`);let i=e=>{let t=this.target===`draft-2020-12`?`$defs`:`definitions`;if(n.external){let r=n.external.registry.get(e[0])?.id,i=n.external.uri??(e=>e);if(r)return{ref:i(r)};let a=e[1].defId??e[1].schema.id??`schema${this.counter++}`;return e[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${t}/${a}`}}if(e[1]===r)return{ref:`#`};let i=`#`,a=`${i}/${t}/`,o=e[1].schema.id??`__schema${this.counter++}`;return{defId:o,ref:a+o}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(n.cycles===`throw`)for(let e of this.seen.entries()){let t=e[1];if(t.cycle)throw Error(`Cycle detected: #/${t.cycle?.join(`/`)}/ + +Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let t of this.seen.entries()){let r=t[1];if(e===t[0]){a(t);continue}if(n.external){let r=n.external.registry.get(t[0])?.id;if(e!==t[0]&&r){a(t);continue}}let i=this.metadataRegistry.get(t[0])?.id;if(i){a(t);continue}if(r.cycle){a(t);continue}if(r.count>1&&n.reused===`ref`){a(t);continue}}let o=(e,t)=>{let n=this.seen.get(e),r=n.def??n.schema,i={...r};if(n.ref===null)return;let a=n.ref;if(n.ref=null,a){o(a,t);let e=this.seen.get(a).schema;e.$ref&&t.target===`draft-7`?(r.allOf=r.allOf??[],r.allOf.push(e)):(Object.assign(r,e),Object.assign(r,i))}n.isParent||this.override({zodSchema:e,jsonSchema:r,path:n.path??[]})};for(let e of[...this.seen.entries()].reverse())o(e[0],{target:this.target});let s={};if(this.target===`draft-2020-12`?s.$schema=`https://json-schema.org/draft/2020-12/schema`:this.target===`draft-7`?s.$schema=`http://json-schema.org/draft-07/schema#`:console.warn(`Invalid target: ${this.target}`),n.external?.uri){let t=n.external.registry.get(e)?.id;if(!t)throw Error("Schema is missing an `id` property");s.$id=n.external.uri(t)}Object.assign(s,r.def);let c=n.external?.defs??{};for(let e of this.seen.entries()){let t=e[1];t.def&&t.defId&&(c[t.defId]=t.def)}n.external||Object.keys(c).length>0&&(this.target===`draft-2020-12`?s.$defs=c:s.definitions=c);try{return JSON.parse(JSON.stringify(s))}catch{throw Error(`Error converting schema to JSON.`)}}};function d(e,t){if(e instanceof s){let n=new u(t),r={};for(let t of e._idmap.entries()){let[e,r]=t;n.process(r)}let i={},a={registry:e,uri:t?.uri,defs:r};for(let r of e._idmap.entries()){let[e,o]=r;i[e]=n.emit(o,{...t,external:a})}if(Object.keys(r).length>0){let e=n.target===`draft-2020-12`?`$defs`:`definitions`;i.__shared={[e]:r}}return{schemas:i}}let n=new u(t);return n.process(e),n.emit(e,t)}function f(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e,i=r._zod.def;switch(i.type){case`string`:case`number`:case`bigint`:case`boolean`:case`date`:case`symbol`:case`undefined`:case`null`:case`any`:case`unknown`:case`never`:case`void`:case`literal`:case`enum`:case`nan`:case`file`:case`template_literal`:return!1;case`array`:return f(i.element,n);case`object`:for(let e in i.shape)if(f(i.shape[e],n))return!0;return!1;case`union`:for(let e of i.options)if(f(e,n))return!0;return!1;case`intersection`:return f(i.left,n)||f(i.right,n);case`tuple`:for(let e of i.items)if(f(e,n))return!0;return!!(i.rest&&f(i.rest,n));case`record`:return f(i.keyType,n)||f(i.valueType,n);case`map`:return f(i.keyType,n)||f(i.valueType,n);case`set`:return f(i.valueType,n);case`promise`:case`optional`:case`nonoptional`:case`nullable`:case`readonly`:return f(i.innerType,n);case`lazy`:return f(i.getter(),n);case`default`:return f(i.innerType,n);case`prefault`:return f(i.innerType,n);case`custom`:return!1;case`transform`:return!0;case`pipe`:return f(i.in,n)||f(i.out,n);case`success`:return!1;case`catch`:return!1;default:}throw Error(`Unknown schema type: ${i.type}`)}export{s as $ZodRegistry,u as JSONSchemaGenerator,l as globalRegistry,c as registry,d as toJSONSchema}; \ No newline at end of file diff --git a/assets/core-Bo_5D72p.js b/assets/core-Bo_5D72p.js deleted file mode 100644 index 31501410e66e7d84a9812180175d2bdb8ccb584f..0000000000000000000000000000000000000000 --- a/assets/core-Bo_5D72p.js +++ /dev/null @@ -1,3 +0,0 @@ -function e(e){let t=Object.values(e).filter(e=>typeof e==`number`),n=Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t);return n}function t(e){let t=!1;return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}}}}const n=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{},r=t(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{let e=Function;return new e(``),!0}catch{return!1}}),i={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},a=Symbol(`ZodOutput`),o=Symbol(`ZodInput`);var s=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];if(this._map.set(e,n),n&&typeof n==`object`&&`id`in n){if(this._idmap.has(n.id))throw Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}remove(e){return this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};return delete n.id,{...n,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}};function c(){return new s}const l=c();var u=class{constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??l,this.target=e?.target??`draft-2020-12`,this.unrepresentable=e?.unrepresentable??`throw`,this.override=e?.override??(()=>{}),this.io=e?.io??`output`,this.seen=new Map}process(t,n={path:[],schemaPath:[]}){var r;let i=t._zod.def,a={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},o=this.seen.get(t);if(o){o.count++;let e=n.schemaPath.includes(t);return e&&(o.cycle=n.path),o.schema}let s={schema:{},count:1,cycle:void 0,path:n.path};this.seen.set(t,s);let c=t._zod.toJSONSchema?.();if(c)s.schema=c;else{let r={...n,schemaPath:[...n.schemaPath,t],path:n.path},o=t._zod.parent;if(o)s.ref=o,this.process(o,r),this.seen.get(o).isParent=!0;else{let n=s.schema;switch(i.type){case`string`:{let e=n;e.type=`string`;let{minimum:r,maximum:i,format:o,patterns:c,contentEncoding:l}=t._zod.bag;if(typeof r==`number`&&(e.minLength=r),typeof i==`number`&&(e.maxLength=i),o&&(e.format=a[o]??o,e.format===``&&delete e.format),l&&(e.contentEncoding=l),c&&c.size>0){let t=[...c];t.length===1?e.pattern=t[0].source:t.length>1&&(s.schema.allOf=[...t.map(e=>({...this.target===`draft-7`?{type:`string`}:{},pattern:e.source}))])}break}case`number`:{let e=n,{minimum:r,maximum:i,format:a,multipleOf:o,exclusiveMaximum:s,exclusiveMinimum:c}=t._zod.bag;typeof a==`string`&&a.includes(`int`)?e.type=`integer`:e.type=`number`,typeof c==`number`&&(e.exclusiveMinimum=c),typeof r==`number`&&(e.minimum=r,typeof c==`number`&&(c>=r?delete e.minimum:delete e.exclusiveMinimum)),typeof s==`number`&&(e.exclusiveMaximum=s),typeof i==`number`&&(e.maximum=i,typeof s==`number`&&(s<=i?delete e.maximum:delete e.exclusiveMaximum)),typeof o==`number`&&(e.multipleOf=o);break}case`boolean`:{let e=n;e.type=`boolean`;break}case`bigint`:if(this.unrepresentable===`throw`)throw Error(`BigInt cannot be represented in JSON Schema`);break;case`symbol`:if(this.unrepresentable===`throw`)throw Error(`Symbols cannot be represented in JSON Schema`);break;case`null`:n.type=`null`;break;case`any`:break;case`unknown`:break;case`undefined`:case`never`:n.not={};break;case`void`:if(this.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`);break;case`date`:if(this.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`);break;case`array`:{let e=n,{minimum:a,maximum:o}=t._zod.bag;typeof a==`number`&&(e.minItems=a),typeof o==`number`&&(e.maxItems=o),e.type=`array`,e.items=this.process(i.element,{...r,path:[...r.path,`items`]});break}case`object`:{let e=n;e.type=`object`,e.properties={};let t=i.shape;for(let n in t)e.properties[n]=this.process(t[n],{...r,path:[...r.path,`properties`,n]});let a=new Set(Object.keys(t)),o=new Set([...a].filter(e=>{let t=i.shape[e]._zod;return this.io===`input`?t.optin===void 0:t.optout===void 0}));o.size>0&&(e.required=Array.from(o)),i.catchall?._zod.def.type===`never`?e.additionalProperties=!1:i.catchall?i.catchall&&(e.additionalProperties=this.process(i.catchall,{...r,path:[...r.path,`additionalProperties`]})):this.io===`output`&&(e.additionalProperties=!1);break}case`union`:{let e=n;e.anyOf=i.options.map((e,t)=>this.process(e,{...r,path:[...r.path,`anyOf`,t]}));break}case`intersection`:{let e=n,t=this.process(i.left,{...r,path:[...r.path,`allOf`,0]}),a=this.process(i.right,{...r,path:[...r.path,`allOf`,1]}),o=e=>`allOf`in e&&Object.keys(e).length===1,s=[...o(t)?t.allOf:[t],...o(a)?a.allOf:[a]];e.allOf=s;break}case`tuple`:{let e=n;e.type=`array`;let a=i.items.map((e,t)=>this.process(e,{...r,path:[...r.path,`prefixItems`,t]}));if(this.target===`draft-2020-12`?e.prefixItems=a:e.items=a,i.rest){let t=this.process(i.rest,{...r,path:[...r.path,`items`]});this.target===`draft-2020-12`?e.items=t:e.additionalItems=t}i.rest&&(e.items=this.process(i.rest,{...r,path:[...r.path,`items`]}));let{minimum:o,maximum:s}=t._zod.bag;typeof o==`number`&&(e.minItems=o),typeof s==`number`&&(e.maxItems=s);break}case`record`:{let e=n;e.type=`object`,e.propertyNames=this.process(i.keyType,{...r,path:[...r.path,`propertyNames`]}),e.additionalProperties=this.process(i.valueType,{...r,path:[...r.path,`additionalProperties`]});break}case`map`:if(this.unrepresentable===`throw`)throw Error(`Map cannot be represented in JSON Schema`);break;case`set`:if(this.unrepresentable===`throw`)throw Error(`Set cannot be represented in JSON Schema`);break;case`enum`:{let t=n,r=e(i.entries);r.every(e=>typeof e==`number`)&&(t.type=`number`),r.every(e=>typeof e==`string`)&&(t.type=`string`),t.enum=r;break}case`literal`:{let e=n,t=[];for(let e of i.values)if(e===void 0){if(this.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(this.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);t.push(Number(e))}else t.push(e);if(t.length!==0)if(t.length===1){let n=t[0];e.type=n===null?`null`:typeof n,e.const=n}else t.every(e=>typeof e==`number`)&&(e.type=`number`),t.every(e=>typeof e==`string`)&&(e.type=`string`),t.every(e=>typeof e==`boolean`)&&(e.type=`string`),t.every(e=>e===null)&&(e.type=`null`),e.enum=t;break}case`file`:{let e=n,r={type:`string`,format:`binary`,contentEncoding:`binary`},{minimum:i,maximum:a,mime:o}=t._zod.bag;i!==void 0&&(r.minLength=i),a!==void 0&&(r.maxLength=a),o?o.length===1?(r.contentMediaType=o[0],Object.assign(e,r)):e.anyOf=o.map(e=>{let t={...r,contentMediaType:e};return t}):Object.assign(e,r);break}case`transform`:if(this.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`);break;case`nullable`:{let e=this.process(i.innerType,r);n.anyOf=[e,{type:`null`}];break}case`nonoptional`:this.process(i.innerType,r),s.ref=i.innerType;break;case`success`:{let e=n;e.type=`boolean`;break}case`default`:this.process(i.innerType,r),s.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue));break;case`prefault`:this.process(i.innerType,r),s.ref=i.innerType,this.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)));break;case`catch`:{this.process(i.innerType,r),s.ref=i.innerType;let e;try{e=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=e;break}case`nan`:if(this.unrepresentable===`throw`)throw Error(`NaN cannot be represented in JSON Schema`);break;case`template_literal`:{let e=n,r=t._zod.pattern;if(!r)throw Error(`Pattern not found in template literal`);e.type=`string`,e.pattern=r.source;break}case`pipe`:{let e=this.io===`input`?i.in._zod.def.type===`transform`?i.out:i.in:i.out;this.process(e,r),s.ref=e;break}case`readonly`:this.process(i.innerType,r),s.ref=i.innerType,n.readOnly=!0;break;case`promise`:this.process(i.innerType,r),s.ref=i.innerType;break;case`optional`:this.process(i.innerType,r),s.ref=i.innerType;break;case`lazy`:{let e=t._zod.innerType;this.process(e,r),s.ref=e;break}case`custom`:if(this.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`);break;default:}}}let l=this.metadataRegistry.get(t);l&&Object.assign(s.schema,l),this.io===`input`&&f(t)&&(delete s.schema.examples,delete s.schema.default),this.io===`input`&&s.schema._prefault&&((r=s.schema).default??(r.default=s.schema._prefault)),delete s.schema._prefault;let u=this.seen.get(t);return u.schema}emit(e,t){let n={cycles:t?.cycles??`ref`,reused:t?.reused??`inline`,external:t?.external??void 0},r=this.seen.get(e);if(!r)throw Error(`Unprocessed schema. This is a bug in Zod.`);let i=e=>{let t=this.target===`draft-2020-12`?`$defs`:`definitions`;if(n.external){let r=n.external.registry.get(e[0])?.id;if(r)return{ref:n.external.uri(r)};let i=e[1].defId??e[1].schema.id??`schema${this.counter++}`;return e[1].defId=i,{defId:i,ref:`${n.external.uri(`__shared`)}#/${t}/${i}`}}if(e[1]===r)return{ref:`#`};let i=`#`,a=`${i}/${t}/`,o=e[1].schema.id??`__schema${this.counter++}`;return{defId:o,ref:a+o}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};for(let t of this.seen.entries()){let r=t[1];if(e===t[0]){a(t);continue}if(n.external){let r=n.external.registry.get(t[0])?.id;if(e!==t[0]&&r){a(t);continue}}let i=this.metadataRegistry.get(t[0])?.id;if(i){a(t);continue}if(r.cycle){if(n.cycles===`throw`)throw Error(`Cycle detected: #/${r.cycle?.join(`/`)}/ - -Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);n.cycles===`ref`&&a(t);continue}if(r.count>1&&n.reused===`ref`){a(t);continue}}let o=(e,t)=>{let n=this.seen.get(e),r=n.def??n.schema,i={...r};if(n.ref===null)return;let a=n.ref;if(n.ref=null,a){o(a,t);let e=this.seen.get(a).schema;e.$ref&&t.target===`draft-7`?(r.allOf=r.allOf??[],r.allOf.push(e)):(Object.assign(r,e),Object.assign(r,i))}n.isParent||this.override({zodSchema:e,jsonSchema:r,path:n.path??[]})};for(let e of[...this.seen.entries()].reverse())o(e[0],{target:this.target});let s={};this.target===`draft-2020-12`?s.$schema=`https://json-schema.org/draft/2020-12/schema`:this.target===`draft-7`?s.$schema=`http://json-schema.org/draft-07/schema#`:console.warn(`Invalid target: ${this.target}`),Object.assign(s,r.def);let c=n.external?.defs??{};for(let e of this.seen.entries()){let t=e[1];t.def&&t.defId&&(c[t.defId]=t.def)}!n.external&&Object.keys(c).length>0&&(this.target===`draft-2020-12`?s.$defs=c:s.definitions=c);try{return JSON.parse(JSON.stringify(s))}catch{throw Error(`Error converting schema to JSON.`)}}};function d(e,t){if(e instanceof s){let n=new u(t),r={};for(let t of e._idmap.entries()){let[e,r]=t;n.process(r)}let i={},a={registry:e,uri:t?.uri||(e=>e),defs:r};for(let r of e._idmap.entries()){let[e,o]=r;i[e]=n.emit(o,{...t,external:a})}if(Object.keys(r).length>0){let e=n.target===`draft-2020-12`?`$defs`:`definitions`;i.__shared={[e]:r}}return{schemas:i}}let n=new u(t);return n.process(e),n.emit(e,t)}function f(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e,i=r._zod.def;switch(i.type){case`string`:case`number`:case`bigint`:case`boolean`:case`date`:case`symbol`:case`undefined`:case`null`:case`any`:case`unknown`:case`never`:case`void`:case`literal`:case`enum`:case`nan`:case`file`:case`template_literal`:return!1;case`array`:return f(i.element,n);case`object`:for(let e in i.shape)if(f(i.shape[e],n))return!0;return!1;case`union`:for(let e of i.options)if(f(e,n))return!0;return!1;case`intersection`:return f(i.left,n)||f(i.right,n);case`tuple`:for(let e of i.items)if(f(e,n))return!0;return!!(i.rest&&f(i.rest,n));case`record`:return f(i.keyType,n)||f(i.valueType,n);case`map`:return f(i.keyType,n)||f(i.valueType,n);case`set`:return f(i.valueType,n);case`promise`:case`optional`:case`nonoptional`:case`nullable`:case`readonly`:return f(i.innerType,n);case`lazy`:return f(i.getter(),n);case`default`:return f(i.innerType,n);case`prefault`:return f(i.innerType,n);case`custom`:return!1;case`transform`:return!0;case`pipe`:return f(i.in,n)||f(i.out,n);case`success`:return!1;case`catch`:return!1;default:}throw Error(`Unknown schema type: ${i.type}`)}export{s as $ZodRegistry,u as JSONSchemaGenerator,l as globalRegistry,c as registry,d as toJSONSchema}; \ No newline at end of file diff --git a/assets/deepseek-BPOq0AFu.js b/assets/deepseek-BPOq0AFu.js deleted file mode 100644 index a351d4fb65602e6c00207c8af6a9413603b96c3d..0000000000000000000000000000000000000000 --- a/assets/deepseek-BPOq0AFu.js +++ /dev/null @@ -1 +0,0 @@ -import{J as e,L as t,aN as n,aS as r,bA as i,bG as a,bK as o,bN as s,bP as c,bR as l,bU as u,b_ as d,by as f,t as p,u as m,v as h,w as g,x as _,y as v}from"./index-BFym949y.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b=`deepseek`;var x=c({__name:`deepseek`,setup(c){let{t:y}=t(),x=n(),S=e(),{providers:C}=r(S),w=s(()=>S.getProviderMetadata(b)),T=s({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=s({get:()=>C.value[b]?.baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});o(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||``}),f([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)=>(i(),a(d(p),{"provider-name":w.value?.localizedName,"provider-icon-color":w.value?.iconColor,"on-back":()=>d(x).back()},{default:l(()=>[u(d(m),null,{default:l(()=>[u(d(h),{title:d(y)(`settings.pages.providers.common.section.basic.title`),description:d(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:l(()=>[u(d(_),{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`]),u(d(v),{title:d(y)(`settings.pages.providers.common.section.advanced.title`)},{default:l(()=>[u(d(g),{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/deepseek-DnJanhZ7.js b/assets/deepseek-DnJanhZ7.js new file mode 100644 index 0000000000000000000000000000000000000000..d7e00bfbe0c3eff8e90c2913acbc65481de3db7a --- /dev/null +++ b/assets/deepseek-DnJanhZ7.js @@ -0,0 +1 @@ +import{J as e,L as t,aN as n,aS as r,bA as i,bE as a,bH as o,bJ as s,bL as c,bO as l,bQ as u,bT as d,b_ as f,t as p,u as m,v as h,w as g,x as _,y as v}from"./index-J3uhnpYL.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b=`deepseek`;var x=s({__name:`deepseek`,setup(s){let{t:y}=t(),x=n(),S=e(),{providers:C}=r(S),w=o(()=>S.getProviderMetadata(b)),T=o({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=o({get:()=>C.value[b]?.baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});a(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||``}),u([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)=>(d(),i(f(p),{"provider-name":w.value?.localizedName,"provider-icon-color":w.value?.iconColor,"on-back":()=>f(x).back()},{default:c(()=>[l(f(m),null,{default:c(()=>[l(f(h),{title:f(y)(`settings.pages.providers.common.section.basic.title`),description:f(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:c(()=>[l(f(_),{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`]),l(f(v),{title:f(y)(`settings.pages.providers.common.section.advanced.title`)},{default:c(()=>[l(f(g),{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-DhKdy896.js b/assets/default-BjhJ8iTT.js similarity index 51% rename from assets/default-DhKdy896.js rename to assets/default-BjhJ8iTT.js index fd32d76861be143f1f8a9aa3d0bf6a731b9897ce..75901a3310c1bbe00528139c40d419f402f3b36c 100644 --- a/assets/default-DhKdy896.js +++ b/assets/default-BjhJ8iTT.js @@ -1 +1 @@ -import{aQ as e,bA as t,bB as n,bP as r,bS as i,bU as a,b_ as o}from"./index-BFym949y.js";import{b as s}from"./HeaderLink-BXWLCGTy.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`,"mx-auto":``,"h-full":``,"max-w-screen-xl":``};var d=r({__name:`default`,setup(r){return(r,d)=>(t(),i(`div`,c,[n(`div`,l,[a(s)]),n(`div`,u,[a(o(e))])]))}}),f=d;export{f as default}; \ No newline at end of file +import{aQ as e,bJ as t,bM as n,bO as r,bT as i,bU as a,b_ as o}from"./index-J3uhnpYL.js";import{b as s}from"./HeaderLink-C5rYwZW4.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`,"mx-auto":``,"h-full":``,"max-w-screen-xl":``};var d=t({__name:`default`,setup(t){return(t,d)=>(i(),n(`div`,c,[a(`div`,l,[r(s)]),a(`div`,u,[r(o(e))])]))}}),f=d;export{f as default}; \ No newline at end of file diff --git a/assets/default-browser-BsyDD-mc.js b/assets/default-browser-fG6G3mbs.js similarity index 100% rename from assets/default-browser-BsyDD-mc.js rename to assets/default-browser-fG6G3mbs.js diff --git a/assets/default-node-C7L-dwjz.js b/assets/default-node-DnFRZ-9a.js similarity index 64% rename from assets/default-node-C7L-dwjz.js rename to assets/default-node-DnFRZ-9a.js index 59ae1370a83552c4857da2d9f907a9f2de4c99e4..0bc554cbf31df589bc22b4e63f86bae3dac8c311 100644 --- a/assets/default-node-C7L-dwjz.js +++ b/assets/default-node-DnFRZ-9a.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/__vite-browser-external-CKGmuslh.js","assets/index-BFym949y.js","assets/index-DW4V58Ib.css"])))=>i.map(i=>d[i]); -import{aR as e,c4 as t}from"./index-BFym949y.js";async function n(){let{createRequire:n}=await e(async()=>{let{createRequire:e}=await import(`./__vite-browser-external-CKGmuslh.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-CKGmuslh.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-MQa0rNba.js","assets/index-J3uhnpYL.js","assets/index-BT-tiZao.css"])))=>i.map(i=>d[i]); +import{aR as e,c4 as t}from"./index-J3uhnpYL.js";async function n(){let{createRequire:n}=await e(async()=>{let{createRequire:e}=await import(`./__vite-browser-external-MQa0rNba.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-MQa0rNba.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-BJ-K9VUB.js b/assets/delays-BJ-K9VUB.js deleted file mode 100644 index d3a9e3a3e484ed45ea0b9b98076fca2cec9b02f6..0000000000000000000000000000000000000000 --- a/assets/delays-BJ-K9VUB.js +++ /dev/null @@ -1 +0,0 @@ -import"./Basic-CcFV8fg0.js";import{b as e}from"./Textarea-DQ3UodrM.js";import{a1 as t,aC as n,bA as r,bB as i,bD as a,bM as o,bP as s,bS as c,bU as l,bX as u,b_ as d,c1 as f}from"./index-BFym949y.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)=>(r(),c(`div`,p,[i(`div`,m,[l(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),(r(!0),c(o,null,a(b.value,e=>(r(),c(`div`,{key:e},[i(`div`,null,f(e),1)]))),128))]),i(`div`,v,[n[2]||=i(`h3`,{"font-normal":``},` Delays `,-1),(r(!0),c(o,null,a(x.value,e=>(r(),c(`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/delays-DJ8ppqmz.js b/assets/delays-DJ8ppqmz.js new file mode 100644 index 0000000000000000000000000000000000000000..a3239ddd022a5535cd3587167b669a115bb0fc2f --- /dev/null +++ b/assets/delays-DJ8ppqmz.js @@ -0,0 +1 @@ +import"./Basic-Cwa2X3hA.js";import{b as e}from"./Textarea-C55W7JzB.js";import{$ as t,aC as n,bG as r,bJ as i,bM as a,bO as o,bT as s,bU as c,bX as l,b_ as u,bx as d,c0 as f}from"./index-J3uhnpYL.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=i({__name:`delays`,setup(i){let y=l(``),b=l([]),x=l([]),S=l(!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)=>(s(),a(`div`,p,[c(`div`,m,[o(u(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`]),c(`button`,h,f(S.value?`Processing...`:`Send`),1)]),c(`div`,g,[c(`div`,_,[n[1]||=c(`h3`,{"font-normal":``},` Emotion Message `,-1),(s(!0),a(r,null,d(b.value,e=>(s(),a(`div`,{key:e},[c(`div`,null,f(e),1)]))),128))]),c(`div`,v,[n[2]||=c(`h3`,{"font-normal":``},` Delays `,-1),(s(!0),a(r,null,d(x.value,e=>(s(),a(`div`,{key:e},[c(`div`,null,f(e)+`s`,1)]))),128))])])]))}}),b=y;export{b as default}; \ No newline at end of file diff --git a/assets/developer-Dqo6PXeC.js b/assets/developer-G1V3X_27.js similarity index 61% rename from assets/developer-Dqo6PXeC.js rename to assets/developer-G1V3X_27.js index fb14a6011557a03abadafcf69b0d7e5d83fcc536..01dc0bfa9a2d54733031a1bca2a179303c702849 100644 --- a/assets/developer-Dqo6PXeC.js +++ b/assets/developer-G1V3X_27.js @@ -1 +1 @@ -import{B as e,b$ as t,bA as n,bB as r,bE as i,bH as a,bJ as o,bM as s,bP as c,bQ as l,bR as u,bS as d,bU as f,b_ as p,br as m,bt as h,bx as g,bz as _,c1 as v}from"./index-BFym949y.js";import{b as y}from"./route-block-DVyt-3Cw.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:g({text:{},iconOn:{},iconOff:{},description:{}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let s=a(e,`modelValue`);return(e,a)=>(n(),d(`label`,b,[o(r(`input`,{"onUpdate:modelValue":a[0]||=e=>s.value=e,"aria-checked":s.value,type:`checkbox`,hidden:``},null,8,x),[[m,s.value]]),r(`div`,null,[i(v(e.$t(e.text))+` `,1),e.description?(n(),d(`div`,S,v(e.$t(e.description)),1)):l(``,!0)]),f(h,{name:`slide-away`,mode:`out-in`},{default:u(()=>[s.value?(n(),d(`div`,{key:0,class:t(e.iconOn),transition:`all ease-in-out duration-250`},null,2)):(n(),d(`div`,{key:1,class:t(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=c({__name:`developer`,setup(t){let i=e();return(e,t)=>{let a=_(`motion`);return n(),d(s,null,[o(f(w,{modelValue:p(i).disableTransitions,"onUpdate:modelValue":t[0]||=e=>p(i).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:19*50,transition:`all ease-in-out duration-250`},null,8,[`modelValue`]),[[a]]),o(f(w,{modelValue:p(i).usePageSpecificTransitions,"onUpdate:modelValue":t[1]||=e=>p(i).usePageSpecificTransitions=e,disabled:p(i).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:20*50,transition:`all ease-in-out duration-250`},null,8,[`modelValue`,`disabled`]),[[a]]),o((n(),d(`div`,T,t[2]||=[r(`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 +import{B as e,bB as t,bD as n,bG as r,bJ as i,bK as a,bL as o,bM as s,bO as c,bP as l,bS as u,bT as d,bU as f,b_ as p,bs as m,bv as h,by as g,c0 as _,c1 as v}from"./index-J3uhnpYL.js";import{b as y}from"./route-block-DVyt-3Cw.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=i({__name:`CheckBar`,props:l({text:{},iconOn:{},iconOff:{},description:{}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let r=t(e,`modelValue`);return(e,t)=>(d(),s(`label`,b,[n(f(`input`,{"onUpdate:modelValue":t[0]||=e=>r.value=e,"aria-checked":r.value,type:`checkbox`,hidden:``},null,8,x),[[m,r.value]]),f(`div`,null,[g(_(e.$t(e.text))+` `,1),e.description?(d(),s(`div`,S,_(e.$t(e.description)),1)):a(``,!0)]),c(h,{name:`slide-away`,mode:`out-in`},{default:o(()=>[r.value?(d(),s(`div`,{key:0,class:v(e.iconOn),transition:`all ease-in-out duration-250`},null,2)):(d(),s(`div`,{key:1,class:v(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=i({__name:`developer`,setup(t){let i=e();return(e,t)=>{let a=u(`motion`);return d(),s(r,null,[n(c(w,{modelValue:p(i).disableTransitions,"onUpdate:modelValue":t[0]||=e=>p(i).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:19*50,transition:`all ease-in-out duration-250`},null,8,[`modelValue`]),[[a]]),n(c(w,{modelValue:p(i).usePageSpecificTransitions,"onUpdate:modelValue":t[1]||=e=>p(i).usePageSpecificTransitions=e,disabled:p(i).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:20*50,transition:`all ease-in-out duration-250`},null,8,[`modelValue`,`disabled`]),[[a]]),n((d(),s(`div`,T,t[2]||=[f(`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-DBSVVF8G-PVyVIIwu.js b/assets/effect-DBSVVF8G-D__cQ9PS.js similarity index 72% rename from assets/effect-DBSVVF8G-PVyVIIwu.js rename to assets/effect-DBSVVF8G-D__cQ9PS.js index e51a6f64f977679ec2aade9f2000a1934c9360d9..f92225c5607a9d07c585cf9fc5e5c87d2f627f69 100644 --- a/assets/effect-DBSVVF8G-PVyVIIwu.js +++ b/assets/effect-DBSVVF8G-D__cQ9PS.js @@ -1 +1 @@ -import{O as e,aR as t}from"./index-BFym949y.js";const n=async()=>{let{JSONSchema:n}=await e(t(()=>import(`./__vite-optional-peer-dep_effect_xsschema-CXIfmAu1.js`),[]),`effect`);return e=>n.make(e)};export{n as getToJsonSchemaFn}; \ No newline at end of file +import{O as e,aR as t}from"./index-J3uhnpYL.js";const n=async()=>{let{JSONSchema:n}=await e(t(()=>import(`./__vite-optional-peer-dep_effect_xsschema-CXIfmAu1.js`),[]),`effect`);return e=>n.make(e)};export{n as getToJsonSchemaFn}; \ No newline at end of file diff --git a/assets/elevenlabs-D_o9OBbz.js b/assets/elevenlabs-D_o9OBbz.js new file mode 100644 index 0000000000000000000000000000000000000000..b734f75c2b67eb8e0f350c02c102a1f7dab64670 --- /dev/null +++ b/assets/elevenlabs-D_o9OBbz.js @@ -0,0 +1 @@ +import{G as e,J as t,L as n,aS as r,au as i,ay as a,bA as o,bE as s,bH as c,bJ as l,bL as u,bO as d,bQ as f,bT as p,bU as m,bX as h,b_ as g,r as _,s as v}from"./index-J3uhnpYL.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b={flex:`~ col gap-4`},x=`elevenlabs`,S=`eleven_multilingual_v2`;var C=l({__name:`elevenlabs`,setup(l){let y={similarityBoost:.75,stability:.5,speed:1,style:0,useSpeakerBoost:!0},C=h(0),w=h(1),T=h(0),E=h(0),D=h(.5),O=h(.75),k=h(!1),A=e(),j=t(),{providers:M}=r(j),{t:N}=n(),P=c(()=>!!M.value[x]?.apiKey),F=c(()=>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 s(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,t)=>(p(),o(g(_),{"provider-id":x,"default-model":S,"additional-settings":y},{"voice-settings":u(()=>[m(`div`,b,[d(g(i),{modelValue:C.value,"onUpdate:modelValue":t[0]||=e=>C.value=e,label:g(N)(`settings.pages.providers.provider.common.fields.field.pitch.label`),description:g(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`]),d(g(i),{modelValue:w.value,"onUpdate:modelValue":t[1]||=e=>w.value=e,label:g(N)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:g(N)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:2,step:.01},null,8,[`modelValue`,`label`,`description`]),d(g(i),{modelValue:T.value,"onUpdate:modelValue":t[2]||=e=>T.value=e,label:g(N)(`settings.pages.providers.provider.common.fields.field.volume.label`),description:g(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`]),d(g(i),{modelValue:E.value,"onUpdate:modelValue":t[3]||=e=>E.value=e,label:g(N)(`settings.pages.providers.provider.elevenlabs.fields.field.style.label`),description:g(N)(`settings.pages.providers.provider.elevenlabs.fields.field.style.description`),min:0,max:1,step:.01},null,8,[`modelValue`,`label`,`description`]),d(g(i),{modelValue:D.value,"onUpdate:modelValue":t[4]||=e=>D.value=e,label:g(N)(`settings.pages.providers.provider.elevenlabs.fields.field.stability.label`),description:g(N)(`settings.pages.providers.provider.elevenlabs.fields.field.stability.description`),min:0,max:1,step:.01},null,8,[`modelValue`,`label`,`description`]),d(g(i),{modelValue:O.value,"onUpdate:modelValue":t[5]||=e=>O.value=e,label:g(N)(`settings.pages.providers.provider.elevenlabs.fields.field.simularity-boost.label`),description:g(N)(`settings.pages.providers.provider.elevenlabs.fields.field.simularity-boost.description`),min:0,max:1,step:.01},null,8,[`modelValue`,`label`,`description`]),d(g(a),{modelValue:k.value,"onUpdate:modelValue":t[6]||=e=>k.value=e,label:g(N)(`settings.pages.providers.provider.elevenlabs.fields.field.speaker-boost.label`),description:g(N)(`settings.pages.providers.provider.elevenlabs.fields.field.speaker-boost.description`)},null,8,[`modelValue`,`label`,`description`])])]),playground:u(()=>[d(g(v),{"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/elevenlabs-tZGvWrsu.js b/assets/elevenlabs-tZGvWrsu.js deleted file mode 100644 index 1dbb88b3a9251a1309bfce3de28d4ec700550505..0000000000000000000000000000000000000000 --- a/assets/elevenlabs-tZGvWrsu.js +++ /dev/null @@ -1 +0,0 @@ -import{G as e,J as t,L as n,aS as r,au as i,ay as a,bA as o,bB as s,bG as c,bK as l,bN as u,bP as d,bR as f,bU as p,bX as m,b_ as h,by as g,r as _,s as v}from"./index-BFym949y.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b={flex:`~ col gap-4`},x=`elevenlabs`,S=`eleven_multilingual_v2`;var C=d({__name:`elevenlabs`,setup(d){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=e(),j=t(),{providers:M}=r(j),{t:N}=n(),P=u(()=>!!M.value[x]?.apiKey),F=u(()=>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 l(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)}),g(C,async()=>{let e=j.getProviderConfig(x);e.pitch=C.value}),g(w,async()=>{let e=j.getProviderConfig(x);e.speed=w.value}),g(T,async()=>{let e=j.getProviderConfig(x);e.volume=T.value}),g(E,async()=>{let e=j.getProviderConfig(x);e.style=E.value}),g(D,async()=>{let e=j.getProviderConfig(x);e.stability=D.value}),g(O,async()=>{let e=j.getProviderConfig(x);e.similarityBoost=O.value}),g(k,async()=>{let e=j.getProviderConfig(x);e.useSpeakerBoost=k.value}),g(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,t)=>(o(),c(h(_),{"provider-id":x,"default-model":S,"additional-settings":y},{"voice-settings":f(()=>[s(`div`,b,[p(h(i),{modelValue:C.value,"onUpdate:modelValue":t[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`]),p(h(i),{modelValue:w.value,"onUpdate:modelValue":t[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`]),p(h(i),{modelValue:T.value,"onUpdate:modelValue":t[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`]),p(h(i),{modelValue:E.value,"onUpdate:modelValue":t[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`]),p(h(i),{modelValue:D.value,"onUpdate:modelValue":t[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`]),p(h(i),{modelValue:O.value,"onUpdate:modelValue":t[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`]),p(h(a),{modelValue:k.value,"onUpdate:modelValue":t[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:f(()=>[p(h(v),{"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-CUlnAOYu.js b/assets/emotions-CUlnAOYu.js deleted file mode 100644 index fc92292ba35b4721b66f2b1ced1ec097bccc8d49..0000000000000000000000000000000000000000 --- a/assets/emotions-CUlnAOYu.js +++ /dev/null @@ -1 +0,0 @@ -import"./Basic-CcFV8fg0.js";import{b as e}from"./Textarea-DQ3UodrM.js";import{a2 as t,a3 as n,aC as r,bA as i,bB as a,bD as o,bM as s,bP as c,bS as l,bU as u,bX as d,b_ as f,c1 as p}from"./index-BFym949y.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)=>(i(),l(`div`,m,[a(`div`,h,[u(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),(i(!0),l(s,null,o(x.value,e=>(i(),l(`div`,{key:e},[a(`div`,null,p(e),1)]))),128))]),a(`div`,y,[n[2]||=a(`h3`,{"font-normal":``},` Emotions `,-1),(i(!0),l(s,null,o(S.value,e=>(i(),l(`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/emotions-DvokzTuq.js b/assets/emotions-DvokzTuq.js new file mode 100644 index 0000000000000000000000000000000000000000..5fb11311252214a31f9e4018b08d715e7daefef5 --- /dev/null +++ b/assets/emotions-DvokzTuq.js @@ -0,0 +1 @@ +import"./Basic-Cwa2X3hA.js";import{b as e}from"./Textarea-C55W7JzB.js";import{a1 as t,a3 as n,aC as r,bG as i,bJ as a,bM as o,bO as s,bT as c,bU as l,bX as u,b_ as d,bx as f,c0 as p}from"./index-J3uhnpYL.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=a({__name:`emotions`,setup(a){let b=u(``),x=u([]),S=u([]),C=u(!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)=>(c(),o(`div`,m,[l(`div`,h,[s(d(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`]),l(`button`,g,p(C.value?`Processing...`:`Send`),1)]),l(`div`,_,[l(`div`,v,[n[1]||=l(`h3`,{"font-normal":``},` Messages `,-1),(c(!0),o(i,null,f(x.value,e=>(c(),o(`div`,{key:e},[l(`div`,null,p(e),1)]))),128))]),l(`div`,y,[n[2]||=l(`h3`,{"font-normal":``},` Emotions `,-1),(c(!0),o(i,null,f(S.value,e=>(c(),o(`div`,{key:e},[l(`div`,null,p(e),1)]))),128))])])]))}}),x=b;export{x as default}; \ No newline at end of file diff --git a/assets/esm-Cn7iquya.js b/assets/esm-DKRfnT7g.js similarity index 99% rename from assets/esm-Cn7iquya.js rename to assets/esm-DKRfnT7g.js index 7597ef6be791dcee60375f1f4bcd06219443315e..5890a281cd3aff6acc3da5be0dbd8c52c6cc85bb 100644 --- a/assets/esm-Cn7iquya.js +++ b/assets/esm-DKRfnT7g.js @@ -1,3 +1,3 @@ -import{M as e}from"./index-BFym949y.js";const t=Symbol(`Let zodToJsonSchema decide on which parser to use`),n={name:void 0,$refStrategy:`root`,basePath:[`#`],effectStrategy:`input`,pipeStrategy:`all`,dateStrategy:`format:date-time`,mapStrategy:`entries`,removeAdditionalStrategy:`passthrough`,allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:`definitions`,target:`jsonSchema7`,strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:`escape`,applyRegexFlags:!1,emailStrategy:`format:email`,base64Strategy:`contentEncoding:base64`,nameStrategy:`ref`,openAiAnyTypeName:`OpenAiAnyType`},r=e=>typeof e==`string`?{...n,name:e}:{...n,...e},i=e=>{let t=r(e),n=t.name===void 0?t.basePath:[...t.basePath,t.definitionPath,t.name];return{...t,flags:{hasReferencedOpenAiAnyType:!1},currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([e,n])=>[n._def,{def:n._def,path:[...t.basePath,t.definitionPath,e],jsonSchema:void 0}]))}};function a(e,t,n,r){r?.errorMessages&&n&&(e.errorMessage={...e.errorMessage,[t]:n})}function o(e,t,n,r,i){e[t]=n,a(e,t,r,i)}const s=(e,t)=>{let n=0;for(;n$(e.innerType._def,t);function m(e,t,n){let r=n??t.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((n,r)=>m(e,t,n))};switch(r){case`string`:case`format:date-time`:return{type:`string`,format:`date-time`};case`format:date`:return{type:`string`,format:`date`};case`integer`:return h(e,t)}}const h=(e,t)=>{let n={type:`integer`,format:`unix-time`};if(t.target===`openApi3`)return n;for(let r of e.checks)switch(r.kind){case`min`:o(n,`minimum`,r.value,r.message,t);break;case`max`:o(n,`maximum`,r.value,r.message,t);break}return n};function g(e,t){return{...$(e.innerType._def,t),default:e.defaultValue()}}function _(e,t){return t.effectStrategy===`input`?$(e.schema._def,t):c(t)}function v(e){return{type:`string`,enum:Array.from(e.values)}}const y=e=>`type`in e&&e.type===`string`?!1:`allOf`in e;function b(e,t){let n=[$(e.left._def,{...t,currentPath:[...t.currentPath,`allOf`,`0`]}),$(e.right._def,{...t,currentPath:[...t.currentPath,`allOf`,`1`]})].filter(e=>!!e),r=t.target===`jsonSchema2019-09`?{unevaluatedProperties:!1}:void 0,i=[];return n.forEach(e=>{if(y(e))i.push(...e.allOf),e.unevaluatedProperties===void 0&&(r=void 0);else{let t=e;if(`additionalProperties`in e&&e.additionalProperties===!1){let{additionalProperties:n,...r}=e;t=r}else r=void 0;i.push(t)}}),i.length?{allOf:i,...r}:void 0}function x(e,t){let n=typeof e.value;return n!==`bigint`&&n!==`number`&&n!==`boolean`&&n!==`string`?{type:Array.isArray(e.value)?`array`:`object`}:t.target===`openApi3`?{type:n===`bigint`?`integer`:n,enum:[e.value]}:{type:n===`bigint`?`integer`:n,const:e.value}}let S;const C={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(S===void 0&&(S=RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)),S),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,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])$/,ipv4Cidr:/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(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:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function w(e,t){let n={type:`string`};if(e.checks)for(let r of e.checks)switch(r.kind){case`min`:o(n,`minLength`,typeof n.minLength==`number`?Math.max(n.minLength,r.value):r.value,r.message,t);break;case`max`:o(n,`maxLength`,typeof n.maxLength==`number`?Math.min(n.maxLength,r.value):r.value,r.message,t);break;case`email`:switch(t.emailStrategy){case`format:email`:O(n,`email`,r.message,t);break;case`format:idn-email`:O(n,`idn-email`,r.message,t);break;case`pattern:zod`:k(n,C.email,r.message,t);break}break;case`url`:O(n,`uri`,r.message,t);break;case`uuid`:O(n,`uuid`,r.message,t);break;case`regex`:k(n,r.regex,r.message,t);break;case`cuid`:k(n,C.cuid,r.message,t);break;case`cuid2`:k(n,C.cuid2,r.message,t);break;case`startsWith`:k(n,RegExp(`^${T(r.value,t)}`),r.message,t);break;case`endsWith`:k(n,RegExp(`${T(r.value,t)}$`),r.message,t);break;case`datetime`:O(n,`date-time`,r.message,t);break;case`date`:O(n,`date`,r.message,t);break;case`time`:O(n,`time`,r.message,t);break;case`duration`:O(n,`duration`,r.message,t);break;case`length`:o(n,`minLength`,typeof n.minLength==`number`?Math.max(n.minLength,r.value):r.value,r.message,t),o(n,`maxLength`,typeof n.maxLength==`number`?Math.min(n.maxLength,r.value):r.value,r.message,t);break;case`includes`:k(n,RegExp(T(r.value,t)),r.message,t);break;case`ip`:r.version!==`v6`&&O(n,`ipv4`,r.message,t),r.version!==`v4`&&O(n,`ipv6`,r.message,t);break;case`base64url`:k(n,C.base64url,r.message,t);break;case`jwt`:k(n,C.jwt,r.message,t);break;case`cidr`:r.version!==`v6`&&k(n,C.ipv4Cidr,r.message,t),r.version!==`v4`&&k(n,C.ipv6Cidr,r.message,t);break;case`emoji`:k(n,C.emoji(),r.message,t);break;case`ulid`:k(n,C.ulid,r.message,t);break;case`base64`:switch(t.base64Strategy){case`format:binary`:O(n,`binary`,r.message,t);break;case`contentEncoding:base64`:o(n,`contentEncoding`,`base64`,r.message,t);break;case`pattern:zod`:k(n,C.base64,r.message,t);break}break;case`nanoid`:k(n,C.nanoid,r.message,t);case`toLowerCase`:case`toUpperCase`:case`trim`:break;default:(e=>{})(r)}return n}function T(e,t){return t.patternStrategy===`escape`?D(e):e}const E=new Set(`ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789`);function D(e){let t=``;for(let n=0;ne.format)?(e.anyOf||=[],e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&r.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.anyOf.push({format:t,...n&&r.errorMessages&&{errorMessage:{format:n}}})):o(e,`format`,t,n,r)}function k(e,t,n,r){e.pattern||e.allOf?.some(e=>e.pattern)?(e.allOf||=[],e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&r.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.allOf.push({pattern:A(t,r),...n&&r.errorMessages&&{errorMessage:{pattern:n}}})):o(e,`pattern`,A(t,r),n,r)}function A(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let n={i:e.flags.includes(`i`),m:e.flags.includes(`m`),s:e.flags.includes(`s`)},r=n.i?e.source.toLowerCase():e.source,i=``,a=!1,o=!1,s=!1;for(let e=0;etypeof e==`string`?{...n,name:e}:{...n,...e},i=e=>{let t=r(e),n=t.name===void 0?t.basePath:[...t.basePath,t.definitionPath,t.name];return{...t,flags:{hasReferencedOpenAiAnyType:!1},currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([e,n])=>[n._def,{def:n._def,path:[...t.basePath,t.definitionPath,e],jsonSchema:void 0}]))}};function a(e,t,n,r){r?.errorMessages&&n&&(e.errorMessage={...e.errorMessage,[t]:n})}function o(e,t,n,r,i){e[t]=n,a(e,t,r,i)}const s=(e,t)=>{let n=0;for(;n$(e.innerType._def,t);function m(e,t,n){let r=n??t.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((n,r)=>m(e,t,n))};switch(r){case`string`:case`format:date-time`:return{type:`string`,format:`date-time`};case`format:date`:return{type:`string`,format:`date`};case`integer`:return h(e,t)}}const h=(e,t)=>{let n={type:`integer`,format:`unix-time`};if(t.target===`openApi3`)return n;for(let r of e.checks)switch(r.kind){case`min`:o(n,`minimum`,r.value,r.message,t);break;case`max`:o(n,`maximum`,r.value,r.message,t);break}return n};function g(e,t){return{...$(e.innerType._def,t),default:e.defaultValue()}}function _(e,t){return t.effectStrategy===`input`?$(e.schema._def,t):c(t)}function v(e){return{type:`string`,enum:Array.from(e.values)}}const y=e=>`type`in e&&e.type===`string`?!1:`allOf`in e;function b(e,t){let n=[$(e.left._def,{...t,currentPath:[...t.currentPath,`allOf`,`0`]}),$(e.right._def,{...t,currentPath:[...t.currentPath,`allOf`,`1`]})].filter(e=>!!e),r=t.target===`jsonSchema2019-09`?{unevaluatedProperties:!1}:void 0,i=[];return n.forEach(e=>{if(y(e))i.push(...e.allOf),e.unevaluatedProperties===void 0&&(r=void 0);else{let t=e;if(`additionalProperties`in e&&e.additionalProperties===!1){let{additionalProperties:n,...r}=e;t=r}else r=void 0;i.push(t)}}),i.length?{allOf:i,...r}:void 0}function x(e,t){let n=typeof e.value;return n!==`bigint`&&n!==`number`&&n!==`boolean`&&n!==`string`?{type:Array.isArray(e.value)?`array`:`object`}:t.target===`openApi3`?{type:n===`bigint`?`integer`:n,enum:[e.value]}:{type:n===`bigint`?`integer`:n,const:e.value}}let S;const C={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(S===void 0&&(S=RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)),S),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,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])$/,ipv4Cidr:/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(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:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function w(e,t){let n={type:`string`};if(e.checks)for(let r of e.checks)switch(r.kind){case`min`:o(n,`minLength`,typeof n.minLength==`number`?Math.max(n.minLength,r.value):r.value,r.message,t);break;case`max`:o(n,`maxLength`,typeof n.maxLength==`number`?Math.min(n.maxLength,r.value):r.value,r.message,t);break;case`email`:switch(t.emailStrategy){case`format:email`:O(n,`email`,r.message,t);break;case`format:idn-email`:O(n,`idn-email`,r.message,t);break;case`pattern:zod`:k(n,C.email,r.message,t);break}break;case`url`:O(n,`uri`,r.message,t);break;case`uuid`:O(n,`uuid`,r.message,t);break;case`regex`:k(n,r.regex,r.message,t);break;case`cuid`:k(n,C.cuid,r.message,t);break;case`cuid2`:k(n,C.cuid2,r.message,t);break;case`startsWith`:k(n,RegExp(`^${T(r.value,t)}`),r.message,t);break;case`endsWith`:k(n,RegExp(`${T(r.value,t)}$`),r.message,t);break;case`datetime`:O(n,`date-time`,r.message,t);break;case`date`:O(n,`date`,r.message,t);break;case`time`:O(n,`time`,r.message,t);break;case`duration`:O(n,`duration`,r.message,t);break;case`length`:o(n,`minLength`,typeof n.minLength==`number`?Math.max(n.minLength,r.value):r.value,r.message,t),o(n,`maxLength`,typeof n.maxLength==`number`?Math.min(n.maxLength,r.value):r.value,r.message,t);break;case`includes`:k(n,RegExp(T(r.value,t)),r.message,t);break;case`ip`:r.version!==`v6`&&O(n,`ipv4`,r.message,t),r.version!==`v4`&&O(n,`ipv6`,r.message,t);break;case`base64url`:k(n,C.base64url,r.message,t);break;case`jwt`:k(n,C.jwt,r.message,t);break;case`cidr`:r.version!==`v6`&&k(n,C.ipv4Cidr,r.message,t),r.version!==`v4`&&k(n,C.ipv6Cidr,r.message,t);break;case`emoji`:k(n,C.emoji(),r.message,t);break;case`ulid`:k(n,C.ulid,r.message,t);break;case`base64`:switch(t.base64Strategy){case`format:binary`:O(n,`binary`,r.message,t);break;case`contentEncoding:base64`:o(n,`contentEncoding`,`base64`,r.message,t);break;case`pattern:zod`:k(n,C.base64,r.message,t);break}break;case`nanoid`:k(n,C.nanoid,r.message,t);case`toLowerCase`:case`toUpperCase`:case`trim`:break;default:(e=>{})(r)}return n}function T(e,t){return t.patternStrategy===`escape`?D(e):e}const E=new Set(`ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789`);function D(e){let t=``;for(let n=0;ne.format)?(e.anyOf||=[],e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&r.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.anyOf.push({format:t,...n&&r.errorMessages&&{errorMessage:{format:n}}})):o(e,`format`,t,n,r)}function k(e,t,n,r){e.pattern||e.allOf?.some(e=>e.pattern)?(e.allOf||=[],e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&r.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.allOf.push({pattern:A(t,r),...n&&r.errorMessages&&{errorMessage:{pattern:n}}})):o(e,`pattern`,A(t,r),n,r)}function A(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let n={i:e.flags.includes(`i`),m:e.flags.includes(`m`),s:e.flags.includes(`s`)},r=n.i?e.source.toLowerCase():e.source,i=``,a=!1,o=!1,s=!1;for(let e=0;e({...e,[r]:$(t.valueType._def,{...n,currentPath:[...n.currentPath,`properties`,r]})??c(n)}),{}),additionalProperties:n.rejectedAdditionalProperties};let r={type:`object`,additionalProperties:$(t.valueType._def,{...n,currentPath:[...n.currentPath,`additionalProperties`]})??n.allowedAdditionalProperties};if(n.target===`openApi3`)return r;if(t.keyType?._def.typeName===e.ZodString&&t.keyType._def.checks?.length){let{type:e,...i}=w(t.keyType._def,n);return{...r,propertyNames:i}}else if(t.keyType?._def.typeName===e.ZodEnum)return{...r,propertyNames:{enum:t.keyType._def.values}};else if(t.keyType?._def.typeName===e.ZodBranded&&t.keyType._def.type._def.typeName===e.ZodString&&t.keyType._def.type._def.checks?.length){let{type:e,...i}=f(t.keyType._def,n);return{...r,propertyNames:i}}return r}function M(e,t){if(t.mapStrategy===`record`)return j(e,t);let n=$(e.keyType._def,{...t,currentPath:[...t.currentPath,`items`,`items`,`0`]})||c(t),r=$(e.valueType._def,{...t,currentPath:[...t.currentPath,`items`,`items`,`1`]})||c(t);return{type:`array`,maxItems:125,items:{type:`array`,items:[n,r],minItems:2,maxItems:2}}}function N(e){let t=e.values,n=Object.keys(e.values).filter(e=>typeof t[t[e]]!=`number`),r=n.map(e=>t[e]),i=Array.from(new Set(r.map(e=>typeof e)));return{type:i.length===1?i[0]===`string`?`string`:`number`:[`string`,`number`],enum:r}}function P(e){return e.target===`openAi`?void 0:{not:c({...e,currentPath:[...e.currentPath,`not`]})}}function F(e){return e.target===`openApi3`?{enum:[`null`],nullable:!0}:{type:`null`}}const I={ZodString:`string`,ZodNumber:`number`,ZodBigInt:`integer`,ZodBoolean:`boolean`,ZodNull:`null`};function L(e,t){if(t.target===`openApi3`)return R(e,t);let n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(e=>e._def.typeName in I&&(!e._def.checks||!e._def.checks.length))){let e=n.reduce((e,t)=>{let n=I[t._def.typeName];return n&&!e.includes(n)?[...e,n]:e},[]);return{type:e.length>1?e:e[0]}}else if(n.every(e=>e._def.typeName===`ZodLiteral`&&!e.description)){let e=n.reduce((e,t)=>{let n=typeof t._def.value;switch(n){case`string`:case`number`:case`boolean`:return[...e,n];case`bigint`:return[...e,`integer`];case`object`:if(t._def.value===null)return[...e,`null`];case`symbol`:case`undefined`:case`function`:default:return e}},[]);if(e.length===n.length){let t=e.filter((e,t,n)=>n.indexOf(e)===t);return{type:t.length>1?t:t[0],enum:n.reduce((e,t)=>e.includes(t._def.value)?e:[...e,t._def.value],[])}}}else if(n.every(e=>e._def.typeName===`ZodEnum`))return{type:`string`,enum:n.reduce((e,t)=>[...e,...t._def.values.filter(t=>!e.includes(t))],[])};return R(e,t)}const R=(e,t)=>{let n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((e,n)=>$(e._def,{...t,currentPath:[...t.currentPath,`anyOf`,`${n}`]})).filter(e=>!!e&&(!t.strictUnions||typeof e==`object`&&Object.keys(e).length>0));return n.length?{anyOf:n}:void 0};function z(e,t){if([`ZodString`,`ZodNumber`,`ZodBigInt`,`ZodBoolean`,`ZodNull`].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return t.target===`openApi3`?{type:I[e.innerType._def.typeName],nullable:!0}:{type:[I[e.innerType._def.typeName],`null`]};if(t.target===`openApi3`){let n=$(e.innerType._def,{...t,currentPath:[...t.currentPath]});return n&&`$ref`in n?{allOf:[n],nullable:!0}:n&&{...n,nullable:!0}}let n=$(e.innerType._def,{...t,currentPath:[...t.currentPath,`anyOf`,`0`]});return n&&{anyOf:[n,{type:`null`}]}}function B(e,t){let n={type:`number`};if(!e.checks)return n;for(let r of e.checks)switch(r.kind){case`int`:n.type=`integer`,a(n,`type`,r.message,t);break;case`min`:t.target===`jsonSchema7`?r.inclusive?o(n,`minimum`,r.value,r.message,t):o(n,`exclusiveMinimum`,r.value,r.message,t):(r.inclusive||(n.exclusiveMinimum=!0),o(n,`minimum`,r.value,r.message,t));break;case`max`:t.target===`jsonSchema7`?r.inclusive?o(n,`maximum`,r.value,r.message,t):o(n,`exclusiveMaximum`,r.value,r.message,t):(r.inclusive||(n.exclusiveMaximum=!0),o(n,`maximum`,r.value,r.message,t));break;case`multipleOf`:o(n,`multipleOf`,r.value,r.message,t);break}return n}function V(e,t){let n=t.target===`openAi`,r={type:`object`,properties:{}},i=[],a=e.shape();for(let e in a){let o=a[e];if(o===void 0||o._def===void 0)continue;let s=U(o);s&&n&&(o._def.typeName===`ZodOptional`&&(o=o._def.innerType),o.isNullable()||(o=o.nullable()),s=!1);let c=$(o._def,{...t,currentPath:[...t.currentPath,`properties`,e],propertyPath:[...t.currentPath,`properties`,e]});if(c===void 0)continue;r.properties[e]=c,s||i.push(e)}i.length&&(r.required=i);let o=H(e,t);return o!==void 0&&(r.additionalProperties=o),r}function H(e,t){if(e.catchall._def.typeName!==`ZodNever`)return $(e.catchall._def,{...t,currentPath:[...t.currentPath,`additionalProperties`]});switch(e.unknownKeys){case`passthrough`:return t.allowedAdditionalProperties;case`strict`:return t.rejectedAdditionalProperties;case`strip`:return t.removeAdditionalStrategy===`strict`?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function U(e){try{return e.isOptional()}catch{return!0}}const W=(e,t)=>{if(t.currentPath.toString()===t.propertyPath?.toString())return $(e.innerType._def,t);let n=$(e.innerType._def,{...t,currentPath:[...t.currentPath,`anyOf`,`1`]});return n?{anyOf:[{not:c(t)},n]}:c(t)},G=(e,t)=>{if(t.pipeStrategy===`input`)return $(e.in._def,t);if(t.pipeStrategy===`output`)return $(e.out._def,t);let n=$(e.in._def,{...t,currentPath:[...t.currentPath,`allOf`,`0`]}),r=$(e.out._def,{...t,currentPath:[...t.currentPath,`allOf`,n?`1`:`0`]});return{allOf:[n,r].filter(e=>e!==void 0)}};function K(e,t){return $(e.type._def,t)}function q(e,t){let n=$(e.valueType._def,{...t,currentPath:[...t.currentPath,`items`]}),r={type:`array`,uniqueItems:!0,items:n};return e.minSize&&o(r,`minItems`,e.minSize.value,e.minSize.message,t),e.maxSize&&o(r,`maxItems`,e.maxSize.value,e.maxSize.message,t),r}function J(e,t){return e.rest?{type:`array`,minItems:e.items.length,items:e.items.map((e,n)=>$(e._def,{...t,currentPath:[...t.currentPath,`items`,`${n}`]})).reduce((e,t)=>t===void 0?e:[...e,t],[]),additionalItems:$(e.rest._def,{...t,currentPath:[...t.currentPath,`additionalItems`]})}:{type:`array`,minItems:e.items.length,maxItems:e.items.length,items:e.items.map((e,n)=>$(e._def,{...t,currentPath:[...t.currentPath,`items`,`${n}`]})).reduce((e,t)=>t===void 0?e:[...e,t],[])}}function Y(e){return{not:c(e)}}function X(e){return c(e)}const Z=(e,t)=>$(e.innerType._def,t),Q=(t,n,r)=>{switch(n){case e.ZodString:return w(t,r);case e.ZodNumber:return B(t,r);case e.ZodObject:return V(t,r);case e.ZodBigInt:return u(t,r);case e.ZodBoolean:return d();case e.ZodDate:return m(t,r);case e.ZodUndefined:return Y(r);case e.ZodNull:return F(r);case e.ZodArray:return l(t,r);case e.ZodUnion:case e.ZodDiscriminatedUnion:return L(t,r);case e.ZodIntersection:return b(t,r);case e.ZodTuple:return J(t,r);case e.ZodRecord:return j(t,r);case e.ZodLiteral:return x(t,r);case e.ZodEnum:return v(t);case e.ZodNativeEnum:return N(t);case e.ZodNullable:return z(t,r);case e.ZodOptional:return W(t,r);case e.ZodMap:return M(t,r);case e.ZodSet:return q(t,r);case e.ZodLazy:return()=>t.getter()._def;case e.ZodPromise:return K(t,r);case e.ZodNaN:case e.ZodNever:return P(r);case e.ZodEffects:return _(t,r);case e.ZodAny:return c(r);case e.ZodUnknown:return X(r);case e.ZodDefault:return g(t,r);case e.ZodBranded:return f(t,r);case e.ZodReadonly:return Z(t,r);case e.ZodCatch:return p(t,r);case e.ZodPipeline:return G(t,r);case e.ZodFunction:case e.ZodVoid:case e.ZodSymbol:return;default:return(e=>void 0)(n)}};function $(e,n,r=!1){let i=n.seen.get(e);if(n.override){let a=n.override?.(e,n,i,r);if(a!==t)return a}if(i&&!r){let e=ee(i,n);if(e!==void 0)return e}let a={def:e,path:n.currentPath,jsonSchema:void 0};n.seen.set(e,a);let o=Q(e,e.typeName,n),s=typeof o==`function`?$(o(),n):o;if(s&&te(e,n,s),n.postProcess){let t=n.postProcess(s,e,n);return a.jsonSchema=s,t}return a.jsonSchema=s,s}const ee=(e,t)=>{switch(t.$refStrategy){case`root`:return{$ref:e.path.join(`/`)};case`relative`:return{$ref:s(t.currentPath,e.path)};case`none`:case`seen`:return e.path.lengtht.currentPath[n]===e)?(console.warn(`Recursive reference detected at ${t.currentPath.join(`/`)}! Defaulting to any`),c(t)):t.$refStrategy===`seen`?c(t):void 0}},te=(e,t,n)=>(e.description&&(n.description=e.description,t.markdownDescription&&(n.markdownDescription=e.description)),n),ne=(e,t)=>{let n=i(t),r=typeof t==`object`&&t.definitions?Object.entries(t.definitions).reduce((e,[t,r])=>({...e,[t]:$(r._def,{...n,currentPath:[...n.basePath,n.definitionPath,t]},!0)??c(n)}),{}):void 0,a=typeof t==`string`?t:t?.nameStrategy===`title`?void 0:t?.name,o=$(e._def,a===void 0?n:{...n,currentPath:[...n.basePath,n.definitionPath,a]},!1)??c(n),s=typeof t==`object`&&t.name!==void 0&&t.nameStrategy===`title`?t.name:void 0;s!==void 0&&(o.title=s),n.flags.hasReferencedOpenAiAnyType&&(r||={},r[n.openAiAnyTypeName]||(r[n.openAiAnyTypeName]={type:[`string`,`number`,`integer`,`boolean`,`array`,`null`],items:{$ref:n.$refStrategy===`relative`?`1`:[...n.basePath,n.definitionPath,n.openAiAnyTypeName].join(`/`)}}));let l=a===void 0?r?{...o,[n.definitionPath]:r}:o:{$ref:[...n.$refStrategy===`relative`?[]:n.basePath,n.definitionPath,a].join(`/`),[n.definitionPath]:{...r,[a]:o}};return n.target===`jsonSchema7`?l.$schema=`http://json-schema.org/draft-07/schema#`:(n.target===`jsonSchema2019-09`||n.target===`openAi`)&&(l.$schema=`https://json-schema.org/draft/2019-09/schema#`),n.target===`openAi`&&(`anyOf`in l||`oneOf`in l||`allOf`in l||`type`in l&&Array.isArray(l.type))&&console.warn(`Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property.`),l};export{a as addErrorMessage,n as defaultOptions,r as getDefaultOptions,i as getRefs,s as getRelativePath,t as ignoreOverride,c as parseAnyDef,l as parseArrayDef,u as parseBigintDef,d as parseBooleanDef,f as parseBrandedDef,p as parseCatchDef,m as parseDateDef,$ as parseDef,g as parseDefaultDef,_ as parseEffectsDef,v as parseEnumDef,b as parseIntersectionDef,x as parseLiteralDef,M as parseMapDef,N as parseNativeEnumDef,P as parseNeverDef,F as parseNullDef,z as parseNullableDef,B as parseNumberDef,V as parseObjectDef,W as parseOptionalDef,G as parsePipelineDef,K as parsePromiseDef,Z as parseReadonlyDef,j as parseRecordDef,q as parseSetDef,w as parseStringDef,J as parseTupleDef,Y as parseUndefinedDef,L as parseUnionDef,X as parseUnknownDef,I as primitiveMappings,Q as selectParser,o as setResponseValueAndErrors,C as zodPatterns,ne as zodToJsonSchema}; \ No newline at end of file diff --git a/assets/featherless-ai-2oNxwFxi.js b/assets/featherless-ai-2oNxwFxi.js new file mode 100644 index 0000000000000000000000000000000000000000..3ea4755f4725017f3765c094f54b517cfb392369 --- /dev/null +++ b/assets/featherless-ai-2oNxwFxi.js @@ -0,0 +1 @@ +import{J as e,L as t,aN as n,aS as r,bA as i,bE as a,bH as o,bJ as s,bL as c,bO as l,bQ as u,bT as d,b_ as f,t as p,u as m,v as h,w as g,x as _,y as v}from"./index-J3uhnpYL.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b=`featherless-ai`;var x=s({__name:`featherless-ai`,setup(s){let{t:y}=t(),x=n(),S=e(),{providers:C}=r(S),w=o(()=>S.getProviderMetadata(b)),T=o({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=o({get:()=>C.value[b]?.baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});a(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||``}),u([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)=>(d(),i(f(p),{"provider-name":w.value?.localizedName,"provider-icon":w.value?.icon,"on-back":()=>f(x).back()},{default:c(()=>[l(f(m),null,{default:c(()=>[l(f(h),{title:f(y)(`settings.pages.providers.common.section.basic.title`),description:f(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:c(()=>[l(f(_),{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`]),l(f(v),{title:f(y)(`settings.pages.providers.common.section.advanced.title`)},{default:c(()=>[l(f(g),{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/featherless-ai-B-HXyLKh.js b/assets/featherless-ai-B-HXyLKh.js deleted file mode 100644 index 1a44c5bc5b8b8c2710b270d0026196cd461f100d..0000000000000000000000000000000000000000 --- a/assets/featherless-ai-B-HXyLKh.js +++ /dev/null @@ -1 +0,0 @@ -import{J as e,L as t,aN as n,aS as r,bA as i,bG as a,bK as o,bN as s,bP as c,bR as l,bU as u,b_ as d,by as f,t as p,u as m,v as h,w as g,x as _,y as v}from"./index-BFym949y.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b=`featherless-ai`;var x=c({__name:`featherless-ai`,setup(c){let{t:y}=t(),x=n(),S=e(),{providers:C}=r(S),w=s(()=>S.getProviderMetadata(b)),T=s({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=s({get:()=>C.value[b]?.baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});o(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||``}),f([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)=>(i(),a(d(p),{"provider-name":w.value?.localizedName,"provider-icon":w.value?.icon,"on-back":()=>d(x).back()},{default:l(()=>[u(d(m),null,{default:l(()=>[u(d(h),{title:d(y)(`settings.pages.providers.common.section.basic.title`),description:d(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:l(()=>[u(d(_),{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`]),u(d(v),{title:d(y)(`settings.pages.providers.common.section.advanced.title`)},{default:l(()=>[u(d(g),{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-BZNjFRng.js b/assets/filter-message-BcMyfSi6.js similarity index 61% rename from assets/filter-message-BZNjFRng.js rename to assets/filter-message-BcMyfSi6.js index 0c0c4884161269e86fab11c70328590947b58555..bd3c3799c1ddb08b565aad9fb0c626acf190c4b6 100644 --- a/assets/filter-message-BZNjFRng.js +++ b/assets/filter-message-BcMyfSi6.js @@ -1 +1 @@ -import"./Basic-CcFV8fg0.js";import{b as e}from"./Textarea-DQ3UodrM.js";import{a7 as t,bA as n,bB as r,bP as i,bS as a,bU as o,bX as s,b_ as c,c1 as l}from"./index-BFym949y.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=i({__name:`filter-message`,setup(i){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,i)=>(n(),a(`div`,u,[r(`div`,d,[o(c(e),{modelValue:m.value,"onUpdate:modelValue":i[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,[i[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 +import"./Basic-Cwa2X3hA.js";import{b as e}from"./Textarea-C55W7JzB.js";import{a7 as t,bJ as n,bM as r,bO as i,bT as a,bU as o,bX as s,b_ as c,c0 as l}from"./index-J3uhnpYL.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)=>(a(),r(`div`,u,[o(`div`,d,[i(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`]),o(`button`,f,l(h.value?`Processing...`:`Send`),1)]),o(`div`,p,[n[1]||=o(`h3`,{"font-normal":``},` Streaming Message `,-1),o(`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-CI_8N3O3.js b/assets/fireworks-ai-CI_8N3O3.js deleted file mode 100644 index 3719fc7e827ff334523f4a1a869a23a98f0f407f..0000000000000000000000000000000000000000 --- a/assets/fireworks-ai-CI_8N3O3.js +++ /dev/null @@ -1 +0,0 @@ -import{J as e,L as t,aN as n,aS as r,bA as i,bG as a,bK as o,bN as s,bP as c,bR as l,bU as u,b_ as d,by as f,t as p,u as m,v as h,w as g,x as _,y as v}from"./index-BFym949y.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b=`fireworks-ai`;var x=c({__name:`fireworks-ai`,setup(c){let{t:y}=t(),x=n(),S=e(),{providers:C}=r(S),w=s(()=>S.getProviderMetadata(b)),T=s({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=s({get:()=>C.value[b]?.baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});o(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||``}),f([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)=>(i(),a(d(p),{"provider-name":w.value?.localizedName,"provider-icon":w.value?.icon,"on-back":()=>d(x).back()},{default:l(()=>[u(d(m),null,{default:l(()=>[u(d(h),{title:d(y)(`settings.pages.providers.common.section.basic.title`),description:d(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:l(()=>[u(d(_),{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`]),u(d(v),{title:d(y)(`settings.pages.providers.common.section.advanced.title`)},{default:l(()=>[u(d(g),{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/fireworks-ai-CW9vBjr8.js b/assets/fireworks-ai-CW9vBjr8.js new file mode 100644 index 0000000000000000000000000000000000000000..14206eebae97d91c4bcfb70a3ed905c1d1a3e927 --- /dev/null +++ b/assets/fireworks-ai-CW9vBjr8.js @@ -0,0 +1 @@ +import{J as e,L as t,aN as n,aS as r,bA as i,bE as a,bH as o,bJ as s,bL as c,bO as l,bQ as u,bT as d,b_ as f,t as p,u as m,v as h,w as g,x as _,y as v}from"./index-J3uhnpYL.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b=`fireworks-ai`;var x=s({__name:`fireworks-ai`,setup(s){let{t:y}=t(),x=n(),S=e(),{providers:C}=r(S),w=o(()=>S.getProviderMetadata(b)),T=o({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=o({get:()=>C.value[b]?.baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});a(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||``}),u([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)=>(d(),i(f(p),{"provider-name":w.value?.localizedName,"provider-icon":w.value?.icon,"on-back":()=>f(x).back()},{default:c(()=>[l(f(m),null,{default:c(()=>[l(f(h),{title:f(y)(`settings.pages.providers.common.section.basic.title`),description:f(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:c(()=>[l(f(_),{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`]),l(f(v),{title:f(y)(`settings.pages.providers.common.section.advanced.title`)},{default:c(()=>[l(f(g),{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-CVrjEVIh.js b/assets/general-B2Scnzyg.js similarity index 57% rename from assets/general-CVrjEVIh.js rename to assets/general-B2Scnzyg.js index 0cdc9ce8cdc9413c88fe91609ea2cbed5c5be705..0bd39bd4e208707c1542be3dffb90bd1614de650 100644 --- a/assets/general-CVrjEVIh.js +++ b/assets/general-B2Scnzyg.js @@ -1 +1 @@ -import{B as e,L as t,aT as n,ao as r,ap as i,at as a,ay as o,bA as s,bB as c,bE as l,bG as u,bJ as d,bP as f,bR as p,bS as m,bU as h,bV as g,b_ as _,bz as v,c1 as y}from"./index-BFym949y.js";import{b}from"./route-block-DVyt-3Cw.js";const x={"rounded-lg":``,"bg-neutral-50":``,"p-4":``,"dark:bg-neutral-800":``,flex:`~ col gap-4`},S={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 C=f({__name:`general`,setup(f){let b=e(),{t:C,locale:w}=t(),T=n();return(e,t)=>{let n=v(`motion`);return s(),m(`div`,x,[d(h(_(o),{modelValue:_(T),"onUpdate:modelValue":t[0]||=e=>g(T)?T.value=e:null,"mb-2":``,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:270,delay:2*50,label:_(C)(`settings.theme.title`),description:_(C)(`settings.theme.description`)},null,8,[`modelValue`,`label`,`description`]),[[n]]),d((s(),u(_(a),{initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:280,delay:3*50,transition:`all ease-in-out duration-250`,label:_(C)(`settings.language.title`),description:_(C)(`settings.language.description`)},{default:p(()=>[h(_(r),{modelValue:_(b).language,"onUpdate:modelValue":t[1]||=e=>_(b).language=e,transition:`all ease-in-out duration-250`,"cursor-pointer":``,"bg-transparent":``,"outline-none":``},{default:p(({value:t})=>[c(`div`,null,y(t?e.$t(`settings.language.${t}`):_(C)(`settings.language.english`)),1)]),options:p(({hide:t})=>[h(_(i),{value:`en`,active:_(w)===`en`,onClick:e=>t()},{default:p(()=>[l(y(e.$t(`settings.language.english`)),1)]),_:2},1032,[`active`,`onClick`]),h(_(i),{value:`zh-Hans`,active:_(w)===`zh-Hans`,onClick:e=>t()},{default:p(()=>[l(y(e.$t(`settings.language.chinese`)),1)]),_:2},1032,[`active`,`onClick`])]),_:1},8,[`modelValue`])]),_:1},8,[`label`,`description`])),[[n]]),d((s(),m(`div`,S,t[2]||=[c(`div`,{text:`60`,"i-solar:emoji-funny-square-bold-duotone":``},null,-1)])),[[n]])])}}});typeof b==`function`&&b(C);var w=C;export{w as default}; \ No newline at end of file +import{B as e,L as t,aW as n,ao as r,ap as i,at as a,ay as o,bA as s,bD as c,bJ as l,bL as u,bM as d,bO as f,bS as p,bT as m,bU as h,bV as g,b_ as _,by as v,c0 as y}from"./index-J3uhnpYL.js";import{b}from"./route-block-DVyt-3Cw.js";const x={"rounded-lg":``,"bg-neutral-50":``,"p-4":``,"dark:bg-neutral-800":``,flex:`~ col gap-4`},S={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 C=l({__name:`general`,setup(l){let b=e(),{t:C,locale:w}=t(),T=n();return(e,t)=>{let n=p(`motion`);return m(),d(`div`,x,[c(f(_(o),{modelValue:_(T),"onUpdate:modelValue":t[0]||=e=>g(T)?T.value=e:null,"mb-2":``,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:270,delay:2*50,label:_(C)(`settings.theme.title`),description:_(C)(`settings.theme.description`)},null,8,[`modelValue`,`label`,`description`]),[[n]]),c((m(),s(_(a),{initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:280,delay:3*50,transition:`all ease-in-out duration-250`,label:_(C)(`settings.language.title`),description:_(C)(`settings.language.description`)},{default:u(()=>[f(_(r),{modelValue:_(b).language,"onUpdate:modelValue":t[1]||=e=>_(b).language=e,transition:`all ease-in-out duration-250`,"cursor-pointer":``,"bg-transparent":``,"outline-none":``},{default:u(({value:t})=>[h(`div`,null,y(t?e.$t(`settings.language.${t}`):_(C)(`settings.language.english`)),1)]),options:u(({hide:t})=>[f(_(i),{value:`en`,active:_(w)===`en`,onClick:e=>t()},{default:u(()=>[v(y(e.$t(`settings.language.english`)),1)]),_:2},1032,[`active`,`onClick`]),f(_(i),{value:`zh-Hans`,active:_(w)===`zh-Hans`,onClick:e=>t()},{default:u(()=>[v(y(e.$t(`settings.language.chinese`)),1)]),_:2},1032,[`active`,`onClick`])]),_:1},8,[`modelValue`])]),_:1},8,[`label`,`description`])),[[n]]),c((m(),d(`div`,S,t[2]||=[h(`div`,{text:`60`,"i-solar:emoji-funny-square-bold-duotone":``},null,-1)])),[[n]])])}}});typeof b==`function`&&b(C);var w=C;export{w as default}; \ No newline at end of file diff --git a/assets/gesture-circle-BBMVN_ye.js b/assets/gesture-circle-BBMVN_ye.js new file mode 100644 index 0000000000000000000000000000000000000000..cac2d028087aba91469cd3f35e630302846f71fe --- /dev/null +++ b/assets/gesture-circle-BBMVN_ye.js @@ -0,0 +1 @@ +import{aT as e,b1 as t,b2 as n,b6 as r,b7 as i,bH as a,bJ as o,bM as s,bQ as c,bT as l,bU as u,bX as d,b_ as f,c0 as p}from"./index-J3uhnpYL.js";import{b as m}from"./route-block-DVyt-3Cw.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=o({__name:`gesture-circle`,setup(o){let m=d(),v=d(),y=d(),b=d(),{x,y:S}=t({target:y}),C=e(v,{immediate:!0,windowResize:!0}),w=a(()=>({x:x.value,y:S.value}));n(v,e=>{let t=e[0],{width:n,height:r}=t.contentRect;y.value&&(y.value.width=n,y.value.height=r)}),c(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=i(w,50),E=r(w,50),D=d(E.value),O=d(0),k=d(0),A=d(!1),j=d([]),M=d(!1);return c([x,S],()=>{b.value&&(b.value.beginPath(),b.value.fillStyle=`red`,b.value.arc(x.value,S.value,4,0,2*Math.PI),b.value.closePath(),b.value.fill())}),c(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=[]}),c(T,e=>{j.value.push(e)}),(e,t)=>(l(),s(`div`,{ref_key:`containerRef`,ref:m,"h-full":``},[u(`div`,h,[u(`div`,g,[t[0]||=u(`div`,{text:`neutral-400 dark:neutral-600`},` pointThrottled: `,-1),u(`div`,null,p(f(T)),1),t[1]||=u(`div`,{text:`neutral-400 dark:neutral-600`},` pointDebounced: `,-1),u(`div`,null,p(f(E)),1),t[2]||=u(`div`,{text:`neutral-400 dark:neutral-600`},` lastPoint: `,-1),u(`div`,null,p(D.value),1),t[3]||=u(`div`,{text:`neutral-400 dark:neutral-600`},` distance: `,-1),u(`div`,null,p(O.value),1),t[4]||=u(`div`,{text:`neutral-400 dark:neutral-600`},` count: `,-1),u(`div`,null,p(k.value),1),t[5]||=u(`div`,{text:`neutral-400 dark:neutral-600`},` show: `,-1),u(`div`,null,p(A.value),1),t[6]||=u(`div`,{text:`neutral-400 dark:neutral-600`},` lastPoints: `,-1),u(`div`,null,p(j.value),1),t[7]||=u(`div`,{text:`neutral-400 dark:neutral-600`},` isCircle: `,-1),u(`div`,null,p(M.value),1)]),u(`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-NieW4uSY.js b/assets/gesture-circle-NieW4uSY.js deleted file mode 100644 index 6e3030f0780a15d96bc2d436dd64d446ae5eb99c..0000000000000000000000000000000000000000 --- a/assets/gesture-circle-NieW4uSY.js +++ /dev/null @@ -1 +0,0 @@ -import{a$ as e,a_ as t,b2 as n,b5 as r,b6 as i,bA as a,bB as o,bN as s,bP as c,bS as l,bX as u,b_ as d,by as f,c1 as p}from"./index-BFym949y.js";import{b as m}from"./route-block-DVyt-3Cw.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=c({__name:`gesture-circle`,setup(c){let m=u(),v=u(),y=u(),b=u(),{x,y:S}=t({target:y}),C=n(v,{immediate:!0,windowResize:!0}),w=s(()=>({x:x.value,y:S.value}));e(v,e=>{let t=e[0],{width:n,height:r}=t.contentRect;y.value&&(y.value.width=n,y.value.height=r)}),f(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=i(w,50),E=r(w,50),D=u(E.value),O=u(0),k=u(0),A=u(!1),j=u([]),M=u(!1);return f([x,S],()=>{b.value&&(b.value.beginPath(),b.value.fillStyle=`red`,b.value.arc(x.value,S.value,4,0,2*Math.PI),b.value.closePath(),b.value.fill())}),f(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=[]}),f(T,e=>{j.value.push(e)}),(e,t)=>(a(),l(`div`,{ref_key:`containerRef`,ref:m,"h-full":``},[o(`div`,h,[o(`div`,g,[t[0]||=o(`div`,{text:`neutral-400 dark:neutral-600`},` pointThrottled: `,-1),o(`div`,null,p(d(T)),1),t[1]||=o(`div`,{text:`neutral-400 dark:neutral-600`},` pointDebounced: `,-1),o(`div`,null,p(d(E)),1),t[2]||=o(`div`,{text:`neutral-400 dark:neutral-600`},` lastPoint: `,-1),o(`div`,null,p(D.value),1),t[3]||=o(`div`,{text:`neutral-400 dark:neutral-600`},` distance: `,-1),o(`div`,null,p(O.value),1),t[4]||=o(`div`,{text:`neutral-400 dark:neutral-600`},` count: `,-1),o(`div`,null,p(k.value),1),t[5]||=o(`div`,{text:`neutral-400 dark:neutral-600`},` show: `,-1),o(`div`,null,p(A.value),1),t[6]||=o(`div`,{text:`neutral-400 dark:neutral-600`},` lastPoints: `,-1),o(`div`,null,p(j.value),1),t[7]||=o(`div`,{text:`neutral-400 dark:neutral-600`},` isCircle: `,-1),o(`div`,null,p(M.value),1)]),o(`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-BwVpRZEr.js b/assets/google-generative-ai-BwVpRZEr.js new file mode 100644 index 0000000000000000000000000000000000000000..62a0550d0e54b7f2ba6bf6022debb38dd40fb84d --- /dev/null +++ b/assets/google-generative-ai-BwVpRZEr.js @@ -0,0 +1 @@ +import{J as e,L as t,aN as n,aS as r,bA as i,bE as a,bH as o,bJ as s,bL as c,bO as l,bQ as u,bT as d,b_ as f,t as p,u as m,v as h,w as g,x as _,y as v}from"./index-J3uhnpYL.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b=`google-generative-ai`;var x=s({__name:`google-generative-ai`,setup(s){let{t:y}=t(),x=n(),S=e(),{providers:C}=r(S),w=o(()=>S.getProviderMetadata(b)),T=o({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=o({get:()=>C.value[b]?.baseUrl||`https://generativelanguage.googleapis.com/v1beta/openai/`,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});a(()=>{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/`}),u([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)=>(d(),i(f(p),{"provider-name":w.value?.localizedName||`Google | Gemini`,"provider-icon":w.value?.icon,"on-back":()=>f(x).back()},{default:c(()=>[l(f(m),null,{default:c(()=>[l(f(h),{title:f(y)(`settings.pages.providers.common.section.basic.title`),description:f(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:c(()=>[l(f(_),{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`]),l(f(v),{title:f(y)(`settings.pages.providers.common.section.advanced.title`)},{default:c(()=>[l(f(g),{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/google-generative-ai-CjRSvghG.js b/assets/google-generative-ai-CjRSvghG.js deleted file mode 100644 index 882488df9f82ee8f5a166efbda218bf2aa67d84c..0000000000000000000000000000000000000000 --- a/assets/google-generative-ai-CjRSvghG.js +++ /dev/null @@ -1 +0,0 @@ -import{J as e,L as t,aN as n,aS as r,bA as i,bG as a,bK as o,bN as s,bP as c,bR as l,bU as u,b_ as d,by as f,t as p,u as m,v as h,w as g,x as _,y as v}from"./index-BFym949y.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b=`google-generative-ai`;var x=c({__name:`google-generative-ai`,setup(c){let{t:y}=t(),x=n(),S=e(),{providers:C}=r(S),w=s(()=>S.getProviderMetadata(b)),T=s({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=s({get:()=>C.value[b]?.baseUrl||`https://generativelanguage.googleapis.com/v1beta/openai/`,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});o(()=>{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/`}),f([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)=>(i(),a(d(p),{"provider-name":w.value?.localizedName||`Google | Gemini`,"provider-icon":w.value?.icon,"on-back":()=>d(x).back()},{default:l(()=>[u(d(m),null,{default:l(()=>[u(d(h),{title:d(y)(`settings.pages.providers.common.section.basic.title`),description:d(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:l(()=>[u(d(_),{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`]),u(d(v),{title:d(y)(`settings.pages.providers.common.section.advanced.title`)},{default:l(()=>[u(d(g),{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-DkgAkF88.js b/assets/hearing-DoOHup8T.js similarity index 72% rename from assets/hearing-DkgAkF88.js rename to assets/hearing-DoOHup8T.js index 6aeaefd464a970d80e9614a054c46ebe54a0b72e..249e821d55d0ecd2fe3f4f0283f6857b60547981 100644 --- a/assets/hearing-DkgAkF88.js +++ b/assets/hearing-DoOHup8T.js @@ -1 +1 @@ -import{E as e,J as t,L as n,a6 as r,a9 as i,aB as a,aJ as o,aK as s,aM as c,aS as l,af as ee,ag as te,ai as ne,at as re,au as u,ay as d,b$ as ie,b0 as ae,b3 as oe,bA as f,bB as p,bD as se,bE as ce,bG as m,bK as le,bL as ue,bM as h,bN as g,bO as de,bP as fe,bQ as _,bR as v,bS as y,bT as pe,bU as b,bV as me,bX as x,b_ as S,by as C,c1 as w}from"./index-BFym949y.js";import{c as T,f as E}from"./transformers.web-B6jLny9T.js";import{b as D}from"./route-block-DVyt-3Cw.js";function he(){let e=x(),t=x(),n=x(),r=x([]),i=x(0),a=x();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}},ve=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 T(`int64`,[this.config.sampleRate],[]),this.state=new T(`float32`,new Float32Array(2*1*128),[2,1,128])}async initialize(){try{this.emit(`status`,{type:`info`,message:`Loading VAD model...`}),this.model=await E.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 T(`int64`,[this.config.sampleRate],[]))}getLastProbability(){return 0}isCurrentlyRecording(){return this.isRecording}};async function ye(e){let t=new ve(e);return await t.initialize(),t}const be={flex:`~ col md:row gap-6`},xe={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%]`},Se={flex:`~ col gap-4`},Ce={flex:`~ col gap-4`},we={class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-500`},Te={text:`neutral-400 dark:neutral-400`},Ee={"max-w-full":``},De={key:0,flex:`~ row gap-4`,style:{"scrollbar-width":`none`},"min-w-0":``,"of-x-scroll":``,"scroll-smooth":``,role:`radiogroup`},Oe={key:1},ke={flex:`~ col gap-6`,class:`w-full md:w-[60%]`},Ae={"w-full":``,"rounded-xl":``},je={class:`mb-4 text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`,"w-full":``},Me={class:`inline-flex items-center gap-4`},Ne=[`src`],Pe={key:0,class:`mt-2 text-sm text-neutral-500 dark:text-neutral-400`},Fe={flex:`~ col gap-4`},Ie={class:`space-y-4`},Le={class:`space-y-3`},Re={key:1,class:`space-y-3`},ze={key:2,class:`space-y-3`},Be={class:`flex items-center gap-3`},Ve={class:`text-sm font-medium`},He={class:`ml-auto text-xs text-neutral-500`},Ue={class:`border-t border-neutral-200 pt-3 dark:border-neutral-700`},We={key:0,class:`mt-3 space-y-2`},Ge={key:0,class:`flex items-center gap-2 text-primary-600 dark:text-primary-400`},Ke={key:2,class:`flex items-center gap-2 text-green-600 dark:text-green-400`},qe={class:`ml-auto text-xs text-neutral-500`},Je={key:0,class:`border-t border-neutral-200 pt-4 dark:border-neutral-700`},Ye={key:0,class:`mt-3`},Xe={key:1,class:`border border-amber-200 rounded-lg bg-amber-50 p-3 dark:border-amber-800 dark:bg-amber-900/20`},Ze=50;var O=fe({__name:`hearing`,setup(fe){let{t:T}=n(),E=e(),{activeTranscriptionProvider:D,activeTranscriptionModel:ve}=l(E),O=t(),{configuredTranscriptionProvidersMetadata:k}=l(O),A=ae({constraints:{audio:!0}}),j=g(()=>A.audioInputs.value),M=x(A.audioInputs.value[0]?.deviceId||``),Qe=g(()=>({audio:{deviceId:{exact:M.value},autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0}})),{stream:N,stop:$e,start:et}=oe({constraints:Qe,enabled:!1,autoSwitch:!1}),{startRecord:tt,stopRecord:nt,onStopRecord:rt}=r(N),{startAnalyzer:it,stopAnalyzer:at,onAnalyzerUpdate:ot,volumeLevel:st}=he(),{audioContext:P}=l(i()),F=x(``),I=x(``),L=x(!1),R=x(!1),z=x(),B=x(),V=x(!1),H=x(25),U=x(50),W=x(),G=x(!1),K=x(!1),q=x(!0),J=x(0),Y=x(.5),X=x([]),Z=x([]),ct=x([]),lt=g(()=>Z.value.map(e=>{let t=URL.createObjectURL(e);return ct.value.push(()=>URL.revokeObjectURL(t)),t})),Q=x([]);async function ut(){if(!(G.value||K.value)){K.value=!0,I.value=``;try{let e=await ye({sampleRate:16e3,speechThreshold:Y.value,exitThreshold:Y.value*.3,minSilenceDurationMs:400});e.on(`speech-start`,()=>{V.value=!0,tt()}),e.on(`speech-end`,()=>{V.value=!1,nt()}),e.on(`debug`,({data:e})=>{e?.probability!==void 0&&(J.value=e.probability,X.value.push(e.probability),X.value.length>Ze&&X.value.shift())}),e.on(`status`,({type:e,message:t})=>{e===`error`&&(I.value=t)});let t=new _e(e,{minChunkSize:512,audioContextOptions:{sampleRate:16e3,latencyHint:`interactive`}});await t.initialize(ge),W.value=t,G.value=!0}catch(e){I.value=e instanceof Error?e.message:String(e),console.error(`Failed to load VAD model:`,e)}finally{K.value=!1}}}async function dt(){try{if(!M.value){console.warn(`No audio input device selected`);return}if(await $(),await et(),!N.value){console.warn(`No audio stream available`);return}rt(async e=>{if(e)try{if(e){Z.value.push(e);let t=await O.getProviderInstance(D.value);if(!t)throw Error(`Failed to initialize speech provider`);let n=ve.value,r=await E.transcription(t,n,new File([e],`recording.wav`),`json`);Q.value.push(r.text)}}catch(e){F.value=e instanceof Error?e.message:String(e),console.error(`Error generating transcription:`,F.value)}});let e=P.value.createMediaStreamSource(N.value),t=it(P.value);ot(e=>{(!q.value||!G.value)&&(V.value=e>H.value)}),z.value=P.value.createGain(),z.value.gain.value=R.value?U.value/100:0,t&&e.connect(t),R.value&&(e.connect(z.value),z.value.connect(P.value.destination)),q.value&&(await ut(),W.value&&await W.value.start(N.value))}catch(e){console.error(`Error setting up audio monitoring:`,e),I.value=e instanceof Error?e.message:String(e)}}async function $(){B.value&&(cancelAnimationFrame(B.value),B.value=void 0),W.value&&await W.value.stop(),N.value&&$e(),at(),z.value=void 0,V.value=!1,J.value=0,X.value=[]}async function ft(){!P.value||!z.value||(R.value?(z.value.gain.value=U.value/100,z.value.connect(P.value.destination)):(z.value.gain.value=0,z.value.disconnect()))}C(M,async()=>{L.value&&await dt()}),C(R,ft),C(U,()=>{z.value&&R.value&&(z.value.gain.value=U.value/100)}),C(j,()=>{!M.value&&j.value.length>0&&(M.value=j.value[0]?.deviceId)}),C(Y,()=>{W.value&&G.value});async function pt(){L.value?(await $(),L.value=!1):(await dt(),L.value=!0)}let mt=g(()=>{if(!q.value||!G.value)return V.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=J.value,t=Y.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`});return le(()=>{A.ensurePermissions().then(()=>de()).then(()=>{j.value.length>0&&!M.value&&(M.value=j.value[0]?.deviceId)})}),pe(()=>{$(),W.value&&W.value.dispose(),ct.value.forEach(e=>e())}),(e,t)=>{let n=ue(`RouterLink`);return f(),y(`div`,be,[p(`div`,xe,[p(`div`,Se,[p(`div`,null,[b(S(re),{modelValue:M.value,"onUpdate:modelValue":t[0]||=e=>M.value=e,label:`Audio Input Device`,description:`Select the audio input device for your hearing module.`,options:j.value.map(e=>({label:e.label||e.deviceId,value:e.deviceId})),placeholder:`Select an audio input device`},null,8,[`modelValue`,`options`])]),p(`div`,Ce,[p(`div`,null,[p(`h2`,we,w(S(T)(`settings.pages.providers.title`)),1),p(`div`,Te,[p(`span`,null,w(S(T)(`settings.pages.modules.hearing.sections.section.provider-model-selection.description`)),1)])]),p(`div`,Ee,[S(k).length>0?(f(),y(`fieldset`,De,[(f(!0),y(h,null,se(S(k),e=>(f(),m(S(ne),{id:e.id,key:e.id,modelValue:S(D),"onUpdate:modelValue":t[1]||=e=>me(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))])):(f(),y(`div`,Oe,[b(n,{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(()=>t[7]||=[p(`div`,{"i-solar:warning-circle-line-duotone":``,class:`text-2xl text-amber-500 dark:text-amber-400`},null,-1),p(`div`,{class:`flex flex-col`},[p(`span`,{class:`font-medium`},`No Providers Configured`),p(`span`,{class:`text-sm text-neutral-400 dark:text-neutral-500`},`Click here to set up your Transcription providers`)],-1),p(`div`,{"i-solar:arrow-right-line-duotone":``,class:`ml-auto text-xl text-neutral-400 dark:text-neutral-500`},null,-1)]),_:1,__:[7]})]))])])])]),p(`div`,ke,[p(`div`,Ae,[p(`h2`,je,[p(`div`,Me,[b(S(s)),p(`div`,null,w(S(T)(`settings.pages.providers.provider.elevenlabs.playground.title`)),1)])]),b(S(te),{class:`mb-4`,"w-full":``,onClick:pt},{default:v(()=>[ce(w(L.value?`Stop Monitoring`:`Start Monitoring`),1)]),_:1}),p(`div`,null,[(f(!0),y(h,null,se(lt.value,(e,t)=>(f(),y(`div`,{key:t,class:`mb-2`},[p(`audio`,{src:e,controls:``,class:`w-full`},null,8,Ne),Q.value[t]?(f(),y(`div`,Pe,w(Q.value[t]),1)):_(``,!0)]))),128))]),p(`div`,Fe,[p(`div`,Ie,[p(`div`,Le,[b(S(c),{level:S(st),label:`Input Level`},null,8,[`level`]),q.value&&G.value?(f(),m(S(o),{key:0,value:J.value,threshold:Y.value,label:`Probability of Speech`,"below-label":`Silence`,"above-label":`Speech`,"threshold-label":`Detection threshold`},null,8,[`value`,`threshold`])):_(``,!0),q.value&&G.value?(f(),y(`div`,Re,[b(S(u),{modelValue:Y.value,"onUpdate:modelValue":t[2]||=e=>Y.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`])])):(f(),y(`div`,ze,[b(S(u),{modelValue:H.value,"onUpdate:modelValue":t[3]||=e=>H.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`])])),p(`div`,Be,[p(`div`,{class:ie([`h-4 w-4 rounded-full transition-all duration-200`,mt.value])},null,2),p(`span`,Ve,w(V.value?`Speaking Detected`:`Silence`),1),p(`span`,He,w(q.value&&G.value?`Model Based`:`Volume Based`),1)]),p(`div`,Ue,[b(S(d),{modelValue:q.value,"onUpdate:modelValue":t[4]||=e=>q.value=e,label:`Model Based`,description:`Use AI models for more accurate speech detection`},null,8,[`modelValue`]),q.value?(f(),y(`div`,We,[K.value?(f(),y(`div`,Ge,t[8]||=[p(`div`,{class:`animate-spin text-sm`,"i-solar:spinner-line-duotone":``},null,-1),p(`span`,{class:`text-sm`},`Loading...`,-1)])):I.value?(f(),m(S(ee),{key:1,title:`Inference error`,error:I.value},null,8,[`error`])):G.value?(f(),y(`div`,Ke,[t[9]||=p(`div`,{class:`text-sm`,"i-solar:check-circle-bold-duotone":``},null,-1),t[10]||=p(`span`,{class:`text-sm`},`Activated`,-1),p(`span`,qe,` Probability: `+w((J.value*100).toFixed(1))+`% `,1)])):_(``,!0)])):_(``,!0)]),q.value&&G.value?(f(),m(S(a),{key:3,history:X.value,"current-value":J.value,threshold:Y.value,"is-active":V.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`])):_(``,!0)]),L.value?(f(),y(`div`,Je,[b(S(d),{modelValue:R.value,"onUpdate:modelValue":t[5]||=e=>R.value=e,label:`Monitor Audio (Listen)`,description:`Enable audio playback monitoring (like OBS). Be careful of feedback!`},null,8,[`modelValue`]),R.value?(f(),y(`div`,Ye,[b(S(u),{modelValue:U.value,"onUpdate:modelValue":t[6]||=e=>U.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`])])):_(``,!0)])):_(``,!0),R.value?(f(),y(`div`,Xe,t[11]||=[p(`div`,{class:`flex items-center gap-2 text-amber-700 dark:text-amber-300`},[p(`div`,{class:`text-sm`,"i-solar:warning-circle-bold-duotone":``}),p(`span`,{class:`text-sm font-medium`},`Audio feedback warning`)],-1),p(`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)])):_(``,!0)])])])])])}}});typeof D==`function`&&D(O);var k=O;export{k as default}; \ No newline at end of file +import{E as e,J as t,L as n,a6 as r,aB as i,aJ as a,aK as o,aM as s,aS as c,aU as l,aa as ee,af as te,ag as ne,ai as re,at as ie,au as u,ay as d,b3 as ae,bA as f,bE as oe,bF as se,bG as ce,bH as p,bI as le,bJ as ue,bK as m,bL as h,bM as g,bN as de,bO as _,bQ as v,bT as y,bU as b,bV as fe,bX as x,b_ as S,bx as C,by as pe,c0 as w,c1 as me}from"./index-J3uhnpYL.js";import{c as T,d as E}from"./transformers.web-DPuLqcmp.js";import{b as D}from"./route-block-DVyt-3Cw.js";function he(){let e=x(),t=x(),n=x(),r=x([]),i=x(0),a=x();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}},ve=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(2*1*128),[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 ye(e){let t=new ve(e);return await t.initialize(),t}const be={flex:`~ col md:row gap-6`},xe={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%]`},Se={flex:`~ col gap-4`},Ce={flex:`~ col gap-4`},we={class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-500`},Te={text:`neutral-400 dark:neutral-400`},Ee={"max-w-full":``},De={key:0,flex:`~ row gap-4`,style:{"scrollbar-width":`none`},"min-w-0":``,"of-x-scroll":``,"scroll-smooth":``,role:`radiogroup`},Oe={key:1},ke={flex:`~ col gap-6`,class:`w-full md:w-[60%]`},Ae={"w-full":``,"rounded-xl":``},je={class:`mb-4 text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`,"w-full":``},Me={class:`inline-flex items-center gap-4`},Ne=[`src`],Pe={key:0,class:`mt-2 text-sm text-neutral-500 dark:text-neutral-400`},Fe={flex:`~ col gap-4`},Ie={class:`space-y-4`},Le={class:`space-y-3`},Re={key:1,class:`space-y-3`},ze={key:2,class:`space-y-3`},Be={class:`flex items-center gap-3`},Ve={class:`text-sm font-medium`},He={class:`ml-auto text-xs text-neutral-500`},Ue={class:`border-t border-neutral-200 pt-3 dark:border-neutral-700`},We={key:0,class:`mt-3 space-y-2`},Ge={key:0,class:`flex items-center gap-2 text-primary-600 dark:text-primary-400`},Ke={key:2,class:`flex items-center gap-2 text-green-600 dark:text-green-400`},qe={class:`ml-auto text-xs text-neutral-500`},Je={key:0,class:`border-t border-neutral-200 pt-4 dark:border-neutral-700`},Ye={key:0,class:`mt-3`},Xe={key:1,class:`border border-amber-200 rounded-lg bg-amber-50 p-3 dark:border-amber-800 dark:bg-amber-900/20`},Ze=50;var O=ue({__name:`hearing`,setup(ue){let{t:T}=n(),E=e(),{activeTranscriptionProvider:D,activeTranscriptionModel:ve}=c(E),O=t(),{configuredTranscriptionProvidersMetadata:k}=c(O),A=ae({constraints:{audio:!0}}),j=p(()=>A.audioInputs.value),M=x(A.audioInputs.value[0]?.deviceId||``),Qe=p(()=>({audio:{deviceId:{exact:M.value},autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0}})),{stream:N,stop:$e,start:et}=l({constraints:Qe,enabled:!1,autoSwitch:!1}),{startRecord:tt,stopRecord:nt,onStopRecord:rt}=r(N),{startAnalyzer:it,stopAnalyzer:at,onAnalyzerUpdate:ot,volumeLevel:st}=he(),{audioContext:P}=c(ee()),F=x(``),I=x(``),L=x(!1),R=x(!1),z=x(),B=x(),V=x(!1),H=x(25),U=x(50),W=x(),G=x(!1),K=x(!1),q=x(!0),J=x(0),Y=x(.5),X=x([]),Z=x([]),ct=x([]),lt=p(()=>Z.value.map(e=>{let t=URL.createObjectURL(e);return ct.value.push(()=>URL.revokeObjectURL(t)),t})),Q=x([]);async function ut(){if(!(G.value||K.value)){K.value=!0,I.value=``;try{let e=await ye({sampleRate:16e3,speechThreshold:Y.value,exitThreshold:Y.value*.3,minSilenceDurationMs:400});e.on(`speech-start`,()=>{V.value=!0,tt()}),e.on(`speech-end`,()=>{V.value=!1,nt()}),e.on(`debug`,({data:e})=>{e?.probability!==void 0&&(J.value=e.probability,X.value.push(e.probability),X.value.length>Ze&&X.value.shift())}),e.on(`status`,({type:e,message:t})=>{e===`error`&&(I.value=t)});let t=new _e(e,{minChunkSize:512,audioContextOptions:{sampleRate:16e3,latencyHint:`interactive`}});await t.initialize(ge),W.value=t,G.value=!0}catch(e){I.value=e instanceof Error?e.message:String(e),console.error(`Failed to load VAD model:`,e)}finally{K.value=!1}}}async function dt(){try{if(!M.value){console.warn(`No audio input device selected`);return}if(await $(),await et(),!N.value){console.warn(`No audio stream available`);return}rt(async e=>{if(e)try{if(e){Z.value.push(e);let t=await O.getProviderInstance(D.value);if(!t)throw Error(`Failed to initialize speech provider`);let n=ve.value,r=await E.transcription(t,n,new File([e],`recording.wav`),`json`);Q.value.push(r.text)}}catch(e){F.value=e instanceof Error?e.message:String(e),console.error(`Error generating transcription:`,F.value)}});let e=P.value.createMediaStreamSource(N.value),t=it(P.value);ot(e=>{(!q.value||!G.value)&&(V.value=e>H.value)}),z.value=P.value.createGain(),z.value.gain.value=R.value?U.value/100:0,t&&e.connect(t),R.value&&(e.connect(z.value),z.value.connect(P.value.destination)),q.value&&(await ut(),W.value&&await W.value.start(N.value))}catch(e){console.error(`Error setting up audio monitoring:`,e),I.value=e instanceof Error?e.message:String(e)}}async function $(){B.value&&(cancelAnimationFrame(B.value),B.value=void 0),W.value&&await W.value.stop(),N.value&&$e(),at(),z.value=void 0,V.value=!1,J.value=0,X.value=[]}async function ft(){!P.value||!z.value||(R.value?(z.value.gain.value=U.value/100,z.value.connect(P.value.destination)):(z.value.gain.value=0,z.value.disconnect()))}v(M,async()=>{L.value&&await dt()}),v(R,ft),v(U,()=>{z.value&&R.value&&(z.value.gain.value=U.value/100)}),v(j,()=>{!M.value&&j.value.length>0&&(M.value=j.value[0]?.deviceId)}),v(Y,()=>{W.value&&G.value});async function pt(){L.value?(await $(),L.value=!1):(await dt(),L.value=!0)}let mt=p(()=>{if(!q.value||!G.value)return V.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=J.value,t=Y.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`});return oe(()=>{A.ensurePermissions().then(()=>le()).then(()=>{j.value.length>0&&!M.value&&(M.value=j.value[0]?.deviceId)})}),de(()=>{$(),W.value&&W.value.dispose(),ct.value.forEach(e=>e())}),(e,t)=>{let n=se(`RouterLink`);return y(),g(`div`,be,[b(`div`,xe,[b(`div`,Se,[b(`div`,null,[_(S(ie),{modelValue:M.value,"onUpdate:modelValue":t[0]||=e=>M.value=e,label:`Audio Input Device`,description:`Select the audio input device for your hearing module.`,options:j.value.map(e=>({label:e.label||e.deviceId,value:e.deviceId})),placeholder:`Select an audio input device`},null,8,[`modelValue`,`options`])]),b(`div`,Ce,[b(`div`,null,[b(`h2`,we,w(S(T)(`settings.pages.providers.title`)),1),b(`div`,Te,[b(`span`,null,w(S(T)(`settings.pages.modules.hearing.sections.section.provider-model-selection.description`)),1)])]),b(`div`,Ee,[S(k).length>0?(y(),g(`fieldset`,De,[(y(!0),g(ce,null,C(S(k),e=>(y(),f(S(re),{id:e.id,key:e.id,modelValue:S(D),"onUpdate:modelValue":t[1]||=e=>fe(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))])):(y(),g(`div`,Oe,[_(n,{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(()=>t[7]||=[b(`div`,{"i-solar:warning-circle-line-duotone":``,class:`text-2xl text-amber-500 dark:text-amber-400`},null,-1),b(`div`,{class:`flex flex-col`},[b(`span`,{class:`font-medium`},`No Providers Configured`),b(`span`,{class:`text-sm text-neutral-400 dark:text-neutral-500`},`Click here to set up your Transcription providers`)],-1),b(`div`,{"i-solar:arrow-right-line-duotone":``,class:`ml-auto text-xl text-neutral-400 dark:text-neutral-500`},null,-1)]),_:1,__:[7]})]))])])])]),b(`div`,ke,[b(`div`,Ae,[b(`h2`,je,[b(`div`,Me,[_(S(o)),b(`div`,null,w(S(T)(`settings.pages.providers.provider.elevenlabs.playground.title`)),1)])]),_(S(ne),{class:`mb-4`,"w-full":``,onClick:pt},{default:h(()=>[pe(w(L.value?`Stop Monitoring`:`Start Monitoring`),1)]),_:1}),b(`div`,null,[(y(!0),g(ce,null,C(lt.value,(e,t)=>(y(),g(`div`,{key:t,class:`mb-2`},[b(`audio`,{src:e,controls:``,class:`w-full`},null,8,Ne),Q.value[t]?(y(),g(`div`,Pe,w(Q.value[t]),1)):m(``,!0)]))),128))]),b(`div`,Fe,[b(`div`,Ie,[b(`div`,Le,[_(S(s),{level:S(st),label:`Input Level`},null,8,[`level`]),q.value&&G.value?(y(),f(S(a),{key:0,value:J.value,threshold:Y.value,label:`Probability of Speech`,"below-label":`Silence`,"above-label":`Speech`,"threshold-label":`Detection threshold`},null,8,[`value`,`threshold`])):m(``,!0),q.value&&G.value?(y(),g(`div`,Re,[_(S(u),{modelValue:Y.value,"onUpdate:modelValue":t[2]||=e=>Y.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`])])):(y(),g(`div`,ze,[_(S(u),{modelValue:H.value,"onUpdate:modelValue":t[3]||=e=>H.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`])])),b(`div`,Be,[b(`div`,{class:me([`h-4 w-4 rounded-full transition-all duration-200`,mt.value])},null,2),b(`span`,Ve,w(V.value?`Speaking Detected`:`Silence`),1),b(`span`,He,w(q.value&&G.value?`Model Based`:`Volume Based`),1)]),b(`div`,Ue,[_(S(d),{modelValue:q.value,"onUpdate:modelValue":t[4]||=e=>q.value=e,label:`Model Based`,description:`Use AI models for more accurate speech detection`},null,8,[`modelValue`]),q.value?(y(),g(`div`,We,[K.value?(y(),g(`div`,Ge,t[8]||=[b(`div`,{class:`animate-spin text-sm`,"i-solar:spinner-line-duotone":``},null,-1),b(`span`,{class:`text-sm`},`Loading...`,-1)])):I.value?(y(),f(S(te),{key:1,title:`Inference error`,error:I.value},null,8,[`error`])):G.value?(y(),g(`div`,Ke,[t[9]||=b(`div`,{class:`text-sm`,"i-solar:check-circle-bold-duotone":``},null,-1),t[10]||=b(`span`,{class:`text-sm`},`Activated`,-1),b(`span`,qe,` Probability: `+w((J.value*100).toFixed(1))+`% `,1)])):m(``,!0)])):m(``,!0)]),q.value&&G.value?(y(),f(S(i),{key:3,history:X.value,"current-value":J.value,threshold:Y.value,"is-active":V.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`])):m(``,!0)]),L.value?(y(),g(`div`,Je,[_(S(d),{modelValue:R.value,"onUpdate:modelValue":t[5]||=e=>R.value=e,label:`Monitor Audio (Listen)`,description:`Enable audio playback monitoring (like OBS). Be careful of feedback!`},null,8,[`modelValue`]),R.value?(y(),g(`div`,Ye,[_(S(u),{modelValue:U.value,"onUpdate:modelValue":t[6]||=e=>U.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`])])):m(``,!0)])):m(``,!0),R.value?(y(),g(`div`,Xe,t[11]||=[b(`div`,{class:`flex items-center gap-2 text-amber-700 dark:text-amber-300`},[b(`div`,{class:`text-sm`,"i-solar:warning-circle-bold-duotone":``}),b(`span`,{class:`text-sm font-medium`},`Audio feedback warning`)],-1),b(`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)])):m(``,!0)])])])])])}}});typeof D==`function`&&D(O);var k=O;export{k as default}; \ No newline at end of file diff --git a/assets/home-_FSVNe9h.js b/assets/home-_FSVNe9h.js deleted file mode 100644 index ebe8414d62567fa0255a33be04df2679e48358a2..0000000000000000000000000000000000000000 --- a/assets/home-_FSVNe9h.js +++ /dev/null @@ -1 +0,0 @@ -import{aQ as e,bA as t,bB as n,bP as r,bS as i,bU as a,b_ as o}from"./index-BFym949y.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=r({__name:`home`,setup(r){return(r,l)=>(t(),i(`div`,s,[n(`div`,c,[a(o(e))])]))}}),u=l;export{u as default}; \ No newline at end of file diff --git a/assets/home-kypUX7iO.js b/assets/home-kypUX7iO.js new file mode 100644 index 0000000000000000000000000000000000000000..18385fd9f4d8f9cebf39c19f13d7191264f89ee8 --- /dev/null +++ b/assets/home-kypUX7iO.js @@ -0,0 +1 @@ +import{aQ as e,bJ as t,bM as n,bO as r,bT as i,bU as a,b_ as o}from"./index-J3uhnpYL.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=t({__name:`home`,setup(t){return(t,l)=>(i(),n(`div`,s,[a(`div`,c,[r(o(e))])]))}}),u=l;export{u as default}; \ No newline at end of file diff --git a/assets/icon-animation-ChTUnIeG.js b/assets/icon-animation-kCs3SNq8.js similarity index 64% rename from assets/icon-animation-ChTUnIeG.js rename to assets/icon-animation-kCs3SNq8.js index 2377f8ed2cf9ce6640e2f88ade2f2047f97061cf..59726180b825f3178812dc62f6923e838784bb37 100644 --- a/assets/icon-animation-ChTUnIeG.js +++ b/assets/icon-animation-kCs3SNq8.js @@ -1 +1 @@ -import{B as e,bK as t,bN as n,bT as r,bX as i}from"./index-BFym949y.js";function a(a){let o=i(!1),s=i(!1),c=i(a),l=e(),u=n(()=>s.value&&!l.disableTransitions&&l.usePageSpecificTransitions);return t(()=>{s.value=!0,requestAnimationFrame(()=>{o.value=!0})}),r(()=>{o.value=!1,s.value=!1}),{iconAnimationStarted:o,showIconAnimation:u,animationIcon:c}}export{a as b}; \ No newline at end of file +import{B as e,bE as t,bH as n,bN as r,bX as i}from"./index-J3uhnpYL.js";function a(a){let o=i(!1),s=i(!1),c=i(a),l=e(),u=n(()=>s.value&&!l.disableTransitions&&l.usePageSpecificTransitions);return t(()=>{s.value=!0,requestAnimationFrame(()=>{o.value=!0})}),r(()=>{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-ByPuRM0v.js b/assets/image-ByPuRM0v.js new file mode 100644 index 0000000000000000000000000000000000000000..040a9b30d9d449240c8eb88f7895562b307e180e --- /dev/null +++ b/assets/image-ByPuRM0v.js @@ -0,0 +1,2 @@ +import{aL as e,b4 as t,bJ as n,bK as r,bM as i,bT as a,bU as o,bX as s,b_ as c,c0 as l}from"./index-J3uhnpYL.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=n({__name:`image`,setup(e){let n=s(),m=s(``),{copy:h}=t({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,r=t.files?.[0];if(r){n.value=r;let e=await g(r);m.value=e}}return(e,t)=>(a(),i(`div`,null,[o(`label`,u,[o(`input`,{type:`file`,accept:`image/*`,hidden:``,onChange:_},null,32),t[1]||=o(`span`,null,`Upload Image`,-1)]),m.value?(a(),i(`div`,d,[o(`img`,{src:m.value,alt:`Uploaded Image`,"w-100":``},null,8,f),o(`pre`,p,` `+l(m.value)+` + `,1),o(`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-CG6IRKrT.js b/assets/image-CG6IRKrT.js deleted file mode 100644 index de54393db03d606c0e6b68ace7a5a3c171e560c5..0000000000000000000000000000000000000000 --- a/assets/image-CG6IRKrT.js +++ /dev/null @@ -1,2 +0,0 @@ -import{aL as e,b1 as t,bA as n,bB as r,bP as i,bQ as a,bS as o,bX as s,b_ as c,c1 as l}from"./index-BFym949y.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}=t({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,t)=>(n(),o(`div`,null,[r(`label`,u,[r(`input`,{type:`file`,accept:`image/*`,hidden:``,onChange:_},null,32),t[1]||=r(`span`,null,`Upload Image`,-1)]),m.value?(n(),o(`div`,d,[r(`img`,{src:m.value,alt:`Uploaded Image`,"w-100":``},null,8,f),r(`pre`,p,` `+l(m.value)+` - `,1),r(`button`,{bg:`primary-500`,text:`white`,"mt-4":``,"rounded-lg":``,"px-4":``,"py-2":``,onClick:t[0]||=()=>c(h)()},` Copy Data URL `)])):a(``,!0)]))}}),h=e(m,[[`__scopeId`,`data-v-7edd53e6`]]);export{h as default}; \ No newline at end of file diff --git a/assets/import-url-browser-CzbE4_30.js b/assets/import-url-browser-BymzNjKM.js similarity index 100% rename from assets/import-url-browser-CzbE4_30.js rename to assets/import-url-browser-BymzNjKM.js diff --git a/assets/import-url-browser-CkMcxt8_.js b/assets/import-url-browser-CkMcxt8_.js deleted file mode 100644 index 8a530c8f6b70b195c7f3830c9f62aa4c1d8f236f..0000000000000000000000000000000000000000 --- a/assets/import-url-browser-CkMcxt8_.js +++ /dev/null @@ -1 +0,0 @@ -import{b as e}from"./import-url-browser-CzbE4_30.js";import"./duckdb-mvp-1eM9E9sB.js";export{e as getImportUrlBundles}; \ No newline at end of file diff --git a/assets/import-url-browser-iGhQiEJs.js b/assets/import-url-browser-iGhQiEJs.js new file mode 100644 index 0000000000000000000000000000000000000000..6eb89e57c38a9f79ca907b51c04e200f8f8f596c --- /dev/null +++ b/assets/import-url-browser-iGhQiEJs.js @@ -0,0 +1 @@ +import{b as e}from"./import-url-browser-BymzNjKM.js";import"./duckdb-mvp-1eM9E9sB.js";export{e as getImportUrlBundles}; \ No newline at end of file diff --git a/assets/import-url-node-DmUEwuAI.js b/assets/import-url-node-DHMEAMi-.js similarity index 100% rename from assets/import-url-node-DmUEwuAI.js rename to assets/import-url-node-DHMEAMi-.js diff --git a/assets/index-BT-tiZao.css b/assets/index-BT-tiZao.css new file mode 100644 index 0000000000000000000000000000000000000000..d24d91bb544065a192c9f032079cc2408481d007 --- /dev/null +++ b/assets/index-BT-tiZao.css @@ -0,0 +1 @@ +.volumed[data-v-d8ce56aa]{transform-style:preserve-3d;width:fit-content;height:fit-content}.test-dummy-flat[data-v-28f8c660]{display:inline-block;position:relative}.test-dummy-flat .marker[data-v-28f8c660]{background:conic-gradient(#ffeb3b 0deg 90deg,#000 90deg 180deg,#ffeb3b 180deg 270deg,#000 270deg 360deg);border-radius:50%;position:absolute;inset:0;box-shadow:0 4px 12px #b9b9b933}.dark .test-dummy-flat .marker[data-v-28f8c660]{box-shadow:0 4px 12px #0003}.fade-enter-active[data-v-6b4f300d],.fade-leave-active[data-v-6b4f300d]{transition:opacity .2s}.fade-enter-from[data-v-6b4f300d],.fade-leave-to[data-v-6b4f300d]{opacity:0}.fade-enter-to[data-v-6b4f300d],.fade-leave-from[data-v-6b4f300d]{opacity:1}.form_input-range[data-v-3a236ac7]{--height:2em;min-height:var(--height);appearance:none;--thumb-width:4px;--thumb-height:var(--height);--thumb-box-shadow:0 0 0px #e6e6e6;--thumb-border:none;--thumb-border-radius:999px;--thumb-background:oklch(80% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0));--thumb-background-hover:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0));--thumb-background-active:oklch(70% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0));--track-height:calc(var(--height) - var(--track-value-padding)*2);--track-box-shadow:none;--track-border:solid 2px #eee;--track-border-radius:6px;--track-background:#eee9;--track-background-hover:#eee9;--track-background-active:#eee9;--track-value-background:#fff;--track-value-background-hover:#fff;--track-value-background-active:#fff;--track-value-padding:2px;background:0 0;border-radius:4px;transition:background-color .2s}.dark .form_input-range[data-v-3a236ac7]{--thumb-background:oklch(70% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0));--thumb-background-hover:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0));--thumb-background-active:oklch(80% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0));--track-border:solid 2px #2c2c2c;--track-background:#2c2c2cb3;--track-background-hover:#2c2c2cb3;--track-background-active:#2c2c2cb3;--track-value-background:#a4a4a4;--track-value-background-hover:#a4a4a4;--track-value-background-active:#a4a4a4}.form_input-range.slider-progress[data-v-3a236ac7]{--range:calc(var(--max) - var(--min));--ratio:calc((var(--value) - var(--min))/var(--range));--sx:calc(.5*0em + var(--ratio)*(100% - 0em))}.form_input-range[data-v-3a236ac7]:focus{outline:none}.form_input-range[data-v-3a236ac7]::-webkit-slider-thumb{appearance:none;width:var(--thumb-width);height:var(--thumb-height);border-radius:var(--thumb-border-radius);background:var(--thumb-background);border:var(--thumb-border);box-shadow:var(--thumb-box-shadow);margin-top:calc(var(--track-height)*.5 - var(--thumb-height)*.5 - 2px);margin-left:calc(0 - var(--track-value-padding));cursor:col-resize;transition:background .2s ease-in-out,box-shadow .2s ease-in-out,border-color .2s ease-in-out,transform .2s cubic-bezier(.165,.84,.44,1),width .2s cubic-bezier(.165,.84,.44,1)}.form_input-range[data-v-3a236ac7]::-webkit-slider-runnable-track{height:var(--track-height);border:var(--track-border);border-radius:var(--track-border-radius);background:var(--track-background);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);box-shadow:var(--track-box-shadow);cursor:col-resize;transition:box-shadow .2s ease-in-out,border-color .2s ease-in-out;position:relative}.form_input-range[data-v-3a236ac7]::-webkit-slider-thumb:hover{background:var(--thumb-background-hover);width:calc(var(--thumb-width)*1.6);transform:scaleY(1.2)}.form_input-range[data-v-3a236ac7]:hover::-webkit-slider-runnable-track{background:var(--track-background-hover)}.form_input-range[data-v-3a236ac7]::-webkit-slider-thumb:active{background:var(--thumb-background-active)}.form_input-range[data-v-3a236ac7]:active::-webkit-slider-runnable-track{background:var(--track-background-active)}.form_input-range.slider-progress[data-v-3a236ac7]::-webkit-slider-runnable-track{margin-right:calc(0 - var(--track-value-padding));background:linear-gradient(var(--track-value-background),var(--track-value-background))0/var(--sx)100% no-repeat,var(--track-background)}.form_input-range.slider-progress[data-v-3a236ac7]:hover::-webkit-slider-runnable-track{background:linear-gradient(var(--track-value-background-hover),var(--track-value-background-hover))0/var(--sx)100% no-repeat,var(--track-background-hover)}.form_input-range.slider-progress[data-v-3a236ac7]:active::-webkit-slider-runnable-track{background:linear-gradient(var(--track-value-background-active),var(--track-value-background-active))0/var(--sx)100% no-repeat,var(--track-background-active)}.form_input-range[data-v-3a236ac7]::-moz-range-thumb{width:var(--thumb-width);height:var(--thumb-height);border-radius:var(--thumb-border-radius);background:var(--thumb-background);box-shadow:var(--thumb-box-shadow);cursor:col-resize;margin-left:calc(0 - var(--track-value-padding));border:none;transition:background .2s ease-in-out,box-shadow .2s ease-in-out,border-color .2s ease-in-out,transform .2s cubic-bezier(.165,.84,.44,1),width .2s cubic-bezier(.165,.84,.44,1)}.form_input-range[data-v-3a236ac7]::-moz-range-track{height:var(--track-height);border:var(--track-border);border-radius:var(--track-border-radius);background:var(--track-background);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);box-shadow:var(--track-box-shadow);cursor:col-resize;width:calc(100% - var(--track-value-padding)*2)}.form_input-range[data-v-3a236ac7]::-moz-range-thumb:hover{background:var(--thumb-background-hover);width:calc(var(--thumb-width)*1.6);transform:scaleY(1.2)}.form_input-range[data-v-3a236ac7]:hover::-moz-range-track{background:var(--track-background-hover)}.form_input-range[data-v-3a236ac7]::-moz-range-thumb:active{background:var(--thumb-background-active)}.form_input-range[data-v-3a236ac7]:active::-moz-range-track{background:var(--track-background-active)}.form_input-range.slider-progress[data-v-3a236ac7]::-moz-range-track{background:linear-gradient(var(--track-value-background),var(--track-value-background))0/var(--sx)100% no-repeat,var(--track-background)}.form_input-range.slider-progress[data-v-3a236ac7]:hover::-moz-range-track{background:linear-gradient(var(--track-value-background-hover),var(--track-value-background-hover))0/var(--sx)100% no-repeat,var(--track-background-hover)}.form_input-range.slider-progress[data-v-3a236ac7]:active::-moz-range-track{background:linear-gradient(var(--track-value-background-active),var(--track-value-background-active))0/var(--sx)100% no-repeat,var(--track-background-active)}.form_input-range[data-v-3a236ac7]::-ms-fill-upper{background:0 0;border-color:#0000}.form_input-range[data-v-3a236ac7]::-ms-fill-lower{background:0 0;border-color:#0000}.form_input-range[data-v-3a236ac7]::-ms-thumb{width:var(--thumb-width);height:var(--thumb-height);border-radius:var(--thumb-border-radius);background:var(--thumb-background);border:var(--thumb-border);box-shadow:var(--thumb-box-shadow);margin-top:0;margin-left:calc(0 - var(--track-value-padding));box-sizing:border-box;cursor:col-resize;transition:background .2s ease-in-out,box-shadow .2s ease-in-out,border-color .2s ease-in-out,transform .2s cubic-bezier(.165,.84,.44,1),width .2s cubic-bezier(.165,.84,.44,1)}.form_input-range[data-v-3a236ac7]::-ms-track{height:var(--track-height);border-radius:var(--track-border-radius);background:var(--track-background);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);border:var(--track-border);box-shadow:var(--track-box-shadow);box-sizing:border-box;cursor:col-resize}.form_input-range[data-v-3a236ac7]::-ms-thumb:hover{background:var(--thumb-background-hover);width:calc(var(--thumb-width)*1.6);transform:scaleY(1.2)}.form_input-range[data-v-3a236ac7]:hover::-ms-track{background:var(--track-background-hover)}.form_input-range[data-v-3a236ac7]::-ms-thumb:active{background:var(--thumb-background-active)}.form_input-range[data-v-3a236ac7]:active::-ms-track{background:var(--track-background-active)}.form_input-range.slider-progress[data-v-3a236ac7]::-ms-fill-lower{height:var(--track-height);border-radius:var(--track-border-radius)0 0 var(--track-border-radius);background:var(--track-value-background);margin:0;margin-left:calc(var(--track-value-padding));margin-right:calc(0 - var(--track-value-padding));border:none;border-right-width:0}.form_input-range.slider-progress[data-v-3a236ac7]:hover::-ms-fill-lower{background:var(--track-value-background-hover)}.form_input-range.slider-progress[data-v-3a236ac7]:active::-ms-fill-lower{background:var(--track-value-background-active)}.color-hue-range[data-v-3d01d2fa]{appearance:none;background:linear-gradient(90deg,#ffb2cb,#ffba76,#bedf0d,#00efd2,#90d7ff,#d8bfff,#ffb2cb);background:linear-gradient(90deg,lab(80.0841% 65.3995 .860357),lab(81.7178% 42.879 86.4545),lab(84.2289% -27.648 80.2367),lab(85.1086% -71.1664 -.472653),lab(82.2823% -19.2763 -62.1951),lab(79.7314% 41.9269 -62.2558),lab(80.0841% 65.3994 .860381));border-radius:.5rem;height:2.5rem}.color-hue-range[data-v-3d01d2fa]::-webkit-slider-thumb{cursor:pointer;cursor:col-resize;appearance:none;--un-border-opacity:1;border-width:2px;border-color:rgb(115 115 115/var(--un-border-opacity));--un-bg-opacity:1;background-color:rgb(82 82 82/var(--un-bg-opacity));background-color:rgb(38 38 38/var(--un-bg-opacity));--un-shadow:var(--un-shadow-inset)0 10px 15px -3px var(--un-shadow-color,#0000001a),var(--un-shadow-inset)0 4px 6px -4px var(--un-shadow-color,#0000001a);width:.25rem;height:3rem;box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow);border-radius:.375rem;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,transform,width,height;transition-duration:.2s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.color-hue-range[data-v-3d01d2fa]::-webkit-slider-thumb:hover{width:.5rem;height:3.25rem}.dark .color-hue-range[data-v-3d01d2fa]::-webkit-slider-thumb{cursor:pointer;cursor:col-resize;appearance:none;--un-border-opacity:1;border-width:2px;border-color:rgb(255 255 255/var(--un-border-opacity));--un-bg-opacity:1;background-color:rgb(245 245 245/var(--un-bg-opacity));background-color:rgb(212 212 212/var(--un-bg-opacity));--un-shadow:var(--un-shadow-inset)0 4px 6px -1px var(--un-shadow-color,#0000001a),var(--un-shadow-inset)0 2px 4px -2px var(--un-shadow-color,#0000001a);width:.25rem;height:3rem;box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow);border-radius:.375rem;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,transform,width,height;transition-duration:.2s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.dark .color-hue-range[data-v-3d01d2fa]::-webkit-slider-thumb:hover{width:.5rem;height:3.25rem}.color-hue-range[data-v-3d01d2fa]::-moz-range-thumb{cursor:pointer;cursor:col-resize;appearance:none;--un-border-opacity:1;border-width:2px;border-color:rgb(115 115 115/var(--un-border-opacity));--un-bg-opacity:1;background-color:rgb(82 82 82/var(--un-bg-opacity));background-color:rgb(38 38 38/var(--un-bg-opacity));--un-shadow:var(--un-shadow-inset)0 10px 15px -3px var(--un-shadow-color,#0000001a),var(--un-shadow-inset)0 4px 6px -4px var(--un-shadow-color,#0000001a);width:.25rem;height:3rem;box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow);border-radius:.375rem;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,transform,width,height;transition-duration:.2s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.color-hue-range[data-v-3d01d2fa]::-moz-range-thumb:hover{width:.5rem;height:3.25rem}.dark .color-hue-range[data-v-3d01d2fa]::-moz-range-thumb{cursor:pointer;cursor:col-resize;appearance:none;--un-border-opacity:1;border-width:2px;border-color:rgb(255 255 255/var(--un-border-opacity));--un-bg-opacity:1;background-color:rgb(245 245 245/var(--un-bg-opacity));background-color:rgb(212 212 212/var(--un-bg-opacity));--un-shadow:var(--un-shadow-inset)0 4px 6px -1px var(--un-shadow-color,#0000001a),var(--un-shadow-inset)0 2px 4px -2px var(--un-shadow-color,#0000001a);width:.25rem;height:3rem;box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow);border-radius:.375rem;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,transform,width,height;transition-duration:.2s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.dark .color-hue-range[data-v-3d01d2fa]::-moz-range-thumb:hover{width:.5rem;height:3.25rem}.form_input-round-range[data-v-ac8cc218]{--height:2em;min-height:var(--height);appearance:none;--thumb-width:var(--height);--thumb-height:var(--height);--thumb-box-shadow:none;--thumb-border:none;--thumb-border-radius:0px;--thumb-background:transparent;--track-height:calc(var(--height) - var(--track-value-padding)*2);--track-box-shadow:0 0 12px -2px #00000038;--track-border:none;--track-border-radius:10px;--track-background:#0006;--track-value-background:#fff;--track-value-padding:0px;background:0 0;border-radius:4px;transition:background-color .2s}[data-direction=vertical].form_input-round-range[data-v-ac8cc218]{transform:rotate(180deg)}.dark .form_input-round-range[data-v-ac8cc218]{--thumb-background:#eee;--track-border:none;--track-background:#636363b3;--track-box-shadow:0 0 12px -2px #00000038;--track-value-background:#eee}.form_input-round-range.slider-progress[data-v-ac8cc218]{--range:calc(var(--max) - var(--min));--ratio:calc((var(--value) - var(--min))/var(--range));--sx:calc(.5*0em + var(--ratio)*(100% - 0em))}.form_input-round-range[data-v-ac8cc218]:focus{outline:none}.form_input-round-range[data-v-ac8cc218]::-webkit-slider-thumb{appearance:none;width:var(--thumb-width);height:var(--thumb-height);border-radius:var(--thumb-border-radius);background:var(--thumb-background);border:var(--thumb-border);box-shadow:var(--thumb-box-shadow);margin-top:0;margin-left:calc(0 - var(--track-value-padding));cursor:col-resize;transition:background .2s ease-in-out,box-shadow .2s ease-in-out,border-color .2s ease-in-out,transform .2s cubic-bezier(.165,.84,.44,1),width .2s cubic-bezier(.165,.84,.44,1)}[data-direction=vertical][data-v-ac8cc218]::-webkit-slider-thumb{cursor:ns-resize}.form_input-round-range[data-v-ac8cc218]::-webkit-slider-runnable-track{height:var(--track-height);border:var(--track-border);border-radius:var(--track-border-radius);background:var(--track-background);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);box-shadow:var(--track-box-shadow);cursor:col-resize;transition:box-shadow .2s ease-in-out,border-color .2s ease-in-out;position:relative;overflow:hidden}[data-direction=vertical][data-v-ac8cc218]::-webkit-slider-runnable-track{cursor:ns-resize}.form_input-round-range.slider-progress[data-v-ac8cc218]::-webkit-slider-runnable-track{background:linear-gradient(var(--track-value-background),var(--track-value-background))0/var(--sx)100% no-repeat,var(--track-background)}[data-direction=vertical].form_input-round-range.slider-progress[data-v-ac8cc218]::-webkit-slider-runnable-track{background:linear-gradient(var(--track-value-background)var(--sx),var(--track-background)var(--sx))no-repeat}.form_input-round-range[data-v-ac8cc218]::-moz-range-thumb{width:var(--thumb-width);height:var(--thumb-height);border-radius:var(--thumb-border-radius);background:var(--thumb-background);box-shadow:var(--thumb-box-shadow);cursor:col-resize;margin-left:calc(0 - var(--track-value-padding));border:none;transition:background .2s ease-in-out,box-shadow .2s ease-in-out,border-color .2s ease-in-out,transform .2s cubic-bezier(.165,.84,.44,1),width .2s cubic-bezier(.165,.84,.44,1)}[data-direction=vertical][data-v-ac8cc218]::-moz-range-thumb{cursor:ns-resize}.form_input-round-range[data-v-ac8cc218]::-moz-range-track{height:var(--track-height);border:var(--track-border);border-radius:var(--track-border-radius);background:var(--track-background);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);box-shadow:var(--track-box-shadow);cursor:col-resize;width:calc(100% - var(--track-value-padding)*2);overflow:hidden}[data-direction=vertical][data-v-ac8cc218]::-moz-range-track{cursor:ns-resize}.form_input-round-range.slider-progress[data-v-ac8cc218]::-moz-range-track{background:linear-gradient(var(--track-value-background),var(--track-value-background))0/var(--sx)100% no-repeat,var(--track-background)}[data-direction=vertical].form_input-round-range.slider-progress[data-v-ac8cc218]::-moz-range-track{background:linear-gradient(var(--track-value-background)var(--sx),var(--track-background)var(--sx))no-repeat}.form_input-round-range[data-v-ac8cc218]::-ms-fill-upper{background:0 0;border-color:#0000}.form_input-round-range[data-v-ac8cc218]::-ms-fill-lower{background:0 0;border-color:#0000}.form_input-round-range[data-v-ac8cc218]::-ms-thumb{width:var(--thumb-width);height:var(--thumb-height);border-radius:var(--thumb-border-radius);background:var(--thumb-background);border:var(--thumb-border);box-shadow:var(--thumb-box-shadow);box-sizing:border-box;cursor:col-resize;transition:background .2s ease-in-out,box-shadow .2s ease-in-out,border-color .2s ease-in-out,transform .2s cubic-bezier(.165,.84,.44,1),width .2s cubic-bezier(.165,.84,.44,1)}[data-direction=vertical][data-v-ac8cc218]::-ms-thumb{cursor:ns-resize}.form_input-round-range[data-v-ac8cc218]::-ms-track{height:var(--track-height);border-radius:var(--track-border-radius);background:var(--track-background);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);border:var(--track-border);box-shadow:var(--track-box-shadow);box-sizing:border-box;cursor:col-resize;overflow:hidden}[data-direction=vertical][data-v-ac8cc218]::-ms-track{cursor:ns-resize}.form_input-round-range.slider-progress[data-v-ac8cc218]::-ms-fill-lower{height:var(--track-height);border-radius:var(--track-border-radius)0 0 var(--track-border-radius);background:var(--track-value-background);border:none;border-right-width:0;margin:0}.resize-observer[data-v-b329ee4c]{z-index:-1;pointer-events:none;opacity:0;background-color:#0000;border:none;width:100%;height:100%;display:block;position:absolute;top:0;left:0;overflow:hidden}.resize-observer[data-v-b329ee4c] object{pointer-events:none;z-index:-1;width:100%;height:100%;display:block;position:absolute;top:0;left:0;overflow:hidden}.v-popper__popper{z-index:10000;outline:none;top:0;left:0}.v-popper__arrow-container{display:none}.v-popper__inner{border:none!important}.menu-icon-item[data-v-d08788bb]{position:relative;overflow:hidden}.menu-icon-item[data-v-d08788bb]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),var(--un-gradient-to);--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape),var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));content:"";z-index:-1;opacity:0;width:25%;height:100%;transition:all .4s ease-in-out;position:absolute;inset:0;-webkit-mask-image:linear-gradient(120deg,#fff 30%,#0000 50%);mask-image:linear-gradient(120deg,#fff 30%,#0000 50%)}.dark .menu-icon-item[data-v-d08788bb]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),var(--un-gradient-to)}.menu-icon-item[data-v-d08788bb]:hover:before,.menu-icon-item._hover[data-v-d08788bb]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.2)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.1)var(--un-gradient-via-position),var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape),var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));opacity:1;width:85%}.dark .menu-icon-item[data-v-d08788bb]:hover:before,.dark .menu-icon-item._hover[data-v-d08788bb]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.2)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.1)var(--un-gradient-via-position),var(--un-gradient-to);--un-gradient-via-position:50%}.menu-icon-item[data-v-d08788bb]:after{background-image:radial-gradient(circle at 1px 1px,rgb(229 229 229/var(--un-background-opacity))1px,transparent 0);--un-background-opacity:.6;z-index:-2;content:"";background-size:10px 10px;width:100%;height:100%;transition:all .4s ease-in-out;position:absolute;inset:0;-webkit-mask-image:linear-gradient(165deg,#fff 30%,#0000 50%);mask-image:linear-gradient(165deg,#fff 30%,#0000 50%)}.menu-icon-item[data-v-d08788bb]:after:hover{background-image:radial-gradient(circle at 1px 1px,oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/var(--un-background-opacity))1px,transparent 0);--un-background-opacity:%alpha}.dark .menu-icon-item[data-v-d08788bb]:after{background-image:radial-gradient(circle at 1px 1px,rgb(64 64 64/var(--un-background-opacity))1px,transparent 0);--un-background-opacity:.25}.dark .menu-icon-item[data-v-d08788bb]:after:hover{background-image:radial-gradient(circle at 1px 1px,oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/var(--un-background-opacity))1px,transparent 0);--un-background-opacity:%alpha}.menu-icon-item-icon[data-v-d08788bb]{opacity:.5}.menu-icon-item:hover .menu-icon-item-title[data-v-d08788bb],.menu-icon-item._hover .menu-icon-item-title[data-v-d08788bb]{--un-text-opacity:1;color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity))}.menu-icon-item:hover .menu-icon-item-description[data-v-d08788bb],.menu-icon-item._hover .menu-icon-item-description[data-v-d08788bb]{--un-text-opacity:1;color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity));opacity:.8}.menu-icon-item:hover .menu-icon-item-icon[data-v-d08788bb],.menu-icon-item._hover .menu-icon-item-icon[data-v-d08788bb]{--un-text-opacity:1;color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity));scale:1.2}.dark .menu-icon-item:hover .menu-icon-item-title[data-v-d08788bb],.dark .menu-icon-item._hover .menu-icon-item-title[data-v-d08788bb]{--un-text-opacity:1;color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity))}.dark .menu-icon-item:hover .menu-icon-item-description[data-v-d08788bb],.dark .menu-icon-item._hover .menu-icon-item-description[data-v-d08788bb]{--un-text-opacity:1;color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity));opacity:.8}.dark .menu-icon-item:hover .menu-icon-item-icon[data-v-d08788bb],.dark .menu-icon-item._hover .menu-icon-item-icon[data-v-d08788bb]{--un-text-opacity:1;color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity))}.menu-icon-status-item[data-v-93a9757f]{position:relative;overflow:hidden}.menu-icon-status-item[data-v-93a9757f]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),var(--un-gradient-to);--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape),var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));content:"";z-index:0;opacity:0;width:25%;height:100%;transition:all .4s ease-in-out;position:absolute;inset:0;-webkit-mask-image:linear-gradient(120deg,#fff 100%);mask-image:linear-gradient(120deg,#fff 100%)}.dark .menu-icon-status-item[data-v-93a9757f]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),var(--un-gradient-to)}.menu-icon-status-item[data-v-93a9757f]:hover:before,.menu-icon-status-item._hover[data-v-93a9757f]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.2)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.1)var(--un-gradient-via-position),var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape),var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));opacity:1;width:50%}.dark .menu-icon-status-item[data-v-93a9757f]:hover:before,.dark .menu-icon-status-item._hover[data-v-93a9757f]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.2)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.1)var(--un-gradient-via-position),var(--un-gradient-to);--un-gradient-via-position:50%}.menu-icon-status-item-link[data-v-93a9757f]:after{background-image:radial-gradient(circle at 1px 1px,rgb(229 229 229/var(--un-background-opacity))1px,transparent 0);--un-background-opacity:.8;z-index:-2;content:"";background-size:10px 10px;width:100%;height:100%;transition:all .4s ease-in-out;position:absolute;inset:0;-webkit-mask-image:linear-gradient(165deg,#fff 30%,#0000 50%);mask-image:linear-gradient(165deg,#fff 30%,#0000 50%)}.menu-icon-status-item-link[data-v-93a9757f]:after:hover{background-image:radial-gradient(circle at 1px 1px,oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/var(--un-background-opacity))1px,transparent 0);--un-background-opacity:%alpha}.dark .menu-icon-status-item-link[data-v-93a9757f]:after{background-image:radial-gradient(circle at 1px 1px,rgb(64 64 64/var(--un-background-opacity))1px,transparent 0);--un-background-opacity:.4}.dark .menu-icon-status-item-link[data-v-93a9757f]:after:hover{background-image:radial-gradient(circle at 1px 1px,oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/var(--un-background-opacity))1px,transparent 0);--un-background-opacity:%alpha}.menu-icon-status-item-icon-color[data-v-93a9757f]{opacity:.5}.menu-icon-status-item:hover .menu-icon-status-item-title[data-v-93a9757f],.menu-icon-status-item._hover .menu-icon-status-item-title[data-v-93a9757f]{--un-text-opacity:1;color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity))}.menu-icon-status-item:hover .menu-icon-status-item-description[data-v-93a9757f],.menu-icon-status-item._hover .menu-icon-status-item-description[data-v-93a9757f]{--un-text-opacity:1;color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity));opacity:.8}.menu-icon-status-item:hover .menu-icon-status-item-icon[data-v-93a9757f],.menu-icon-status-item._hover .menu-icon-status-item-icon[data-v-93a9757f],.menu-icon-status-item:hover .menu-icon-status-item-icon-color[data-v-93a9757f],.menu-icon-status-item._hover .menu-icon-status-item-icon-color[data-v-93a9757f]{--un-text-opacity:1;color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity));scale:1.2}.dark .menu-icon-status-item:hover .menu-icon-status-item-title[data-v-93a9757f],.dark .menu-icon-status-item._hover .menu-icon-status-item-title[data-v-93a9757f]{--un-text-opacity:1;color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity))}.dark .menu-icon-status-item:hover .menu-icon-status-item-description[data-v-93a9757f],.dark .menu-icon-status-item._hover .menu-icon-status-item-description[data-v-93a9757f]{--un-text-opacity:1;color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity));opacity:.8}.dark .menu-icon-status-item:hover .menu-icon-status-item-icon[data-v-93a9757f],.dark .menu-icon-status-item._hover .menu-icon-status-item-icon[data-v-93a9757f],.dark .menu-icon-status-item:hover .menu-icon-status-item-icon-color[data-v-93a9757f],.dark .menu-icon-status-item._hover .menu-icon-status-item-icon-color[data-v-93a9757f]{--un-text-opacity:1;color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity))}.form_radio-card-detail[data-v-fb6236db]{position:relative;overflow:hidden}.form_radio-card-detail[data-v-fb6236db]:before{pointer-events:none;--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),var(--un-gradient-to);--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape),var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));content:"";z-index:0;opacity:0;width:25%;height:100%;transition:all .35s ease-in-out;position:absolute;inset:0;-webkit-mask-image:linear-gradient(120deg,#fff 100%);mask-image:linear-gradient(120deg,#fff 100%)}.dark .form_radio-card-detail[data-v-fb6236db]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),var(--un-gradient-to)}.form_radio-card-detail[data-v-fb6236db]:hover:before,.form_radio-card-detail._hover[data-v-fb6236db]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.2)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.1)var(--un-gradient-via-position),var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape),var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));opacity:1;width:85%}.dark .form_radio-card-detail[data-v-fb6236db]:hover:before,.dark .form_radio-card-detail._hover[data-v-fb6236db]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.2)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.1)var(--un-gradient-via-position),var(--un-gradient-to);--un-gradient-via-position:50%}.form_radio-card-detail-active[data-v-fb6236db]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.2)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.1)var(--un-gradient-via-position),var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape),var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));opacity:.5;width:85%}.dark .form_radio-card-detail-active[data-v-fb6236db]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.2)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.1)var(--un-gradient-via-position),var(--un-gradient-to);--un-gradient-via-position:50%}input[type=search][data-v-e9feb562]::-webkit-search-cancel-button{display:none}.form_radio-card-simple[data-v-880ce73f]{position:relative;overflow:hidden}.form_radio-card-simple[data-v-880ce73f]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),var(--un-gradient-to);--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape),var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));content:"";z-index:0;opacity:0;width:25%;height:100%;transition:all .35s ease-in-out;position:absolute;inset:0;-webkit-mask-image:linear-gradient(120deg,#fff 100%);mask-image:linear-gradient(120deg,#fff 100%)}.dark .form_radio-card-simple[data-v-880ce73f]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),var(--un-gradient-to)}.form_radio-card-simple[data-v-880ce73f]:hover:before,.form_radio-card-simple._hover[data-v-880ce73f]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.2)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.1)var(--un-gradient-via-position),var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape),var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));opacity:1;width:85%}.dark .form_radio-card-simple[data-v-880ce73f]:hover:before,.dark .form_radio-card-simple._hover[data-v-880ce73f]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.2)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.1)var(--un-gradient-via-position),var(--un-gradient-to);--un-gradient-via-position:50%}.form_radio-card-simple-active[data-v-880ce73f]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.2)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.1)var(--un-gradient-via-position),var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape),var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));opacity:.5;width:85%}.dark .form_radio-card-simple-active[data-v-880ce73f]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.2)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.1)var(--un-gradient-via-position),var(--un-gradient-to);--un-gradient-via-position:50%}.form_voice-card[data-v-fd4023c4]{flex-direction:column;display:flex;position:relative;overflow:hidden}.form_voice-card[data-v-fd4023c4]:before{pointer-events:none;--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),var(--un-gradient-to);--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape),var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));content:"";z-index:0;opacity:0;width:25%;height:100%;transition:all .35s ease-in-out;position:absolute;inset:0;-webkit-mask-image:linear-gradient(120deg,#fff 100%);mask-image:linear-gradient(120deg,#fff 100%)}.dark .form_voice-card[data-v-fd4023c4]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),var(--un-gradient-to)}.form_voice-card[data-v-fd4023c4]:hover:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.2)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.1)var(--un-gradient-via-position),var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape),var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));opacity:1;width:85%}.dark .form_voice-card[data-v-fd4023c4]:hover:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.2)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.1)var(--un-gradient-via-position),var(--un-gradient-to);--un-gradient-via-position:50%}input[type=search][data-v-43a4b028]::-webkit-search-cancel-button{display:none}.voice-card[data-v-43a4b028]{flex-direction:column;display:flex;position:relative;overflow:hidden}.voice-card[data-v-43a4b028]:before{pointer-events:none;--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),var(--un-gradient-to);--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape),var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));content:"";z-index:0;opacity:0;width:25%;height:100%;transition:all .35s ease-in-out;position:absolute;inset:0;-webkit-mask-image:linear-gradient(120deg,#fff 100%);mask-image:linear-gradient(120deg,#fff 100%)}.dark .voice-card[data-v-43a4b028]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),var(--un-gradient-to)}.voice-card[data-v-43a4b028]:hover:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.2)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.1)var(--un-gradient-via-position),var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape),var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));opacity:1;width:85%}.dark .voice-card[data-v-43a4b028]:hover:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.2)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.1)var(--un-gradient-via-position),var(--un-gradient-to);--un-gradient-via-position:50%}.skeleton[data-v-fa4a54cc]{transition:all .2s ease-in-out;position:relative}.skeleton-pulse[data-v-fa4a54cc]{animation:2s ease-in-out .5s infinite skeleton-pulse-fa4a54cc}@keyframes skeleton-pulse-fa4a54cc{0%{opacity:1}50%{opacity:.5}to{opacity:1}}.skeleton-wave[data-v-fa4a54cc]:after{content:"";border-radius:inherit;background:linear-gradient(90deg,#0000,#fff,#0000);animation:2s ease-in-out infinite skeleton-wave-fa4a54cc;position:absolute;inset:0;transform:translate(-100%)}.dark .skeleton-wave[data-v-fa4a54cc]:after{background:linear-gradient(90deg,#0000,#ffffff1a,#0000)}@keyframes skeleton-wave-fa4a54cc{0%{opacity:0;transform:translate(-100%)}60%{opacity:1;transform:translate(100%)}to{opacity:0;transform:translate(100%)}}.card-hover-effect[data-v-24a7a9d5]{transform-style:preserve-3d;transform-origin:50%;will-change:transform;transition:transform .3s cubic-bezier(.23,1,.32,1)}.card-hover-effect[data-v-24a7a9d5]:before,.card-hover-effect[data-v-24a7a9d5]:after{content:"";pointer-events:none;background-repeat:no-repeat;transition:all .33s;position:absolute;inset:0}.card-hover-effect[data-v-24a7a9d5]:before{background-position:var(--card-position-x)var(--card-position-y);background-size:300% 300%;background-image:linear-gradient(115deg,transparent 0%,rgba(var(--color-primary-500),calc(.3*var(--effect-intensity)))25%,transparent 47%,transparent 53%,rgba(var(--color-primary-600),calc(.3*var(--effect-intensity)))75%,transparent 100%);opacity:calc(.5*var(--effect-intensity));filter:brightness(.5)contrast();z-index:1;mix-blend-mode:color-dodge}.card-hover-effect[data-v-24a7a9d5]:after{background-position:var(--sparkle-position-x)var(--sparkle-position-y);background-size:160%;background-image:linear-gradient(125deg,rgba(var(--color-primary-500),calc(.3*var(--effect-intensity)))15%,rgba(var(--color-primary-400),calc(.25*var(--effect-intensity)))30%,rgba(var(--color-primary-300),calc(.2*var(--effect-intensity)))40%,rgba(var(--color-primary-200),calc(.1*var(--effect-intensity)))60%,rgba(var(--color-primary-400),calc(.25*var(--effect-intensity)))70%,rgba(var(--color-primary-500),calc(.3*var(--effect-intensity)))85%);background-blend-mode:overlay;opacity:calc(var(--sparkle-opacity)*var(--effect-intensity));filter:brightness()contrast();z-index:2;mix-blend-mode:color-dodge}.card-hover-effect[data-v-24a7a9d5]:hover:before{opacity:calc(.88*var(--effect-intensity));filter:brightness(.66)contrast(1.33)}.card-hover-effect[data-v-24a7a9d5]:hover:after{opacity:var(--effect-intensity);filter:brightness(1.1)contrast(1.2)}.slide-next-enter-active[data-v-6b45c8eb],.slide-next-leave-active[data-v-6b45c8eb]{transition:transform .2s ease-in-out,opacity .2s ease-in-out}.slide-next-enter-from[data-v-6b45c8eb]{opacity:0;transform:translate(100%)}.slide-next-enter-to[data-v-6b45c8eb],.slide-next-leave-from[data-v-6b45c8eb]{opacity:1;transform:translate(0)}.slide-next-leave-to[data-v-6b45c8eb]{opacity:0;transform:translate(-100%)}.slide-prev-enter-active[data-v-6b45c8eb],.slide-prev-leave-active[data-v-6b45c8eb]{transition:transform .2s ease-in-out,opacity .2s ease-in-out}.slide-prev-enter-from[data-v-6b45c8eb]{opacity:0;transform:translate(-100%)}.slide-prev-enter-to[data-v-6b45c8eb],.slide-prev-leave-from[data-v-6b45c8eb]{opacity:1;transform:translate(0)}.slide-prev-leave-to[data-v-6b45c8eb]{opacity:0;transform:translate(100%)}[data-sonner-toast=""] [data-content=""]{width:100%}.stage-transition-3[data-v-17464329]{--delay:0s;--sharpness:40%;position:fixed;inset:0;overflow:hidden}.stage-transition-3[data-v-17464329]:before,.stage-transition-3[data-v-17464329]:after{content:"";animation:1s cubic-bezier(.87,.05,.02,.97) both arrowIn-17464329,1s cubic-bezier(.87,.05,.02,.97) forwards arrowOut-17464329;position:absolute;inset:0}.stage-transition-3[data-v-17464329]:before{background-color:var(--stage-transition-3-overlay-color-2);animation-delay:calc(0s + var(--delay,0s)),calc(1.4s + var(--delay,0s))}.stage-transition-3[data-v-17464329]:after{background-color:var(--stage-transition-3-overlay-color-1);animation-delay:calc(.2s + var(--delay,0s)),calc(1.2s + var(--delay,0s))}@keyframes arrowIn-17464329{0%{clip-path:polygon(calc(var(--sharpness)*-1)0,calc(var(--sharpness)*-1)0,0 50%,calc(var(--sharpness)*-1)100%,calc(var(--sharpness)*-1)100%,0 50%)}to{clip-path:polygon(calc(var(--sharpness)*-1)0,100% 0,calc(100% + var(--sharpness))50%,100% 100%,calc(var(--sharpness)*-1)100%,0 50%)}}@keyframes arrowOut-17464329{0%{clip-path:polygon(calc(var(--sharpness)*-1)0,100% 0,calc(100% + var(--sharpness))50%,100% 100%,calc(var(--sharpness)*-1)100%,0 50%)}to{clip-path:polygon(100% 0,100% 0,calc(100% + var(--sharpness))50%,100% 100%,100% 100%,calc(100% + var(--sharpness))50%)}}.circle-expansion-transition[data-v-4624be9e]{pointer-events:none;width:150vmax;height:150vmax;position:fixed;top:calc(50% - 75vmax);left:calc(50% - 75vmax)}.circle-expansion-transition div[data-v-4624be9e]{border-radius:50%;width:100%;height:100%;position:absolute;top:0;left:0;transform:scale(0)}.circle-expansion-transition div[data-v-4624be9e]:first-child{background-color:var(--circle-expansion-color-1);animation:circleExpand-4624be9e var(--circle-expansion-duration)ease-in calc(var(--circle-expansion-delay) + 0s)forwards}.circle-expansion-transition div[data-v-4624be9e]:nth-child(2){background-color:var(--circle-expansion-color-2);animation:circleExpand-4624be9e var(--circle-expansion-duration)ease-in calc(var(--circle-expansion-delay) + .15s)forwards}.circle-expansion-transition div[data-v-4624be9e]:nth-child(3){background-color:var(--circle-expansion-color-3);animation:circleExpand-4624be9e var(--circle-expansion-duration)ease-in calc(var(--circle-expansion-delay) + .3s)forwards}.circle-expansion-transition div[data-v-4624be9e]:nth-child(4){background-color:var(--circle-expansion-color-4);animation:circleExpand-4624be9e var(--circle-expansion-duration)ease-in calc(var(--circle-expansion-delay) + .45s)forwards}@keyframes circleExpand-4624be9e{0%{transform:scale(0)}to{transform:scale(1)}}.fantasy-fall-transition[data-v-826171f5]{position:fixed;inset:0;overflow:hidden}.fantasy-fall-up[data-v-826171f5]:before{content:"";background-color:var(--fantasy-fall-color);border-bottom-left-radius:var(--fantasy-fall-radius-sm);border-bottom-right-radius:var(--fantasy-fall-radius-sm);width:100%;height:100%;animation:fantasy-fall-up var(--fantasy-fall-duration)ease-out var(--fantasy-fall-delay)forwards;display:block;position:absolute;top:0;left:0;transform:translateY(-100%)}.fantasy-fall-down[data-v-826171f5]:before{content:"";background-color:var(--fantasy-fall-color);border-top-left-radius:var(--fantasy-fall-radius-sm);border-top-right-radius:var(--fantasy-fall-radius-sm);width:100%;height:100%;animation:fantasy-fall-down var(--fantasy-fall-duration)ease-out var(--fantasy-fall-delay)forwards;display:block;position:absolute;top:0;left:0;transform:translateY(100%)}.fantasy-fall-left[data-v-826171f5]:before{content:"";background-color:var(--fantasy-fall-color);border-top-right-radius:var(--fantasy-fall-radius-sm);border-bottom-right-radius:var(--fantasy-fall-radius-sm);width:100%;height:100%;animation:fantasy-fall-left var(--fantasy-fall-duration)ease-out var(--fantasy-fall-delay)forwards;display:block;position:absolute;top:0;left:0;transform:translate(-100%)}.fantasy-fall-right[data-v-826171f5]:before{content:"";background-color:var(--fantasy-fall-color);border-top-left-radius:var(--fantasy-fall-radius-sm);border-bottom-left-radius:var(--fantasy-fall-radius-sm);width:100%;height:100%;animation:fantasy-fall-right var(--fantasy-fall-duration)ease-out var(--fantasy-fall-delay)forwards;display:block;position:absolute;top:0;left:0;transform:translate(100%)}@media (min-width:768px){.fantasy-fall-up[data-v-826171f5]:before{border-bottom-left-radius:var(--fantasy-fall-radius-md);border-bottom-right-radius:var(--fantasy-fall-radius-md)}.fantasy-fall-down[data-v-826171f5]:before{border-top-left-radius:var(--fantasy-fall-radius-md);border-top-right-radius:var(--fantasy-fall-radius-md)}.fantasy-fall-left[data-v-826171f5]:before{border-top-right-radius:var(--fantasy-fall-radius-md);border-bottom-right-radius:var(--fantasy-fall-radius-md)}.fantasy-fall-right[data-v-826171f5]:before{border-top-left-radius:var(--fantasy-fall-radius-md);border-bottom-left-radius:var(--fantasy-fall-radius-md)}}@media (min-width:1024px){.fantasy-fall-up[data-v-826171f5]:before{border-bottom-left-radius:var(--fantasy-fall-radius-lg);border-bottom-right-radius:var(--fantasy-fall-radius-lg)}.fantasy-fall-down[data-v-826171f5]:before{border-top-left-radius:var(--fantasy-fall-radius-lg);border-top-right-radius:var(--fantasy-fall-radius-lg)}.fantasy-fall-left[data-v-826171f5]:before{border-top-right-radius:var(--fantasy-fall-radius-lg);border-bottom-right-radius:var(--fantasy-fall-radius-lg)}.fantasy-fall-right[data-v-826171f5]:before{border-top-left-radius:var(--fantasy-fall-radius-lg);border-bottom-left-radius:var(--fantasy-fall-radius-lg)}}@keyframes fantasy-fall-up{0%{transform:translateY(-100%)}50%{transform:translateY(0%)}to{border-bottom-right-radius:0%;border-bottom-left-radius:0%;transform:translateY(0%)}}@keyframes fantasy-fall-down{0%{transform:translateY(100%)}50%{transform:translateY(0%)}to{border-top-left-radius:0%;border-top-right-radius:0%;transform:translateY(0%)}}@keyframes fantasy-fall-left{0%{transform:translate(-100%)}50%{transform:translate(0%)}to{border-top-right-radius:0%;border-bottom-right-radius:0%;transform:translate(0%)}}@keyframes fantasy-fall-right{0%{transform:translate(100%)}50%{transform:translate(0%)}to{border-top-left-radius:0%;border-bottom-left-radius:0%;transform:translate(0%)}}.stage-transition-4[data-v-4221f976]{--delay:0s;grid-template-rows:repeat(5,1fr);display:grid;position:fixed;inset:0;overflow:hidden}.stage-transition-4__block[data-v-4221f976]{width:100%;height:100%;position:relative}.stage-transition-4__block[data-v-4221f976]:before,.stage-transition-4__block[data-v-4221f976]:after{content:"";animation:.8s cubic-bezier(.87,.05,.02,.97) both slideIn-4221f976,.8s cubic-bezier(.87,.05,.02,.97) forwards slideOut-4221f976;position:absolute;inset:0}.stage-transition-4__block[data-v-4221f976]:before{background-color:var(--stage-transition-4-overlay-color-2);animation-delay:calc(0s + var(--d,0s) + var(--delay,0s)),calc(1.6s + var(--d,0s) + var(--delay,0s))}.stage-transition-4__block[data-v-4221f976]:after{background-color:var(--stage-transition-4-overlay-color-1);animation-delay:calc(.3s + var(--d,0s) + var(--delay,0s)),calc(1.3s + var(--d,0s) + var(--delay,0s))}.stage-transition-4__block[data-v-4221f976]:first-child{--d:.1s}.stage-transition-4__block[data-v-4221f976]:nth-child(2){--d:.3s}.stage-transition-4__block[data-v-4221f976]:nth-child(3){--d:0s}.stage-transition-4__block[data-v-4221f976]:nth-child(4){--d:.4s}.stage-transition-4__block[data-v-4221f976]:nth-child(5){--d:.2s}@keyframes slideIn-4221f976{0%{transform:translate(-101%)}to{transform:translate(0)}}@keyframes slideOut-4221f976{0%{transform:translate(0)}to{transform:translate(101%)}}.stage-transition-1[data-v-81c0af14]{--delay:0s;position:fixed;inset:0;overflow:hidden}.stage-transition-1[data-v-81c0af14]:before,.stage-transition-1[data-v-81c0af14]:after{content:"";animation:1s cubic-bezier(.87,.05,.02,.97) both slideIn-81c0af14,1s cubic-bezier(.87,.05,.02,.97) forwards slideOut-81c0af14;position:absolute;inset:0}.stage-transition-1[data-v-81c0af14]:before{background-color:var(--stage-transition-1-overlay-color-2);animation-delay:calc(0s + var(--delay,0s)),calc(1.4s + var(--delay,0s))}.stage-transition-1[data-v-81c0af14]:after{background-color:var(--stage-transition-1-overlay-color-1);animation-delay:calc(.2s + var(--delay,0s)),calc(1.2s + var(--delay,0s))}@keyframes slideIn-81c0af14{0%{transform:translate(-101%)}to{transform:translate(0)}}@keyframes slideOut-81c0af14{0%{transform:translate(0)}to{transform:translate(101%)}}.stage-transition-2[data-v-9e8b66c8]{--delay:0s;--skew-x:100%;position:fixed;inset:0;overflow:hidden}.stage-transition-2[data-v-9e8b66c8]:before,.stage-transition-2[data-v-9e8b66c8]:after{content:"";animation:1s cubic-bezier(.87,.05,.02,.97) both maskIn-9e8b66c8,1s cubic-bezier(.87,.05,.02,.97) forwards maskOut-9e8b66c8;position:absolute;inset:0}.stage-transition-2[data-v-9e8b66c8]:before{background-color:var(--stage-transition-2-overlay-color-2);animation-delay:calc(0s + var(--delay,0s)),calc(1.4s + var(--delay,0s))}.stage-transition-2[data-v-9e8b66c8]:after{background-color:var(--stage-transition-2-overlay-color-1);animation-delay:calc(.2s + var(--delay,0s)),calc(1.2s + var(--delay,0s))}@keyframes maskIn-9e8b66c8{0%{clip-path:polygon(0 0,0 0,calc(var(--skew-x,0)*-1)100%,calc(var(--skew-x,0)*-1)100%)}to{clip-path:polygon(0 0,calc(100% + var(--skew-x,0))0,100% 100%,calc(var(--skew-x,0)*-1)100%)}}@keyframes maskOut-9e8b66c8{0%{clip-path:polygon(0 0,calc(100% + var(--skew-x,0))0,100% 100%,calc(var(--skew-x,0)*-1)100%)}to{clip-path:polygon(calc(100% + var(--skew-x,0))0,calc(100% + var(--skew-x,0))0,100% 100%,100% 100%)}}.rectangle-rotate-transition[data-v-45ea2f7f]{position:fixed;inset:0;overflow:hidden}.rectangle[data-v-45ea2f7f]{width:100%;height:100%;position:absolute}.rectangle div[data-v-45ea2f7f]{width:100vmax;height:100vmax;position:absolute;transform:scale(0)}.rectangle-rotate-1 div[data-v-45ea2f7f]{background-color:var(--rectangle-rotate-1-color);animation:expand-rotate-45ea2f7f var(--rectangle-rotate-duration)ease calc(var(--rectangle-rotate-delay) + 0s)forwards;top:-50vmax;left:-50vmax}.rectangle-rotate-2 div[data-v-45ea2f7f]{background-color:var(--rectangle-rotate-2-color);animation:expand-rotate-45ea2f7f var(--rectangle-rotate-duration)ease calc(var(--rectangle-rotate-delay) + var(--rectangle-rotate-stagger))forwards;bottom:-50vmax;right:-50vmax}.rectangle-rotate-3 div[data-v-45ea2f7f]{background-color:var(--rectangle-rotate-3-color);animation:expand-rotate-45ea2f7f var(--rectangle-rotate-duration)ease calc(var(--rectangle-rotate-delay) + calc(var(--rectangle-rotate-stagger)*2))forwards;top:calc(50% - 50vmax);left:calc(50% - 50vmax)}@keyframes expand-rotate-45ea2f7f{0%{transform:scale(0)rotate(0)}to{transform:scale(1)rotate(var(--rectangle-rotate-rotation))}}html[dir=ltr],[data-sonner-toaster][dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%,-35%)}html[dir=rtl],[data-sonner-toaster][dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%,-35%)}[data-sonner-toaster]{width:var(--width);--gray1:#fcfcfc;--gray2:#f8f8f8;--gray3:#f3f3f3;--gray4:#ededed;--gray5:#e8e8e8;--gray6:#e2e2e2;--gray7:#dbdbdb;--gray8:#c7c7c7;--gray9:#8f8f8f;--gray10:#858585;--gray11:#6f6f6f;--gray12:#171717;--border-radius:8px;box-sizing:border-box;z-index:999999999;outline:none;margin:0;padding:0;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;list-style:none;transition:transform .4s;position:fixed}[data-sonner-toaster][data-lifted=true]{transform:translateY(-8px)}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translate(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift)*var(--gap));z-index:var(--z-index);opacity:0;transform:var(--y);touch-action:none;box-sizing:border-box;overflow-wrap:anywhere;outline:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;position:absolute}[data-sonner-toast][data-styled=true]{background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);width:var(--width);align-items:center;gap:6px;padding:16px;font-size:13px;display:flex;box-shadow:0 4px 12px #0000001a}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}[data-sonner-toast][data-y-position=top]{--y:translateY(-100%);--lift:1;--lift-amount:calc(1*var(--gap));top:0}[data-sonner-toast][data-y-position=bottom]{--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift)*var(--gap));bottom:0}[data-sonner-toast][data-styled=true] [data-description]{color:#3f3f3f;font-weight:400;line-height:1.4}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{color:inherit;font-weight:500;line-height:1.5}[data-sonner-toast][data-styled=true] [data-icon]{width:16px;height:16px;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end);flex-shrink:0;justify-content:flex-start;align-items:center;display:flex;position:relative}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform-origin:50%;animation:.3s forwards sonner-fade-in;transform:scale(.8)}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{flex-direction:column;gap:2px;display:flex}[data-sonner-toast][data-styled=true] [data-button]{height:24px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);cursor:pointer;border:none;border-radius:4px;outline:none;flex-shrink:0;align-items:center;padding-left:8px;padding-right:8px;font-size:12px;font-weight:500;transition:opacity .4s,box-shadow .2s;display:flex}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px #0006}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:#00000014}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:#ffffff4d}[data-sonner-toast][data-styled=true] [data-close-button]{left:var(--toast-close-button-start);right:var(--toast-close-button-end);width:20px;height:20px;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);cursor:pointer;z-index:1;border-radius:50%;justify-content:center;align-items:center;padding:0;transition:opacity .1s,background .2s,border-color .2s;display:flex;position:absolute;top:0}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]:before{content:"";z-index:-1;height:100%;position:absolute;left:-100%;right:-100%}[data-sonner-toast][data-y-position=top][data-swiping=true]:before{bottom:50%;transform:scaleY(3)translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]:before{top:50%;transform:scaleY(3)translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]:before{content:"";position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]:after{content:"";height:calc(var(--gap) + 1px);width:100%;position:absolute;bottom:100%;left:0}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before)*.05 + 1;--y:translateY(calc(var(--lift-amount)*var(--toasts-before)))scale(calc(-1*var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift)*var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift)*-100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift)*var(--offset) + var(--lift)*-100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]:before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y)translateY(var(--swipe-amount-y,0px))translateX(var(--swipe-amount-x,0px));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y)translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y)translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y)translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y)translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y)translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y)translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y)translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y)translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%;position:fixed}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left)*-1)}[data-sonner-toaster] [data-sonner-toast]{width:calc(100% - var(--mobile-offset-left)*2);left:0;right:0}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:calc(var(--mobile-offset-bottom) + max(env(safe-area-inset-bottom),0px))}[data-sonner-toaster][data-y-position=top]{top:calc(var(--mobile-offset-top) + max(env(safe-area-inset-top),0px))}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:#ecfdf3;--success-border:#bffcd9;--success-text:#008a2e;--info-bg:#f0f8ff;--info-border:#dde7fd;--info-text:#0973dc;--warning-bg:#fffcf0;--warning-border:#fbeeb1;--warning-text:#dc7609;--error-bg:#fff0f0;--error-border:#ffe0e1;--error-text:#e60000}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:#333;--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:#1f1f1f;--normal-border:#333;--normal-border-hover:#404040;--normal-text:var(--gray1);--success-bg:#001f0f;--success-border:#003d1c;--success-text:#59f3a6;--info-bg:#000d1f;--info-border:#19233e;--info-text:#5896f3;--warning-bg:#1d1f00;--warning-border:#2e2e00;--warning-text:#f3cf58;--error-bg:#2d0607;--error-border:#4d0408;--error-text:#ff9ea1}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);z-index:10;position:absolute;inset:0}.sonner-loading-wrapper[data-visible=false]{transform-origin:50%;animation:.2s forwards sonner-fade-out}.sonner-spinner{height:var(--size);width:var(--size);position:relative;top:50%;left:50%}.sonner-loading-bar{background:var(--gray11);border-radius:6px;width:24%;height:8%;animation:1.2s linear infinite sonner-spin;position:absolute;top:-3.9%;left:-10%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg)translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg)translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg)translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg)translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg)translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg)translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg)translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg)translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg)translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg)translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg)translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg)translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{transform-origin:50%;transition:opacity .2s,transform .2s;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8)translate(-50%,-50%)}@property --chromatic-hue{syntax:"";inherits:true;initial-value:0}@keyframes hue-anim{0%{--chromatic-hue:0}to{--chromatic-hue:360}}.dynamic-hue{animation:10s linear infinite hue-anim}@font-face{font-family:cjkfonts AllSeto;font-style:normal;font-display:swap;src:url(/assets/cjkFonts_allseto_v1.11-ByBdljxl.ttf)format("truetype")}@font-face{font-family:Xiaolai SC;font-style:normal;font-display:swap;src:url(/assets/XiaolaiSC-Regular-SNWuh554.ttf)format("truetype")}*,:before,:after{box-sizing:border-box;border-style:solid;border-width:0;border-color:var(--un-default-border-color,#e5e7eb)}:before,:after{--un-content:""}html,:host{-webkit-text-size-adjust:100%;tab-size:4;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}body{line-height:inherit;margin:0}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-feature-settings:normal;font-variation-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-feature-settings:inherit;font-variation-settings:inherit;font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:#0000;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{margin:0;padding:0;list-style:none}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.slide-away-enter-active,.slide-away-leave-active{transition:transform .3s ease-in-out,opacity .3s ease-in-out}.slide-away-enter,.slide-away-leave-to{opacity:0;transform:translateY(-10px)}.slide-away-enter-from,.slide-away-leave{opacity:0;transform:translateY(10px)}.fade-slide-out-r-to-l-enter-active,.fade-slide-out-r-to-l-leave-active{transition:opacity .2s ease-in-out,transform .2s ease-in-out}.fade-slide-out-r-to-l-enter-from,.fade-slide-out-r-to-l-leave-to{opacity:0;transform:translate(10px)}.fade-slide-out-r-to-l-enter-to,.fade-slide-out-r-to-l-leave-from{opacity:1;transform:translate(0)}.fade-slide-out-l-to-r-enter-active,.fade-slide-out-l-to-r-leave-active{transition:opacity .2s ease-in-out,transform .2s ease-in-out}.fade-slide-out-l-to-r-enter-from,.fade-slide-out-l-to-r-leave-to{opacity:0;transform:translate(-10px)}.fade-slide-out-l-to-r-enter-to,.fade-slide-out-l-to-r-leave-from{opacity:1;transform:translate(0)}.fade-enter-active,.fade-leave-active{transition:opacity .2s ease-in-out}.fade-enter-from,.fade-leave-to{opacity:0}.fade-enter-to,.fade-leave-from{opacity:1}:root{--bg-color-light:#fff;--bg-color-dark:#121212;--bg-color:var(--bg-color-light)}*{touch-action:manipulation}html,body,#app{overscroll-behavior:none;height:100%;margin:0;padding:0}html{background:var(--bg-color);transition:all .3s ease-in-out}html.dark{--bg-color:var(--bg-color-dark);--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}#nprogress{pointer-events:none}#nprogress .bar{background:color-mix(in srgb,oklch(95% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + ${0}))70%,#636363);opacity:.75;z-index:1031;width:100%;height:2px;position:fixed;top:0;left:0}@supports (color:lab(0% 0 0)){#nprogress .bar{background:color-mix(in srgb,oklch(95% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + ${0}))70%,lab(42% 0 0))}}.dark #nprogress .bar{background:`color-mix(in srgb,oklch(95% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + ${0}))90%,#dedede)`}@supports (color:lab(0% 0 0)){.dark #nprogress .bar{background:`color-mix(in srgb,oklch(95% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + ${0}))90%,lab(88.4% 0 0))`}}@media (display-mode:standalone){#nprogress,#nprogress .bar{display:none}}@font-face{font-family:DM Sans;font-style:normal;font-display:swap;font-weight:100 1000;src:url(https://cdn.jsdelivr.net/fontsource/fonts/dm-sans:vf@latest/latin-wght-normal.woff2)format("woff2-variations");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:DM Sans;font-style:normal;font-display:swap;font-weight:100 1000;src:url(https://cdn.jsdelivr.net/fontsource/fonts/dm-sans:vf@latest/latin-ext-wght-normal.woff2)format("woff2-variations");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:DM Serif Display;font-style:normal;font-display:swap;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/dm-serif-display@latest/latin-400-normal.woff2)format("woff2");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:DM Serif Display;font-style:normal;font-display:swap;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/dm-serif-display@latest/latin-ext-400-normal.woff2)format("woff2");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:DM Mono;font-style:normal;font-display:swap;font-weight:300;src:url(https://cdn.jsdelivr.net/fontsource/fonts/dm-mono@latest/latin-300-normal.woff2)format("woff2");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:DM Mono;font-style:normal;font-display:swap;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/dm-mono@latest/latin-400-normal.woff2)format("woff2");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:DM Mono;font-style:normal;font-display:swap;font-weight:500;src:url(https://cdn.jsdelivr.net/fontsource/fonts/dm-mono@latest/latin-500-normal.woff2)format("woff2");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:DM Mono;font-style:normal;font-display:swap;font-weight:300;src:url(https://cdn.jsdelivr.net/fontsource/fonts/dm-mono@latest/latin-ext-300-normal.woff2)format("woff2");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:DM Mono;font-style:normal;font-display:swap;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/dm-mono@latest/latin-ext-400-normal.woff2)format("woff2");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:DM Mono;font-style:normal;font-display:swap;font-weight:500;src:url(https://cdn.jsdelivr.net/fontsource/fonts/dm-mono@latest/latin-ext-500-normal.woff2)format("woff2");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Kiwi Maru;font-style:normal;font-display:swap;font-weight:300;src:url(https://cdn.jsdelivr.net/fontsource/fonts/kiwi-maru@latest/cyrillic-300-normal.woff2)format("woff2");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:Kiwi Maru;font-style:normal;font-display:swap;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/kiwi-maru@latest/cyrillic-400-normal.woff2)format("woff2");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:Kiwi Maru;font-style:normal;font-display:swap;font-weight:500;src:url(https://cdn.jsdelivr.net/fontsource/fonts/kiwi-maru@latest/cyrillic-500-normal.woff2)format("woff2");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:Kiwi Maru;font-style:normal;font-display:swap;font-weight:300;src:url(https://cdn.jsdelivr.net/fontsource/fonts/kiwi-maru@latest/japanese-300-normal.woff2)format("woff2")}@font-face{font-family:Kiwi Maru;font-style:normal;font-display:swap;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/kiwi-maru@latest/japanese-400-normal.woff2)format("woff2")}@font-face{font-family:Kiwi Maru;font-style:normal;font-display:swap;font-weight:500;src:url(https://cdn.jsdelivr.net/fontsource/fonts/kiwi-maru@latest/japanese-500-normal.woff2)format("woff2")}@font-face{font-family:Kiwi Maru;font-style:normal;font-display:swap;font-weight:300;src:url(https://cdn.jsdelivr.net/fontsource/fonts/kiwi-maru@latest/latin-300-normal.woff2)format("woff2");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Kiwi Maru;font-style:normal;font-display:swap;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/kiwi-maru@latest/latin-400-normal.woff2)format("woff2");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Kiwi Maru;font-style:normal;font-display:swap;font-weight:500;src:url(https://cdn.jsdelivr.net/fontsource/fonts/kiwi-maru@latest/latin-500-normal.woff2)format("woff2");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Kiwi Maru;font-style:normal;font-display:swap;font-weight:300;src:url(https://cdn.jsdelivr.net/fontsource/fonts/kiwi-maru@latest/latin-ext-300-normal.woff2)format("woff2");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Kiwi Maru;font-style:normal;font-display:swap;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/kiwi-maru@latest/latin-ext-400-normal.woff2)format("woff2");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Kiwi Maru;font-style:normal;font-display:swap;font-weight:500;src:url(https://cdn.jsdelivr.net/fontsource/fonts/kiwi-maru@latest/latin-ext-500-normal.woff2)format("woff2");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Sniglet;font-style:normal;font-display:swap;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/sniglet@latest/latin-400-normal.woff2)format("woff2");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Sniglet;font-style:normal;font-display:swap;font-weight:800;src:url(https://cdn.jsdelivr.net/fontsource/fonts/sniglet@latest/latin-800-normal.woff2)format("woff2");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Sniglet;font-style:normal;font-display:swap;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/sniglet@latest/latin-ext-400-normal.woff2)format("woff2");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Sniglet;font-style:normal;font-display:swap;font-weight:800;src:url(https://cdn.jsdelivr.net/fontsource/fonts/sniglet@latest/latin-ext-800-normal.woff2)format("woff2");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Jura;font-style:normal;font-display:swap;font-weight:300 700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/jura:vf@latest/cyrillic-wght-normal.woff2)format("woff2-variations");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:Jura;font-style:normal;font-display:swap;font-weight:300 700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/jura:vf@latest/cyrillic-ext-wght-normal.woff2)format("woff2-variations");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Jura;font-style:normal;font-display:swap;font-weight:300 700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/jura:vf@latest/greek-wght-normal.woff2)format("woff2-variations");unicode-range:U+370-377,U+37A-37F,U+384-38A,U+38C,U+38E-3A1,U+3A3-3FF}@font-face{font-family:Jura;font-style:normal;font-display:swap;font-weight:300 700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/jura:vf@latest/greek-ext-wght-normal.woff2)format("woff2-variations");unicode-range:U+1F??}@font-face{font-family:Jura;font-style:normal;font-display:swap;font-weight:300 700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/jura:vf@latest/kayah-li-wght-normal.woff2)format("woff2-variations");unicode-range:U+200C-200D,U+2010,U+25CC,U+A900-A92F}@font-face{font-family:Jura;font-style:normal;font-display:swap;font-weight:300 700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/jura:vf@latest/latin-wght-normal.woff2)format("woff2-variations");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Jura;font-style:normal;font-display:swap;font-weight:300 700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/jura:vf@latest/latin-ext-wght-normal.woff2)format("woff2-variations");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Jura;font-style:normal;font-display:swap;font-weight:300 700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/jura:vf@latest/vietnamese-wght-normal.woff2)format("woff2-variations");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Gugi;font-style:normal;font-display:swap;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/gugi@latest/korean-400-normal.woff2)format("woff2")}@font-face{font-family:Gugi;font-style:normal;font-display:swap;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/gugi@latest/latin-400-normal.woff2)format("woff2");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Quicksand;font-style:normal;font-display:swap;font-weight:300 700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/quicksand:vf@latest/latin-wght-normal.woff2)format("woff2-variations");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Quicksand;font-style:normal;font-display:swap;font-weight:300 700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/quicksand:vf@latest/latin-ext-wght-normal.woff2)format("woff2-variations");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Quicksand;font-style:normal;font-display:swap;font-weight:300 700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/quicksand:vf@latest/vietnamese-wght-normal.woff2)format("woff2-variations");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Urbanist;font-style:normal;font-display:swap;font-weight:100 900;src:url(https://cdn.jsdelivr.net/fontsource/fonts/urbanist:vf@latest/latin-wght-normal.woff2)format("woff2-variations");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Urbanist;font-style:normal;font-display:swap;font-weight:100 900;src:url(https://cdn.jsdelivr.net/fontsource/fonts/urbanist:vf@latest/latin-ext-wght-normal.woff2)format("woff2-variations");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Comfortaa;font-style:normal;font-display:swap;font-weight:300 700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/comfortaa:vf@latest/cyrillic-wght-normal.woff2)format("woff2-variations");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:Comfortaa;font-style:normal;font-display:swap;font-weight:300 700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/comfortaa:vf@latest/cyrillic-ext-wght-normal.woff2)format("woff2-variations");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Comfortaa;font-style:normal;font-display:swap;font-weight:300 700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/comfortaa:vf@latest/greek-wght-normal.woff2)format("woff2-variations");unicode-range:U+370-377,U+37A-37F,U+384-38A,U+38C,U+38E-3A1,U+3A3-3FF}@font-face{font-family:Comfortaa;font-style:normal;font-display:swap;font-weight:300 700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/comfortaa:vf@latest/latin-wght-normal.woff2)format("woff2-variations");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Comfortaa;font-style:normal;font-display:swap;font-weight:300 700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/comfortaa:vf@latest/latin-ext-wght-normal.woff2)format("woff2-variations");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Comfortaa;font-style:normal;font-display:swap;font-weight:300 700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/comfortaa:vf@latest/vietnamese-wght-normal.woff2)format("woff2-variations");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:100;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/cyrillic-100-normal.woff2)format("woff2");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:300;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/cyrillic-300-normal.woff2)format("woff2");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/cyrillic-400-normal.woff2)format("woff2");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:500;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/cyrillic-500-normal.woff2)format("woff2");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/cyrillic-700-normal.woff2)format("woff2");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:800;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/cyrillic-800-normal.woff2)format("woff2");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:900;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/cyrillic-900-normal.woff2)format("woff2");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:100;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/cyrillic-ext-100-normal.woff2)format("woff2");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:300;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/cyrillic-ext-300-normal.woff2)format("woff2");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/cyrillic-ext-400-normal.woff2)format("woff2");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:500;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/cyrillic-ext-500-normal.woff2)format("woff2");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/cyrillic-ext-700-normal.woff2)format("woff2");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:800;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/cyrillic-ext-800-normal.woff2)format("woff2");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:900;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/cyrillic-ext-900-normal.woff2)format("woff2");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:100;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/greek-100-normal.woff2)format("woff2");unicode-range:U+370-377,U+37A-37F,U+384-38A,U+38C,U+38E-3A1,U+3A3-3FF}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:300;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/greek-300-normal.woff2)format("woff2");unicode-range:U+370-377,U+37A-37F,U+384-38A,U+38C,U+38E-3A1,U+3A3-3FF}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/greek-400-normal.woff2)format("woff2");unicode-range:U+370-377,U+37A-37F,U+384-38A,U+38C,U+38E-3A1,U+3A3-3FF}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:500;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/greek-500-normal.woff2)format("woff2");unicode-range:U+370-377,U+37A-37F,U+384-38A,U+38C,U+38E-3A1,U+3A3-3FF}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/greek-700-normal.woff2)format("woff2");unicode-range:U+370-377,U+37A-37F,U+384-38A,U+38C,U+38E-3A1,U+3A3-3FF}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:800;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/greek-800-normal.woff2)format("woff2");unicode-range:U+370-377,U+37A-37F,U+384-38A,U+38C,U+38E-3A1,U+3A3-3FF}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:900;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/greek-900-normal.woff2)format("woff2");unicode-range:U+370-377,U+37A-37F,U+384-38A,U+38C,U+38E-3A1,U+3A3-3FF}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:100;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/greek-ext-100-normal.woff2)format("woff2");unicode-range:U+1F??}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:300;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/greek-ext-300-normal.woff2)format("woff2");unicode-range:U+1F??}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/greek-ext-400-normal.woff2)format("woff2");unicode-range:U+1F??}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:500;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/greek-ext-500-normal.woff2)format("woff2");unicode-range:U+1F??}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/greek-ext-700-normal.woff2)format("woff2");unicode-range:U+1F??}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:800;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/greek-ext-800-normal.woff2)format("woff2");unicode-range:U+1F??}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:900;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/greek-ext-900-normal.woff2)format("woff2");unicode-range:U+1F??}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:100;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/hebrew-100-normal.woff2)format("woff2");unicode-range:U+307-308,U+590-5FF,U+200C-2010,U+20AA,U+25CC,U+FB1D-FB4F}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:300;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/hebrew-300-normal.woff2)format("woff2");unicode-range:U+307-308,U+590-5FF,U+200C-2010,U+20AA,U+25CC,U+FB1D-FB4F}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/hebrew-400-normal.woff2)format("woff2");unicode-range:U+307-308,U+590-5FF,U+200C-2010,U+20AA,U+25CC,U+FB1D-FB4F}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:500;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/hebrew-500-normal.woff2)format("woff2");unicode-range:U+307-308,U+590-5FF,U+200C-2010,U+20AA,U+25CC,U+FB1D-FB4F}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/hebrew-700-normal.woff2)format("woff2");unicode-range:U+307-308,U+590-5FF,U+200C-2010,U+20AA,U+25CC,U+FB1D-FB4F}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:800;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/hebrew-800-normal.woff2)format("woff2");unicode-range:U+307-308,U+590-5FF,U+200C-2010,U+20AA,U+25CC,U+FB1D-FB4F}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:900;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/hebrew-900-normal.woff2)format("woff2");unicode-range:U+307-308,U+590-5FF,U+200C-2010,U+20AA,U+25CC,U+FB1D-FB4F}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:100;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/japanese-100-normal.woff2)format("woff2")}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:300;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/japanese-300-normal.woff2)format("woff2")}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/japanese-400-normal.woff2)format("woff2")}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:500;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/japanese-500-normal.woff2)format("woff2")}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/japanese-700-normal.woff2)format("woff2")}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:800;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/japanese-800-normal.woff2)format("woff2")}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:900;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/japanese-900-normal.woff2)format("woff2")}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:100;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/latin-100-normal.woff2)format("woff2");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:300;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/latin-300-normal.woff2)format("woff2");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/latin-400-normal.woff2)format("woff2");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:500;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/latin-500-normal.woff2)format("woff2");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/latin-700-normal.woff2)format("woff2");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:800;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/latin-800-normal.woff2)format("woff2");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:900;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/latin-900-normal.woff2)format("woff2");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:100;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/latin-ext-100-normal.woff2)format("woff2");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:300;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/latin-ext-300-normal.woff2)format("woff2");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/latin-ext-400-normal.woff2)format("woff2");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:500;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/latin-ext-500-normal.woff2)format("woff2");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/latin-ext-700-normal.woff2)format("woff2");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:800;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/latin-ext-800-normal.woff2)format("woff2");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:900;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/latin-ext-900-normal.woff2)format("woff2");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:100;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/vietnamese-100-normal.woff2)format("woff2");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:300;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/vietnamese-300-normal.woff2)format("woff2");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/vietnamese-400-normal.woff2)format("woff2");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:500;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/vietnamese-500-normal.woff2)format("woff2");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/vietnamese-700-normal.woff2)format("woff2");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:800;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/vietnamese-800-normal.woff2)format("woff2");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:900;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/vietnamese-900-normal.woff2)format("woff2");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}*,:before,:after,::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 #0000;--un-ring-shadow:0 0 #0000;--un-shadow-inset: ;--un-shadow:0 0 #0000;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:#93c5fd80;--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }:root{--chromatic-hue:220.44;--chromatic-chroma:calc(.18 + (cos(var(--chromatic-hue)*3.14159/180)*.04));--chromatic-chroma-50:calc(var(--chromatic-chroma)*.3);--chromatic-chroma-100:calc(var(--chromatic-chroma)*.5);--chromatic-chroma-200:calc(var(--chromatic-chroma)*.6);--chromatic-chroma-300:calc(var(--chromatic-chroma)*.75);--chromatic-chroma-400:calc(var(--chromatic-chroma)*.85);--chromatic-chroma-500:var(--chromatic-chroma);--chromatic-chroma-600:calc(var(--chromatic-chroma)*1.15);--chromatic-chroma-700:calc(var(--chromatic-chroma)*1.1);--chromatic-chroma-800:calc(var(--chromatic-chroma)*.85);--chromatic-chroma-900:calc(var(--chromatic-chroma)*.7);--chromatic-chroma-950:calc(var(--chromatic-chroma)*.5)}.i-eos-icons\:three-dots-loading,[i-eos-icons\:three-dots-loading=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Ccircle cx='18' cy='12' r='0' fill='currentColor'%3E%3Canimate attributeName='r' begin='.67' calcMode='spline' dur='1.5s' keySplines='0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8' repeatCount='indefinite' values='0;2;0;0'/%3E%3C/circle%3E%3Ccircle cx='12' cy='12' r='0' fill='currentColor'%3E%3Canimate attributeName='r' begin='.33' calcMode='spline' dur='1.5s' keySplines='0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8' repeatCount='indefinite' values='0;2;0;0'/%3E%3C/circle%3E%3Ccircle cx='6' cy='12' r='0' fill='currentColor'%3E%3Canimate attributeName='r' begin='0' calcMode='spline' dur='1.5s' keySplines='0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8' repeatCount='indefinite' values='0;2;0;0'/%3E%3C/circle%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:alibabacloud{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M14.752 4.64h5.274C22.242 4.64 24 6.475 24 8.691V15.8a3.947 3.947 0 01-3.974 3.975h-5.274l1.299-1.835 3.822-1.222c.688-.23 1.146-.918 1.146-1.605v-5.81c0-.687-.458-1.375-1.146-1.605L16.05 6.475l-1.3-1.835zM2.98 15.111c0 .688.46 1.376 1.147 1.606l3.822 1.146 1.3 1.835H3.974A3.947 3.947 0 010 15.723V8.69c0-2.216 1.758-4.05 3.975-4.05h5.273L7.95 6.474 4.127 7.697c-.688.23-1.146.918-1.146 1.606v5.808z'/%3E%3Cpath d='M16.051 11.213H8.025v1.835h8.026v-1.835z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:anthropic{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M13.827 3.52h3.603L24 20h-3.603l-6.57-16.48zm-7.258 0h3.767L16.906 20h-3.674l-1.343-3.461H5.017l-1.344 3.46H0L6.57 3.522zm4.132 9.959L8.453 7.687 6.205 13.48H10.7z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:cloudflare{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cg%3E%3Cpath d='M16.493 17.4c.135-.52.08-.983-.161-1.338-.215-.328-.592-.519-1.05-.519l-8.663-.109a.148.148 0 01-.135-.082c-.027-.054-.027-.109-.027-.163.027-.082.108-.164.189-.164l8.744-.11c1.05-.054 2.153-.9 2.556-1.937l.511-1.31c.027-.055.027-.11.027-.164C17.92 8.91 15.66 7 12.942 7c-2.503 0-4.628 1.638-5.381 3.903a2.432 2.432 0 00-1.803-.491c-1.21.109-2.153 1.092-2.287 2.32-.027.328 0 .628.054.9C1.56 13.688 0 15.326 0 17.319c0 .19.027.355.027.545 0 .082.08.137.161.137h15.983c.08 0 .188-.055.215-.164l.107-.437'/%3E%3Cpath d='M19.238 11.75h-.242c-.054 0-.108.054-.135.109l-.35 1.2c-.134.52-.08.983.162 1.338.215.328.592.518 1.05.518l1.855.11c.054 0 .108.027.135.082.027.054.027.109.027.163-.027.082-.108.164-.188.164l-1.91.11c-1.05.054-2.153.9-2.557 1.937l-.134.355c-.027.055.026.137.107.137h6.592c.081 0 .162-.055.162-.137.107-.41.188-.846.188-1.31-.027-2.62-2.153-4.777-4.762-4.777'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:deepseek{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M23.748 4.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526 5.526 0 01-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365 11.365 0 00-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055 3.055 0 01-.465.137 9.597 9.597 0 00-2.883-.102c-1.885.21-3.39 1.102-4.497 2.623C.082 8.606-.231 10.684.152 12.85c.403 2.284 1.569 4.175 3.36 5.653 1.858 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.133-.284 4.994-1.86.47.234.962.327 1.78.397.63.059 1.236-.03 1.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926 1.096-1.296 2.746-2.642 3.392-7.003.05-.347.007-.565 0-.845-.004-.17.035-.237.23-.256a4.173 4.173 0 001.545-.475c1.396-.763 1.96-2.015 2.093-3.517.02-.23-.004-.467-.247-.588zM11.581 18c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696 4.696 0 011.529-.039c2.132.312 3.946 1.265 5.468 2.774.868.86 1.525 1.887 2.202 2.891.72 1.066 1.494 2.082 2.48 2.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306 0 01.415-.287.302.302 0 01.2.288.306.306 0 01-.31.307.303.303 0 01-.304-.308zm3.11 1.596c-.2.081-.399.151-.59.16a1.245 1.245 0 01-.798-.254c-.274-.23-.47-.358-.552-.758a1.73 1.73 0 01.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559 0 01-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:featherless-ai{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 36' width='1em' height='1em' %3E%3Cg fill='currentColor'%3E%3Cpath d='M40.0866 4.68482C38.2902 3.5825 35.863 3 33.0672 3C28.7842 3 24.0653 4.35865 19.8276 6.72206L19.7979 6.71083C19.7979 6.71083 19.7937 6.73344 19.7914 6.74423C18.5086 7.4617 17.2656 8.2629 16.0981 9.15731C9.22112 14.4248 7.29519 20.6748 8.92004 24.0156C7.14142 27.0728 6.0457 30.2332 6 33.9767C9.41949 27.421 11.4719 22.108 22.6146 13.1637C19.4309 13.8501 13.9281 17.1057 10.2271 22.0459C9.87793 19.156 12.1477 14.4895 17.2033 10.6174C17.8435 10.127 18.5092 9.66864 19.1886 9.23374C18.6577 10.8934 18.8269 10.4806 17.7254 12.8076C19.3543 11.2566 20.4268 10.2995 22.035 7.64145C24.123 6.60964 26.2948 5.83844 28.4482 5.37235C28.0919 6.56071 27.4137 8.57466 26.4955 10.1669C26.4955 10.1669 28.8258 9.66435 30.7518 9.77788C29.6995 10.9459 28.7527 12.2094 27.7926 13.5012C26.4777 15.2696 25.1184 17.0983 23.3778 18.8005C23.1683 19.0054 22.968 19.1912 22.7649 19.383C20.0902 19.1254 18.3235 20.1315 16.6683 21.9089C17.9737 21.2966 19.7273 20.7924 20.8266 21.0959C18.8008 22.7579 15.6106 24.9488 12.9893 24.7684C12.4922 25.5295 12.4608 25.5528 11.9144 26.4722C16.1664 27.537 21.507 23.1905 24.6498 20.1161C26.4926 18.3131 27.8964 16.4257 29.2534 14.6012C32.0481 10.8427 34.4616 7.5974 39.8153 6.3624L42 5.85877L40.0866 4.68482Z' class='logo-mark'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:fireworks{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath clip-rule='evenodd' d='M14.8 5l-2.801 6.795L9.195 5H7.397l3.072 7.428a1.64 1.64 0 003.038.002L16.598 5H14.8zm1.196 10.352l5.124-5.244-.699-1.669-5.596 5.739a1.664 1.664 0 00-.343 1.807 1.642 1.642 0 001.516 1.012L16 17l8-.02-.699-1.669-7.303.041h-.002zM2.88 10.104l.699-1.669 5.596 5.739c.468.479.603 1.189.343 1.807a1.643 1.643 0 01-1.516 1.012l-8-.018-.002.002.699-1.669 7.303.042-5.122-5.246z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:gemini{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M12 24A14.304 14.304 0 000 12 14.304 14.304 0 0012 0a14.305 14.305 0 0012 12 14.305 14.305 0 00-12 12'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:huggingface{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M16.781 3.277c2.997 1.704 4.844 4.851 4.844 8.258 0 .995-.155 1.955-.443 2.857a1.332 1.332 0 011.125.4 1.41 1.41 0 01.2 1.723c.204.165.352.385.428.632l.017.062c.06.222.12.69-.2 1.166.244.37.279.836.093 1.236-.255.57-.893 1.018-2.128 1.5l-.202.078-.131.048c-.478.173-.89.295-1.061.345l-.086.024c-.89.243-1.808.375-2.732.394-1.32 0-2.3-.36-2.923-1.067a9.852 9.852 0 01-3.18.018C9.778 21.647 8.802 22 7.494 22a11.249 11.249 0 01-2.541-.343l-.221-.06-.273-.08a16.574 16.574 0 01-1.175-.405c-1.237-.483-1.875-.93-2.13-1.501-.186-.4-.151-.867.093-1.236a1.42 1.42 0 01-.2-1.166c.069-.273.226-.516.447-.694a1.41 1.41 0 01.2-1.722c.233-.248.557-.391.917-.407l.078-.001a9.385 9.385 0 01-.44-2.85c0-3.407 1.847-6.554 4.844-8.258a9.822 9.822 0 019.687 0zM4.188 14.758c.125.687 2.357 2.35 2.14 2.707-.19.315-.796-.239-.948-.386l-.041-.04-.168-.147c-.561-.479-2.304-1.9-2.74-1.432-.43.46.119.859 1.055 1.42l.784.467.136.083c1.045.643 1.12.84.95 1.113-.188.295-3.07-2.1-3.34-1.083-.27 1.011 2.942 1.304 2.744 2.006-.2.7-2.265-1.324-2.685-.537-.425.79 2.913 1.718 2.94 1.725l.16.04.175.042c1.227.284 3.565.65 4.435-.604.673-.973.64-1.709-.248-2.61l-.057-.057c-.945-.928-1.495-2.288-1.495-2.288l-.017-.058-.025-.072c-.082-.22-.284-.639-.63-.584-.46.073-.798 1.21.12 1.933l.05.038c.977.721-.195 1.21-.573.534l-.058-.104-.143-.25c-.463-.799-1.282-2.111-1.739-2.397-.532-.332-.907-.148-.782.541zm14.842-.541c-.533.335-1.563 2.074-1.94 2.751a.613.613 0 01-.687.302.436.436 0 01-.176-.098.303.303 0 01-.049-.06l-.014-.028-.008-.02-.007-.019-.003-.013-.003-.017a.289.289 0 01-.004-.048c0-.12.071-.266.25-.427.026-.024.054-.047.084-.07l.047-.036c.022-.016.043-.032.063-.049.883-.71.573-1.81.131-1.917l-.031-.006-.056-.004a.368.368 0 00-.062.006l-.028.005-.042.014-.039.017-.028.015-.028.019-.036.027-.023.02c-.173.158-.273.428-.31.542l-.016.054s-.53 1.309-1.439 2.234l-.054.054c-.365.358-.596.69-.702 1.018-.143.437-.066.868.21 1.353.055.097.117.195.187.296.882 1.275 3.282.876 4.494.59l.286-.07.25-.074c.276-.084.736-.233 1.2-.42l.188-.077.065-.028.064-.028.124-.056.081-.038c.529-.252.964-.543.994-.827l.001-.036a.299.299 0 00-.037-.139c-.094-.176-.271-.212-.491-.168l-.045.01c-.044.01-.09.024-.136.04l-.097.035-.054.022c-.559.23-1.238.705-1.607.745h.006a.452.452 0 01-.05.003h-.024l-.024-.003-.023-.005c-.068-.016-.116-.06-.14-.142a.22.22 0 01-.005-.1c.062-.345.958-.595 1.713-.91l.066-.028c.528-.224.97-.483.985-.832v-.04a.47.47 0 00-.016-.098c-.048-.18-.175-.251-.36-.251-.785 0-2.55 1.36-2.92 1.36-.025 0-.048-.007-.058-.024a.6.6 0 01-.046-.088c-.1-.238.068-.462 1.06-1.066l.209-.126c.538-.32 1.01-.588 1.341-.831.29-.212.475-.406.503-.6l.003-.028c.008-.113-.038-.227-.147-.344a.266.266 0 00-.07-.054l-.034-.015-.013-.005a.403.403 0 00-.13-.02c-.162 0-.369.07-.595.18-.637.313-1.431.952-1.826 1.285l-.249.215-.033.033c-.08.078-.288.27-.493.386l-.071.037-.041.019a.535.535 0 01-.122.036h.005a.346.346 0 01-.031.003l.01-.001-.013.001c-.079.005-.145-.021-.19-.095a.113.113 0 01-.014-.065c.027-.465 2.034-1.991 2.152-2.642l.009-.048c.1-.65-.271-.817-.791-.493zM11.938 2.984c-4.798 0-8.688 3.829-8.688 8.55 0 .692.083 1.364.24 2.008l.008-.009c.252-.298.612-.46 1.017-.46.355.008.699.117.993.312.22.14.465.384.715.694.261-.372.69-.598 1.15-.605.852 0 1.367.728 1.562 1.383l.047.105.06.127c.192.396.595 1.139 1.143 1.68 1.06 1.04 1.324 2.115.8 3.266a8.865 8.865 0 002.024-.014c-.505-1.12-.26-2.17.74-3.186l.066-.066c.695-.684 1.157-1.69 1.252-1.912.195-.655.708-1.383 1.56-1.383.46.007.889.233 1.15.605.25-.31.495-.553.718-.694a1.87 1.87 0 01.99-.312c.357 0 .682.126.925.36.14-.61.215-1.245.215-1.898 0-4.722-3.89-8.55-8.687-8.55zm1.857 8.926l.439-.212c.553-.264.89-.383.89.152 0 1.093-.771 3.208-3.155 3.262h-.184c-2.325-.052-3.116-2.06-3.156-3.175l-.001-.087c0-1.107 1.452.586 3.25.586.716 0 1.379-.272 1.917-.526zm4.017-3.143c.45 0 .813.358.813.8 0 .441-.364.8-.813.8a.806.806 0 01-.812-.8c0-.442.364-.8.812-.8zm-11.624 0c.448 0 .812.358.812.8 0 .441-.364.8-.812.8a.806.806 0 01-.813-.8c0-.442.364-.8.813-.8zm7.79-.841c.32-.384.846-.54 1.33-.394.483.146.83.564.878 1.06.048.495-.212.97-.659 1.203-.322.168-.447-.477-.767-.585l.002-.003c-.287-.098-.772.362-.925.079a1.215 1.215 0 01.14-1.36zm-4.323 0c.322.384.377.92.14 1.36-.152.283-.64-.177-.925-.079l.003.003c-.108.036-.194.134-.273.24l-.118.165c-.11.15-.22.262-.377.18a1.226 1.226 0 01-.658-1.204c.048-.495.395-.913.878-1.059a1.262 1.262 0 011.33.394z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:microsoft{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M11.49 2H2v9.492h9.492V2h-.002z'/%3E%3Cpath d='M22 2h-9.492v9.492H22V2z'/%3E%3Cpath d='M11.49 12.508H2V22h9.492v-9.492h-.002z'/%3E%3Cpath d='M22 12.508h-9.492V22H22v-9.492z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:mistral{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath clip-rule='evenodd' d='M3.428 3.4h3.429v3.428h3.429v3.429h-.002 3.431V6.828h3.427V3.4h3.43v13.714H24v3.429H13.714v-3.428h-3.428v-3.429h-3.43v3.428h3.43v3.429H0v-3.429h3.428V3.4zm10.286 13.715h3.428v-3.429h-3.427v3.429z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:moonshot{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M1.052 16.916l9.539 2.552a21.007 21.007 0 00.06 2.033l5.956 1.593a11.997 11.997 0 01-5.586.865l-.18-.016-.044-.004-.084-.009-.094-.01a11.605 11.605 0 01-.157-.02l-.107-.014-.11-.016a11.962 11.962 0 01-.32-.051l-.042-.008-.075-.013-.107-.02-.07-.015-.093-.019-.075-.016-.095-.02-.097-.023-.094-.022-.068-.017-.088-.022-.09-.024-.095-.025-.082-.023-.109-.03-.062-.02-.084-.025-.093-.028-.105-.034-.058-.019-.08-.026-.09-.031-.066-.024a6.293 6.293 0 01-.044-.015l-.068-.025-.101-.037-.057-.022-.08-.03-.087-.035-.088-.035-.079-.032-.095-.04-.063-.028-.063-.027a5.655 5.655 0 01-.041-.018l-.066-.03-.103-.047-.052-.024-.096-.046-.062-.03-.084-.04-.086-.044-.093-.047-.052-.027-.103-.055-.057-.03-.058-.032a6.49 6.49 0 01-.046-.026l-.094-.053-.06-.034-.051-.03-.072-.041-.082-.05-.093-.056-.052-.032-.084-.053-.061-.039-.079-.05-.07-.047-.053-.035a7.785 7.785 0 01-.054-.036l-.044-.03-.044-.03a6.066 6.066 0 01-.04-.028l-.057-.04-.076-.054-.069-.05-.074-.054-.056-.042-.076-.057-.076-.059-.086-.067-.045-.035-.064-.052-.074-.06-.089-.073-.046-.039-.046-.039a7.516 7.516 0 01-.043-.037l-.045-.04-.061-.053-.07-.062-.068-.06-.062-.058-.067-.062-.053-.05-.088-.084a13.28 13.28 0 01-.099-.097l-.029-.028-.041-.042-.069-.07-.05-.051-.05-.053a6.457 6.457 0 01-.168-.179l-.08-.088-.062-.07-.071-.08-.042-.049-.053-.062-.058-.068-.046-.056a7.175 7.175 0 01-.027-.033l-.045-.055-.066-.082-.041-.052-.05-.064-.02-.025a11.99 11.99 0 01-1.44-2.402zm-1.02-5.794l11.353 3.037a20.468 20.468 0 00-.469 2.011l10.817 2.894a12.076 12.076 0 01-1.845 2.005L.657 15.923l-.016-.046-.035-.104a11.965 11.965 0 01-.05-.153l-.007-.023a11.896 11.896 0 01-.207-.741l-.03-.126-.018-.08-.021-.097-.018-.081-.018-.09-.017-.084-.018-.094c-.026-.141-.05-.283-.071-.426l-.017-.118-.011-.083-.013-.102a12.01 12.01 0 01-.019-.161l-.005-.047a12.12 12.12 0 01-.034-2.145zm1.593-5.15l11.948 3.196c-.368.605-.705 1.231-1.01 1.875l11.295 3.022c-.142.82-.368 1.612-.668 2.365l-11.55-3.09L.124 10.26l.015-.1.008-.049.01-.067.015-.087.018-.098c.026-.148.056-.295.088-.442l.028-.124.02-.085.024-.097c.022-.09.045-.18.07-.268l.028-.102.023-.083.03-.1.025-.082.03-.096.026-.082.031-.095a11.896 11.896 0 011.01-2.232zm4.442-4.4L17.352 4.59a20.77 20.77 0 00-1.688 1.721l7.823 2.093c.267.852.442 1.744.513 2.665L2.106 5.213l.045-.065.027-.04.04-.055.046-.065.055-.076.054-.072.064-.086.05-.065.057-.073.055-.07.06-.074.055-.069.065-.077.054-.066.066-.077.053-.06.072-.082.053-.06.067-.074.054-.058.073-.078.058-.06.063-.067.168-.17.1-.098.059-.056.076-.071a12.084 12.084 0 012.272-1.677zM12.017 0h.097l.082.001.069.001.054.002.068.002.046.001.076.003.047.002.06.003.054.002.087.005.105.007.144.011.088.007.044.004.077.008.082.008.047.005.102.012.05.006.108.014.081.01.042.006.065.01.207.032.07.012.065.011.14.026.092.018.11.022.046.01.075.016.041.01L14.7.3l.042.01.065.015.049.012.071.017.096.024.112.03.113.03.113.032.05.015.07.02.078.024.073.023.05.016.05.016.076.025.099.033.102.036.048.017.064.023.093.034.11.041.116.045.1.04.047.02.06.024.041.018.063.026.04.018.057.025.11.048.1.046.074.035.075.036.06.028.092.046.091.045.102.052.053.028.049.026.046.024.06.033.041.022.052.029.088.05.106.06.087.051.057.034.053.032.096.059.088.055.098.062.036.024.064.041.084.056.04.027.062.042.062.043.023.017c.054.037.108.075.161.114l.083.06.065.048.056.043.086.065.082.064.04.03.05.041.086.069.079.065.085.071c.712.6 1.353 1.283 1.909 2.031L7.222.994l.062-.027.065-.028.081-.034.086-.035c.113-.045.227-.09.341-.131l.096-.035.093-.033.084-.03.096-.031c.087-.03.176-.058.264-.085l.091-.027.086-.025.102-.03.085-.023.1-.026L9.04.37l.09-.023.091-.022.095-.022.09-.02.098-.021.091-.02.095-.018.092-.018.1-.018.091-.016.098-.017.092-.014.097-.015.092-.013.102-.013.091-.012.105-.012.09-.01.105-.01c.093-.01.186-.018.28-.024l.106-.008.09-.005.11-.006.093-.004.1-.004.097-.002.099-.002.197-.002z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:novita{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath clip-rule='evenodd' d='M9.167 4.17v5.665L0 19.003h9.167v-5.666l5.666 5.666H24L9.167 4.17z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:ollama{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M7.905 1.09c.216.085.411.225.588.41.295.306.544.744.734 1.263.191.522.315 1.1.362 1.68a5.054 5.054 0 012.049-.636l.051-.004c.87-.07 1.73.087 2.48.474.101.053.2.11.297.17.05-.569.172-1.134.36-1.644.19-.52.439-.957.733-1.264a1.67 1.67 0 01.589-.41c.257-.1.53-.118.796-.042.401.114.745.368 1.016.737.248.337.434.769.561 1.287.23.934.27 2.163.115 3.645l.053.04.026.019c.757.576 1.284 1.397 1.563 2.35.435 1.487.216 3.155-.534 4.088l-.018.021.002.003c.417.762.67 1.567.724 2.4l.002.03c.064 1.065-.2 2.137-.814 3.19l-.007.01.01.024c.472 1.157.62 2.322.438 3.486l-.006.039a.651.651 0 01-.747.536.648.648 0 01-.54-.742c.167-1.033.01-2.069-.48-3.123a.643.643 0 01.04-.617l.004-.006c.604-.924.854-1.83.8-2.72-.046-.779-.325-1.544-.8-2.273a.644.644 0 01.18-.886l.009-.006c.243-.159.467-.565.58-1.12a4.229 4.229 0 00-.095-1.974c-.205-.7-.58-1.284-1.105-1.683-.595-.454-1.383-.673-2.38-.61a.653.653 0 01-.632-.371c-.314-.665-.772-1.141-1.343-1.436a3.288 3.288 0 00-1.772-.332c-1.245.099-2.343.801-2.67 1.686a.652.652 0 01-.61.425c-1.067.002-1.893.252-2.497.703-.522.39-.878.935-1.066 1.588a4.07 4.07 0 00-.068 1.886c.112.558.331 1.02.582 1.269l.008.007c.212.207.257.53.109.785-.36.622-.629 1.549-.673 2.44-.05 1.018.186 1.902.719 2.536l.016.019a.643.643 0 01.095.69c-.576 1.236-.753 2.252-.562 3.052a.652.652 0 01-1.269.298c-.243-1.018-.078-2.184.473-3.498l.014-.035-.008-.012a4.339 4.339 0 01-.598-1.309l-.005-.019a5.764 5.764 0 01-.177-1.785c.044-.91.278-1.842.622-2.59l.012-.026-.002-.002c-.293-.418-.51-.953-.63-1.545l-.005-.024a5.352 5.352 0 01.093-2.49c.262-.915.777-1.701 1.536-2.269.06-.045.123-.09.186-.132-.159-1.493-.119-2.73.112-3.67.127-.518.314-.95.562-1.287.27-.368.614-.622 1.015-.737.266-.076.54-.059.797.042zm4.116 9.09c.936 0 1.8.313 2.446.855.63.527 1.005 1.235 1.005 1.94 0 .888-.406 1.58-1.133 2.022-.62.375-1.451.557-2.403.557-1.009 0-1.871-.259-2.493-.734-.617-.47-.963-1.13-.963-1.845 0-.707.398-1.417 1.056-1.946.668-.537 1.55-.849 2.485-.849zm0 .896a3.07 3.07 0 00-1.916.65c-.461.37-.722.835-.722 1.25 0 .428.21.829.61 1.134.455.347 1.124.548 1.943.548.799 0 1.473-.147 1.932-.426.463-.28.7-.686.7-1.257 0-.423-.246-.89-.683-1.256-.484-.405-1.14-.643-1.864-.643zm.662 1.21l.004.004c.12.151.095.37-.056.49l-.292.23v.446a.375.375 0 01-.376.373.375.375 0 01-.376-.373v-.46l-.271-.218a.347.347 0 01-.052-.49.353.353 0 01.494-.051l.215.172.22-.174a.353.353 0 01.49.051zm-5.04-1.919c.478 0 .867.39.867.871a.87.87 0 01-.868.871.87.87 0 01-.867-.87.87.87 0 01.867-.872zm8.706 0c.48 0 .868.39.868.871a.87.87 0 01-.868.871.87.87 0 01-.867-.87.87.87 0 01.867-.872zM7.44 2.3l-.003.002a.659.659 0 00-.285.238l-.005.006c-.138.189-.258.467-.348.832-.17.692-.216 1.631-.124 2.782.43-.128.899-.208 1.404-.237l.01-.001.019-.034c.046-.082.095-.161.148-.239.123-.771.022-1.692-.253-2.444-.134-.364-.297-.65-.453-.813a.628.628 0 00-.107-.09L7.44 2.3zm9.174.04l-.002.001a.628.628 0 00-.107.09c-.156.163-.32.45-.453.814-.29.794-.387 1.776-.23 2.572l.058.097.008.014h.03a5.184 5.184 0 011.466.212c.086-1.124.038-2.043-.128-2.722-.09-.365-.21-.643-.349-.832l-.004-.006a.659.659 0 00-.285-.239h-.004z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:openai{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M21.55 10.004a5.416 5.416 0 00-.478-4.501c-1.217-2.09-3.662-3.166-6.05-2.66A5.59 5.59 0 0010.831 1C8.39.995 6.224 2.546 5.473 4.838A5.553 5.553 0 001.76 7.496a5.487 5.487 0 00.691 6.5 5.416 5.416 0 00.477 4.502c1.217 2.09 3.662 3.165 6.05 2.66A5.586 5.586 0 0013.168 23c2.443.006 4.61-1.546 5.361-3.84a5.553 5.553 0 003.715-2.66 5.488 5.488 0 00-.693-6.497v.001zm-8.381 11.558a4.199 4.199 0 01-2.675-.954c.034-.018.093-.05.132-.074l4.44-2.53a.71.71 0 00.364-.623v-6.176l1.877 1.069c.02.01.033.029.036.05v5.115c-.003 2.274-1.87 4.118-4.174 4.123zM4.192 17.78a4.059 4.059 0 01-.498-2.763c.032.02.09.055.131.078l4.44 2.53c.225.13.504.13.73 0l5.42-3.088v2.138a.068.068 0 01-.027.057L9.9 19.288c-1.999 1.136-4.552.46-5.707-1.51h-.001zM3.023 8.216A4.15 4.15 0 015.198 6.41l-.002.151v5.06a.711.711 0 00.364.624l5.42 3.087-1.876 1.07a.067.067 0 01-.063.005l-4.489-2.559c-1.995-1.14-2.679-3.658-1.53-5.63h.001zm15.417 3.54l-5.42-3.088L14.896 7.6a.067.067 0 01.063-.006l4.489 2.557c1.998 1.14 2.683 3.662 1.529 5.633a4.163 4.163 0 01-2.174 1.807V12.38a.71.71 0 00-.363-.623zm1.867-2.773a6.04 6.04 0 00-.132-.078l-4.44-2.53a.731.731 0 00-.729 0l-5.42 3.088V7.325a.068.068 0 01.027-.057L14.1 4.713c2-1.137 4.555-.46 5.707 1.513.487.833.664 1.809.499 2.757h.001zm-11.741 3.81l-1.877-1.068a.065.065 0 01-.036-.051V6.559c.001-2.277 1.873-4.122 4.181-4.12.976 0 1.92.338 2.671.954-.034.018-.092.05-.131.073l-4.44 2.53a.71.71 0 00-.365.623l-.003 6.173v.002zm1.02-2.168L12 9.25l2.414 1.375v2.75L12 14.75l-2.415-1.375v-2.75z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:openrouter{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M16.804 1.957l7.22 4.105v.087L16.73 10.21l.017-2.117-.821-.03c-1.059-.028-1.611.002-2.268.11-1.064.175-2.038.577-3.147 1.352L8.345 11.03c-.284.195-.495.336-.68.455l-.515.322-.397.234.385.23.53.338c.476.314 1.17.796 2.701 1.866 1.11.775 2.083 1.177 3.147 1.352l.3.045c.694.091 1.375.094 2.825.033l.022-2.159 7.22 4.105v.087L16.589 22l.014-1.862-.635.022c-1.386.042-2.137.002-3.138-.162-1.694-.28-3.26-.926-4.881-2.059l-2.158-1.5a21.997 21.997 0 00-.755-.498l-.467-.28a55.927 55.927 0 00-.76-.43C2.908 14.73.563 14.116 0 14.116V9.888l.14.004c.564-.007 2.91-.622 3.809-1.124l1.016-.58.438-.274c.428-.28 1.072-.726 2.686-1.853 1.621-1.133 3.186-1.78 4.881-2.059 1.152-.19 1.974-.213 3.814-.138l.02-1.907z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:perplexity{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M19.785 0v7.272H22.5V17.62h-2.935V24l-7.037-6.194v6.145h-1.091v-6.152L4.392 24v-6.465H1.5V7.188h2.884V0l7.053 6.494V.19h1.09v6.49L19.786 0zm-7.257 9.044v7.319l5.946 5.234V14.44l-5.946-5.397zm-1.099-.08l-5.946 5.398v7.235l5.946-5.234V8.965zm8.136 7.58h1.844V8.349H13.46l6.105 5.54v2.655zm-8.982-8.28H2.59v8.195h1.8v-2.576l6.192-5.62zM5.475 2.476v4.71h5.115l-5.115-4.71zm13.219 0l-5.115 4.71h5.115v-4.71z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:player2{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M19.956 10.178C19.8934 10.7544 19.724 11.6784 19.1182 12.5274C18.3667 13.5817 17.3528 13.8824 16.9558 13.9746C16.6911 14.0049 16.3026 14.045 15.8323 14.0789C14.1804 14.2045 13.0525 14.1565 11.7041 14.131C10.81 14.1143 9.54304 14.1034 7.98548 14.131C7.97564 16.7493 7.96551 19.368 7.95508 21.987L5 22V15.8717C5.00358 14.6542 5.00983 12.9193 5.03397 10.7643C6.47441 10.7684 14.6905 10.7205 15.6696 10.7721C15.8672 10.7841 16.3621 10.8039 16.6764 10.4458C16.8842 10.2113 16.9696 9.83348 16.9763 9.26802C16.9835 8.82659 16.9902 8.38204 16.9763 7.94322C16.9459 6.90454 16.608 6.51472 15.7103 6.51107C12.8124 6.5069 9.91142 6.43915 7.01356 6.51107C6.60048 6.51888 5.90083 6.53087 5.02056 6.50325V3C5.43007 3.00782 6.13285 3.02397 7.00686 3.01563C11.1399 2.98436 12.7292 3.01199 15.5328 3.01563C18.3591 3.0198 19.994 4.94393 19.994 8.26009C19.9913 8.90059 20.0253 9.54944 19.956 10.178Z'/%3E%3Cpath d='M20 19H11V22H20V19Z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:together{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cg%3E%3Cpath d='M17.385 11.23a4.615 4.615 0 100-9.23 4.615 4.615 0 000 9.23zm0 10.77a4.615 4.615 0 100-9.23 4.615 4.615 0 000 9.23zm-10.77 0a4.615 4.615 0 100-9.23 4.615 4.615 0 000 9.23z' opacity='.2'/%3E%3Ccircle cx='6.615' cy='6.615' r='4.615'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:vllm{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M0 4.973h9.324V23L0 4.973z'/%3E%3Cpath d='M13.986 4.351L22.378 0l-6.216 23H9.324l4.662-18.649z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:volcengine{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M7.29 5.36L3.148 21.737a.215.215 0 00.203.261h8.29a.214.214 0 00.215-.261L7.7 5.359a.214.214 0 00-.41 0z' fill-opacity='.5'/%3E%3Cpath clip-rule='evenodd' d='M4.553 16.18l-1.406 5.558a.214.214 0 00.203.261h2.42-4.551a.214.214 0 01-.214-.26l2.275-8.961a.214.214 0 01.409 0l.864 3.402z'/%3E%3Cpath d='M14.44.15a.214.214 0 00-.41 0L8.366 21.739a.214.214 0 00.214.261H19.9a.214.214 0 00.215-.261L14.44.151z' fill-opacity='.5'/%3E%3Cpath clip-rule='evenodd' d='M16.694 22h3.207a.215.215 0 00.214-.262l-1.839-6.993 1.164-4.592a.214.214 0 01.411 0l2.951 11.586a.214.214 0 01-.214.261h-5.894z'/%3E%3Cpath d='M10.278 7.741L6.685 21.736a.214.214 0 00.214.264h7.17a.216.216 0 00.214-.166.216.216 0 000-.098L10.687 7.742a.214.214 0 00-.409 0z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:xai{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M6.469 8.776L16.512 23h-4.464L2.005 8.776H6.47zm-.004 7.9l2.233 3.164L6.467 23H2l4.465-6.324zM22 2.582V23h-3.659V7.764L22 2.582zM22 1l-9.952 14.095-2.233-3.163L17.533 1H22z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lucide\:ghost,[i-lucide\:ghost=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M9 10h.01M15 10h.01M12 2a8 8 0 0 0-8 8v12l3-3l2.5 2.5L12 19l2.5 2.5L17 19l3 3V10a8 8 0 0 0-8-8'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lucide\:mic,[i-lucide\:mic=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3E%3Cpath d='M12 19v3m7-12v2a7 7 0 0 1-14 0v-2'/%3E%3Crect width='6' height='13' x='9' y='2' rx='3'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lucide\:music,[i-lucide\:music=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3E%3Cpath d='M9 18V5l12-2v13'/%3E%3Ccircle cx='6' cy='18' r='3'/%3E%3Ccircle cx='18' cy='16' r='3'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-simple-icons\:discord{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M20.317 4.37a19.8 19.8 0 0 0-4.885-1.515a.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.3 18.3 0 0 0-5.487 0a13 13 0 0 0-.617-1.25a.08.08 0 0 0-.079-.037A19.7 19.7 0 0 0 3.677 4.37a.1.1 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.08.08 0 0 0 .031.057a19.9 19.9 0 0 0 5.993 3.03a.08.08 0 0 0 .084-.028a14 14 0 0 0 1.226-1.994a.076.076 0 0 0-.041-.106a13 13 0 0 1-1.872-.892a.077.077 0 0 1-.008-.128a10 10 0 0 0 .372-.292a.07.07 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.07.07 0 0 1 .078.01q.181.149.373.292a.077.077 0 0 1-.006.127a12.3 12.3 0 0 1-1.873.892a.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.08.08 0 0 0 .084.028a19.8 19.8 0 0 0 6.002-3.03a.08.08 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.06.06 0 0 0-.031-.03M8.02 15.33c-1.182 0-2.157-1.085-2.157-2.419c0-1.333.956-2.419 2.157-2.419c1.21 0 2.176 1.096 2.157 2.42c0 1.333-.956 2.418-2.157 2.418m7.975 0c-1.183 0-2.157-1.085-2.157-2.419c0-1.333.955-2.419 2.157-2.419c1.21 0 2.176 1.096 2.157 2.42c0 1.333-.946 2.418-2.157 2.418'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-simple-icons\:elevenlabs{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M4.604 0v24h4.931V0zm9.86 0v24h4.933V0z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-simple-icons\:github,[i-simple-icons\:github=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M12 .297c-6.63 0-12 5.373-12 12c0 5.303 3.438 9.8 8.205 11.385c.6.113.82-.258.82-.577c0-.285-.01-1.04-.015-2.04c-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729c1.205.084 1.838 1.236 1.838 1.236c1.07 1.835 2.809 1.305 3.495.998c.108-.776.417-1.305.76-1.605c-2.665-.3-5.466-1.332-5.466-5.93c0-1.31.465-2.38 1.235-3.22c-.135-.303-.54-1.523.105-3.176c0 0 1.005-.322 3.3 1.23c.96-.267 1.98-.399 3-.405c1.02.006 2.04.138 3 .405c2.28-1.552 3.285-1.23 3.285-1.23c.645 1.653.24 2.873.12 3.176c.765.84 1.23 1.91 1.23 3.22c0 4.61-2.805 5.625-5.475 5.92c.42.36.81 1.096.81 2.22c0 1.606-.015 2.896-.015 3.286c0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-simple-icons\:javascript{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M0 0h24v24H0zm22.034 18.276c-.175-1.095-.888-2.015-3.003-2.873c-.736-.345-1.554-.585-1.797-1.14c-.091-.33-.105-.51-.046-.705c.15-.646.915-.84 1.515-.66c.39.12.75.42.976.9c1.034-.676 1.034-.676 1.755-1.125c-.27-.42-.404-.601-.586-.78c-.63-.705-1.469-1.065-2.834-1.034l-.705.089c-.676.165-1.32.525-1.71 1.005c-1.14 1.291-.811 3.541.569 4.471c1.365 1.02 3.361 1.244 3.616 2.205c.24 1.17-.87 1.545-1.966 1.41c-.811-.18-1.26-.586-1.755-1.336l-1.83 1.051c.21.48.45.689.81 1.109c1.74 1.756 6.09 1.666 6.871-1.004c.029-.09.24-.705.074-1.65zm-8.983-7.245h-2.248c0 1.938-.009 3.864-.009 5.805c0 1.232.063 2.363-.138 2.711c-.33.689-1.18.601-1.566.48c-.396-.196-.597-.466-.83-.855c-.063-.105-.11-.196-.127-.196l-1.825 1.125c.305.63.75 1.172 1.324 1.517c.855.51 2.004.675 3.207.405c.783-.226 1.458-.691 1.811-1.411c.51-.93.402-2.07.397-3.346c.012-2.054 0-4.109 0-6.179z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-simple-icons\:x{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584l-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932ZM17.61 20.644h2.039L6.486 3.24H4.298Z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar-check-circle-line-duotone,.i-solar\:check-circle-line-duotone,[i-solar-check-circle-line-duotone=""],[i-solar\:check-circle-line-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Ccircle cx='12' cy='12' r='10' opacity='.5'/%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m8.5 12.5l2 2l5-5'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:add-circle-line-duotone,[i-solar\:add-circle-line-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Ccircle cx='12' cy='12' r='10' opacity='.5'/%3E%3Cpath stroke-linecap='round' d='M15 12h-3m0 0H9m3 0V9m0 3v3'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:add-square-line-duotone,[i-solar\:add-square-line-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Cpath d='M2 12c0-4.714 0-7.071 1.464-8.536C4.93 2 7.286 2 12 2s7.071 0 8.535 1.464C22 4.93 22 7.286 22 12s0 7.071-1.465 8.535C19.072 22 16.714 22 12 22s-7.071 0-8.536-1.465C2 19.072 2 16.714 2 12Z' opacity='.5'/%3E%3Cpath stroke-linecap='round' d='M15 12h-3m0 0H9m3 0V9m0 3v3'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:alt-arrow-down-linear,[i-solar\:alt-arrow-down-linear=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m19 9l-7 6l-7-6'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:alt-arrow-left-line-duotone,[i-solar\:alt-arrow-left-line-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m15 5l-6 7l6 7'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:alt-arrow-right-outline,[i-solar\:alt-arrow-right-outline=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M8.512 4.43a.75.75 0 0 1 1.057.082l6 7a.75.75 0 0 1 0 .976l-6 7a.75.75 0 0 1-1.138-.976L14.012 12L8.431 5.488a.75.75 0 0 1 .08-1.057' clip-rule='evenodd'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:armchair-2-bold-duotone,[i-solar\:armchair-2-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M16.533 18H6.75v2a.75.75 0 1 1-1.5 0v-2.324c-.829-.362-1.49-1.005-1.808-1.817l-.039-.102L2.1 12.264C1.685 11.15 2.613 10 3.927 10c.81 0 1.534.453 1.81 1.134l1.098 2.706c.1.246.15.37.222.47a1.2 1.2 0 0 0 .74.463c.13.027.277.027.57.027h6.98c.569 0 .853 0 1.091-.098q.196-.082.349-.219c.184-.166.281-.405.475-.883l1.001-2.466c.276-.68 1-1.134 1.81-1.134c1.314 0 2.242 1.15 1.827 2.264l-1.12 3c-.195.524-.292.785-.421 1.008a3.43 3.43 0 0 1-1.609 1.404V20a.75.75 0 1 1-1.5 0v-2.005c-.187.005-.415.005-.717.005'/%3E%3Cpath fill='currentColor' d='M13.236 3.5h-2.472c-1.1 0-1.976 0-2.66.088c-.706.09-1.285.28-1.746.72c-.464.441-.669 1.003-.765 1.685c-.093.658-.093 1.495-.093 2.54v2.195q.147.186.237.406l1.098 2.706c.1.246.15.37.222.47a1.2 1.2 0 0 0 .74.463c.13.027.277.027.57.027h6.98c.569 0 .853 0 1.091-.098q.196-.082.349-.219c.184-.166.281-.405.475-.883l1.001-2.466q.09-.221.237-.406V8.533c0-1.045 0-1.882-.093-2.54c-.096-.682-.301-1.244-.765-1.686c-.46-.438-1.04-.629-1.745-.72c-.685-.087-1.56-.087-2.661-.087' opacity='.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:arrow-right-line-duotone,[i-solar\:arrow-right-line-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none'%3E%3Cpath fill='currentColor' d='M4 11.25a.75.75 0 0 0 0 1.5zm0 1.5h16v-1.5H4z' opacity='.5'/%3E%3Cpath stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m14 6l6 6l-6 6'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:arrow-up-outline,[i-solar\:arrow-up-outline=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M11.47 3.47a.75.75 0 0 1 1.06 0l6 6a.75.75 0 1 1-1.06 1.06l-4.72-4.72V20a.75.75 0 0 1-1.5 0V5.81l-4.72 4.72a.75.75 0 1 1-1.06-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:book-bookmark-bold-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M12 20.028V18H8v2.028c0 .277 0 .416.095.472s.224-.006.484-.13l1.242-.593c.088-.042.132-.063.179-.063s.091.02.179.063l1.242.593c.26.124.39.186.484.13c.095-.056.095-.195.095-.472' opacity='.5'/%3E%3Cpath fill='currentColor' d='M8 18h-.574c-1.084 0-1.462.006-1.753.068c-.513.11-.96.347-1.285.667c-.11.108-.164.161-.291.505s-.107.489-.066.78l.022.15c.11.653.31.998.616 1.244c.307.246.737.407 1.55.494c.837.09 1.946.092 3.536.092h4.43c1.59 0 2.7-.001 3.536-.092c.813-.087 1.243-.248 1.55-.494s.506-.591.616-1.243c.091-.548.11-1.241.113-2.171h-8v2.028c0 .277 0 .416-.095.472s-.224-.006-.484-.13l-1.242-.593c-.088-.042-.132-.063-.179-.063s-.091.02-.179.063l-1.242.593c-.26.124-.39.186-.484.13C8 20.444 8 20.305 8 20.028z'/%3E%3Cpath fill='currentColor' d='M4.727 2.733c.306-.308.734-.508 1.544-.618C7.105 2.002 8.209 2 9.793 2h4.414c1.584 0 2.688.002 3.522.115c.81.11 1.238.31 1.544.618c.305.308.504.74.613 1.557c.112.84.114 1.955.114 3.552V18H7.426c-1.084 0-1.462.006-1.753.068c-.513.11-.96.347-1.285.667c-.11.108-.164.161-.291.505A1.3 1.3 0 0 0 4 19.7V7.842c0-1.597.002-2.711.114-3.552c.109-.816.308-1.249.613-1.557' opacity='.5'/%3E%3Cpath fill='currentColor' d='M7.25 7A.75.75 0 0 1 8 6.25h8a.75.75 0 0 1 0 1.5H8A.75.75 0 0 1 7.25 7M8 9.75a.75.75 0 0 0 0 1.5h5a.75.75 0 0 0 0-1.5z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:bookmark-bold-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M21 11.098v4.993c0 3.096 0 4.645-.734 5.321c-.35.323-.792.526-1.263.58c-.987.113-2.14-.907-4.445-2.946c-1.02-.901-1.529-1.352-2.118-1.47a2.2 2.2 0 0 0-.88 0c-.59.118-1.099.569-2.118 1.47c-2.305 2.039-3.458 3.059-4.445 2.945a2.24 2.24 0 0 1-1.263-.579C3 20.736 3 19.188 3 16.091v-4.994C3 6.81 3 4.666 4.318 3.333S7.758 2 12 2s6.364 0 7.682 1.332S21 6.81 21 11.098' opacity='.5'/%3E%3Cpath fill='currentColor' d='M9 5.25a.75.75 0 0 0 0 1.5h6a.75.75 0 0 0 0-1.5z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:box-minimalistic-bold-duotone,[i-solar\:box-minimalistic-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M8.422 20.618C10.178 21.54 11.056 22 12 22V12L2.638 7.073l-.04.067C2 8.154 2 9.417 2 11.942v.117c0 2.524 0 3.787.597 4.801c.598 1.015 1.674 1.58 3.825 2.709z'/%3E%3Cpath fill='currentColor' d='m17.577 4.432l-2-1.05C13.822 2.461 12.944 2 12 2c-.945 0-1.822.46-3.578 1.382l-2 1.05C4.318 5.536 3.242 6.1 2.638 7.072L12 12l9.362-4.927c-.606-.973-1.68-1.537-3.785-2.641' opacity='.7'/%3E%3Cpath fill='currentColor' d='m21.403 7.14l-.041-.067L12 12v10c.944 0 1.822-.46 3.578-1.382l2-1.05c2.151-1.129 3.227-1.693 3.825-2.708c.597-1.014.597-2.277.597-4.8v-.117c0-2.525 0-3.788-.597-4.802' opacity='.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:card-search-broken,[i-solar\:card-search-broken=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' d='M14 4c3.771 0 5.657 0 6.828 1.172S22 8.229 22 12v1M10 4C6.229 4 4.343 4 3.172 5.172S2 8.229 2 12s0 5.657 1.172 6.828S6.229 20 10 20h3m-3-4H6'/%3E%3Ccircle cx='18' cy='17' r='3'/%3E%3Cpath stroke-linecap='round' d='m20.5 19.5l1 1M2 10h5m15 0H11'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:chat-round-line-bold-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2S2 6.477 2 12c0 1.6.376 3.112 1.043 4.453c.178.356.237.763.134 1.148l-.595 2.226a1.3 1.3 0 0 0 1.591 1.592l2.226-.596a1.63 1.63 0 0 1 1.149.133A9.96 9.96 0 0 0 12 22' opacity='.5'/%3E%3Cpath fill='currentColor' d='M7.825 12.85a.825.825 0 0 0 0 1.65h6.05a.825.825 0 0 0 0-1.65zm0-3.85a.825.825 0 0 0 0 1.65h8.8a.825.825 0 0 0 0-1.65z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:chat-square-like-bold-duotone,[i-solar\:chat-square-like-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='m13.629 20.472l-.542.916c-.483.816-1.69.816-2.174 0l-.542-.916c-.42-.71-.63-1.066-.968-1.262c-.338-.197-.763-.204-1.613-.219c-1.256-.021-2.043-.098-2.703-.372a5 5 0 0 1-2.706-2.706C2 14.995 2 13.83 2 11.5v-1c0-3.273 0-4.91.737-6.112a5 5 0 0 1 1.65-1.651C5.59 2 7.228 2 10.5 2h3c3.273 0 4.91 0 6.113.737a5 5 0 0 1 1.65 1.65C22 5.59 22 7.228 22 10.5v1c0 2.33 0 3.495-.38 4.413a5 5 0 0 1-2.707 2.706c-.66.274-1.447.35-2.703.372c-.85.015-1.275.022-1.613.219c-.338.196-.548.551-.968 1.262' opacity='.5'/%3E%3Cpath fill='currentColor' d='M10.99 14.308c-1.327-.978-3.49-2.84-3.49-4.593c0-2.677 2.475-3.677 4.5-1.609c2.025-2.068 4.5-1.068 4.5 1.609c0 1.752-2.163 3.615-3.49 4.593c-.454.335-.681.502-1.01.502s-.556-.167-1.01-.502'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:check-circle-bold-duotone,[i-solar\:check-circle-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2s10 4.477 10 10' opacity='.5'/%3E%3Cpath fill='currentColor' d='M16.03 8.97a.75.75 0 0 1 0 1.06l-5 5a.75.75 0 0 1-1.06 0l-2-2a.75.75 0 1 1 1.06-1.06l1.47 1.47l2.235-2.235L14.97 8.97a.75.75 0 0 1 1.06 0'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:close-circle-line-duotone,[i-solar\:close-circle-line-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Ccircle cx='12' cy='12' r='10' opacity='.5'/%3E%3Cpath stroke-linecap='round' d='m14.5 9.5l-5 5m0-5l5 5'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:code-bold-duotone,[i-solar\:code-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M16.443 7.328a.75.75 0 0 1 1.059-.056l1.737 1.564c.737.663 1.347 1.212 1.767 1.71c.44.525.754 1.088.754 1.784c0 .695-.313 1.258-.754 1.782c-.42.499-1.03 1.049-1.767 1.711l-1.737 1.564a.75.75 0 1 1-1.004-1.115l1.697-1.527c.788-.709 1.319-1.19 1.663-1.598c.33-.393.402-.622.402-.817c0-.196-.072-.425-.402-.818c-.344-.409-.875-.889-1.663-1.598l-1.697-1.527a.75.75 0 0 1-.056-1.06m-8.94 1.06a.75.75 0 0 0-1.004-1.115L4.761 8.836c-.737.663-1.347 1.212-1.767 1.71c-.44.525-.754 1.088-.754 1.784c0 .695.313 1.258.754 1.782c.42.499 1.03 1.049 1.767 1.711l1.737 1.564a.75.75 0 1 0 1.004-1.115l-1.697-1.527c-.788-.709-1.319-1.19-1.663-1.598c-.33-.393-.402-.622-.402-.817c0-.196.072-.425.402-.818c.344-.409.875-.889 1.663-1.598z'/%3E%3Cpath fill='currentColor' d='M14.182 4.276a.75.75 0 0 1 .53.918l-3.974 14.83a.75.75 0 1 1-1.449-.389l3.974-14.83a.75.75 0 0 1 .919-.53' opacity='.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:danger-circle-bold-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M22 12c0-5.523-4.477-10-10-10S2 6.477 2 12s4.477 10 10 10s10-4.477 10-10' opacity='.5'/%3E%3Cpath fill='currentColor' d='M12 6.25a.75.75 0 0 1 .75.75v6a.75.75 0 0 1-1.5 0V7a.75.75 0 0 1 .75-.75M12 17a1 1 0 1 0 0-2a1 1 0 0 0 0 2'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:danger-circle-line-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none'%3E%3Ccircle cx='12' cy='12' r='10' stroke='currentColor' stroke-width='1.5' opacity='.5'/%3E%3Cpath stroke='currentColor' stroke-linecap='round' stroke-width='1.5' d='M12 7v6'/%3E%3Ccircle cx='12' cy='16' r='1' fill='currentColor'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:danger-triangle-bold-duotone,[i-solar\:danger-triangle-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M12 3c-2.31 0-3.77 2.587-6.688 7.762l-.364.644c-2.425 4.3-3.638 6.45-2.542 8.022S6.214 21 11.636 21h.728c5.422 0 8.134 0 9.23-1.572s-.117-3.722-2.542-8.022l-.364-.645C15.77 5.587 14.311 3 12 3' opacity='.5'/%3E%3Cpath fill='currentColor' d='M12 7.25a.75.75 0 0 1 .75.75v5a.75.75 0 0 1-1.5 0V8a.75.75 0 0 1 .75-.75M12 17a1 1 0 1 0 0-2a1 1 0 0 0 0 2'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:dialog-2-bold-duotone,[i-solar\:dialog-2-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='m10.404 22.48l.275-.465c.44-.745.66-1.117 1.012-1.325c.351-.207.81-.222 1.725-.252c.859-.027 1.436-.102 1.93-.306a4.24 4.24 0 0 0 2.295-2.296c.323-.779.323-1.767.323-3.743v-.848c0-2.777 0-4.165-.625-5.185c-.35-.57-.83-1.05-1.4-1.4c-1.02-.625-2.408-.625-5.185-.625H8.21c-2.777 0-4.165 0-5.185.625c-.57.35-1.05.83-1.4 1.4C1 9.08 1 10.468 1 13.245v.848c0 1.976 0 2.964.323 3.744a4.24 4.24 0 0 0 2.295 2.295c.494.204 1.07.28 1.93.306c.916.03 1.374.045 1.725.252c.35.208.571.58 1.012 1.325l.275.465c.41.692 1.434.692 1.844 0m2.789-7.963a1.06 1.06 0 1 0 0-2.12a1.06 1.06 0 0 0 0 2.12m-2.65-1.06a1.06 1.06 0 1 1-2.121 0a1.06 1.06 0 0 1 2.12 0m-4.772 1.06a1.06 1.06 0 1 0 0-2.12a1.06 1.06 0 0 0 0 2.12' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' d='M15.486 1c1.267 0 2.274 0 3.082.077c.829.079 1.53.244 2.153.626a4.8 4.8 0 0 1 1.575 1.575c.383.624.548 1.325.627 2.153c.076.808.076 1.816.076 3.082v.866c0 .901 0 1.619-.04 2.2c-.04.595-.125 1.106-.323 1.584a4.77 4.77 0 0 1-2.67 2.617q-.21.082-.368.135h-1.65c.016-.499.016-1.093.016-1.822v-.848c0-2.777 0-4.165-.625-5.185c-.35-.57-.83-1.05-1.4-1.4c-1.02-.625-2.408-.625-5.185-.625H8.21c-.986 0-1.796 0-2.478.028v-1.65q.05-.17.13-.396q.133-.389.346-.739a4.8 4.8 0 0 1 1.576-1.575c.624-.382 1.324-.547 2.153-.626C10.745 1 11.752 1 13.019 1z' opacity='.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:document-add-outline,[i-solar\:document-add-outline=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M10.944 1.25h2.112c1.838 0 3.294 0 4.433.153c1.172.158 2.121.49 2.87 1.238a.75.75 0 0 1-1.06 1.06c-.424-.422-1.004-.676-2.01-.811c-1.027-.138-2.382-.14-4.289-.14h-2c-1.907 0-3.261.002-4.29.14c-1.005.135-1.585.389-2.008.812S4.025 4.705 3.89 5.71c-.138 1.029-.14 2.383-.14 4.29v4c0 1.907.002 3.262.14 4.29c.135 1.005.389 1.585.812 2.008s1.003.677 2.009.812c1.028.138 2.382.14 4.289.14h2c1.907 0 3.262-.002 4.29-.14c1.005-.135 1.585-.389 2.008-.812c.696-.696.907-1.777.943-4.309a.75.75 0 0 1 1.5.022c-.035 2.427-.192 4.158-1.382 5.348c-.749.748-1.698 1.08-2.87 1.238c-1.14.153-2.595.153-4.433.153h-2.112c-1.838 0-3.294 0-4.433-.153c-1.172-.158-2.121-.49-2.87-1.238c-.748-.749-1.08-1.698-1.238-2.87c-.153-1.14-.153-2.595-.153-4.433V9.944c0-1.838 0-3.294.153-4.433c.158-1.172.49-2.121 1.238-2.87c.749-.748 1.698-1.08 2.87-1.238c1.14-.153 2.595-.153 4.433-.153m7.17 5.796a2.716 2.716 0 1 1 3.84 3.84L17.2 15.643a7 7 0 0 1-.63.587q-.346.27-.744.46c-.224.107-.46.185-.806.3l-2.084.695a1.28 1.28 0 0 1-1.62-1.62l.681-2.04l.014-.043c.116-.347.194-.582.301-.806a4 4 0 0 1 .46-.744c.153-.196.328-.371.587-.63l.031-.031zm2.78 1.06a1.216 1.216 0 0 0-1.72 0l-.182.182l.034.107c.094.27.273.63.611.968a2.55 2.55 0 0 0 1.075.645l.182-.182a1.216 1.216 0 0 0 0-1.72m-1.328 3.048a4 4 0 0 1-.99-.73a4 4 0 0 1-.73-.99L14.45 12.83c-.301.301-.407.409-.496.523q-.17.218-.289.467c-.062.131-.111.274-.246.678l-.4 1.2l.283.283l1.2-.4c.404-.135.547-.184.678-.246q.248-.12.467-.289c.114-.089.222-.195.523-.496zM7.25 9A.75.75 0 0 1 8 8.25h6.5a.75.75 0 0 1 0 1.5H8A.75.75 0 0 1 7.25 9m0 4a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5H8a.75.75 0 0 1-.75-.75m0 4a.75.75 0 0 1 .75-.75h1.5a.75.75 0 0 1 0 1.5H8a.75.75 0 0 1-.75-.75' clip-rule='evenodd'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:document-text-linear{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Cpath d='M3 10c0-3.771 0-5.657 1.172-6.828S7.229 2 11 2h2c3.771 0 5.657 0 6.828 1.172S21 6.229 21 10v4c0 3.771 0 5.657-1.172 6.828S16.771 22 13 22h-2c-3.771 0-5.657 0-6.828-1.172S3 17.771 3 14z'/%3E%3Cpath stroke-linecap='round' d='M8 12h8M8 8h8m-8 8h5'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:earth-outline,[i-solar\:earth-outline=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M5.578 5.343a9.25 9.25 0 0 0 6.803 15.9c-.206-.912-.234-2.138.393-3.319c.652-1.229 2.002-1.762 2.995-2.006a9.2 9.2 0 0 1 1.898-.254h.043c1.673-.018 2.426-.562 2.826-1.08c.342-.444.47-.887.602-1.336l.05-.172A9.22 9.22 0 0 0 18.6 5.519l-.027.1c-.163.594-.425 1.202-.711 1.636c-.256.388-.752.78-1.164 1.076a10 10 0 0 1-.902.56c-.228.132-.433.25-.63.38c-.432.286-.766.593-.991 1.056a.67.67 0 0 0-.035.49c.075.272.126.578.126.889c.002.649-.328 1.176-.753 1.518a2.4 2.4 0 0 1-1.521.526c-2.455-.027-3.965-2.02-4.164-4.236c-.08-.881-.466-1.773-.954-2.552a8.8 8.8 0 0 0-1.296-1.62m1.167-.956a10.5 10.5 0 0 1 1.4 1.779c.558.89 1.069 2.012 1.177 3.214c.15 1.68 1.213 2.854 2.686 2.87a.9.9 0 0 0 .563-.194c.146-.117.196-.24.195-.346c0-.156-.026-.328-.072-.495a2.16 2.16 0 0 1 .131-1.542c.385-.794.956-1.285 1.514-1.653c.239-.158.487-.3.71-.43l.09-.05c.255-.148.48-.28.683-.427c.431-.31.704-.557.787-.684c.183-.276.388-.734.518-1.207c.103-.374.131-.662.122-.84A9.2 9.2 0 0 0 12 2.75a9.2 9.2 0 0 0-5.255 1.637M22.68 13.24q.07-.61.071-1.24c0-5.937-4.813-10.75-10.75-10.75S1.25 6.063 1.25 12S6.063 22.75 12 22.75c5.46 0 9.97-4.071 10.659-9.344a3 3 0 0 1 .048-.156zm-2.774 3.567c-.596.218-1.314.348-2.179.357h-.031l-.09.003a7.7 7.7 0 0 0-1.477.208c-.902.221-1.693.62-2.029 1.252c-.456.859-.39 1.793-.22 2.432a9.26 9.26 0 0 0 6.026-4.252' clip-rule='evenodd'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:emoji-funny-square-bold-duotone,[i-solar\:emoji-funny-square-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M6.504 21.52c1.633.943 3.706.387 7.853-.724s6.22-1.666 7.163-3.3s.387-3.706-.724-7.853s-1.666-6.22-3.3-7.163s-3.706-.388-7.853.724c-4.147 1.11-6.22 1.666-7.163 3.3s-.388 3.706.724 7.853c1.11 4.147 1.666 6.22 3.3 7.163' opacity='.5'/%3E%3Cpath fill='currentColor' d='M14.898 11.224c.533-.143.792-.908.578-1.708s-.821-1.333-1.355-1.19c-.533.143-.792.907-.577 1.708c.214.8.82 1.333 1.354 1.19m-5.796 1.553c.534-.143.792-.908.578-1.708s-.82-1.333-1.354-1.19s-.792.907-.578 1.708s.82 1.333 1.354 1.19m-.917 2.974a.75.75 0 0 1 .91-.545c1.13.283 2.428.287 3.746-.066c1.318-.354 2.44-1.006 3.278-1.816a.75.75 0 1 1 1.043 1.078a8.4 8.4 0 0 1-1.15.928l.159.322a1.5 1.5 0 1 1-2.693 1.322l-.196-.4l-.053.014c-1.555.417-3.112.42-4.499.073a.75.75 0 0 1-.545-.91'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:eye-closed-bold-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M2.919 6.605a1 1 0 0 0-1.838.79l.002.003l.003.007l.01.021l.032.072q.04.09.12.25c.105.21.262.506.47.857c.41.687 1.027 1.6 1.872 2.52l-.797.797a1 1 0 1 0 1.414 1.414l.84-.84c.565.455 1.197.885 1.897 1.256l-.782 1.202a1 1 0 0 0 1.676 1.091l.985-1.514c.677.208 1.402.355 2.177.425V16.5a1 1 0 0 0 1 1V13c-2.748 0-4.819-1.199-6.304-2.59l-.024-.022a12 12 0 0 1-.564-.569a13.4 13.4 0 0 1-1.67-2.237a12 12 0 0 1-.516-.968zm-1.838.79L2 7c-.92.394-.919.395-.919.395' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' d='M15.22 12.398A8.7 8.7 0 0 1 12 13v4.5a1 1 0 0 0 1-1v-1.544c.772-.07 1.497-.217 2.176-.425l.986 1.515a1 1 0 0 0 1.676-1.091l-.782-1.203c.701-.37 1.332-.8 1.897-1.256l.84.84a1 1 0 1 0 1.414-1.414l-.797-.798a15.4 15.4 0 0 0 2.302-3.296a10 10 0 0 0 .19-.395l.011-.026l.004-.008l.002-.005a1 1 0 1 0-1.838-.788l-.005.011a5 5 0 0 1-.146.302a13 13 0 0 1-2.614 3.48c-.841.79-1.87 1.517-3.095 2' opacity='.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:face-scan-circle-bold-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M10.801 2.57a.71.71 0 0 1-.555.838a8.78 8.78 0 0 0-6.838 6.838a.71.71 0 1 1-1.394-.283a10.2 10.2 0 0 1 7.949-7.949a.71.71 0 0 1 .838.556M2.57 13.199a.71.71 0 0 1 .838.555a8.78 8.78 0 0 0 6.838 6.838a.71.71 0 1 1-.283 1.394a10.2 10.2 0 0 1-7.948-7.949a.71.71 0 0 1 .555-.838M13.199 2.57a.71.71 0 0 1 .838-.556a10.2 10.2 0 0 1 7.949 7.949a.711.711 0 0 1-1.394.283a8.78 8.78 0 0 0-6.838-6.838a.71.71 0 0 1-.555-.838m8.231 10.629a.71.71 0 0 1 .556.838a10.2 10.2 0 0 1-7.949 7.949a.711.711 0 0 1-.283-1.394a8.78 8.78 0 0 0 6.838-6.838a.71.71 0 0 1 .838-.555' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' d='M12 19.583a7.583 7.583 0 1 0 0-15.166a7.583 7.583 0 0 0 0 15.166' opacity='.5'/%3E%3Cpath fill='currentColor' d='M8.94 14.539a.71.71 0 0 1 .995-.148c.59.437 1.3.69 2.065.69a3.45 3.45 0 0 0 2.065-.69a.71.71 0 1 1 .847 1.142a4.87 4.87 0 0 1-2.912.97a4.87 4.87 0 0 1-2.911-.97a.71.71 0 0 1-.148-.994m5.547-2.895c.458 0 .83-.557.83-1.244s-.372-1.244-.83-1.244s-.83.557-.83 1.244s.372 1.244.83 1.244m-4.976 0c.458 0 .83-.557.83-1.244s-.372-1.244-.83-1.244s-.83.557-.83 1.244s.372 1.244.83 1.244'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:face-scan-circle-outline,[i-solar\:face-scan-circle-outline=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M16 10.5c0 .829-.448 1.5-1 1.5c-.553 0-1-.671-1-1.5c0-.828.447-1.5 1-1.5s1 .672 1 1.5m-6 0c0 .829-.448 1.5-1 1.5s-1-.671-1-1.5C8 9.672 8.448 9 9 9s1 .672 1 1.5'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M13.265 2.051a.75.75 0 0 1 .884-.586a10.76 10.76 0 0 1 8.386 8.386a.75.75 0 0 1-1.47.298a9.26 9.26 0 0 0-7.214-7.214a.75.75 0 0 1-.586-.884m-2.53 0a.75.75 0 0 1-.586.884a9.26 9.26 0 0 0-7.214 7.215a.75.75 0 0 1-1.47-.299A10.76 10.76 0 0 1 9.85 1.465a.75.75 0 0 1 .884.586M2.051 13.265a.75.75 0 0 1 .884.586a9.26 9.26 0 0 0 7.214 7.214a.75.75 0 1 1-.298 1.47a10.76 10.76 0 0 1-8.386-8.385a.75.75 0 0 1 .586-.885m19.898 0a.75.75 0 0 1 .586.885a10.76 10.76 0 0 1-8.386 8.385a.75.75 0 0 1-.298-1.47a9.26 9.26 0 0 0 7.214-7.214a.75.75 0 0 1 .884-.586M8.397 15.554a.75.75 0 0 1 1.05-.156c.728.54 1.607.852 2.553.852s1.825-.312 2.553-.852a.75.75 0 1 1 .893 1.205A5.77 5.77 0 0 1 12 17.75a5.77 5.77 0 0 1-3.447-1.147a.75.75 0 0 1-.156-1.05' clip-rule='evenodd'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:filters-bold-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M18 8A6 6 0 1 1 6 8a6 6 0 0 1 12 0'/%3E%3Cpath fill='currentColor' d='M13.58 13.79a6 6 0 0 1-7.16-3.58a6 6 0 1 0 7.16 3.58' opacity='.7'/%3E%3Cpath fill='currentColor' d='M13.58 13.79c.271.684.42 1.43.42 2.21a6 6 0 0 1-2 4.472a6 6 0 1 0 5.58-10.262a6.01 6.01 0 0 1-4 3.58' opacity='.4'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:forward-linear,[i-solar\:forward-linear=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m19.5 12l-5-5m5 5l-5 5m5-5h-10c-1.667 0-5 1-5 5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:ghost-bold-duotone,[i-solar\:ghost-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M22 19.206V12c0-5.523-4.477-10-10-10S2 6.477 2 12v7.206a1.727 1.727 0 0 0 2.5 1.544a2.89 2.89 0 0 1 2.896.18a2.89 2.89 0 0 0 3.208 0l.353-.234a1.88 1.88 0 0 1 2.086 0l.353.235a2.89 2.89 0 0 0 3.208 0a2.89 2.89 0 0 1 2.897-.18A1.727 1.727 0 0 0 22 19.206' opacity='.5'/%3E%3Cpath fill='currentColor' d='M15 12c.552 0 1-.672 1-1.5S15.552 9 15 9s-1 .672-1 1.5s.448 1.5 1 1.5m-5-1.5c0 .828-.448 1.5-1 1.5s-1-.672-1-1.5S8.448 9 9 9s1 .672 1 1.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:home-smile-outline,[i-solar\:home-smile-outline=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M9.447 15.398a.75.75 0 1 0-.894 1.204A5.77 5.77 0 0 0 12 17.75a5.77 5.77 0 0 0 3.447-1.148a.75.75 0 1 0-.894-1.204A4.27 4.27 0 0 1 12 16.25a4.27 4.27 0 0 1-2.553-.852'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M12 1.25c-.708 0-1.351.203-2.05.542c-.674.328-1.454.812-2.427 1.416L5.456 4.491c-.92.572-1.659 1.03-2.227 1.465c-.589.45-1.041.91-1.368 1.507c-.326.595-.472 1.229-.543 1.978c-.068.725-.068 1.613-.068 2.726v1.613c0 1.904 0 3.407.153 4.582c.156 1.205.486 2.178 1.23 2.947c.747.773 1.697 1.119 2.875 1.282c1.14.159 2.598.159 4.434.159h4.116c1.836 0 3.294 0 4.434-.159c1.177-.163 2.128-.509 2.876-1.282c.743-.769 1.073-1.742 1.23-2.947c.152-1.175.152-2.678.152-4.582v-1.613c0-1.113 0-2-.068-2.726c-.07-.75-.217-1.383-.543-1.978c-.327-.597-.78-1.056-1.368-1.507c-.568-.436-1.306-.893-2.227-1.465l-2.067-1.283c-.973-.604-1.753-1.088-2.428-1.416c-.697-.34-1.34-.542-2.049-.542M8.28 4.504c1.015-.63 1.73-1.072 2.327-1.363c.581-.283.993-.391 1.393-.391s.812.108 1.393.391c.598.29 1.312.733 2.327 1.363l2 1.241c.961.597 1.636 1.016 2.14 1.402c.489.375.77.684.963 1.036c.193.353.306.766.365 1.398c.061.648.062 1.465.062 2.623v1.521c0 1.97-.002 3.376-.14 4.443c-.136 1.048-.393 1.656-.82 2.099c-.425.439-1.003.7-2.004.839c-1.026.142-2.379.144-4.286.144h-4c-1.908 0-3.26-.002-4.286-.144c-1.001-.14-1.579-.4-2.003-.84c-.428-.442-.685-1.05-.82-2.098c-.14-1.067-.141-2.472-.141-4.443v-1.521c0-1.158 0-1.975.062-2.623c.059-.632.172-1.045.365-1.398c.193-.352.474-.661.964-1.036c.503-.386 1.178-.805 2.139-1.402z' clip-rule='evenodd'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:info-circle-line-duotone,[i-solar\:info-circle-line-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none'%3E%3Ccircle cx='12' cy='12' r='10' stroke='currentColor' stroke-width='1.5' opacity='.5'/%3E%3Cpath stroke='currentColor' stroke-linecap='round' stroke-width='1.5' d='M12 17v-6'/%3E%3Ccircle cx='1' cy='1' r='1' fill='currentColor' transform='matrix(1 0 0 -1 11 9)'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:info-circle-outline,[i-solar\:info-circle-outline=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M12 17.75a.75.75 0 0 0 .75-.75v-6a.75.75 0 0 0-1.5 0v6c0 .414.336.75.75.75M12 7a1 1 0 1 1 0 2a1 1 0 0 1 0-2'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M1.25 12C1.25 6.063 6.063 1.25 12 1.25S22.75 6.063 22.75 12S17.937 22.75 12 22.75S1.25 17.937 1.25 12M12 2.75a9.25 9.25 0 1 0 0 18.5a9.25 9.25 0 0 0 0-18.5' clip-rule='evenodd'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:layers-bold-duotone,[i-solar\:layers-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M4.979 9.685C2.993 8.891 2 8.494 2 8s.993-.89 2.979-1.685l2.808-1.123C9.773 4.397 10.767 4 12 4s2.227.397 4.213 1.192l2.808 1.123C21.007 7.109 22 7.506 22 8s-.993.89-2.979 1.685l-2.808 1.124C14.227 11.603 13.233 12 12 12s-2.227-.397-4.213-1.191z'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M2 8c0 .494.993.89 2.979 1.685l2.808 1.124C9.773 11.603 10.767 12 12 12s2.227-.397 4.213-1.191l2.808-1.124C21.007 8.891 22 8.494 22 8s-.993-.89-2.979-1.685l-2.808-1.123C14.227 4.397 13.233 4 12 4s-2.227.397-4.213 1.192L4.98 6.315C2.993 7.109 2 7.506 2 8' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' d='m5.766 10l-.787.315C2.993 11.109 2 11.507 2 12s.993.89 2.979 1.685l2.808 1.124C9.773 15.603 10.767 16 12 16s2.227-.397 4.213-1.191l2.808-1.124C21.007 12.891 22 12.493 22 12s-.993-.89-2.979-1.685L18.234 10l-2.021.809C14.227 11.603 13.233 12 12 12s-2.227-.397-4.213-1.191z' opacity='.7'/%3E%3Cpath fill='currentColor' d='m5.766 14l-.787.315C2.993 15.109 2 15.507 2 16s.993.89 2.979 1.685l2.808 1.124C9.773 19.603 10.767 20 12 20s2.227-.397 4.213-1.192l2.808-1.123C21.007 16.891 22 16.494 22 16c0-.493-.993-.89-2.979-1.685L18.234 14l-2.021.809C14.227 15.603 13.233 16 12 16s-2.227-.397-4.213-1.191z' opacity='.4'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:leaf-bold-duotone,[i-solar\:leaf-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M12 22c-4.418 0-8-3.646-8-8.143c0-4.462 2.553-9.67 6.537-11.531A3.45 3.45 0 0 1 12 2z' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' d='M13.463 2.326A3.45 3.45 0 0 0 12 2v7l4.432-4.432c-.863-.947-1.86-1.724-2.97-2.242' opacity='.3'/%3E%3Cpath fill='currentColor' d='M12 9v5.5l6.614-6.614c-.572-1.22-1.308-2.357-2.182-3.318z' opacity='.4'/%3E%3Cpath fill='currentColor' d='m12 19.5l7.811-7.811a15 15 0 0 0-1.197-3.803L12 14.5z' opacity='.6'/%3E%3Cpath fill='currentColor' d='M19.811 11.689L12 19.5V22c4.418 0 8-3.646 8-8.143c0-.71-.064-1.438-.189-2.168' opacity='.7'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:magic-stick-2-bold-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M16.714 2.127c-.836-.43-1.922.263-4.095 1.65l-.562.36c-.618.394-.927.591-1.273.648c-.347.056-.692-.034-1.382-.215l-.628-.164C6.345 3.769 5.13 3.45 4.436 4.13s-.412 1.908.157 4.363l.147.635c.161.697.242 1.046.177 1.393c-.066.346-.27.65-.68 1.26l-.372.555c-1.439 2.145-2.158 3.217-1.753 4.067c.406.85 1.668.915 4.192 1.045l.654.033c.717.037 1.076.056 1.382.213c.306.158.524.436.962.994l.398.507c1.539 1.962 2.309 2.943 3.255 2.788c.945-.154 1.441-1.342 2.433-3.717l.257-.614c.282-.675.422-1.012.677-1.261c.255-.25.595-.382 1.274-.647l.618-.24c2.39-.933 3.586-1.4 3.765-2.345s-.777-1.744-2.688-3.342l-.495-.413c-.543-.454-.815-.68-.963-.992s-.158-.672-.175-1.393l-.016-.657c-.062-2.538-.093-3.806-.928-4.236'/%3E%3Cpath fill='currentColor' d='M15.93 16.991c.127-.268.239-.45.392-.6c.172-.167.382-.282.71-.42l4.498 4.499a.75.75 0 0 1-1.06 1.06z' opacity='.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:magic-stick-3-bold-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M3.845 3.845a2.883 2.883 0 0 0 0 4.077L5.432 9.51c.012-.014.555.503.568.49l4-4c.013-.013-.504-.556-.49-.568L7.922 3.845a2.883 2.883 0 0 0-4.077 0m1.288 11.462a.483.483 0 0 1 .9 0l.157.4a.48.48 0 0 0 .272.273l.398.157a.486.486 0 0 1 0 .903l-.398.158a.48.48 0 0 0-.272.273l-.157.4a.483.483 0 0 1-.9 0l-.157-.4a.48.48 0 0 0-.272-.273l-.398-.158a.486.486 0 0 1 0-.903l.398-.157a.48.48 0 0 0 .272-.274z' opacity='.5'/%3E%3Cpath fill='currentColor' d='M19.967 9.13a.483.483 0 0 1 .9 0l.156.399c.05.125.148.224.273.273l.398.158a.486.486 0 0 1 0 .902l-.398.158a.5.5 0 0 0-.273.273l-.156.4a.483.483 0 0 1-.9 0l-.157-.4a.5.5 0 0 0-.272-.273l-.398-.158a.486.486 0 0 1 0-.902l.398-.158a.5.5 0 0 0 .272-.273z' opacity='.2'/%3E%3Cpath fill='currentColor' d='M16.1 2.307a.483.483 0 0 1 .9 0l.43 1.095a.48.48 0 0 0 .272.274l1.091.432a.486.486 0 0 1 0 .903l-1.09.432a.5.5 0 0 0-.273.273L17 6.81a.483.483 0 0 1-.9 0l-.43-1.095a.5.5 0 0 0-.273-.273l-1.09-.432a.486.486 0 0 1 0-.903l1.09-.432a.5.5 0 0 0 .273-.274z' opacity='.7'/%3E%3Cpath fill='currentColor' d='M10.568 6.49c-.012.014-.555-.503-.568-.49l-4 4c-.013.013.504.556.49.568l9.588 9.587a2.883 2.883 0 1 0 4.078-4.077z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:magnifer-line-duotone,[i-solar\:magnifer-line-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cdefs%3E%3Cmask id='solarMagniferLineDuotone0'%3E%3Cg fill='none' stroke-width='1.5'%3E%3Ccircle cx='11.5' cy='11.5' r='9.5' stroke='gray'/%3E%3Cpath stroke='%23fff' stroke-linecap='round' d='M18.5 18.5L22 22'/%3E%3C/g%3E%3C/mask%3E%3C/defs%3E%3Cpath fill='currentColor' d='M0 0h24v24H0z' mask='url(%23solarMagniferLineDuotone0)'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:microphone-3-bold-duotone,[i-solar\:microphone-3-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M4 9a.75.75 0 0 1 .75.75v1a7.25 7.25 0 1 0 14.5 0v-1a.75.75 0 0 1 1.5 0v1a8.75 8.75 0 0 1-8 8.718v2.282a.75.75 0 0 1-1.5 0v-2.282a8.75 8.75 0 0 1-8-8.718v-1A.75.75 0 0 1 4 9' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M12 2a5.75 5.75 0 0 0-5.75 5.75v3a5.75 5.75 0 0 0 11.5 0v-3A5.75 5.75 0 0 0 12 2m2 9.5a.75.75 0 0 0 0-1.5h-4a.75.75 0 0 0 0 1.5zm-.25-3.75a.75.75 0 0 1-.75.75h-2A.75.75 0 0 1 11 7h2a.75.75 0 0 1 .75.75' clip-rule='evenodd' opacity='.5'/%3E%3Cpath fill='currentColor' d='M14 11.5a.75.75 0 0 0 0-1.5h-4a.75.75 0 0 0 0 1.5zm-1-3A.75.75 0 0 0 13 7h-2a.75.75 0 0 0 0 1.5z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:minus-circle-line-duotone,[i-solar\:minus-circle-line-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Ccircle cx='12' cy='12' r='10' opacity='.5'/%3E%3Cpath stroke-linecap='round' d='M15 12H9'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:moon-outline,[i-solar\:moon-outline=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M11.017 2.802a9.25 9.25 0 1 0 10.181 10.181A7.25 7.25 0 1 1 11.017 2.802M1.25 12C1.25 6.063 6.063 1.25 12 1.25c.717 0 1.075.571 1.137 1.026c.059.438-.103.995-.606 1.299a5.75 5.75 0 1 0 7.894 7.894c.304-.503.861-.665 1.299-.606c.455.062 1.026.42 1.026 1.137c0 5.937-4.813 10.75-10.75 10.75S1.25 17.937 1.25 12' clip-rule='evenodd'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:notes-linear{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Cpath d='m20.312 12.647l.517-1.932c.604-2.255.907-3.382.68-4.358a4 4 0 0 0-1.162-2.011c-.731-.685-1.859-.987-4.114-1.591c-2.255-.605-3.383-.907-4.358-.68a4 4 0 0 0-2.011 1.162c-.587.626-.893 1.543-1.348 3.209l-.244.905l-.517 1.932c-.605 2.255-.907 3.382-.68 4.358a4 4 0 0 0 1.162 2.011c.731.685 1.859.987 4.114 1.592c2.032.544 3.149.843 4.064.73q.15-.019.294-.052a4 4 0 0 0 2.011-1.16c.685-.732.987-1.86 1.592-4.115Z'/%3E%3Cpath d='M16.415 17.974a4 4 0 0 1-1.068 1.678c-.731.685-1.859.987-4.114 1.591s-3.383.907-4.358.679a4 4 0 0 1-2.011-1.161c-.685-.731-.988-1.859-1.592-4.114l-.517-1.932c-.605-2.255-.907-3.383-.68-4.358a4 4 0 0 1 1.162-2.011c.731-.685 1.859-.987 4.114-1.592q.638-.172 1.165-.309'/%3E%3Cpath stroke-linecap='round' d='m11.777 10l4.83 1.294M11 12.898l2.898.776'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:pallete-2-bold-duotone,[i-solar\:pallete-2-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M10.847 21.934C5.867 21.362 2 17.133 2 12C2 6.477 6.477 2 12 2s10 4.477 10 10c0 5.157-3.283 4.733-6.086 4.37c-1.618-.209-3.075-.397-3.652.518c-.395.626.032 1.406.555 1.929a1.673 1.673 0 0 1 0 2.366c-.523.523-1.235.836-1.97.751' opacity='.5'/%3E%3Cpath fill='currentColor' d='M11.085 7a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0M6.5 13a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m11 0a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m-3-4.5a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:pause-circle-bold-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2s10 4.477 10 10' opacity='.5'/%3E%3Cpath fill='currentColor' d='M8.076 8.617C8 8.801 8 9.034 8 9.5v5c0 .466 0 .699.076.883a1 1 0 0 0 .541.54c.184.077.417.077.883.077s.699 0 .883-.076a1 1 0 0 0 .54-.541c.077-.184.077-.417.077-.883v-5c0-.466 0-.699-.076-.883a1 1 0 0 0-.541-.54C10.199 8 9.966 8 9.5 8s-.699 0-.883.076a1 1 0 0 0-.54.541m4.999 0C13 8.801 13 9.034 13 9.5v5c0 .466 0 .699.076.883a1 1 0 0 0 .541.54c.184.077.417.077.883.077s.699 0 .883-.076a1 1 0 0 0 .54-.541c.077-.184.077-.417.077-.883v-5c0-.466 0-.699-.076-.883a1 1 0 0 0-.541-.54C15.199 8 14.966 8 14.5 8s-.699 0-.883.076a1 1 0 0 0-.54.541'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:people-nearby-bold-duotone,[i-solar\:people-nearby-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M19.717 20.362C21.143 19.585 22 18.587 22 17.5c0-1.152-.963-2.204-2.546-3C17.623 13.58 14.962 13 12 13s-5.623.58-7.454 1.5C2.963 15.296 2 16.348 2 17.5s.963 2.204 2.546 3C6.377 21.42 9.038 22 12 22c3.107 0 5.882-.637 7.717-1.638' opacity='.6'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M9.25 4a2.75 2.75 0 1 1 5.5 0a2.75 2.75 0 0 1-5.5 0' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' d='m8.223 11.574l-2.175-.725a1.532 1.532 0 0 1 .805-2.952l1.898.407l.21.044a15 15 0 0 0 6.288-.044l1.897-.407a1.532 1.532 0 0 1 .806 2.952l-2.175.725c-.263.088-.394.132-.493.193a1 1 0 0 0-.466.986c.016.115.066.244.165.503l1.247 3.242a1.473 1.473 0 0 1-2.654 1.26L12 15l-1.576 2.757a1.473 1.473 0 0 1-2.654-1.26l1.247-3.241c.1-.259.149-.388.165-.503a1 1 0 0 0-.466-.986c-.099-.061-.23-.105-.493-.193'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:play-circle-bold-duotone,[i-solar\:play-circle-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2S2 6.477 2 12s4.477 10 10 10' clip-rule='evenodd' opacity='.5'/%3E%3Cpath fill='currentColor' d='m15.414 13.059l-4.72 2.787C9.934 16.294 9 15.71 9 14.786V9.214c0-.924.934-1.507 1.694-1.059l4.72 2.787c.781.462.781 1.656 0 2.118'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:play-circle-broken{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Cpath d='M13.888 9.935C14.963 10.812 15.5 11.25 15.5 12s-.537 1.188-1.612 2.065c-.297.242-.591.47-.862.66c-.237.167-.506.339-.784.508c-1.073.652-1.609.978-2.09.617c-.48-.36-.524-1.116-.612-2.628c-.024-.427-.04-.846-.04-1.222s.016-.795.04-1.222c.088-1.512.132-2.267.612-2.628c.481-.361 1.018-.035 2.09.617c.278.169.547.341.784.508c.27.19.565.418.862.66Z'/%3E%3Cpath stroke-linecap='round' d='M7 3.338A9.95 9.95 0 0 1 12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12c0-1.821.487-3.53 1.338-5'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:refresh-bold-duotone,[i-solar\:refresh-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M12.079 2.25c-4.794 0-8.734 3.663-9.118 8.333H2a.75.75 0 0 0-.528 1.283l1.68 1.666a.75.75 0 0 0 1.056 0l1.68-1.666a.75.75 0 0 0-.528-1.283h-.893c.38-3.831 3.638-6.833 7.612-6.833a7.66 7.66 0 0 1 6.537 3.643a.75.75 0 1 0 1.277-.786A9.16 9.16 0 0 0 12.08 2.25'/%3E%3Cpath fill='currentColor' d='M20.841 10.467a.75.75 0 0 0-1.054 0L18.1 12.133a.75.75 0 0 0 .527 1.284h.899c-.381 3.83-3.651 6.833-7.644 6.833a7.7 7.7 0 0 1-6.565-3.644a.75.75 0 1 0-1.276.788a9.2 9.2 0 0 0 7.84 4.356c4.809 0 8.766-3.66 9.151-8.333H22a.75.75 0 0 0 .527-1.284z' opacity='.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:round-double-alt-arrow-right-bold-duotone,[i-solar\:round-double-alt-arrow-right-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12' opacity='.5'/%3E%3Cpath fill='currentColor' d='M9.03 15.53a.75.75 0 0 1-1.06-1.06L10.44 12L7.97 9.53a.75.75 0 0 1 1.06-1.06l3 3a.75.75 0 0 1 0 1.06z'/%3E%3Cpath fill='currentColor' d='M13.03 15.53a.75.75 0 1 1-1.06-1.06L14.44 12l-2.47-2.47a.75.75 0 0 1 1.06-1.06l3 3a.75.75 0 0 1 0 1.06z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:running-2-line-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none'%3E%3Ccircle cx='18.5' cy='4.5' r='2.5' stroke='currentColor' stroke-width='1.5' opacity='.5'/%3E%3Cpath stroke='currentColor' stroke-linecap='round' stroke-width='1.5' d='m9 17l-1 1.2c-.738.886-1.107 1.328-1.61 1.564S5.31 20 4.157 20H3'/%3E%3Cpath fill='currentColor' d='M13.65 22a.75.75 0 0 0 1.5 0zm-1.085-5.754l.453-.598zm1.184 1.015l.587-.466zm.557 1.12l.727-.186zm-.802-6.826a.75.75 0 0 0-1.009-1.11zm-2.652 1.61l.703.26zm.07 1.555l-.677.323zm2.728 5.219v2.06h1.5v-2.06zm-1.538-3.095c.663.502.887.679 1.05.884l1.174-.934c-.308-.387-.717-.69-1.319-1.146zm3.038 3.095c0-.755.006-1.264-.117-1.744l-1.453.373c.065.254.07.538.07 1.37zm-1.988-2.211c.197.247.339.534.417.84l1.454-.373a3.75 3.75 0 0 0-.697-1.4zm-.667-7.283c-.42.381-.945.836-1.354 1.224c-.21.198-.41.398-.573.586c-.149.172-.327.4-.42.649l1.407.521c-.007.021.014-.035.146-.187c.116-.134.276-.295.471-.48c.4-.38.865-.778 1.332-1.203zm.523 5.203c-.488-.37-.818-.62-1.056-.832c-.233-.208-.32-.33-.363-.418l-1.354.645c.167.35.423.63.72.894c.292.26.679.552 1.147.907zm-2.87-2.744a2.75 2.75 0 0 0 .097 2.139l1.354-.645a1.25 1.25 0 0 1-.044-.973z' opacity='.5'/%3E%3Cpath fill='currentColor' d='m5.436 8.82l-.37-.652zm-1.807.164a.75.75 0 1 0 .742 1.304zm9.778-1.627l-.286.693zm-2.96-.715l-.055-.748zM21 12.75a.75.75 0 1 0 0-1.5zm-5.232-3.213l-.67.335zM5.065 8.168l-1.436.816l.742 1.304l1.435-.816zm8.627-1.505c-1.344-.553-2.08-.857-3.3-.769l.11 1.496c.823-.06 1.255.099 2.62.66zm-7.886 2.81c2.502-1.422 3.552-2 4.695-2.083l-.109-1.496c-1.56.114-2.949.923-5.327 2.274zm13.949 3.276H21v-1.5h-1.245zm-4.658-2.878a5.21 5.21 0 0 0 4.658 2.878v-1.5A3.71 3.71 0 0 1 16.439 9.2zm1.342-.67a5.33 5.33 0 0 0-2.747-2.538l-.57 1.387c.86.354 1.564 1 1.975 1.821z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:scale-bold-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M2 12c0-4.714 0-7.071 1.464-8.536C4.93 2 7.286 2 12 2s7.071 0 8.535 1.464C22 4.93 22 7.286 22 12s0 7.071-1.465 8.535C19.072 22 16.714 22 12 22s-7.071 0-8.536-1.465C2 19.072 2 16.714 2 12' opacity='.5'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M16.656 2.75a.75.75 0 0 1 0-1.5H22a.75.75 0 0 1 .75.75v5.344a.75.75 0 0 1-1.5 0V3.81l-7.44 7.439H16a.75.75 0 0 1 0 1.5h-4a.75.75 0 0 1-.75-.75V8a.75.75 0 0 1 1.5 0v2.19l7.44-7.44z' clip-rule='evenodd'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:settings-bold-duotone,[i-solar\:settings-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M14.279 2.152C13.909 2 13.439 2 12.5 2s-1.408 0-1.779.152a2 2 0 0 0-1.09 1.083c-.094.223-.13.484-.145.863a1.62 1.62 0 0 1-.796 1.353a1.64 1.64 0 0 1-1.579.008c-.338-.178-.583-.276-.825-.308a2.03 2.03 0 0 0-1.49.396c-.318.242-.553.646-1.022 1.453c-.47.807-.704 1.21-.757 1.605c-.07.526.074 1.058.4 1.479c.148.192.357.353.68.555c.477.297.783.803.783 1.361s-.306 1.064-.782 1.36c-.324.203-.533.364-.682.556a2 2 0 0 0-.399 1.479c.053.394.287.798.757 1.605s.704 1.21 1.022 1.453c.424.323.96.465 1.49.396c.242-.032.487-.13.825-.308a1.64 1.64 0 0 1 1.58.008c.486.28.774.795.795 1.353c.015.38.051.64.145.863c.204.49.596.88 1.09 1.083c.37.152.84.152 1.779.152s1.409 0 1.779-.152a2 2 0 0 0 1.09-1.083c.094-.223.13-.483.145-.863c.02-.558.309-1.074.796-1.353a1.64 1.64 0 0 1 1.579-.008c.338.178.583.276.825.308c.53.07 1.066-.073 1.49-.396c.318-.242.553-.646 1.022-1.453c.47-.807.704-1.21.757-1.605a2 2 0 0 0-.4-1.479c-.148-.192-.357-.353-.68-.555c-.477-.297-.783-.803-.783-1.361s.306-1.064.782-1.36c.324-.203.533-.364.682-.556a2 2 0 0 0 .399-1.479c-.053-.394-.287-.798-.757-1.605s-.704-1.21-1.022-1.453a2.03 2.03 0 0 0-1.49-.396c-.242.032-.487.13-.825.308a1.64 1.64 0 0 1-1.58-.008a1.62 1.62 0 0 1-.795-1.353c-.015-.38-.051-.64-.145-.863a2 2 0 0 0-1.09-1.083' clip-rule='evenodd' opacity='.5'/%3E%3Cpath fill='currentColor' d='M15.523 12c0 1.657-1.354 3-3.023 3s-3.023-1.343-3.023-3S10.83 9 12.5 9s3.023 1.343 3.023 3'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:settings-minimalistic-bold-duotone,[i-solar\:settings-minimalistic-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M12.428 2c-1.114 0-2.129.6-4.157 1.802l-.686.406C5.555 5.41 4.542 6.011 3.985 7c-.557.99-.557 2.19-.557 4.594v.812c0 2.403 0 3.605.557 4.594s1.57 1.59 3.6 2.791l.686.407C10.299 21.399 11.314 22 12.428 22s2.128-.6 4.157-1.802l.686-.407c2.028-1.2 3.043-1.802 3.6-2.791c.557-.99.557-2.19.557-4.594v-.812c0-2.403 0-3.605-.557-4.594s-1.572-1.59-3.6-2.792l-.686-.406C14.555 2.601 13.542 2 12.428 2' clip-rule='evenodd' opacity='.5'/%3E%3Cpath fill='currentColor' d='M12.428 8.25a3.75 3.75 0 1 0 0 7.5a3.75 3.75 0 0 0 0-7.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:settings-outline,[i-solar\:settings-outline=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='currentColor' fill-rule='evenodd' clip-rule='evenodd'%3E%3Cpath d='M12 8.25a3.75 3.75 0 1 0 0 7.5a3.75 3.75 0 0 0 0-7.5M9.75 12a2.25 2.25 0 1 1 4.5 0a2.25 2.25 0 0 1-4.5 0'/%3E%3Cpath d='M11.975 1.25c-.445 0-.816 0-1.12.02a2.8 2.8 0 0 0-.907.19a2.75 2.75 0 0 0-1.489 1.488c-.145.35-.184.72-.2 1.122a.87.87 0 0 1-.415.731a.87.87 0 0 1-.841-.005c-.356-.188-.696-.339-1.072-.389a2.75 2.75 0 0 0-2.033.545a2.8 2.8 0 0 0-.617.691c-.17.254-.356.575-.578.96l-.025.044c-.223.385-.408.706-.542.98c-.14.286-.25.568-.29.88a2.75 2.75 0 0 0 .544 2.033c.231.301.532.52.872.734a.87.87 0 0 1 .426.726a.87.87 0 0 1-.426.726c-.34.214-.64.433-.872.734a2.75 2.75 0 0 0-.545 2.033c.041.312.15.594.29.88c.135.274.32.595.543.98l.025.044c.222.385.408.706.578.96c.177.263.367.5.617.69a2.75 2.75 0 0 0 2.033.546c.376-.05.716-.2 1.072-.389a.87.87 0 0 1 .84-.005a.86.86 0 0 1 .417.731c.015.402.054.772.2 1.122a2.75 2.75 0 0 0 1.488 1.489c.29.12.59.167.907.188c.304.021.675.021 1.12.021h.05c.445 0 .816 0 1.12-.02c.318-.022.617-.069.907-.19a2.75 2.75 0 0 0 1.489-1.488c.145-.35.184-.72.2-1.122a.87.87 0 0 1 .415-.732a.87.87 0 0 1 .841.006c.356.188.696.339 1.072.388a2.75 2.75 0 0 0 2.033-.544c.25-.192.44-.428.617-.691c.17-.254.356-.575.578-.96l.025-.044c.223-.385.408-.706.542-.98c.14-.286.25-.569.29-.88a2.75 2.75 0 0 0-.544-2.033c-.231-.301-.532-.52-.872-.734a.87.87 0 0 1-.426-.726c0-.278.152-.554.426-.726c.34-.214.64-.433.872-.734a2.75 2.75 0 0 0 .545-2.033a2.8 2.8 0 0 0-.29-.88a18 18 0 0 0-.543-.98l-.025-.044a18 18 0 0 0-.578-.96a2.8 2.8 0 0 0-.617-.69a2.75 2.75 0 0 0-2.033-.546c-.376.05-.716.2-1.072.389a.87.87 0 0 1-.84.005a.87.87 0 0 1-.417-.731c-.015-.402-.054-.772-.2-1.122a2.75 2.75 0 0 0-1.488-1.489c-.29-.12-.59-.167-.907-.188c-.304-.021-.675-.021-1.12-.021zm-1.453 1.595c.077-.032.194-.061.435-.078c.247-.017.567-.017 1.043-.017s.796 0 1.043.017c.241.017.358.046.435.078c.307.127.55.37.677.677c.04.096.073.247.086.604c.03.792.439 1.555 1.165 1.974s1.591.392 2.292.022c.316-.167.463-.214.567-.227a1.25 1.25 0 0 1 .924.247c.066.051.15.138.285.338c.139.206.299.483.537.895s.397.69.506.912c.107.217.14.333.15.416a1.25 1.25 0 0 1-.247.924c-.064.083-.178.187-.48.377c-.672.422-1.128 1.158-1.128 1.996s.456 1.574 1.128 1.996c.302.19.416.294.48.377c.202.263.29.595.247.924c-.01.083-.044.2-.15.416c-.109.223-.268.5-.506.912s-.399.689-.537.895c-.135.2-.219.287-.285.338a1.25 1.25 0 0 1-.924.247c-.104-.013-.25-.06-.567-.227c-.7-.37-1.566-.398-2.292.021s-1.135 1.183-1.165 1.975c-.013.357-.046.508-.086.604a1.25 1.25 0 0 1-.677.677c-.077.032-.194.061-.435.078c-.247.017-.567.017-1.043.017s-.796 0-1.043-.017c-.241-.017-.358-.046-.435-.078a1.25 1.25 0 0 1-.677-.677c-.04-.096-.073-.247-.086-.604c-.03-.792-.439-1.555-1.165-1.974s-1.591-.392-2.292-.022c-.316.167-.463.214-.567.227a1.25 1.25 0 0 1-.924-.247c-.066-.051-.15-.138-.285-.338a17 17 0 0 1-.537-.895c-.238-.412-.397-.69-.506-.912c-.107-.217-.14-.333-.15-.416a1.25 1.25 0 0 1 .247-.924c.064-.083.178-.187.48-.377c.672-.422 1.128-1.158 1.128-1.996s-.456-1.574-1.128-1.996c-.302-.19-.416-.294-.48-.377a1.25 1.25 0 0 1-.247-.924c.01-.083.044-.2.15-.416c.109-.223.268-.5.506-.912s.399-.689.537-.895c.135-.2.219-.287.285-.338a1.25 1.25 0 0 1 .924-.247c.104.013.25.06.567.227c.7.37 1.566.398 2.292-.022c.726-.419 1.135-1.182 1.165-1.974c.013-.357.046-.508.086-.604c.127-.307.37-.55.677-.677'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:stop-circle-bold-duotone,[i-solar\:stop-circle-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2s10 4.477 10 10' opacity='.5'/%3E%3Cpath fill='currentColor' d='M8.586 8.586C8 9.172 8 10.114 8 12s0 2.828.586 3.414S10.114 16 12 16s2.828 0 3.414-.586S16 13.886 16 12s0-2.828-.586-3.414S13.886 8 12 8s-2.828 0-3.414.586'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:sun-2-outline,[i-solar\:sun-2-outline=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M12 1.25a.75.75 0 0 1 .75.75v2a.75.75 0 0 1-1.5 0V2a.75.75 0 0 1 .75-.75M3.669 3.716a.75.75 0 0 1 1.06-.047L6.95 5.7a.75.75 0 1 1-1.012 1.107L3.716 4.776a.75.75 0 0 1-.047-1.06m16.662 0a.75.75 0 0 1-.047 1.06l-2.222 2.031A.75.75 0 0 1 17.05 5.7l2.222-2.031a.75.75 0 0 1 1.06.047M12 7.75a4.25 4.25 0 1 0 0 8.5a4.25 4.25 0 0 0 0-8.5M6.25 12a5.75 5.75 0 1 1 11.5 0a5.75 5.75 0 0 1-11.5 0m-5 0a.75.75 0 0 1 .75-.75h2a.75.75 0 0 1 0 1.5H2a.75.75 0 0 1-.75-.75m18 0a.75.75 0 0 1 .75-.75h2a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1-.75-.75m-2.224 5.025a.75.75 0 0 1 1.06 0l2.222 2.223a.75.75 0 0 1-1.06 1.06l-2.222-2.222a.75.75 0 0 1 0-1.06m-10.051 0a.75.75 0 0 1 0 1.061l-2.223 2.222a.75.75 0 0 1-1.06-1.06l2.222-2.223a.75.75 0 0 1 1.06 0M12 19.25a.75.75 0 0 1 .75.75v2a.75.75 0 0 1-1.5 0v-2a.75.75 0 0 1 .75-.75' clip-rule='evenodd'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:trash-bin-trash-linear,[i-solar\:trash-bin-trash-linear=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' d='M20.5 6h-17m15.333 2.5l-.46 6.9c-.177 2.654-.265 3.981-1.13 4.79s-2.196.81-4.856.81h-.774c-2.66 0-3.991 0-4.856-.81c-.865-.809-.954-2.136-1.13-4.79l-.46-6.9M9.5 11l.5 5m4.5-5l-.5 5'/%3E%3Cpath d='M6.5 6h.11a2 2 0 0 0 1.83-1.32l.034-.103l.097-.291c.083-.249.125-.373.18-.479a1.5 1.5 0 0 1 1.094-.788C9.962 3 10.093 3 10.355 3h3.29c.262 0 .393 0 .51.019a1.5 1.5 0 0 1 1.094.788c.055.106.097.23.18.479l.097.291A2 2 0 0 0 17.5 6'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:tuning-outline,[i-solar\:tuning-outline=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M16.959 9.75a.75.75 0 0 1-.75-.75V2a.75.75 0 0 1 1.5 0v7a.75.75 0 0 1-.75.75'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M7 5.75a3.75 3.75 0 1 1 0 7.5a3.75 3.75 0 0 1 0-7.5M9.25 9.5a2.25 2.25 0 1 0-4.5 0a2.25 2.25 0 0 0 4.5 0M17 18.25a3.75 3.75 0 1 0 0-7.5a3.75 3.75 0 0 0 0 7.5m2.25-3.75a2.25 2.25 0 1 1-4.5 0a2.25 2.25 0 0 1 4.5 0' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' d='M6.209 15a.75.75 0 0 1 1.5 0v7a.75.75 0 0 1-1.5 0zm10.75 7.75a.75.75 0 0 1-.75-.75v-2a.75.75 0 0 1 1.5 0v2a.75.75 0 0 1-.75.75M6.209 2a.75.75 0 0 1 1.5 0v2a.75.75 0 0 1-1.5 0z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:tuning-square-linear{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Cpath d='M2 12c0-4.714 0-7.071 1.464-8.536C4.93 2 7.286 2 12 2s7.071 0 8.535 1.464C22 4.93 22 7.286 22 12s0 7.071-1.465 8.535C19.072 22 16.714 22 12 22s-7.071 0-8.536-1.465C2 19.072 2 16.714 2 12Z'/%3E%3Ccircle cx='8' cy='10' r='2'/%3E%3Ccircle cx='2' cy='2' r='2' transform='matrix(1 0 0 -1 14 16)'/%3E%3Cpath stroke-linecap='round' d='M8 14v5m8-9V5M8 5v1m8 13v-1'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:undo-left-bold-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M7.53 3.47a.75.75 0 0 1 0 1.06L5.06 7l2.47 2.47a.75.75 0 1 1-1.06 1.06l-3-3a.75.75 0 0 1 0-1.06l3-3a.75.75 0 0 1 1.06 0' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' d='m5.06 7l.75-.75h9.226c.904 0 1.633 0 2.222.053c.606.055 1.136.172 1.617.45a3.75 3.75 0 0 1 1.372 1.372c.278.481.395 1.011.45 1.617c.053.589.053 1.318.053 2.222v.072c0 .904 0 1.633-.053 2.222c-.055.606-.172 1.136-.45 1.617a3.75 3.75 0 0 1-1.372 1.373c-.481.277-1.011.394-1.617.449c-.589.053-1.318.053-2.222.053H8a.75.75 0 0 1 0-1.5h7c.948 0 1.61 0 2.122-.047c.502-.046.788-.13 1.003-.254a2.25 2.25 0 0 0 .823-.824c.125-.215.21-.5.255-1.003c.046-.512.047-1.174.047-2.122s0-1.61-.047-2.122c-.046-.503-.13-.788-.255-1.003a2.25 2.25 0 0 0-.823-.824c-.215-.124-.5-.208-1.003-.254c-.512-.046-1.174-.047-2.122-.047H5.81z' opacity='.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:upload-minimalistic-bold,[i-solar\:upload-minimalistic-bold=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M12.554 2.494a.75.75 0 0 0-1.107 0l-4 4.375A.75.75 0 0 0 8.553 7.88l2.696-2.95V16a.75.75 0 0 0 1.5 0V4.932l2.697 2.95a.75.75 0 1 0 1.107-1.013z'/%3E%3Cpath fill='currentColor' d='M3.75 15a.75.75 0 0 0-1.5 0v.055c0 1.367 0 2.47.117 3.337c.12.9.38 1.658.981 2.26c.602.602 1.36.86 2.26.982c.867.116 1.97.116 3.337.116h6.11c1.367 0 2.47 0 3.337-.116c.9-.122 1.658-.38 2.26-.982s.86-1.36.982-2.26c.116-.867.116-1.97.116-3.337V15a.75.75 0 0 0-1.5 0c0 1.435-.002 2.436-.103 3.192c-.099.734-.28 1.122-.556 1.399c-.277.277-.665.457-1.4.556c-.755.101-1.756.103-3.191.103H9c-1.435 0-2.437-.002-3.192-.103c-.734-.099-1.122-.28-1.399-.556c-.277-.277-.457-.665-.556-1.4c-.101-.755-.103-1.756-.103-3.191'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:upload-square-line-duotone,[i-solar\:upload-square-line-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M12 17v-7m0 0l3 3m-3-3l-3 3'/%3E%3Cpath stroke-linecap='round' d='M16 7H8'/%3E%3Cpath d='M2 12c0-4.714 0-7.071 1.464-8.536C4.93 2 7.286 2 12 2s7.071 0 8.535 1.464C22 4.93 22 7.286 22 12s0 7.071-1.465 8.535C19.072 22 16.714 22 12 22s-7.071 0-8.536-1.465C2 19.072 2 16.714 2 12Z' opacity='.5'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:user-rounded-linear{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Ccircle cx='12' cy='6' r='4'/%3E%3Cellipse cx='12' cy='17' rx='7' ry='4'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:user-speak-rounded-bold-duotone,[i-solar\:user-speak-rounded-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Ccircle cx='10' cy='6.75' r='4' fill='currentColor'/%3E%3Cellipse cx='10' cy='17.75' fill='currentColor' opacity='.5' rx='7' ry='4'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M18.357 2.364a.75.75 0 0 1 1.029-.257L19 2.75l.386-.643h.001l.002.002l.004.002l.01.006l.113.076c.07.049.166.12.277.212c.222.185.512.462.802.838c.582.758 1.155 1.914 1.155 3.507s-.573 2.75-1.155 3.507c-.29.376-.58.653-.802.838a4 4 0 0 1-.363.27l-.028.018l-.01.006l-.003.002l-.002.001s-.001.001-.387-.642l.386.643a.75.75 0 0 1-.776-1.283l.005-.004l.041-.027q.06-.042.177-.136c.152-.128.362-.326.573-.6c.417-.542.844-1.386.844-2.593s-.427-2.05-.844-2.593a3.8 3.8 0 0 0-.573-.6a3 3 0 0 0-.218-.163l-.005-.003a.75.75 0 0 1-.253-1.027' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M16.33 4.415a.75.75 0 0 1 1.006-.336L17 4.75l.336-.67h.001l.002.001l.004.002l.008.004l.022.012a2 2 0 0 1 .233.153c.136.102.31.254.48.467c.349.436.664 1.099.664 2.031s-.316 1.595-.664 2.031a2.7 2.7 0 0 1-.654.586l-.06.034l-.02.012l-.01.004l-.003.002l-.002.001l-.33-.657l.329.658a.75.75 0 0 1-.685-1.335l.003-.001l.052-.036c.052-.04.13-.106.209-.205c.15-.189.335-.526.335-1.094s-.184-.905-.335-1.094a1.2 1.2 0 0 0-.261-.24l-.003-.002a.75.75 0 0 1-.322-1' clip-rule='evenodd'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-svg-spinners\:3-dots-fade{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Ccircle cx='4' cy='12' r='3' fill='currentColor'%3E%3Canimate id='svgSpinners3DotsFade0' fill='freeze' attributeName='opacity' begin='0;svgSpinners3DotsFade1.end-0.25s' dur='0.75s' values='1;.2'/%3E%3C/circle%3E%3Ccircle cx='12' cy='12' r='3' fill='currentColor' opacity='.4'%3E%3Canimate fill='freeze' attributeName='opacity' begin='svgSpinners3DotsFade0.begin+0.15s' dur='0.75s' values='1;.2'/%3E%3C/circle%3E%3Ccircle cx='20' cy='12' r='3' fill='currentColor' opacity='.3'%3E%3Canimate id='svgSpinners3DotsFade1' fill='freeze' attributeName='opacity' begin='svgSpinners3DotsFade0.begin+0.3s' dur='0.75s' values='1;.2'/%3E%3C/circle%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-svg-spinners\:ring-resize{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg stroke='currentColor'%3E%3Ccircle cx='12' cy='12' r='9.5' fill='none' stroke-linecap='round' stroke-width='3'%3E%3Canimate attributeName='stroke-dasharray' calcMode='spline' dur='1.5s' keySplines='0.42,0,0.58,1;0.42,0,0.58,1;0.42,0,0.58,1' keyTimes='0;0.475;0.95;1' repeatCount='indefinite' values='0 150;42 150;42 150;42 150'/%3E%3Canimate attributeName='stroke-dashoffset' calcMode='spline' dur='1.5s' keySplines='0.42,0,0.58,1;0.42,0,0.58,1;0.42,0,0.58,1' keyTimes='0;0.475;0.95;1' repeatCount='indefinite' values='0;-16;-59;-59'/%3E%3C/circle%3E%3CanimateTransform attributeName='transform' dur='2s' repeatCount='indefinite' type='rotate' values='0 12 12;360 12 12'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-vscode-icons\:file-type-minecraft{background:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='%2352a535' d='M30 2H2v28h28z'/%3E%3Cpath fill='%2386d562' d='M24.4 13.2h-5.6v.47h5.6zm-5.6 8.4h-5.6v.47h5.6zm2.8 2.8h-2.8v.47h2.8zm-8.4 0h-2.8v.47h2.8zm0-11.2H7.6v.47h5.6z'/%3E%3Cpath d='M24.4 13.2V7.6h-5.6v5.6h-5.6V16h-2.8v8.4h2.8v-2.8h5.6v2.8h2.8V16h-2.8v-2.8zM13.2 7.6H7.6v5.6h5.6z'/%3E%3Cpath fill='%232a641c' d='M24.4 7.6h-5.6v.47h5.6zm-5.6 5.6h-5.6v.47h5.6zm-5.6-5.6H7.6v.47h5.6zm0 8.4h-2.8v.47h2.8zm8.4 0h-2.8v.47h2.8z'/%3E%3C/svg%3E") 0 0/100% 100% no-repeat;width:1.2em;height:1.2em}.prose :where(h1,h2,h3,h4,h5,h6):not(:where(.not-prose,.not-prose *)){color:var(--un-prose-headings);font-weight:600;line-height:1.25}.prose :where(a):not(:where(.not-prose,.not-prose *)){color:var(--un-prose-links);font-weight:500;text-decoration:underline}.prose :where(a code):not(:where(.not-prose,.not-prose *)){color:var(--un-prose-links)}.prose :where(p,ul,ol,pre):not(:where(.not-prose,.not-prose *)){margin:1em 0;line-height:1.75}.prose :where(blockquote):not(:where(.not-prose,.not-prose *)){border-left:.25em solid var(--un-prose-borders);margin:1em 0;padding-left:1em;font-style:italic}.prose :where(h1):not(:where(.not-prose,.not-prose *)){margin:1rem 0;font-size:2.25em}.prose :where(h2):not(:where(.not-prose,.not-prose *)){margin:1.75em 0 .5em;font-size:1.75em}.prose :where(h3):not(:where(.not-prose,.not-prose *)){margin:1.5em 0 .5em;font-size:1.375em}.prose :where(h4):not(:where(.not-prose,.not-prose *)){margin:1em 0;font-size:1.125em}.prose :where(img,video):not(:where(.not-prose,.not-prose *)){max-width:100%}.prose :where(figure,picture):not(:where(.not-prose,.not-prose *)){margin:1em 0}.prose :where(figcaption):not(:where(.not-prose,.not-prose *)){color:var(--un-prose-captions);font-size:.875em}.prose :where(code):not(:where(.not-prose,.not-prose *)){color:var(--un-prose-code);font-family:DM Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:.875em;font-weight:600}.prose :where(:not(pre)>code):not(:where(.not-prose,.not-prose *)):before,.prose :where(:not(pre)>code):not(:where(.not-prose,.not-prose *)):after{content:"`"}.prose :where(pre):not(:where(.not-prose,.not-prose *)){border-radius:.375rem;padding:1.25rem 1.5rem;overflow-x:auto}.prose :where(pre,code):not(:where(.not-prose,.not-prose *)){white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;tab-size:4;-webkit-hyphens:none;hyphens:none;background:0 0}.prose :where(pre code):not(:where(.not-prose,.not-prose *)){font-weight:inherit}.prose :where(ol,ul):not(:where(.not-prose,.not-prose *)){padding-left:1.25em}.prose :where(ol):not(:where(.not-prose,.not-prose *)){list-style-type:decimal}.prose :where(ol[type=A]):not(:where(.not-prose,.not-prose *)){list-style-type:upper-alpha}.prose :where(ol[type=a]):not(:where(.not-prose,.not-prose *)){list-style-type:lower-alpha}.prose :where(ol[type=A s]):not(:where(.not-prose,.not-prose *)){list-style-type:upper-alpha}.prose :where(ol[type=a s]):not(:where(.not-prose,.not-prose *)){list-style-type:lower-alpha}.prose :where(ol[type=I]):not(:where(.not-prose,.not-prose *)){list-style-type:upper-roman}.prose :where(ol[type=i]):not(:where(.not-prose,.not-prose *)){list-style-type:lower-roman}.prose :where(ol[type=I s]):not(:where(.not-prose,.not-prose *)){list-style-type:upper-roman}.prose :where(ol[type=i s]):not(:where(.not-prose,.not-prose *)){list-style-type:lower-roman}.prose :where(ol[type="1"]):not(:where(.not-prose,.not-prose *)){list-style-type:decimal}.prose :where(ul):not(:where(.not-prose,.not-prose *)){list-style-type:disc}.prose :where(ol>li):not(:where(.not-prose,.not-prose *))::marker{color:var(--un-prose-lists)}.prose :where(ul>li):not(:where(.not-prose,.not-prose *))::marker{color:var(--un-prose-lists)}.prose :where(summary):not(:where(.not-prose,.not-prose *))::marker{color:var(--un-prose-lists)}.prose :where(hr):not(:where(.not-prose,.not-prose *)){border:1px solid var(--un-prose-hr);margin:2em 0}.prose :where(table):not(:where(.not-prose,.not-prose *)){border-collapse:collapse;margin:1em 0;display:block;overflow-x:auto}.prose :where(tr):not(:where(.not-prose,.not-prose *)):nth-child(2n){background:var(--un-prose-bg-soft)}.prose :where(td,th):not(:where(.not-prose,.not-prose *)){border:1px solid var(--un-prose-borders);padding:.625em 1em}.prose :where(abbr):not(:where(.not-prose,.not-prose *)){cursor:help}.prose :where(kbd):not(:where(.not-prose,.not-prose *)){color:var(--un-prose-code);border:1px solid;border-radius:.25rem;padding:.25rem .5rem;font-size:.875em}.prose :where(details):not(:where(.not-prose,.not-prose *)){background:var(--un-prose-bg-soft);margin:1em 0;padding:1.25rem 1.5rem}.prose :where(summary):not(:where(.not-prose,.not-prose *)){cursor:pointer;font-weight:600}.prose{color:var(--un-prose-body);max-width:65ch}.container,[container=""]{width:100%}.scrollbar-none,[scrollbar-none=""]{scrollbar-width:none}.scrollbar-none::-webkit-scrollbar{display:none}[scrollbar-none=""]::-webkit-scrollbar{display:none}@media (min-width:640px){.container,[container=""]{max-width:640px}}@media (min-width:768px){.container,[container=""]{max-width:768px}}@media (min-width:1024px){.container,[container=""]{max-width:1024px}}@media (min-width:1280px){.container,[container=""]{max-width:1280px}}@media (min-width:1536px){.container,[container=""]{max-width:1536px}}.\[input\:checked\~\&\]{input:checked~&}.sr-only{clip:rect(0,0,0,0);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.pointer-events-none,[pointer-events-none=""],.disabled\:pointer-events-none:disabled{pointer-events:none}.\!visible{visibility:visible!important}.visible{visibility:visible}.absolute,[absolute=""]{position:absolute}.fixed,[fixed=""]{position:fixed}.relative,[relative=""]{position:relative}.sticky,[sticky=""]{position:sticky}.before-position-absolute:before,[before~=absolute]:before,.after\:absolute:after,[after~=absolute]:after{position:absolute}.inset-0,[inset-0=""],.before\:inset-0:before,[before~=inset-0]:before,[after~=inset-0]:after{inset:0}.inset-x-0,[inset-x-0=""]{left:0;right:0}.inset-y-0{top:0;bottom:0}.bottom-0,[bottom-0=""]{bottom:0}.bottom-2{bottom:.5rem}.left-0,[left-0=""]{left:0}.left-1\/2{left:50%}.left-10,[left-10=""]{left:2.5rem}.left-2{left:.5rem}.right--10,[right--10=""]{right:-2.5rem}.right--15,[right--15=""]{right:-3.75rem}.right--5,[right--5=""]{right:-1.25rem}.right-0,[right-0=""]{right:0}.right-2,[right-2=""]{right:.5rem}.right-4,[right-4=""]{right:1rem}.top--20,[top--20=""]{top:-5rem}.top-\[-32px\]{top:-32px}.top-0,[top-0=""],[top~="0"]{top:0}.top-1\/2,[top~="50%"]{top:50%}.top-2,[top-2=""]{top:.5rem}[top~="[65dvh]"]{top:65dvh}[top~="[calc(100dvh-12rem)]"]{top:calc(100dvh - 12rem)}[top~="[calc(100dvh-15rem)]"]{top:calc(100dvh - 15rem)}.after\:left-\[2px\]:after{left:2px}.after\:top-\[2px\]:after{top:2px}.line-clamp-1,[line-clamp-1=""]{-webkit-line-clamp:1;line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-2{-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-3,[line-clamp-3=""]{-webkit-line-clamp:3;line-clamp:3;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.z--1,[z--1=""]{z-index:-1}.z--2{z-index:-2}.z-\[9999\]{z-index:9999}.z-0{z-index:0}.z-1,[z-1=""]{z-index:1}.z-10,[z-10=""]{z-index:10}.z-100,[z-100=""]{z-index:100}.z-1000{z-index:1000}.z-15,[z-15=""]{z-index:15}.z-2,[z-2=""]{z-index:2}.z-3,[z-3=""]{z-index:3}.z-4,[z-4=""]{z-index:4}.z-5,[z-5=""]{z-index:5}.z-99,[z-99=""]{z-index:99}[before~=z-0]:before{z-index:0}[after~=z--2]:after{z-index:-2}.\[\&\>div\]\:grid>div,.grid,[grid=""],[grid~=\~]{display:grid}.col-span-full{grid-column:1/-1}.auto-cols-\[350px\]{grid-auto-columns:350px}.auto-cols-auto{grid-auto-columns:auto}.grid-auto-rows-\[minmax\(min-content\,max-content\)\]{grid-auto-rows:minmax(min-content,max-content)}.grid-auto-flow-dense{grid-auto-flow:dense}.grid-flow-col{grid-auto-flow:column}.grid-flow-row{grid-auto-flow:row}.\[\&\>div\]\:grid-cols-\[4fr_2fr\]>div{grid-template-columns:4fr 2fr}.cols-\[150px_1fr\],[grid~="cols-[150px_1fr]"]{grid-template-columns:150px 1fr}.cols-\[70px_1fr\],[grid~="cols-[70px_1fr]"]{grid-template-columns:70px 1fr}.grid-cols-\[repeat\(auto-fill\,minmax\(280px\,1fr\)\)\]{grid-template-columns:repeat(auto-fill,minmax(280px,1fr))}.cols-1,.grid-cols-1,[grid~=cols-1]{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2,[grid-cols-2=""]{grid-template-columns:repeat(2,minmax(0,1fr))}.m-0,[m0=""]{margin:0}.m-1{margin:.25rem}.m-auto{margin:auto}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-5,[mx-5=""]{margin-left:1.25rem;margin-right:1.25rem}.mx-auto,[mx-auto=""]{margin-left:auto;margin-right:auto}.my,.my-4{margin-top:1rem;margin-bottom:1rem}.my-0,[my-0=""]{margin-top:0;margin-bottom:0}.my-10,[my-10=""]{margin-top:2.5rem;margin-bottom:2.5rem}.my-3{margin-top:.75rem;margin-bottom:.75rem}.my-5,[my-5=""]{margin-top:1.25rem;margin-bottom:1.25rem}.my-auto,[my-auto=""]{margin-top:auto;margin-bottom:auto}[m~=y-1]{margin-top:.25rem;margin-bottom:.25rem}.-mb-px{margin-bottom:-1px}.mb-0{margin-bottom:0}.mb-1,[mb-1=""]{margin-bottom:.25rem}.mb-14,[mb-14=""]{margin-bottom:3.5rem}.mb-2,[mb-2=""]{margin-bottom:.5rem}.mb-3,[mb-3=""]{margin-bottom:.75rem}.mb-4,[mb-4=""]{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.ml{margin-left:1rem}.ml-0\.5,[ml-0\.5=""]{margin-left:.125rem}.ml-1,[ml-1=""]{margin-left:.25rem}.ml-auto{margin-left:auto}.mr{margin-right:1rem}.mr-0\!{margin-right:0!important}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mr-auto{margin-right:auto}.ms{margin-inline-start:1rem}.mt-0\.5{margin-top:.125rem}.mt-1,[mt-1=""]{margin-top:.25rem}.mt-2,[mt-2=""]{margin-top:.5rem}.mt-20{margin-top:5rem}.mt-3{margin-top:.75rem}.mt-4,[mt-4=""]{margin-top:1rem}.mt-auto{margin-top:auto}[ml~="12"]{margin-left:3rem}[mr~="12"]{margin-right:3rem}[box~=border]{box-sizing:border-box}.inline,[inline=""]{display:inline}.block,[block=""]{display:block}.inline-block,[inline-block=""]{display:inline-block}.contents{display:contents}.aspect-square,[aspect-square=""]{aspect-ratio:1}.size-16,[size-16=""]{width:4rem;height:4rem}.size-2{width:.5rem;height:.5rem}.size-20,[size-20=""]{width:5rem;height:5rem}.size-24,[size-24=""],[size~="24"]{width:6rem;height:6rem}.size-3,[size-3=""]{width:.75rem;height:.75rem}.size-5,[size-5=""]{width:1.25rem;height:1.25rem}.size-6,[size-6=""],[size~="6"]{width:1.5rem;height:1.5rem}.size-60,[size-60=""]{width:15rem;height:15rem}.size-8,[size-8=""]{width:2rem;height:2rem}[size~="1"]{width:.25rem;height:.25rem}[size~=sm]{width:24rem;height:24rem}.h-\[calc\(100\%-40px\)\]{height:calc(100% - 40px)}.h-0\.5,[h-0\.5=""]{height:.125rem}.h-0\.5lh{height:.5lh}.h-1\.5,[h-1\.5=""]{height:.375rem}.h-10{height:2.5rem}.h-100dvh,[h-100dvh=""],[h~="100dvh"]{height:100dvh}.h-12{height:3rem}.h-16{height:4rem}.h-18,[h-18=""]{height:4.5rem}.h-1lh{height:1lh}.h-2,.h2,[h-2=""]{height:.5rem}.h-24,[h-24=""]{height:6rem}.h-3\.5{height:.875rem}.h-30,[h-30=""]{height:7.5rem}.h-4,[h-4=""]{height:1rem}.h-48,[h-48=""]{height:12rem}.h-5,[h-5=""]{height:1.25rem}.h-6{height:1.5rem}.h-60,[h-60=""]{height:15rem}.h-7,[h-7=""]{height:1.75rem}.h-8,[h-8=""]{height:2rem}.h-auto,[h-auto=""],[h~=auto]{height:auto}.h-fit,[h-fit=""]{height:fit-content}.h-full,[h-full=""],[h~="100%"]{height:100%}.h1{height:.25rem}.h3{height:.75rem}.max-h-\[10lh\],[max-h~="[10lh]"]{max-height:10lh}.max-h-\[90vh\]{max-height:90vh}.max-h-\[96\%\]{max-height:96%}.max-h-\[calc\(100dvh-100px-56px\)\]{max-height:calc(100dvh - 156px)}.max-h-\[calc\(100dvh-17rem\)\]{max-height:calc(100dvh - 17rem)}.max-h-\[calc\(100dvh-7lh\)\]{max-height:calc(100dvh - 7lh)}.max-h-100dvh,[max-h-100dvh=""],[max-h~="100dvh"]{max-height:100dvh}.max-h-60,[max-h-60=""]{max-height:15rem}.max-h-full{max-height:100%}.max-h-none,[max-h-none=""]{max-height:none}.max-w-100dvw,[max-w-100dvw=""]{max-width:100dvw}.max-w-2xl{max-width:42rem}.max-w-6xl{max-width:72rem}.max-w-full,[max-w-full=""]{max-width:100%}.max-w-md{max-width:28rem}.min-h-\[120px\],.min-h-120px,[min-h-120px=""]{min-height:120px}.min-h-\[1lh\]{min-height:1lh}.min-h-16,[min-h-16=""]{min-height:4rem}.min-h-40px,[min-h-40px=""]{min-height:40px}.min-h-70dvh,[min-h-70dvh=""]{min-height:70dvh}.min-w-\[150px\]{min-width:150px}.min-w-\[160px\],[min-w~="[160px]"]{min-width:160px}.min-w-\[200px\]{min-width:200px}.min-w-\[max-content\]{min-width:max-content}.min-w-0,[min-w-0=""]{min-width:0}.min-w-2,[min-w-2=""]{min-width:.5rem}.min-w-20,[min-w-20=""]{min-width:5rem}.min-w-20px{min-width:20px}.min-w-50,[min-w-50=""]{min-width:12.5rem}.w-\[92dvw\]{width:92dvw}.w-\[92vw\]{width:92vw}.w-0\!{width:0!important}.w-1{width:.25rem}.w-1\.5,[w-1\.5=""]{width:.375rem}.w-1\/2,[w~="[50%]"]{width:50%}.w-10\%{width:10%}.w-100,[w-100=""]{width:25rem}.w-100\%,.w-full,[w-full=""],[w~="100%"],[w~=full]{width:100%}.w-100vw,[w-100vw=""]{width:100vw}.w-11{width:2.75rem}.w-18,[w-18=""]{width:4.5rem}.w-1lh{width:1lh}.w-2,[w-2=""]{width:.5rem}.w-25\%{width:25%}.w-3\.5{width:.875rem}.w-30,[w-30=""]{width:7.5rem}.w-4{width:1rem}.w-4\/5{width:80%}.w-5,[w-5=""]{width:1.25rem}.w-8,[w-8=""]{width:2rem}.w-90\%{width:90%}.w-95\%{width:95%}.w-auto,[w-auto=""]{width:auto}.w-fit,[w-fit=""]{width:fit-content}[h~="[14px]"]{height:14px}[h~="[calc(1lh+4px+4px)]"]{height:calc(1lh + 8px)}[h~="300"]{height:75rem}[h~="50%"]{height:50%}[h~="85dvh"]{height:85dvh}[h~=unset]{height:unset}[max-h~="[300px]"]{max-height:300px}[max-h~="[4.5rem]"]{max-height:4.5rem}[max-h~="[85vh]"]{max-height:85vh}[max-h~="100"]{max-height:25rem}[max-h~="35dvh"]{max-height:35dvh}[max-h~="50"]{max-height:12.5rem}[max-w~="[calc(100%-3.5rem)]"]{max-width:calc(100% - 3.5rem)}[max-w~="500px"]{max-width:500px}[min-h~="[100px]"]{min-height:100px}[min-h~="[calc(1lh+4px+4px)]"]{min-height:calc(1lh + 8px)}[min-h~="100"]{min-height:25rem}[min-h~="120"]{min-height:30rem}[min-w~="1/2"],[min-w~="50%"]{min-width:50%}[min-w~="30%"]{min-width:30%}[min-w~="3em"]{min-width:3em}[w~="[1px]"]{width:1px}[w~="[calc(1lh+4px+4px)]"]{width:calc(1lh + 8px)}[w~="100dvw"]{width:100dvw}[w~="12.5"]{width:3.125rem}[w~="70%"]{width:70%}.hover\:h-13:hover{height:3.25rem}.hover\:w-2:hover{width:.5rem}.before\:h-full:before{height:100%}.before\:w-1:before{width:.25rem}[before~=h-full]:before{height:100%}[before~=w-25\%]:before{width:25%}.after\:h-5:after{height:1.25rem}.after\:w-5:after{width:1.25rem}[after~=h-full]:after{height:100%}[after~=w-full]:after{width:100%}.max-w-screen-xl,[max-w-screen-xl=""]{max-width:1280px}.flex,[flex=""],[flex~=\~]{display:flex}.inline-flex,[inline-flex=""],[inline-flex~=\~]{display:inline-flex}.flex-1,[flex-1=""],[flex~="1"]{flex:1}.flex-shrink-0,.shrink-0,[flex-shrink-0=""],[shrink-0=""]{flex-shrink:0}.flex-row,[flex-row=""],[flex~=row]{flex-direction:row}[flex~=row-reverse]{flex-direction:row-reverse}.flex-col,[flex-col=""],[flex~=col]{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap,[flex-wrap=""]{flex-wrap:wrap}.origin-left,[origin-left=""]{transform-origin:0}[perspective~="800"]{perspective:800px}.-translate-x-1\/2,.translate-x-\[-50\%\]{--un-translate-x:-50%;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.-translate-y-1\/2,.translate-y-\[-50\%\],[transform~="translate-y-[-50%]"],[translate-y~="[-50%]"]{--un-translate-y:-50%;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.translate-x-\[50\%\],[transform~="translate-x-[50%]"]{--un-translate-x:50%;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.translate-y--2,[transform~=translate-y--2]{--un-translate-y:-.5rem;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.translate-y-\[0\.25lh\]{--un-translate-y:.25lh;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.translate-y-\[50\%\]{--un-translate-y:50%;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.translate-y-1,[translate-y-1=""]{--un-translate-y:.25rem;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.translate-y-2,[translate-y-2=""]{--un-translate-y:.5rem;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.translate-y-4,[translate-y-4=""]{--un-translate-y:1rem;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}[translate-x~="0.5"]{--un-translate-x:.125rem;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}[translate-x~="data-[state=checked]:full"][data-state=checked]{--un-translate-x:100%;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}[translate-y~="[-100%]"]{--un-translate-y:-100%;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}[translate-y~="[-80%]"]{--un-translate-y:-80%;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}[translate-y~="[2px]"]{--un-translate-y:2px;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.peer:checked~.peer-checked\:after\:translate-x-full:after{--un-translate-x:100%;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.\[\&_\.card-cover_img\]\:hover\:translate-y-2:hover .card-cover img,[hover\:translate-y-2=""]:hover{--un-translate-y:.5rem;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.rotate-180{--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-rotate:180deg;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.scale-100{--un-scale-x:1;--un-scale-y:1;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.scale-120{--un-scale-x:1.2;--un-scale-y:1.2;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.scale-125{--un-scale-x:1.25;--un-scale-y:1.25;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.\[\&_\.card-cover_img\]\:hover\:scale-102:hover .card-cover img{--un-scale-x:1.02;--un-scale-y:1.02;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.hover\:scale-110:hover{--un-scale-x:1.1;--un-scale-y:1.1;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}[hover~=scale-100]:hover{--un-scale-x:1;--un-scale-y:1;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.active\:scale-95:active{--un-scale-x:.95;--un-scale-y:.95;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.transform-scale-x--100,[transform-scale-x--100=""]{--un-scale-x:-1;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.preserve-3d{transform-style:preserve-3d}.transform,[transform=""]{transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.animate-pulse,[animate-pulse=""]{animation:2s cubic-bezier(.4,0,.6,1) infinite pulse}.animate-spin{animation:1s linear infinite spin}.disabled\:cursor-default:disabled{cursor:default}.cursor-pointer,[cursor-pointer=""],[cursor~=pointer]{cursor:pointer}.cursor-not-allowed,.disabled\:cursor-not-allowed:disabled,[cursor~=disabled\:not-allowed]:disabled,[disabled\:cursor-not-allowed=""]:disabled{cursor:not-allowed}.cursor-col-resize{cursor:col-resize}.cursor-ew-resize,[cursor-ew-resize=""]{cursor:ew-resize}.resize-none,[resize-none=""]{resize:none}.appearance-none{appearance:none}.items-start,[flex~=items-start],[items-start=""]{align-items:flex-start}.items-end,[items-end=""]{align-items:flex-end}.items-center,[flex~=items-center],[items-center=""]{align-items:center}.self-start,[self-start=""]{align-self:flex-start}.self-end,[self-end=""]{align-self:flex-end}.justify-start{justify-content:flex-start}.justify-end,[justify-end=""]{justify-content:flex-end}.justify-center,[flex~=justify-center],[justify-center=""]{justify-content:center}.justify-between,[justify-between=""]{justify-content:space-between}.justify-self-end,[justify-self-end=""]{justify-self:end}.gap-0\.5,[gap-0\.5=""]{gap:.125rem}.gap-1,[flex~=gap-1],[gap-1=""]{gap:.25rem}.gap-1\.5,[gap-1\.5=""]{gap:.375rem}.gap-2,[flex~=gap-2],[gap-2=""]{gap:.5rem}.gap-3,[flex~=gap-3],[gap-3=""]{gap:.75rem}.gap-4,[flex~=gap-4],[gap-4=""],[grid~=gap-4]{gap:1rem}.gap-5,[gap-5=""]{gap:1.25rem}.gap-6,[flex~=gap-6]{gap:1.5rem}.gap-8{gap:2rem}.gap-x-2,[flex~=gap-x-2]{column-gap:.5rem}.gap-y-0,[flex~=gap-y-0]{row-gap:0}.space-x-1>:not([hidden])~:not([hidden]){--un-space-x-reverse:0;margin-left:calc(.25rem*calc(1 - var(--un-space-x-reverse)));margin-right:calc(.25rem*var(--un-space-x-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--un-space-y-reverse:0;margin-top:calc(.25rem*calc(1 - var(--un-space-y-reverse)));margin-bottom:calc(.25rem*var(--un-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--un-space-y-reverse:0;margin-top:calc(.5rem*calc(1 - var(--un-space-y-reverse)));margin-bottom:calc(.5rem*var(--un-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--un-space-y-reverse:0;margin-top:calc(.75rem*calc(1 - var(--un-space-y-reverse)));margin-bottom:calc(.75rem*var(--un-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--un-space-y-reverse:0;margin-top:calc(1rem*calc(1 - var(--un-space-y-reverse)));margin-bottom:calc(1rem*var(--un-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--un-space-y-reverse:0;margin-top:calc(1.5rem*calc(1 - var(--un-space-y-reverse)));margin-bottom:calc(1.5rem*var(--un-space-y-reverse))}.of-hidden,.overflow-hidden,[of-hidden=""],[overflow-hidden=""],[overflow~=hidden]{overflow:hidden}.overflow-auto,[overflow-auto=""]{overflow:auto}.overflow-scroll,[overflow-scroll=""]{overflow:scroll}.of-x-scroll,[of-x-scroll=""]{overflow-x:scroll}.overflow-x-auto{overflow-x:auto}.overflow-y-auto,[overflow-y-auto=""]{overflow-y:auto}.overflow-y-scroll,[overflow-y-scroll=""]{overflow-y:scroll}.scroll-smooth,[scroll-smooth=""]{scroll-behavior:smooth}.truncate,[truncate=""]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.text-ellipsis,[text-ellipsis=""]{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line,[whitespace-pre-line=""]{white-space:pre-line}.whitespace-pre-wrap,[whitespace-pre-wrap=""]{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.b,.border,[b=""],[b~=\~],[border=""],[border~=\~],[border~="1"]{border-width:1px}.border-2,[border~="2"],[border~="2px"]{border-width:2px}[border~="4"]{border-width:4px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-t{border-top-width:1px}.\[\&\:checked\+div\]\:border-primary-500:checked+div,.border-primary-500{--un-border-opacity:1;border-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/var(--un-border-opacity))}.b-green{--un-border-opacity:1;border-color:rgb(74 222 128/var(--un-border-opacity))}.b-orange{--un-border-opacity:1;border-color:rgb(251 146 60/var(--un-border-opacity))}.b-purple{--un-border-opacity:1;border-color:rgb(192 132 252/var(--un-border-opacity))}.b-red{--un-border-opacity:1;border-color:rgb(248 113 113/var(--un-border-opacity))}.border-amber-200{--un-border-opacity:1;border-color:rgb(253 230 138/var(--un-border-opacity))}.border-neutral-100,[border~=neutral-100]{--un-border-opacity:1;border-color:rgb(245 245 245/var(--un-border-opacity))}.border-neutral-100\/60,[border~=neutral-100\/60]{border-color:#f5f5f599}.border-neutral-200,.dark [border~=dark\:neutral-200],[border-neutral-200=""],[border~=neutral-200]{--un-border-opacity:1;border-color:rgb(229 229 229/var(--un-border-opacity))}.border-neutral-300,[border~="data-[state=unchecked]:neutral-300"][data-state=unchecked],[border~=neutral-300]{--un-border-opacity:1;border-color:rgb(212 212 212/var(--un-border-opacity))}.border-neutral-300\/30{border-color:#d4d4d44d}.border-neutral-400{--un-border-opacity:1;border-color:rgb(163 163 163/var(--un-border-opacity))}.border-neutral-500{--un-border-opacity:1;border-color:rgb(115 115 115/var(--un-border-opacity))}.border-primary-100,[border~=primary-100]{--un-border-opacity:1;border-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/var(--un-border-opacity))80%,oklch(100% 0 360/var(--un-border-opacity)))}.border-primary-200,[border~="data-[state=checked]:primary-200"][data-state=checked],[border~=primary-200]{--un-border-opacity:1;border-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/var(--un-border-opacity))}.border-primary-400,.dark .dark\:\[\&\:checked\+div\]\:border-primary-400:checked+div,.dark .dark\:border-primary-400{--un-border-opacity:1;border-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/var(--un-border-opacity))}.border-primary-500\/5{border-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.05)}.border-red-200{--un-border-opacity:1;border-color:rgb(254 202 202/var(--un-border-opacity))}.border-red-200\/30{border-color:#fecaca4d}.border-white,[border~=white]{--un-border-opacity:1;border-color:rgb(255 255 255/var(--un-border-opacity))}.dark .dark\:border-amber-800{--un-border-opacity:1;border-color:rgb(146 64 14/var(--un-border-opacity))}.dark .dark\:border-neutral-600,.dark [border~=dark\:neutral-600]{--un-border-opacity:1;border-color:rgb(82 82 82/var(--un-border-opacity))}.dark .dark\:border-neutral-700,.dark [border~=dark\:neutral-700],.dark [dark\:border-neutral-700=""]{--un-border-opacity:1;border-color:rgb(64 64 64/var(--un-border-opacity))}.dark .dark\:border-neutral-700\/30,.dark [border~="dark:neutral-700/30"]{border-color:#4040404d}.dark .dark\:border-neutral-800,.dark [border~=dark\:neutral-800],.dark [dark\:border-neutral-800=""],[border~=neutral-800]{--un-border-opacity:1;border-color:rgb(38 38 38/var(--un-border-opacity))}.dark .dark\:border-neutral-800\/25,.dark [border~="dark:neutral-800/25"]{border-color:#26262640}.dark .dark\:border-neutral-800\/30,.dark [border~="dark:neutral-800/30"]{border-color:#2626264d}.dark .dark\:border-neutral-900,.dark [border~=dark\:neutral-900]{--un-border-opacity:1;border-color:rgb(23 23 23/var(--un-border-opacity))}.dark .dark\:border-primary-600{--un-border-opacity:1;border-color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/var(--un-border-opacity))}.dark .dark\:border-primary-800,.dark [border~=dark\:primary-800]{--un-border-opacity:1;border-color:oklch(42% var(--chromatic-chroma-800)calc(var(--chromatic-hue) + 0)/var(--un-border-opacity))}.dark .dark\:border-primary-900,.dark [border~=dark\:primary-900]{--un-border-opacity:1;border-color:oklch(37% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + 0)/var(--un-border-opacity))}.dark .dark\:border-primary-900\/40{border-color:oklch(37% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + 0)/.4)}.dark .dark\:border-red-800{--un-border-opacity:1;border-color:rgb(153 27 27/var(--un-border-opacity))}.dark .dark\:border-red-900\/30{border-color:#7f1d1d4d}.dark [border~="dark:cyan-500/50"]{border-color:#06b6d480}.dark [border~="dark:neutral-700/60"]{border-color:#40404099}.dark [border~="dark:primary-400/20"]{border-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.2)}.dark [border~="dark:primary-500/50"]{border-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.5)}.dark [border~="dark:violet-500/50"]{border-color:#8b5cf680}[border~=cyan-200\/50]{border-color:#a5f3fc80}[border~=neutral-200\/50]{border-color:#e5e5e580}[border~=neutral-200\/60]{border-color:#e5e5e599}[border~=primary-200\/20]{border-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/.2)}[border~=primary-200\/50]{border-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/.5)}[border~=primary-300]{--un-border-opacity:1;border-color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/var(--un-border-opacity))}[border~=violet-200\/50]{border-color:#ddd6fe80}.peer:checked~.peer-checked\:after\:border-white:after{--un-border-opacity:1;border-color:rgb(255 255 255/var(--un-border-opacity))}[border~=focus-within\:neutral-800]:focus-within{--un-border-opacity:1;border-color:rgb(38 38 38/var(--un-border-opacity))}.dark .dark\:hover\:border-primary-400\/30:hover{border-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.3)}.dark .dark\:hover\:border-primary-700:hover{--un-border-opacity:1;border-color:oklch(49% var(--chromatic-chroma-700)calc(var(--chromatic-hue) + 0)/var(--un-border-opacity))}.dark [border~="dark:hover:primary-400/30"]:hover{border-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.3)}.hover\:border-primary-300:hover{--un-border-opacity:1;border-color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/var(--un-border-opacity))}.hover\:border-primary-500\/30:hover,[border~="hover:primary-500/30"]:hover{border-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.3)}.dark [border~="dark:focus:neutral-600"]:focus{--un-border-opacity:1;border-color:rgb(82 82 82/var(--un-border-opacity))}.dark [border~="dark:focus:neutral-700"]:focus{--un-border-opacity:1;border-color:rgb(64 64 64/var(--un-border-opacity))}.dark [border~="dark:focus:primary-400/50"]:focus{border-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.5)}[border~=focus\:neutral-200]:focus{--un-border-opacity:1;border-color:rgb(229 229 229/var(--un-border-opacity))}[border~=focus\:neutral-400]:focus{--un-border-opacity:1;border-color:rgb(163 163 163/var(--un-border-opacity))}[border~=focus\:primary-100]:focus{--un-border-opacity:1;border-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/var(--un-border-opacity))80%,oklch(100% 0 360/var(--un-border-opacity)))}[border~=focus\:primary-300]:focus{--un-border-opacity:1;border-color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/var(--un-border-opacity))}.rounded,[rounded=""]{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-full,[rounded-full=""]{border-radius:9999px}.rounded-lg,[rounded-lg=""],[rounded~=lg]{border-radius:.5rem}.rounded-md,[rounded-md=""]{border-radius:.375rem}.rounded-sm,[rounded-sm=""]{border-radius:.125rem}.rounded-xl,[rounded-xl=""]{border-radius:.75rem}[rounded~="[1lh]"]{border-radius:1lh}.before\:rounded-full:before,.after\:rounded-full:after{border-radius:9999px}.rounded-l-xl,[rounded-l-xl=""]{border-top-left-radius:.75rem;border-bottom-left-radius:.75rem}.rounded-r-xl,[rounded-r-xl=""]{border-top-right-radius:.75rem;border-bottom-right-radius:.75rem}.rounded-t-2xl{border-top-left-radius:1rem;border-top-right-radius:1rem}.rounded-t-xl,[rounded-t-xl=""]{border-top-left-radius:.75rem;border-top-right-radius:.75rem}.border-solid,[border~=solid]{border-style:solid}[b~=dashed],[border~=dashed]{border-style:dashed}.bg-amber-50{--un-bg-opacity:1;background-color:rgb(255 251 235/var(--un-bg-opacity))}.bg-black\/50,[bg~=black\/50]{background-color:#00000080}.bg-blue-50,[bg-blue-50=""]{--un-bg-opacity:1;background-color:rgb(239 246 255/var(--un-bg-opacity))}.bg-green-50,[bg-green-50=""]{--un-bg-opacity:1;background-color:rgb(240 253 244/var(--un-bg-opacity))}.bg-green-500,[bg-green-500=""],[bg~=green-500]{--un-bg-opacity:1;background-color:rgb(34 197 94/var(--un-bg-opacity))}.bg-lime-100\/60{background-color:#ecfccb99}.bg-neutral-100,[bg~=neutral-100]{--un-bg-opacity:1;background-color:rgb(245 245 245/var(--un-bg-opacity))}.bg-neutral-100\/55{background-color:#f5f5f58c}.bg-neutral-200,[bg-neutral-200=""],[bg~=neutral-200]{--un-bg-opacity:1;background-color:rgb(229 229 229/var(--un-bg-opacity))}.bg-neutral-200\/45{background-color:#e5e5e573}.bg-neutral-300,.dark [bg~=dark\:neutral-300],[bg~="data-[state=unchecked]:neutral-300"][data-state=unchecked]{--un-bg-opacity:1;background-color:rgb(212 212 212/var(--un-bg-opacity))}.bg-neutral-400,.dark [bg~=dark\:neutral-400],[bg~=neutral-400]{--un-bg-opacity:1;background-color:rgb(163 163 163/var(--un-bg-opacity))}.bg-neutral-50,[bg-neutral-50=""],[bg~=neutral-50]{--un-bg-opacity:1;background-color:rgb(250 250 250/var(--un-bg-opacity))}.bg-neutral-50\/70,[bg~=neutral-50\/70]{background-color:#fafafab3}.bg-neutral-600,.dark .dark\:bg-neutral-600{--un-bg-opacity:1;background-color:rgb(82 82 82/var(--un-bg-opacity))}.bg-neutral-800,.dark .dark\:bg-neutral-800,.dark [bg~="dark:data-[state=unchecked]:neutral-800"][data-state=unchecked],.dark [bg~=dark\:neutral-800],.dark [dark\:bg-neutral-800=""]{--un-bg-opacity:1;background-color:rgb(38 38 38/var(--un-bg-opacity))}.bg-orange-100\/60{background-color:#ffedd599}.bg-primary{--un-bg-opacity:1;background-color:oklch(62% var(--chromatic-chroma)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))}.bg-primary-100,[bg-primary-100=""],[bg~=primary-100]{--un-bg-opacity:1;background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))80%,oklch(100% 0 360/var(--un-bg-opacity)))}.bg-primary-100\/10{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.1)80%,#ffffff1a)}@supports (color:lab(0% 0 0)){.bg-primary-100\/10{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.1)80%,lab(100% 0 0/.1))}}.bg-primary-100\/100{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/1)80%,#fff)}@supports (color:lab(0% 0 0)){.bg-primary-100\/100{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/1)80%,lab(100% 0 0))}}.bg-primary-100\/20{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.2)80%,#fff3)}@supports (color:lab(0% 0 0)){.bg-primary-100\/20{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.2)80%,lab(100% 0 0/.2))}}.bg-primary-100\/30{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.3)80%,#ffffff4d)}@supports (color:lab(0% 0 0)){.bg-primary-100\/30{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.3)80%,lab(100% 0 0/.3))}}.bg-primary-100\/40{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.4)80%,#fff6)}@supports (color:lab(0% 0 0)){.bg-primary-100\/40{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.4)80%,lab(100% 0 0/.4))}}.bg-primary-100\/5{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.05)80%,#ffffff0d)}@supports (color:lab(0% 0 0)){.bg-primary-100\/5{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.05)80%,lab(100% 0 0/.05))}}.bg-primary-100\/50{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.5)80%,#ffffff80)}@supports (color:lab(0% 0 0)){.bg-primary-100\/50{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.5)80%,lab(100% 0 0/.5))}}.bg-primary-100\/60{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.6)80%,#fff9)}@supports (color:lab(0% 0 0)){.bg-primary-100\/60{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.6)80%,lab(100% 0 0/.6))}}.bg-primary-100\/70{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.7)80%,#ffffffb3)}@supports (color:lab(0% 0 0)){.bg-primary-100\/70{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.7)80%,lab(100% 0 0/.7))}}.bg-primary-100\/80{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.8)80%,#fffc)}@supports (color:lab(0% 0 0)){.bg-primary-100\/80{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.8)80%,lab(100% 0 0/.8))}}.bg-primary-100\/90{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.9)80%,#ffffffe6)}@supports (color:lab(0% 0 0)){.bg-primary-100\/90{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.9)80%,lab(100% 0 0/.9))}}.bg-primary-200,[bg-primary-200=""]{--un-bg-opacity:1;background-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))}.bg-primary-200\/10{background-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/.1)}.bg-primary-200\/100{background-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/1)}.bg-primary-200\/20,[bg~=primary-200\/20]{background-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/.2)}.bg-primary-200\/30{background-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/.3)}.bg-primary-200\/40{background-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/.4)}.bg-primary-200\/5{background-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/.05)}.bg-primary-200\/50{background-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/.5)}.bg-primary-200\/60{background-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/.6)}.bg-primary-200\/70{background-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/.7)}.bg-primary-200\/80{background-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/.8)}.bg-primary-200\/90{background-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/.9)}.bg-primary-300,[bg-primary-300=""]{--un-bg-opacity:1;background-color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))}.bg-primary-300\/10{background-color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/.1)}.bg-primary-300\/100{background-color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/1)}.bg-primary-300\/20{background-color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/.2)}.bg-primary-300\/30{background-color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/.3)}.bg-primary-300\/40{background-color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/.4)}.bg-primary-300\/5{background-color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/.05)}.bg-primary-300\/50,.dark .dark\:bg-primary-300\/50{background-color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/.5)}.bg-primary-300\/60{background-color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/.6)}.bg-primary-300\/70{background-color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/.7)}.bg-primary-300\/80{background-color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/.8)}.bg-primary-300\/90{background-color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/.9)}.bg-primary-400,.dark .dark\:bg-primary-400,.dark [bg~=dark\:primary-400],[bg-primary-400=""],[bg~="data-[state=checked]:primary-400"][data-state=checked],[bg~=primary-400]{--un-bg-opacity:1;background-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))}.bg-primary-400\/10{background-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.1)}.bg-primary-400\/100{background-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/1)}.bg-primary-400\/20,.dark [bg~="dark:primary-400/20"]{background-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.2)}.bg-primary-400\/30{background-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.3)}.bg-primary-400\/40{background-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.4)}.bg-primary-400\/5{background-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.05)}.bg-primary-400\/50{background-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.5)}.bg-primary-400\/60{background-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.6)}.bg-primary-400\/70{background-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.7)}.bg-primary-400\/80,.dark [bg~="data-[state=checked]:dark:primary-400/80"][data-state=checked]{background-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.8)}.bg-primary-400\/90{background-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.9)}.bg-primary-50,[bg-primary-50=""]{--un-bg-opacity:1;background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))30%,oklch(100% 0 360/var(--un-bg-opacity)))}.bg-primary-50\/10,.dark .dark\:bg-primary-50\/10{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.1)30%,#ffffff1a)}@supports (color:lab(0% 0 0)){.bg-primary-50\/10,.dark .dark\:bg-primary-50\/10{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.1)30%,lab(100% 0 0/.1))}}.bg-primary-50\/100{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/1)30%,#fff)}@supports (color:lab(0% 0 0)){.bg-primary-50\/100{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/1)30%,lab(100% 0 0))}}.bg-primary-50\/20{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.2)30%,#fff3)}@supports (color:lab(0% 0 0)){.bg-primary-50\/20{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.2)30%,lab(100% 0 0/.2))}}.bg-primary-50\/30{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.3)30%,#ffffff4d)}@supports (color:lab(0% 0 0)){.bg-primary-50\/30{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.3)30%,lab(100% 0 0/.3))}}.bg-primary-50\/40{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.4)30%,#fff6)}@supports (color:lab(0% 0 0)){.bg-primary-50\/40{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.4)30%,lab(100% 0 0/.4))}}.bg-primary-50\/5{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.05)30%,#ffffff0d)}@supports (color:lab(0% 0 0)){.bg-primary-50\/5{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.05)30%,lab(100% 0 0/.05))}}.bg-primary-50\/50,[bg~=primary-50\/50]{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.5)30%,#ffffff80)}@supports (color:lab(0% 0 0)){.bg-primary-50\/50,[bg~=primary-50\/50]{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.5)30%,lab(100% 0 0/.5))}}.bg-primary-50\/60{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.6)30%,#fff9)}@supports (color:lab(0% 0 0)){.bg-primary-50\/60{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.6)30%,lab(100% 0 0/.6))}}.bg-primary-50\/70{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.7)30%,#ffffffb3)}@supports (color:lab(0% 0 0)){.bg-primary-50\/70{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.7)30%,lab(100% 0 0/.7))}}.bg-primary-50\/80,[bg~=primary-50\/80]{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.8)30%,#fffc)}@supports (color:lab(0% 0 0)){.bg-primary-50\/80,[bg~=primary-50\/80]{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.8)30%,lab(100% 0 0/.8))}}.bg-primary-50\/90{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.9)30%,#ffffffe6)}@supports (color:lab(0% 0 0)){.bg-primary-50\/90{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.9)30%,lab(100% 0 0/.9))}}.bg-primary-500,.dark [bg~=dark\:primary-500],[bg-primary-500=""],[bg~=primary-500],.peer:checked~.peer-checked\:bg-primary-500{--un-bg-opacity:1;background-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))}.bg-primary-500\/10,[bg~=primary-500\/10]{background-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.1)}.bg-primary-500\/100{background-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/1)}.bg-primary-500\/15{background-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.15)}.bg-primary-500\/20,[bg~=primary-500\/20]{background-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.2)}.bg-primary-500\/30,[bg~=primary-500\/30]{background-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.3)}.bg-primary-500\/40,[bg~=primary-500\/40]{background-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.4)}.bg-primary-500\/5,[bg~=primary-500\/5]{background-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.05)}.bg-primary-500\/50,[bg~=primary-500\/50]{background-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.5)}.bg-primary-500\/60,[bg~=primary-500\/60]{background-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.6)}.bg-primary-500\/70,[bg~=primary-500\/70]{background-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.7)}.bg-primary-500\/80,[bg~=primary-500\/80]{background-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.8)}.bg-primary-500\/90,[bg~=primary-500\/90]{background-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.9)}.bg-primary-600,.dark .dark\:bg-primary-600,[bg-primary-600=""]{--un-bg-opacity:1;background-color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))}.bg-primary-600\/10{background-color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/.1)}.bg-primary-600\/100{background-color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/1)}.bg-primary-600\/20{background-color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/.2)}.bg-primary-600\/30{background-color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/.3)}.bg-primary-600\/40{background-color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/.4)}.bg-primary-600\/5{background-color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/.05)}.bg-primary-600\/50{background-color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/.5)}.bg-primary-600\/60{background-color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/.6)}.bg-primary-600\/70{background-color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/.7)}.bg-primary-600\/80{background-color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/.8)}.bg-primary-600\/90{background-color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/.9)}.bg-primary-700,.dark .dark\:bg-primary-700,.dark [dark\:bg-primary-700=""],[bg-primary-700=""]{--un-bg-opacity:1;background-color:oklch(49% var(--chromatic-chroma-700)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))}.bg-primary-700\/10{background-color:oklch(49% var(--chromatic-chroma-700)calc(var(--chromatic-hue) + 0)/.1)}.bg-primary-700\/100{background-color:oklch(49% var(--chromatic-chroma-700)calc(var(--chromatic-hue) + 0)/1)}.bg-primary-700\/20{background-color:oklch(49% var(--chromatic-chroma-700)calc(var(--chromatic-hue) + 0)/.2)}.bg-primary-700\/30,.dark .dark\:bg-primary-700\/30{background-color:oklch(49% var(--chromatic-chroma-700)calc(var(--chromatic-hue) + 0)/.3)}.bg-primary-700\/40{background-color:oklch(49% var(--chromatic-chroma-700)calc(var(--chromatic-hue) + 0)/.4)}.bg-primary-700\/5{background-color:oklch(49% var(--chromatic-chroma-700)calc(var(--chromatic-hue) + 0)/.05)}.bg-primary-700\/50{background-color:oklch(49% var(--chromatic-chroma-700)calc(var(--chromatic-hue) + 0)/.5)}.bg-primary-700\/60{background-color:oklch(49% var(--chromatic-chroma-700)calc(var(--chromatic-hue) + 0)/.6)}.bg-primary-700\/70{background-color:oklch(49% var(--chromatic-chroma-700)calc(var(--chromatic-hue) + 0)/.7)}.bg-primary-700\/80{background-color:oklch(49% var(--chromatic-chroma-700)calc(var(--chromatic-hue) + 0)/.8)}.bg-primary-700\/90{background-color:oklch(49% var(--chromatic-chroma-700)calc(var(--chromatic-hue) + 0)/.9)}.bg-primary-800,.dark [bg~=dark\:primary-800],[bg-primary-800=""]{--un-bg-opacity:1;background-color:oklch(42% var(--chromatic-chroma-800)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))}.bg-primary-800\/10{background-color:oklch(42% var(--chromatic-chroma-800)calc(var(--chromatic-hue) + 0)/.1)}.bg-primary-800\/100{background-color:oklch(42% var(--chromatic-chroma-800)calc(var(--chromatic-hue) + 0)/1)}.bg-primary-800\/20{background-color:oklch(42% var(--chromatic-chroma-800)calc(var(--chromatic-hue) + 0)/.2)}.bg-primary-800\/30{background-color:oklch(42% var(--chromatic-chroma-800)calc(var(--chromatic-hue) + 0)/.3)}.bg-primary-800\/40{background-color:oklch(42% var(--chromatic-chroma-800)calc(var(--chromatic-hue) + 0)/.4)}.bg-primary-800\/5{background-color:oklch(42% var(--chromatic-chroma-800)calc(var(--chromatic-hue) + 0)/.05)}.bg-primary-800\/50{background-color:oklch(42% var(--chromatic-chroma-800)calc(var(--chromatic-hue) + 0)/.5)}.bg-primary-800\/60{background-color:oklch(42% var(--chromatic-chroma-800)calc(var(--chromatic-hue) + 0)/.6)}.bg-primary-800\/70{background-color:oklch(42% var(--chromatic-chroma-800)calc(var(--chromatic-hue) + 0)/.7)}.bg-primary-800\/80{background-color:oklch(42% var(--chromatic-chroma-800)calc(var(--chromatic-hue) + 0)/.8)}.bg-primary-800\/90{background-color:oklch(42% var(--chromatic-chroma-800)calc(var(--chromatic-hue) + 0)/.9)}.bg-primary-900,.dark .dark\:bg-primary-900,[bg-primary-900=""]{--un-bg-opacity:1;background-color:oklch(37% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))}.bg-primary-900\/10,.dark .dark\:bg-primary-900\/10{background-color:oklch(37% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + 0)/.1)}.bg-primary-900\/100{background-color:oklch(37% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + 0)/1)}.bg-primary-900\/20,.dark .dark\:bg-primary-900\/20{background-color:oklch(37% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + 0)/.2)}.bg-primary-900\/30,.dark .dark\:bg-primary-900\/30{background-color:oklch(37% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + 0)/.3)}.bg-primary-900\/40,.dark .dark\:bg-primary-900\/40,.dark [bg~="dark:primary-900/40"]{background-color:oklch(37% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + 0)/.4)}.bg-primary-900\/5,.dark .dark\:bg-primary-900\/5{background-color:oklch(37% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + 0)/.05)}.bg-primary-900\/50{background-color:oklch(37% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + 0)/.5)}.bg-primary-900\/60{background-color:oklch(37% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + 0)/.6)}.bg-primary-900\/70{background-color:oklch(37% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + 0)/.7)}.bg-primary-900\/80{background-color:oklch(37% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + 0)/.8)}.bg-primary-900\/90{background-color:oklch(37% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + 0)/.9)}.bg-primary-950,.dark .dark\:bg-primary-950,[bg-primary-950=""]{--un-bg-opacity:1;background-color:oklch(29% var(--chromatic-chroma-950)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))}.bg-primary-950\/10{background-color:oklch(29% var(--chromatic-chroma-950)calc(var(--chromatic-hue) + 0)/.1)}.bg-primary-950\/100{background-color:oklch(29% var(--chromatic-chroma-950)calc(var(--chromatic-hue) + 0)/1)}.bg-primary-950\/20{background-color:oklch(29% var(--chromatic-chroma-950)calc(var(--chromatic-hue) + 0)/.2)}.bg-primary-950\/30{background-color:oklch(29% var(--chromatic-chroma-950)calc(var(--chromatic-hue) + 0)/.3)}.bg-primary-950\/40{background-color:oklch(29% var(--chromatic-chroma-950)calc(var(--chromatic-hue) + 0)/.4)}.bg-primary-950\/5{background-color:oklch(29% var(--chromatic-chroma-950)calc(var(--chromatic-hue) + 0)/.05)}.bg-primary-950\/50{background-color:oklch(29% var(--chromatic-chroma-950)calc(var(--chromatic-hue) + 0)/.5)}.bg-primary-950\/60{background-color:oklch(29% var(--chromatic-chroma-950)calc(var(--chromatic-hue) + 0)/.6)}.bg-primary-950\/70,.dark [bg~="dark:primary-950/70"]{background-color:oklch(29% var(--chromatic-chroma-950)calc(var(--chromatic-hue) + 0)/.7)}.bg-primary-950\/80{background-color:oklch(29% var(--chromatic-chroma-950)calc(var(--chromatic-hue) + 0)/.8)}.bg-primary-950\/90{background-color:oklch(29% var(--chromatic-chroma-950)calc(var(--chromatic-hue) + 0)/.9)}.bg-primary\/10{background-color:oklch(62% var(--chromatic-chroma)calc(var(--chromatic-hue) + 0)/.1)}.bg-primary\/100{background-color:oklch(62% var(--chromatic-chroma)calc(var(--chromatic-hue) + 0)/1)}.bg-primary\/20{background-color:oklch(62% var(--chromatic-chroma)calc(var(--chromatic-hue) + 0)/.2)}.bg-primary\/30{background-color:oklch(62% var(--chromatic-chroma)calc(var(--chromatic-hue) + 0)/.3)}.bg-primary\/40{background-color:oklch(62% var(--chromatic-chroma)calc(var(--chromatic-hue) + 0)/.4)}.bg-primary\/5{background-color:oklch(62% var(--chromatic-chroma)calc(var(--chromatic-hue) + 0)/.05)}.bg-primary\/50{background-color:oklch(62% var(--chromatic-chroma)calc(var(--chromatic-hue) + 0)/.5)}.bg-primary\/60{background-color:oklch(62% var(--chromatic-chroma)calc(var(--chromatic-hue) + 0)/.6)}.bg-primary\/70{background-color:oklch(62% var(--chromatic-chroma)calc(var(--chromatic-hue) + 0)/.7)}.bg-primary\/80{background-color:oklch(62% var(--chromatic-chroma)calc(var(--chromatic-hue) + 0)/.8)}.bg-primary\/90{background-color:oklch(62% var(--chromatic-chroma)calc(var(--chromatic-hue) + 0)/.9)}.bg-red-50,[bg-red-50=""]{--un-bg-opacity:1;background-color:rgb(254 242 242/var(--un-bg-opacity))}.bg-red-500{--un-bg-opacity:1;background-color:rgb(239 68 68/var(--un-bg-opacity))}.bg-red-500\/15{background-color:#ef444426}.bg-red900,.dark [dark\:bg-red-900=""]{--un-bg-opacity:1;background-color:rgb(127 29 29/var(--un-bg-opacity))}.bg-transparent,.dark [bg~=dark\:transparent],[bg-transparent=""],[bg~=transparent]{background-color:#0000}.bg-violet-100\/60{background-color:#ede9fe99}.bg-white,[bg-white=""],[bg~=white]{--un-bg-opacity:1;background-color:rgb(255 255 255/var(--un-bg-opacity))}.bg-white\/60,[bg~=white\/60]{background-color:#fff9}.bg-white\/80{background-color:#fffc}.bg-white\/90{background-color:#ffffffe6}.bg-yellow-500{--un-bg-opacity:1;background-color:rgb(234 179 8/var(--un-bg-opacity))}.dark .dark\:bg-amber-900\/20{background-color:#78350f33}.dark .dark\:bg-black\/30,.dark [bg~="dark:black/30"]{background-color:#0000004d}.dark .dark\:bg-black\/40{background-color:#0006}.dark .dark\:bg-black\/75{background-color:#000000bf}.dark .dark\:bg-blue-900\/30{background-color:#1e3a8a4d}.dark .dark\:bg-green-900\/30{background-color:#14532d4d}.dark .dark\:bg-lime-50\/10{background-color:#f7fee71a}.dark .dark\:bg-lime-900\/10{background-color:#3653141a}.dark .dark\:bg-neutral-500\/70{background-color:#737373b3}.dark .dark\:bg-neutral-700,.dark [bg~=dark\:neutral-700],.dark [dark\:bg-neutral-700=""],[bg~=neutral-700]{--un-bg-opacity:1;background-color:rgb(64 64 64/var(--un-bg-opacity))}.dark .dark\:bg-neutral-700\/50{background-color:#40404080}.dark .dark\:bg-neutral-700\/60{background-color:#40404099}.dark .dark\:bg-neutral-800\/50,.dark [bg~="dark:neutral-800/50"]{background-color:#26262680}.dark .dark\:bg-neutral-800\/70,.dark [bg~="dark:neutral-800/70"]{background-color:#262626b3}.dark .dark\:bg-neutral-900,.dark [bg~=dark\:neutral-900]{--un-bg-opacity:1;background-color:rgb(23 23 23/var(--un-bg-opacity))}.dark .dark\:bg-neutral-900\/20{background-color:#17171733}.dark .dark\:bg-neutral-900\/95{background-color:#171717f2}.dark .dark\:bg-orange-50\/10{background-color:#fff7ed1a}.dark .dark\:bg-orange-900\/10{background-color:#7c2d121a}.dark .dark\:bg-primary-800\/25{background-color:oklch(42% var(--chromatic-chroma-800)calc(var(--chromatic-hue) + 0)/.25)}.dark .dark\:bg-red-700\/30{background-color:#b91c1c4d}.dark .dark\:bg-red-900\/20{background-color:#7f1d1d33}.dark .dark\:bg-red-900\/30{background-color:#7f1d1d4d}.dark .dark\:bg-violet-50\/10{background-color:#f5f3ff1a}.dark .dark\:bg-violet-900\/10{background-color:#4c1d951a}.dark [bg~="dark:[#4e34b9]"]{--un-bg-opacity:1;background-color:rgb(78 52 185/var(--un-bg-opacity))}.dark [bg~="dark:[#676085]"]{--un-bg-opacity:1;background-color:rgb(103 96 133/var(--un-bg-opacity))}.dark [bg~="dark:[rgba(0,0,0,0.3)]"]{--un-bg-opacity:.3;background-color:rgba(0,0,0,var(--un-bg-opacity))}.dark [bg~="dark:black/10"]{background-color:#0000001a}.dark [bg~=dark\:blue-900],.dark [dark\:bg-blue-900=""]{--un-bg-opacity:1;background-color:rgb(30 58 138/var(--un-bg-opacity))}.dark [bg~=dark\:green-600]{--un-bg-opacity:1;background-color:rgb(22 163 74/var(--un-bg-opacity))}.dark [bg~="dark:neutral-100/80"],[bg~=neutral-100\/80]{background-color:#f5f5f5cc}.dark [bg~=dark\:neutral-500]{--un-bg-opacity:1;background-color:rgb(115 115 115/var(--un-bg-opacity))}.dark [bg~="dark:neutral-900/50"]{background-color:#17171780}.dark [bg~="dark:neutral-900/70"]{background-color:#171717b3}.dark [bg~=dark\:neutral-950]{--un-bg-opacity:1;background-color:rgb(10 10 10/var(--un-bg-opacity))}.dark [bg~="dark:neutral-950/80"]{background-color:#0a0a0acc}.dark [bg~="dark:orange-900/20"]{background-color:#7c2d1233}.dark [bg~=dark\:violet-800]{--un-bg-opacity:1;background-color:rgb(91 33 182/var(--un-bg-opacity))}.dark [dark\:bg-green-900=""]{--un-bg-opacity:1;background-color:rgb(20 83 45/var(--un-bg-opacity))}[bg~="[#cabeff]"]{--un-bg-opacity:1;background-color:rgb(202 190 255/var(--un-bg-opacity))}[bg~="[#e6e1fc]"]{--un-bg-opacity:1;background-color:rgb(230 225 252/var(--un-bg-opacity))}[bg~=\$bg-color]{background-color:var(--bg-color)}[bg~=black\/0]{background-color:#0000}[bg~=black\/4]{background-color:#0000000a}[bg~=blue-100]{--un-bg-opacity:1;background-color:rgb(219 234 254/var(--un-bg-opacity))}[bg~=emerald-500]{--un-bg-opacity:1;background-color:rgb(16 185 129/var(--un-bg-opacity))}[bg~=gray-200\/30]{background-color:#e5e7eb4d}[bg~=inherit]{background-color:inherit }[bg~=neutral-100\/50]{background-color:#f5f5f580}[bg~=neutral-200\/50]{background-color:#e5e5e580}[bg~=neutral-50\/50]{background-color:#fafafa80}[bg~=orange-50]{--un-bg-opacity:1;background-color:rgb(255 247 237/var(--un-bg-opacity))}[bg~=violet-500]{--un-bg-opacity:1;background-color:rgb(139 92 246/var(--un-bg-opacity))}[bg~=white\/70]{background-color:#ffffffb3}.dark .dark\:hover\:bg-black\/40:hover{background-color:#0006}.dark .dark\:hover\:bg-neutral-600:hover{--un-bg-opacity:1;background-color:rgb(82 82 82/var(--un-bg-opacity))}.dark .dark\:hover\:bg-neutral-700\/80:hover{background-color:#404040cc}.dark .dark\:hover\:bg-neutral-800:hover{--un-bg-opacity:1;background-color:rgb(38 38 38/var(--un-bg-opacity))}.dark .dark\:hover\:bg-primary-700\/40:hover{background-color:oklch(49% var(--chromatic-chroma-700)calc(var(--chromatic-hue) + 0)/.4)}.dark .dark\:hover\:bg-red-700\/40:hover{background-color:#b91c1c66}.dark .hover\:dark\:bg-neutral-800\/50:hover{background-color:#26262680}.dark [bg~="dark:hover:neutral-800"]:hover{--un-bg-opacity:1;background-color:rgb(38 38 38/var(--un-bg-opacity))}.dark [bg~="dark:hover:white/30"]:hover{background-color:#ffffff4d}.dark [hover~="dark:bg-black/40"]:hover{background-color:#0006}.dark [hover~=dark\:bg-neutral-700]:hover{--un-bg-opacity:1;background-color:rgb(64 64 64/var(--un-bg-opacity))}.dark [hover~="dark:bg-neutral-700/50"]:hover{background-color:#40404080}.group:hover [bg~="group-hover:black/20"]{background-color:#0003}.hover\:bg-neutral-100:hover{--un-bg-opacity:1;background-color:rgb(245 245 245/var(--un-bg-opacity))}.hover\:bg-neutral-300:hover{--un-bg-opacity:1;background-color:rgb(212 212 212/var(--un-bg-opacity))}.hover\:bg-neutral-400:hover{--un-bg-opacity:1;background-color:rgb(163 163 163/var(--un-bg-opacity))}.hover\:bg-neutral-400\/20:hover{background-color:#a3a3a333}.hover\:bg-neutral-50\/50:hover{background-color:#fafafa80}.hover\:bg-primary-500\/20:hover{background-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.2)}.hover\:bg-primary-600:hover{--un-bg-opacity:1;background-color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))}.hover\:bg-red-500\/20:hover{background-color:#ef444433}.hover\:bg-white\/80:hover{background-color:#fffc}[bg~=hover\:emerald-600]:hover{--un-bg-opacity:1;background-color:rgb(5 150 105/var(--un-bg-opacity))}[bg~=hover\:neutral-200]:hover{--un-bg-opacity:1;background-color:rgb(229 229 229/var(--un-bg-opacity))}[bg~=hover\:neutral-50]:hover{--un-bg-opacity:1;background-color:rgb(250 250 250/var(--un-bg-opacity))}[hover\:bg-neutral-300=""]:hover{--un-bg-opacity:1;background-color:rgb(212 212 212/var(--un-bg-opacity))}[hover\:bg-primary-600=""]:hover{--un-bg-opacity:1;background-color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))}[hover~=bg-neutral-200]:hover{--un-bg-opacity:1;background-color:rgb(229 229 229/var(--un-bg-opacity))}[hover~=bg-white\/80]:hover{background-color:#fffc}.dark [bg~="dark:focus:neutral-900"]:focus{--un-bg-opacity:1;background-color:rgb(23 23 23/var(--un-bg-opacity))}[bg~=focus\:neutral-50]:focus{--un-bg-opacity:1;background-color:rgb(250 250 250/var(--un-bg-opacity))}.active\:bg-neutral-400\/30:active{background-color:#a3a3a34d}.active\:bg-neutral-50\/90:active{background-color:#fafafae6}.active\:bg-primary-500\/30:active{background-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.3)}.active\:bg-red-500\/30:active{background-color:#ef44444d}.dark .active\:dark\:bg-neutral-800\/90:active{background-color:#262626e6}.dark .dark\:active\:bg-neutral-700\/60:active{background-color:#40404099}.dark .dark\:active\:bg-primary-700\/30:active{background-color:oklch(49% var(--chromatic-chroma-700)calc(var(--chromatic-hue) + 0)/.3)}.dark .dark\:active\:bg-red-700\/30:active{background-color:#b91c1c4d}.dark [bg~="dark:active:neutral-700"]:active{--un-bg-opacity:1;background-color:rgb(64 64 64/var(--un-bg-opacity))}[bg~=active\:gray-50]:active{--un-bg-opacity:1;background-color:rgb(249 250 251/var(--un-bg-opacity))}[bg~=active\:neutral-300]:active{--un-bg-opacity:1;background-color:rgb(212 212 212/var(--un-bg-opacity))}.dark [bg~="dark:disabled:neutral-900"]:disabled{--un-bg-opacity:1;background-color:rgb(23 23 23/var(--un-bg-opacity))}[bg~=disabled\:neutral-100]:disabled{--un-bg-opacity:1;background-color:rgb(245 245 245/var(--un-bg-opacity))}.before\:bg-lime-400:before{--un-bg-opacity:1;background-color:rgb(163 230 53/var(--un-bg-opacity))}.before\:bg-orange-400:before{--un-bg-opacity:1;background-color:rgb(251 146 60/var(--un-bg-opacity))}.before\:bg-primary-400:before{--un-bg-opacity:1;background-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))}.before\:bg-violet-400:before{--un-bg-opacity:1;background-color:rgb(167 139 250/var(--un-bg-opacity))}.dark .before\:dark\:bg-lime-900:before{--un-bg-opacity:1;background-color:rgb(54 83 20/var(--un-bg-opacity))}.dark .before\:dark\:bg-orange-900:before{--un-bg-opacity:1;background-color:rgb(124 45 18/var(--un-bg-opacity))}.dark .before\:dark\:bg-primary-900:before{--un-bg-opacity:1;background-color:oklch(37% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))}.dark .before\:dark\:bg-violet-900:before{--un-bg-opacity:1;background-color:rgb(76 29 149/var(--un-bg-opacity))}.after\:bg-white:after{--un-bg-opacity:1;background-color:rgb(255 255 255/var(--un-bg-opacity))}.dark .dark\:from-neutral-800,.dark [dark\:from-neutral-800=""]{--un-gradient-from-position:0%;--un-gradient-from:rgb(38 38 38/var(--un-from-opacity,1))var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:#26262600 var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),var(--un-gradient-to)}.dark .dark\:from-primary-400\/0{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),var(--un-gradient-to)}.dark .dark\:from-primary-400\/20{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.2)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),var(--un-gradient-to)}.from-neutral-50,[from-neutral-50=""]{--un-gradient-from-position:0%;--un-gradient-from:rgb(250 250 250/var(--un-from-opacity,1))var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:#fafafa00 var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),var(--un-gradient-to)}.from-primary-500{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/var(--un-from-opacity,1))var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),var(--un-gradient-to)}.from-primary-500\/0{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),var(--un-gradient-to)}.from-primary-500\/20,.before\:from-primary-500\/20:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.2)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),var(--un-gradient-to)}.dark .before\:dark\:from-primary-400\/20:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.2)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),var(--un-gradient-to)}.dark [before~="dark:from-primary-400/0"]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),var(--un-gradient-to)}.dark [hover~="before:dark:from-primary-400/20"]:hover:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.2)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),var(--un-gradient-to)}[before~=from-primary-500\/0]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),var(--un-gradient-to)}[hover~="before:from-primary-500/20"]:hover:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.2)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),var(--un-gradient-to)}.dark .dark\:via-primary-400\/10{--un-gradient-via-position:50%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/0);--un-gradient-stops:var(--un-gradient-from),oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.1)var(--un-gradient-via-position),var(--un-gradient-to)}.via-primary-500\/10,.before\:via-primary-500\/10:before{--un-gradient-via-position:50%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/0);--un-gradient-stops:var(--un-gradient-from),oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.1)var(--un-gradient-via-position),var(--un-gradient-to)}.dark .before\:dark\:via-primary-400\/10:before,.dark [hover~="before:dark:via-primary-400/10"]:hover:before{--un-gradient-via-position:50%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/0);--un-gradient-stops:var(--un-gradient-from),oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.1)var(--un-gradient-via-position),var(--un-gradient-to)}[hover~="before:via-primary-500/10"]:hover:before{--un-gradient-via-position:50%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/0);--un-gradient-stops:var(--un-gradient-from),oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.1)var(--un-gradient-via-position),var(--un-gradient-to)}.dark .dark\:to-neutral-900{--un-gradient-to-position:100%;--un-gradient-to:rgb(23 23 23/var(--un-to-opacity,1))var(--un-gradient-to-position)}.dark .dark\:to-primary-400\/0{--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position)}.dark .dark\:to-transparent,.to-transparent{--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position)}.to-neutral-100,[to-neutral-100=""]{--un-gradient-to-position:100%;--un-gradient-to:rgb(245 245 245/var(--un-to-opacity,1))var(--un-gradient-to-position)}.to-primary-400{--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/var(--un-to-opacity,1))var(--un-gradient-to-position)}.to-primary-500\/0{--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position)}.before\:to-transparent:before,.dark .before\:dark\:to-transparent:before{--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position)}.dark [before~="dark:to-primary-400/0"]:before{--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position)}.dark [hover~="before:dark:to-transparent"]:hover:before{--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position)}[before~=to-primary-500\/0]:before{--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position)}[hover~=before\:to-transparent]:hover:before{--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position)}.bg-gradient-to-b,[bg-gradient-to-b=""]{--un-gradient-shape:to bottom in oklch;--un-gradient:var(--un-gradient-shape),var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient))}.bg-gradient-to-r,.before\:bg-gradient-to-r:before,[before~=bg-gradient-to-r]:before,[hover~=before\:bg-gradient-to-r]:hover:before{--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape),var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient))}.bg-clip-text{-webkit-background-clip:text;background-clip:text}.dark .dark\:fill-neutral-800,.dark [dark\:fill-neutral-800=""]{--un-fill-opacity:1;fill:rgb(38 38 38/var(--un-fill-opacity))}.fill-white,[fill-white=""]{--un-fill-opacity:1;fill:rgb(255 255 255/var(--un-fill-opacity))}[stroke-width~="0.5"]{stroke-width:.5px}[stroke-width~="1.5"]{stroke-width:1.5px}[stroke-width~="2"]{stroke-width:2px}[stroke~="163"]{stroke-width:163px}[stroke~="175"]{stroke-width:175px}.object-cover,[object-cover=""]{object-fit:cover}.object-contain,[object-contain=""]{object-fit:contain}.p-1,[p-1=""],[p~="1"]{padding:.25rem}.p-1\.5,[p-1\.5=""]{padding:.375rem}.p-2,[p-2=""],[p~="2"]{padding:.5rem}.p-2\.5,[p~="2.5"]{padding:.625rem}.p-3,[p-3=""]{padding:.75rem}.p-4,[p-4=""]{padding:1rem}.p-5,[p-5=""]{padding:1.25rem}.p-6{padding:1.5rem}.p-8,[p-8=""]{padding:2rem}.px,.px-4,[px-4=""],[px=""]{padding-left:1rem;padding-right:1rem}.px-0{padding-left:0;padding-right:0}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2,.px2,[px-2=""],[px~="2"],[px2=""]{padding-left:.5rem;padding-right:.5rem}.px-3,[px-3=""]{padding-left:.75rem;padding-right:.75rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py,.py-4,[py-4=""],[py~="4"]{padding-top:1rem;padding-bottom:1rem}.py-\.5,.py-0\.5,[py-\.5=""],[py-0\.5=""]{padding-top:.125rem;padding-bottom:.125rem}.py-0{padding-top:0;padding-bottom:0}.py-1,.py1,[py-1=""],[py1=""]{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5,[py-1\.5=""]{padding-top:.375rem;padding-bottom:.375rem}.py-2,[py-2=""]{padding-top:.5rem;padding-bottom:.5rem}.py-3,[py-3=""]{padding-top:.75rem;padding-bottom:.75rem}.pb-0{padding-bottom:0}.pb-12,[pb-12=""]{padding-bottom:3rem}.pb-2,[pb-2=""]{padding-bottom:.5rem}.pb-3,[pb-3=""]{padding-bottom:.75rem}.pb-4,[pb-4=""]{padding-bottom:1rem}.pb-6,[pb-6=""]{padding-bottom:1.5rem}.pl,.pl-4,[pl-4=""]{padding-left:1rem}.pl-10{padding-left:2.5rem}.pl-3,[pl-3=""]{padding-left:.75rem}.pl-5,[pl-5=""]{padding-left:1.25rem}.pr-\[20px\]{padding-right:20px}.pr-1,[pr-1=""]{padding-right:.25rem}.pr-3,[pr-3=""]{padding-right:.75rem}.pr-4,[pr-4=""]{padding-right:1rem}.pt,.pt-4,[pt-4=""]{padding-top:1rem}.pt-0{padding-top:0}.pt-1,[pt-1=""]{padding-top:.25rem}.pt-10,[pt-10=""]{padding-top:2.5rem}.pt-14,[pt-14=""]{padding-top:3.5rem}.pt-2,[pt-2=""]{padding-top:.5rem}.pt-3{padding-top:.75rem}.text-center,[text-center=""],[text~=center]{text-align:center}.text-left,[text-left=""]{text-align:left}.text-wrap,[text-wrap=""]{text-wrap:wrap}.text-nowrap,[text-nowrap=""]{text-wrap:nowrap}.text-\[10px\]{font-size:10px}.text-2xl,[text-2xl=""],[text~="2xl"]{font-size:1.5rem;line-height:2rem}.text-3xl,[text-3xl=""]{font-size:1.875rem;line-height:2.25rem}.text-5xl,[text-5xl=""]{font-size:3rem;line-height:1}.text-6xl,[text-6xl=""]{font-size:3.75rem;line-height:1}.text-base,[text-base=""],[text~=base]{font-size:1rem;line-height:1.5rem}.text-lg,[text-lg=""],[text~=lg]{font-size:1.125rem;line-height:1.75rem}.text-sm,[text-sm=""],[text~=sm]{font-size:.875rem;line-height:1.25rem}.text-xl,[text-xl=""]{font-size:1.25rem;line-height:1.75rem}.text-xs,[text-xs=""],[text~=xs]{font-size:.75rem;line-height:1rem}[text~="4xl"]{font-size:2.25rem;line-height:2.5rem}[text~="60"]{font-size:15rem}[default-text~="2"]:default{font-size:.5rem}.dark .dark\:text-amber-300{--un-text-opacity:1;color:rgb(252 211 77/var(--un-text-opacity))}.dark .dark\:text-amber-400{--un-text-opacity:1;color:rgb(251 191 36/var(--un-text-opacity))}.dark .dark\:text-blue-300{--un-text-opacity:1;color:rgb(147 197 253/var(--un-text-opacity))}.dark .dark\:text-green-300{--un-text-opacity:1;color:rgb(134 239 172/var(--un-text-opacity))}.dark .dark\:text-green-400,.text-green{--un-text-opacity:1;color:rgb(74 222 128/var(--un-text-opacity))}.dark .dark\:text-lime-400{--un-text-opacity:1;color:rgb(163 230 53/var(--un-text-opacity))}.dark .dark\:text-neutral-100,.dark [text~=dark\:neutral-100],[text~=neutral-100]{--un-text-opacity:1;color:rgb(245 245 245/var(--un-text-opacity))}.dark .dark\:text-neutral-100\/80{color:#f5f5f5cc}.dark .dark\:text-neutral-200,.dark [dark\:text-neutral-200=""],.dark [text~=dark\:neutral-200]{--un-text-opacity:1;color:rgb(229 229 229/var(--un-text-opacity))}.dark .dark\:text-neutral-300,.dark [dark\:text-neutral-300=""],.dark [text~=dark\:neutral-300],[text~=neutral-300]{--un-text-opacity:1;color:rgb(212 212 212/var(--un-text-opacity))}.dark .dark\:text-neutral-400,.dark [dark\:text-neutral-400=""],.dark [text~=dark\:neutral-400],.text-neutral-400,[text-neutral-400=""],[text~=neutral-400]{--un-text-opacity:1;color:rgb(163 163 163/var(--un-text-opacity))}.dark .dark\:text-neutral-500,.dark [text~=dark\:neutral-500],.text-neutral-500,[text-neutral-500=""],[text~=neutral-500]{--un-text-opacity:1;color:rgb(115 115 115/var(--un-text-opacity))}.dark .dark\:text-neutral-600,.dark [text~=dark\:neutral-600],.text-neutral-600,[text~=neutral-600]{--un-text-opacity:1;color:rgb(82 82 82/var(--un-text-opacity))}.dark .dark\:text-neutral-600\/20,.dark [text~="dark:neutral-600/20"]{color:#52525233}.dark .dark\:text-orange-400,.text-orange{--un-text-opacity:1;color:rgb(251 146 60/var(--un-text-opacity))}.dark .dark\:color-primary-100,.dark .dark\:text-primary-100,.dark [dark\:color-primary-100=""]{--un-text-opacity:1;color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity))80%,oklch(100% 0 360/var(--un-text-opacity)))}.dark .dark\:text-primary-300,.dark [text~=dark\:primary-300],.text-primary-300,[text~=primary-300]{--un-text-opacity:1;color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity))}.dark .dark\:text-primary-300\/80{color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/.8)}.color-primary-400,.dark .dark\:text-primary-400,.dark [text~=dark\:primary-400],.text-primary-400,[color-primary-400=""],[text~=primary-400]{--un-text-opacity:1;color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity))}.dark .dark\:text-primary-500,.text-primary-500,[text~=primary-500]{--un-text-opacity:1;color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity))}.dark .dark\:text-primary-600,.text-primary-600,[text~=primary-600]{--un-text-opacity:1;color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity))}.dark .dark\:text-red-100{--un-text-opacity:1;color:rgb(254 226 226/var(--un-text-opacity))}.dark .dark\:text-red-300{--un-text-opacity:1;color:rgb(252 165 165/var(--un-text-opacity))}.dark .dark\:text-red-400,.text-red{--un-text-opacity:1;color:rgb(248 113 113/var(--un-text-opacity))}.dark .dark\:text-slate-100{--un-text-opacity:1;color:rgb(241 245 249/var(--un-text-opacity))}.dark .dark\:text-violet-400{--un-text-opacity:1;color:rgb(167 139 250/var(--un-text-opacity))}.dark .dark\:text-white,.text-white,[text-white=""],[text~=white]{--un-text-opacity:1;color:rgb(255 255 255/var(--un-text-opacity))}.dark [text~="dark:cyan-600/90"]{color:#0891b2e6}.dark [text~=dark\:gray-200]{--un-text-opacity:1;color:rgb(229 231 235/var(--un-text-opacity))}.dark [text~="dark:neutral-100/65"]{color:#f5f5f5a6}.dark [text~="dark:neutral-600/50"]{color:#52525280}.dark [text~=dark\:neutral-900]{--un-text-opacity:1;color:rgb(23 23 23/var(--un-text-opacity))}.dark [text~=dark\:orange-500],.text-orange-500{--un-text-opacity:1;color:rgb(249 115 22/var(--un-text-opacity))}.dark [text~="dark:pink-300/90"]{color:#f9a8d4e6}.dark [text~="dark:primary-300/50"]{color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/.5)}.dark [text~="dark:primary-600/90"]{color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/.9)}.dark [text~="dark:violet-600/90"]{color:#7c3aede6}.text-amber-500{--un-text-opacity:1;color:rgb(245 158 11/var(--un-text-opacity))}.text-amber-600{--un-text-opacity:1;color:rgb(217 119 6/var(--un-text-opacity))}.text-amber-700{--un-text-opacity:1;color:rgb(180 83 9/var(--un-text-opacity))}.text-black,[text-black=""]{--un-text-opacity:1;color:rgb(0 0 0/var(--un-text-opacity))}.text-blue-500{--un-text-opacity:1;color:rgb(59 130 246/var(--un-text-opacity))}.text-blue-700,[text-blue-700=""]{--un-text-opacity:1;color:rgb(29 78 216/var(--un-text-opacity))}.text-green-600{--un-text-opacity:1;color:rgb(22 163 74/var(--un-text-opacity))}.text-green-700,[text-green-700=""]{--un-text-opacity:1;color:rgb(21 128 61/var(--un-text-opacity))}.text-lime-500{--un-text-opacity:1;color:rgb(132 204 22/var(--un-text-opacity))}.text-neutral-200\/50,[text~=neutral-200\/50]{color:#e5e5e580}.text-neutral-400\/50,[text~=neutral-400\/50]{color:#a3a3a380}.text-neutral-500\/50,[text~=neutral-500\/50]{color:#73737380}.text-neutral-700,[text-neutral-700=""],[text~=neutral-700]{--un-text-opacity:1;color:rgb(64 64 64/var(--un-text-opacity))}.text-neutral-800{--un-text-opacity:1;color:rgb(38 38 38/var(--un-text-opacity))}.text-neutral-900\/80{color:#171717cc}.text-neutral-950{--un-text-opacity:1;color:rgb(10 10 10/var(--un-text-opacity))}.text-primary-600\/80{color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/.8)}.text-primary-700{--un-text-opacity:1;color:oklch(49% var(--chromatic-chroma-700)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity))}.text-primary-800{--un-text-opacity:1;color:oklch(42% var(--chromatic-chroma-800)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity))}.text-primary-950{--un-text-opacity:1;color:oklch(29% var(--chromatic-chroma-950)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity))}.text-purple{--un-text-opacity:1;color:rgb(192 132 252/var(--un-text-opacity))}.text-red-500{--un-text-opacity:1;color:rgb(239 68 68/var(--un-text-opacity))}.text-red-700,[text-red-700=""]{--un-text-opacity:1;color:rgb(185 28 28/var(--un-text-opacity))}.text-red-950{--un-text-opacity:1;color:rgb(69 10 10/var(--un-text-opacity))}.text-slate-700{--un-text-opacity:1;color:rgb(51 65 85/var(--un-text-opacity))}.text-transparent{color:#0000}.text-violet-500,[text-violet-500=""]{--un-text-opacity:1;color:rgb(139 92 246/var(--un-text-opacity))}[text~=cyan-400\/90]{color:#22d3eee6}[text~=gray-700]{--un-text-opacity:1;color:rgb(55 65 81/var(--un-text-opacity))}[text~=orange-700]{--un-text-opacity:1;color:rgb(194 65 12/var(--un-text-opacity))}[text~=pink-400]{--un-text-opacity:1;color:rgb(244 114 182/var(--un-text-opacity))}[text~=primary-400\/90]{color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.9)}[text~=violet-400\/90]{color:#a78bfae6}.dark .dark\:hover\:text-neutral-300:hover{--un-text-opacity:1;color:rgb(212 212 212/var(--un-text-opacity))}.dark [hover~="dark:text-primary-300/80"]:hover{color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/.8)}.dark [text~="dark:hover:neutral-200"]:hover{--un-text-opacity:1;color:rgb(229 229 229/var(--un-text-opacity))}.dark [text~="dark:hover:neutral-800"]:hover{--un-text-opacity:1;color:rgb(38 38 38/var(--un-text-opacity))}.dark [text~="dark:hover:primary-500"]:hover{--un-text-opacity:1;color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity))}.hover\:text-neutral-700:hover{--un-text-opacity:1;color:rgb(64 64 64/var(--un-text-opacity))}[hover~=text-primary-600\/80]:hover{color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/.8)}[text~=hover\:neutral-600]:hover{--un-text-opacity:1;color:rgb(82 82 82/var(--un-text-opacity))}[text~=hover\:primary-500]:hover{--un-text-opacity:1;color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity))}[text~=hover\:primary-600]:hover{--un-text-opacity:1;color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity))}.dark [text~="dark:disabled:neutral-600"]:disabled{--un-text-opacity:1;color:rgb(82 82 82/var(--un-text-opacity))}[text~=disabled\:neutral-400]:disabled,.dark [text~="placeholder:dark:hover:neutral-400"]:hover::placeholder{--un-text-opacity:1;color:rgb(163 163 163/var(--un-text-opacity))}.dark [text~="placeholder:dark:hover:primary-500"]:hover::placeholder{--un-text-opacity:1;color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity))}.dark [text~="placeholder:dark:neutral-300"]::placeholder{--un-text-opacity:1;color:rgb(212 212 212/var(--un-text-opacity))}.dark [text~="placeholder:dark:primary-300/50"]::placeholder{color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/.5)}[text~="placeholder:hover:neutral-500"]:hover::placeholder{--un-text-opacity:1;color:rgb(115 115 115/var(--un-text-opacity))}[text~="placeholder:hover:primary-500"]:hover::placeholder{--un-text-opacity:1;color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity))}[text~=placeholder\:neutral-400]::placeholder{--un-text-opacity:1;color:rgb(163 163 163/var(--un-text-opacity))}[text~=placeholder\:primary-400]::placeholder{--un-text-opacity:1;color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity))}.font-bold,[font-bold=""]{font-weight:700}.font-medium,[font-medium=""]{font-weight:500}.font-normal,[font-normal=""]{font-weight:400}.font-semibold,[font-semibold=""]{font-weight:600}.leading-10,.lh-10{line-height:2.5rem}[leading~="[0.75]"]{line-height:.75}[leading~="[1]"]{line-height:1}.font-cuteen,[font-cuteen=""]{font-family:Sniglet}.font-jura,[font-jura=""]{font-family:Jura}.font-mono,[font-mono=""]{font-family:DM Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.font-quicksand,[font-quicksand=""]{font-family:Quicksand}.font-sans,[font-sans=""]{font-family:DM Sans,DM Sans Variant,ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.font-sans-rounded,[font-sans-rounded=""]{font-family:Comfortaa Variable,Comfortaa,DM Sans,ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.font-italic,.italic,[font-italic=""]{font-style:italic}.decoration-underline,.underline,[decoration-underline=""],[underline=""]{text-decoration-line:underline}.decoration-dotted,[decoration-dotted=""]{text-decoration-style:dotted}.decoration-dashed,[decoration-dashed=""]{text-decoration-style:dashed}.tab,[aria-checked~=tab][aria-checked=true],[tab=""],[checked~=tab]:checked{tab-size:4}.text-stroke-1,[text-stroke-1=""]{-webkit-text-stroke-width:1px}.text-shadow{--un-text-shadow:0 0 1px var(--un-text-shadow-color,#0003),0 0 1px var(--un-text-shadow-color,#0100051a);text-shadow:var(--un-text-shadow)}.write-vertical-left,[write-vertical-left=""]{writing-mode:vertical-lr}.\[\&\:checked\+div_\.radio-dot\]\:opacity-100:checked+div .radio-dot,.opacity-100,.group:hover .group-hover\:opacity-100,.group:hover [group-hover\:opacity-100=""]{opacity:1}.op-0,.opacity-0,[op-0=""],[opacity-0=""]{opacity:0}.op50,.opacity-50,[op50=""]{opacity:.5}.opacity-25{opacity:.25}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-95,[opacity-95=""]{opacity:.95}.\[\&_\.round-range-tooltip\]\:hover\:opacity-100:hover .round-range-tooltip,[hover~=opacity-100]:hover{opacity:1}.disabled\:opacity-50:disabled,[disabled\:opacity-50=""]:disabled{opacity:.5}.before\:opacity-100:before{opacity:1}[before~=opacity-0]:before{opacity:0}[hover~=before\:opacity-100]:hover:before{opacity:1}.mix-blend-screen,[mix-blend-screen=""]{mix-blend-mode:screen}.dark .dark\:shadow-lg,.shadow-lg{--un-shadow:var(--un-shadow-inset)0 10px 15px -3px var(--un-shadow-color,#0000001a),var(--un-shadow-inset)0 4px 6px -4px var(--un-shadow-color,#0000001a);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.dark [shadow~=dark\:none]{--un-shadow:0 0 var(--un-shadow-color,#0000);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.shadow{--un-shadow:var(--un-shadow-inset)0 1px 3px 0 var(--un-shadow-color,#0000001a),var(--un-shadow-inset)0 1px 2px -1px var(--un-shadow-color,#0000001a);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.shadow-green-500\/50{--un-shadow-color:#22c55e80 }.shadow-md,[shadow-md=""],[shadow~=md]{--un-shadow:var(--un-shadow-inset)0 4px 6px -1px var(--un-shadow-color,#0000001a),var(--un-shadow-inset)0 2px 4px -2px var(--un-shadow-color,#0000001a);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.shadow-sm,[shadow-sm=""],[shadow~=sm]{--un-shadow:var(--un-shadow-inset)0 1px 2px 0 var(--un-shadow-color,#0000000d);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.shadow-xl,[shadow-xl=""]{--un-shadow:var(--un-shadow-inset)0 20px 25px -5px var(--un-shadow-color,#0000001a),var(--un-shadow-inset)0 8px 10px -6px var(--un-shadow-color,#0000001a);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.shadow-yellow-500\/30{--un-shadow-color:#eab3084d }[shadow~=cyan-200\/20]{--un-shadow-color:#a5f3fc33 }[shadow~=cyan-200\/50]{--un-shadow-color:#a5f3fc80 }[shadow~=primary-200\/20]{--un-shadow-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/.2)}[shadow~=primary-200\/50]{--un-shadow-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/.5)}[shadow~=violet-200\/20]{--un-shadow-color:#ddd6fe33 }[shadow~=violet-200\/50]{--un-shadow-color:#ddd6fe80 }.focus-within\:shadow-neutral-800:focus-within{--un-shadow-opacity:1;--un-shadow-color:rgb(38 38 38/var(--un-shadow-opacity))}[shadow~="focus-within:[0_0_0_1px]"]:focus-within{--un-shadow:0 0 0 1px var(--un-shadow-color);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.dark [hover~=dark\:shadow-lg]:hover{--un-shadow:var(--un-shadow-inset)0 10px 15px -3px var(--un-shadow-color,#0000001a),var(--un-shadow-inset)0 4px 6px -4px var(--un-shadow-color,#0000001a);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}[hover~=shadow-md]:hover{--un-shadow:var(--un-shadow-inset)0 4px 6px -1px var(--un-shadow-color,#0000001a),var(--un-shadow-inset)0 2px 4px -2px var(--un-shadow-color,#0000001a);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.outline{outline-style:solid}.outline-none,[outline-none=""],[outline~=focus-within\:none]:focus-within,.focus\:outline-none:focus{outline-offset:2px;outline:2px solid #0000}.ring-2,.focus\:ring-2:focus{--un-ring-width:2px;--un-ring-offset-shadow:var(--un-ring-inset)0 0 0 var(--un-ring-offset-width)var(--un-ring-offset-color);--un-ring-shadow:var(--un-ring-inset)0 0 0 calc(var(--un-ring-width) + var(--un-ring-offset-width))var(--un-ring-color);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.dark .dark\:ring-neutral-600\/30{--un-ring-color:#5252524d }.dark .dark\:ring-neutral-600\/60{--un-ring-color:#52525299 }.ring-neutral-300\/30{--un-ring-color:#d4d4d44d }.dark .dark\:focus\:ring-neutral-600\/30:focus{--un-ring-color:#5252524d }.dark .dark\:focus\:ring-neutral-600\/60:focus{--un-ring-color:#52525299 }.dark .dark\:focus\:ring-primary-600\/30:focus{--un-ring-color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/.3)}.dark .dark\:focus\:ring-red-600\/30:focus{--un-ring-color:#dc26264d }.dark .dark\:focus\:ring-red-600\/60:focus{--un-ring-color:#dc262699 }.focus\:ring-black\/10:focus{--un-ring-color:#0000001a }.focus\:ring-neutral-300\/30:focus{--un-ring-color:#d4d4d44d }.focus\:ring-primary-300\/60:focus{--un-ring-color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/.6)}.focus\:ring-red-300\/30:focus{--un-ring-color:#fca5a54d }.backdrop-blur-lg{--un-backdrop-blur:blur(16px);-webkit-backdrop-filter:var(--un-backdrop-blur)var(--un-backdrop-brightness)var(--un-backdrop-contrast)var(--un-backdrop-grayscale)var(--un-backdrop-hue-rotate)var(--un-backdrop-invert)var(--un-backdrop-opacity)var(--un-backdrop-saturate)var(--un-backdrop-sepia);backdrop-filter:var(--un-backdrop-blur)var(--un-backdrop-brightness)var(--un-backdrop-contrast)var(--un-backdrop-grayscale)var(--un-backdrop-hue-rotate)var(--un-backdrop-invert)var(--un-backdrop-opacity)var(--un-backdrop-saturate)var(--un-backdrop-sepia)}.backdrop-blur-md,[backdrop-blur-md=""]{--un-backdrop-blur:blur(12px);-webkit-backdrop-filter:var(--un-backdrop-blur)var(--un-backdrop-brightness)var(--un-backdrop-contrast)var(--un-backdrop-grayscale)var(--un-backdrop-hue-rotate)var(--un-backdrop-invert)var(--un-backdrop-opacity)var(--un-backdrop-saturate)var(--un-backdrop-sepia);backdrop-filter:var(--un-backdrop-blur)var(--un-backdrop-brightness)var(--un-backdrop-contrast)var(--un-backdrop-grayscale)var(--un-backdrop-hue-rotate)var(--un-backdrop-invert)var(--un-backdrop-opacity)var(--un-backdrop-saturate)var(--un-backdrop-sepia)}.backdrop-blur-sm,[backdrop-blur-sm=""]{--un-backdrop-blur:blur(4px);-webkit-backdrop-filter:var(--un-backdrop-blur)var(--un-backdrop-brightness)var(--un-backdrop-contrast)var(--un-backdrop-grayscale)var(--un-backdrop-hue-rotate)var(--un-backdrop-invert)var(--un-backdrop-opacity)var(--un-backdrop-saturate)var(--un-backdrop-sepia);backdrop-filter:var(--un-backdrop-blur)var(--un-backdrop-brightness)var(--un-backdrop-contrast)var(--un-backdrop-grayscale)var(--un-backdrop-hue-rotate)var(--un-backdrop-invert)var(--un-backdrop-opacity)var(--un-backdrop-saturate)var(--un-backdrop-sepia)}.backdrop-blur-xl,[backdrop-blur-xl=""]{--un-backdrop-blur:blur(24px);-webkit-backdrop-filter:var(--un-backdrop-blur)var(--un-backdrop-brightness)var(--un-backdrop-contrast)var(--un-backdrop-grayscale)var(--un-backdrop-hue-rotate)var(--un-backdrop-invert)var(--un-backdrop-opacity)var(--un-backdrop-saturate)var(--un-backdrop-sepia);backdrop-filter:var(--un-backdrop-blur)var(--un-backdrop-brightness)var(--un-backdrop-contrast)var(--un-backdrop-grayscale)var(--un-backdrop-hue-rotate)var(--un-backdrop-invert)var(--un-backdrop-opacity)var(--un-backdrop-saturate)var(--un-backdrop-sepia)}.blur{--un-blur:blur(8px);filter:var(--un-blur)var(--un-brightness)var(--un-contrast)var(--un-drop-shadow)var(--un-grayscale)var(--un-hue-rotate)var(--un-invert)var(--un-saturate)var(--un-sepia)}.drop-shadow{--un-drop-shadow:drop-shadow(0 1px 2px var(--un-drop-shadow-color,#0000001a))drop-shadow(0 1px 1px var(--un-drop-shadow-color,#0000000f));filter:var(--un-blur)var(--un-brightness)var(--un-contrast)var(--un-drop-shadow)var(--un-grayscale)var(--un-hue-rotate)var(--un-invert)var(--un-saturate)var(--un-sepia)}.drop-shadow-sm,[drop-shadow-sm=""]{--un-drop-shadow:drop-shadow(0 1px 1px var(--un-drop-shadow-color,#0000000d));filter:var(--un-blur)var(--un-brightness)var(--un-contrast)var(--un-drop-shadow)var(--un-grayscale)var(--un-hue-rotate)var(--un-invert)var(--un-saturate)var(--un-sepia)}[drop-shadow~=none],.dark [drop-shadow~="dark:hover:none"]:hover{--un-drop-shadow:drop-shadow(0 0 var(--un-drop-shadow-color,#0000));filter:var(--un-blur)var(--un-brightness)var(--un-contrast)var(--un-drop-shadow)var(--un-grayscale)var(--un-hue-rotate)var(--un-invert)var(--un-saturate)var(--un-sepia)}[drop-shadow~="hover:[0px_4px_4px_rgba(220,220,220,0.4)]"]:hover{--un-drop-shadow:drop-shadow(0px 4px 4px #dcdcdc66);filter:var(--un-blur)var(--un-brightness)var(--un-contrast)var(--un-drop-shadow)var(--un-grayscale)var(--un-hue-rotate)var(--un-invert)var(--un-saturate)var(--un-sepia)}[drop-shadow~="active:[0px_0px_0px_rgba(220,220,220,0.25)]"]:active{--un-drop-shadow:drop-shadow(0px 0px 0px #dcdcdc40);filter:var(--un-blur)var(--un-brightness)var(--un-contrast)var(--un-drop-shadow)var(--un-grayscale)var(--un-hue-rotate)var(--un-invert)var(--un-saturate)var(--un-sepia)}.\[\&_\.provider-icon\]\:grayscale-100 .provider-icon,.grayscale-100,[grayscale-100=""]{--un-grayscale:grayscale(1);filter:var(--un-blur)var(--un-brightness)var(--un-contrast)var(--un-drop-shadow)var(--un-grayscale)var(--un-hue-rotate)var(--un-invert)var(--un-saturate)var(--un-sepia)}.\[\&_\.provider-icon\]\:hover\:grayscale-0:hover .provider-icon{--un-grayscale:grayscale(0);filter:var(--un-blur)var(--un-brightness)var(--un-contrast)var(--un-drop-shadow)var(--un-grayscale)var(--un-hue-rotate)var(--un-invert)var(--un-saturate)var(--un-sepia)}.filter{filter:var(--un-blur)var(--un-brightness)var(--un-contrast)var(--un-drop-shadow)var(--un-grayscale)var(--un-hue-rotate)var(--un-invert)var(--un-saturate)var(--un-sepia)}.backdrop-filter{-webkit-backdrop-filter:var(--un-backdrop-blur)var(--un-backdrop-brightness)var(--un-backdrop-contrast)var(--un-backdrop-grayscale)var(--un-backdrop-hue-rotate)var(--un-backdrop-invert)var(--un-backdrop-opacity)var(--un-backdrop-saturate)var(--un-backdrop-sepia);backdrop-filter:var(--un-backdrop-blur)var(--un-backdrop-brightness)var(--un-backdrop-contrast)var(--un-backdrop-grayscale)var(--un-backdrop-hue-rotate)var(--un-backdrop-invert)var(--un-backdrop-opacity)var(--un-backdrop-saturate)var(--un-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter,backdrop-filter;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-\[width\,margin\]{transition-property:width,margin;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-100,[transition~="100"]{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter,backdrop-filter;transition-duration:.1s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-all,[transition-all=""],[transition~=all]{transition-property:all;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors,[transition-colors=""],[transition~=colors]{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors\,transform\,width\,height{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,transform,width,height;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-opacity,[transition-opacity=""]{transition-property:opacity;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-transform,[transition~=transform]{transition-property:transform;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}[transition~=border]{transition-property:border;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}[transition~=colors\,transform]{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,transform;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}[transition~=width]{transition-property:width;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}[transition~=placeholder\:all]::placeholder,[before~=transition-all]:before,.after\:transition-all:after,[after~=transition-all]:after{transition-property:all;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-150,[duration-150=""]{transition-duration:.15s}.duration-200,[duration-200=""],[transition~=duration-200]{transition-duration:.2s}.duration-250,[duration-250=""],[duration~="250"],[transition~=duration-250]{transition-duration:.25s}.duration-300,[transition~=duration-300]{transition-duration:.3s}.duration-400,[transition~=duration-400]{transition-duration:.4s}.duration-500,[duration-500=""],[duration~="500"],[transition~=duration-500]{transition-duration:.5s}.duration-75{transition-duration:75ms}[duration~="10"]{transition-duration:10ms}[duration~="1000"]{transition-duration:1s}.placeholder\:duration-250::placeholder,[placeholder\:duration-250=""]::placeholder,[transition~=placeholder\:duration-250]::placeholder{transition-duration:.25s}[before~=duration-400]:before,[after~=duration-400]:after{transition-duration:.4s}[delay~="10"]{transition-delay:10ms}[delay~="100"]{transition-delay:.1s}[delay~="11"]{transition-delay:11ms}[delay~="19"]{transition-delay:19ms}[delay~="2"]{transition-delay:2ms}[delay~="20"]{transition-delay:20ms}[delay~="200"]{transition-delay:.2s}[delay~="3"]{transition-delay:3ms}[delay~="4"]{transition-delay:4ms}[delay~="5"]{transition-delay:5ms}[delay~="50"]{transition-delay:50ms}[delay~="6"]{transition-delay:6ms}[delay~="7"]{transition-delay:7ms}[delay~="8"]{transition-delay:8ms}[delay~="9"]{transition-delay:9ms}.ease,.ease-in-out,[ease-in-out=""],[transition~=ease-in-out]{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.ease-linear,[ease-linear=""]{transition-timing-function:linear}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.placeholder\:ease-in-out::placeholder,[transition~=placeholder\:ease-in-out]::placeholder,[before~=ease-in-out]:before,[after~=ease-in-out]:after{transition-timing-function:cubic-bezier(.4,0,.2,1)}.will-change-background-color,[will-change-background-color=""]{will-change:background-color}.will-change-color,[will-change-color=""]{will-change:color}.will-change-transform,[will-change-transform=""]{will-change:transform}.will-change-width,[will-change-width=""]{will-change:width}.before\:content-\[\'\'\]:before,.after\:content-\[\'\'\]:after,.content-empty,[before~=content-empty]:before,[after~=content-empty]:after{content:""}.hidden,[hidden=""]{display:none}.bg-dotted-\[neutral-200\/60\]{background-image:radial-gradient(circle at 1px 1px,rgb(229 229 229/var(--un-background-opacity))1px,transparent 0);--un-background-opacity:.6}.bg-dotted-\[neutral-200\/80\]{background-image:radial-gradient(circle at 1px 1px,rgb(229 229 229/var(--un-background-opacity))1px,transparent 0);--un-background-opacity:.8}.dark .dark\:bg-dotted-\[neutral-700\/25\]{background-image:radial-gradient(circle at 1px 1px,rgb(64 64 64/var(--un-background-opacity))1px,transparent 0);--un-background-opacity:.25}.dark .dark\:bg-dotted-\[neutral-700\/40\]{background-image:radial-gradient(circle at 1px 1px,rgb(64 64 64/var(--un-background-opacity))1px,transparent 0);--un-background-opacity:.4}.dark .dark\:hover\:bg-dotted-\[primary-200\/20\]:hover{background-image:radial-gradient(circle at 1px 1px,oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/var(--un-background-opacity))1px,transparent 0);--un-background-opacity:%alpha}.hover\:bg-dotted-\[primary-300\/50\]:hover,.after\:bg-dotted-\[primary-300\/50\]:after{background-image:radial-gradient(circle at 1px 1px,oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/var(--un-background-opacity))1px,transparent 0);--un-background-opacity:%alpha}.dark .dark\:after\:bg-dotted-\[primary-200\/20\]:after,.dark [hover~="dark:after:bg-dotted-[primary-200/20]"]:hover:after{background-image:radial-gradient(circle at 1px 1px,oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/var(--un-background-opacity))1px,transparent 0);--un-background-opacity:%alpha}[after~="bg-dotted-[neutral-200/80]"]:after{background-image:radial-gradient(circle at 1px 1px,rgb(229 229 229/var(--un-background-opacity))1px,transparent 0);--un-background-opacity:.8}[hover~="after:bg-dotted-[primary-300/50]"]:hover:after{background-image:radial-gradient(circle at 1px 1px,oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/var(--un-background-opacity))1px,transparent 0);--un-background-opacity:%alpha}.transition-colors-none,.placeholder\:transition-colors-none::placeholder{transition-property:color,background-color,border-color,text-color;transition-duration:0s}@media (max-width:1023.9px){[min-w~="svg{opacity:0;transform-origin:50%;animation:.3s forwards sonner-fade-in;transform:scale(.8)}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{flex-direction:column;gap:2px;display:flex}[data-sonner-toast][data-styled=true] [data-button]{height:24px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);cursor:pointer;border:none;border-radius:4px;outline:none;flex-shrink:0;align-items:center;padding-left:8px;padding-right:8px;font-size:12px;font-weight:500;transition:opacity .4s,box-shadow .2s;display:flex}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px #0006}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:#00000014}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:#ffffff4d}[data-sonner-toast][data-styled=true] [data-close-button]{left:var(--toast-close-button-start);right:var(--toast-close-button-end);width:20px;height:20px;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);cursor:pointer;z-index:1;border-radius:50%;justify-content:center;align-items:center;padding:0;transition:opacity .1s,background .2s,border-color .2s;display:flex;position:absolute;top:0}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]:before{content:"";z-index:-1;height:100%;position:absolute;left:-100%;right:-100%}[data-sonner-toast][data-y-position=top][data-swiping=true]:before{bottom:50%;transform:scaleY(3)translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]:before{top:50%;transform:scaleY(3)translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]:before{content:"";position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]:after{content:"";height:calc(var(--gap) + 1px);width:100%;position:absolute;bottom:100%;left:0}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before)*.05 + 1;--y:translateY(calc(var(--lift-amount)*var(--toasts-before)))scale(calc(-1*var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift)*var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift)*-100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift)*var(--offset) + var(--lift)*-100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]:before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y)translateY(var(--swipe-amount-y,0px))translateX(var(--swipe-amount-x,0px));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y)translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y)translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y)translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y)translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y)translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y)translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y)translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y)translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%;position:fixed}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left)*-1)}[data-sonner-toaster] [data-sonner-toast]{width:calc(100% - var(--mobile-offset-left)*2);left:0;right:0}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:#ecfdf3;--success-border:#bffcd9;--success-text:#008a2e;--info-bg:#f0f8ff;--info-border:#dde7fd;--info-text:#0973dc;--warning-bg:#fffcf0;--warning-border:#fbeeb1;--warning-text:#dc7609;--error-bg:#fff0f0;--error-border:#ffe0e1;--error-text:#e60000}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:#333;--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:#1f1f1f;--normal-border:#333;--normal-border-hover:#404040;--normal-text:var(--gray1);--success-bg:#001f0f;--success-border:#003d1c;--success-text:#59f3a6;--info-bg:#000d1f;--info-border:#19233e;--info-text:#5896f3;--warning-bg:#1d1f00;--warning-border:#2e2e00;--warning-text:#f3cf58;--error-bg:#2d0607;--error-border:#4d0408;--error-text:#ff9ea1}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);z-index:10;position:absolute;inset:0}.sonner-loading-wrapper[data-visible=false]{transform-origin:50%;animation:.2s forwards sonner-fade-out}.sonner-spinner{height:var(--size);width:var(--size);position:relative;top:50%;left:50%}.sonner-loading-bar{background:var(--gray11);border-radius:6px;width:24%;height:8%;animation:1.2s linear infinite sonner-spin;position:absolute;top:-3.9%;left:-10%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg)translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg)translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg)translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg)translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg)translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg)translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg)translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg)translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg)translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg)translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg)translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg)translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{transform-origin:50%;transition:opacity .2s,transform .2s;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8)translate(-50%,-50%)}@property --chromatic-hue{syntax:"";inherits:true;initial-value:0}@keyframes hue-anim{0%{--chromatic-hue:0}to{--chromatic-hue:360}}.dynamic-hue{animation:10s linear infinite hue-anim}@font-face{font-family:cjkfonts AllSeto;font-style:normal;font-display:swap;src:url(/assets/cjkFonts_allseto_v1.11-ByBdljxl.ttf)format("truetype")}@font-face{font-family:Xiaolai SC;font-style:normal;font-display:swap;src:url(/assets/XiaolaiSC-Regular-SNWuh554.ttf)format("truetype")}*,:before,:after{box-sizing:border-box;border-style:solid;border-width:0;border-color:var(--un-default-border-color,#e5e7eb)}:before,:after{--un-content:""}html,:host{-webkit-text-size-adjust:100%;tab-size:4;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}body{line-height:inherit;margin:0}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-feature-settings:normal;font-variation-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-feature-settings:inherit;font-variation-settings:inherit;font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:#0000;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{margin:0;padding:0;list-style:none}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.slide-away-enter-active,.slide-away-leave-active{transition:transform .3s ease-in-out,opacity .3s ease-in-out}.slide-away-enter,.slide-away-leave-to{opacity:0;transform:translateY(-10px)}.slide-away-enter-from,.slide-away-leave{opacity:0;transform:translateY(10px)}.fade-slide-out-r-to-l-enter-active,.fade-slide-out-r-to-l-leave-active{transition:opacity .2s ease-in-out,transform .2s ease-in-out}.fade-slide-out-r-to-l-enter-from,.fade-slide-out-r-to-l-leave-to{opacity:0;transform:translate(10px)}.fade-slide-out-r-to-l-enter-to,.fade-slide-out-r-to-l-leave-from{opacity:1;transform:translate(0)}.fade-slide-out-l-to-r-enter-active,.fade-slide-out-l-to-r-leave-active{transition:opacity .2s ease-in-out,transform .2s ease-in-out}.fade-slide-out-l-to-r-enter-from,.fade-slide-out-l-to-r-leave-to{opacity:0;transform:translate(-10px)}.fade-slide-out-l-to-r-enter-to,.fade-slide-out-l-to-r-leave-from{opacity:1;transform:translate(0)}.fade-enter-active,.fade-leave-active{transition:opacity .2s ease-in-out}.fade-enter-from,.fade-leave-to{opacity:0}.fade-enter-to,.fade-leave-from{opacity:1}:root{--bg-color-light:#fff;--bg-color-dark:#121212;--bg-color:var(--bg-color-light)}*{touch-action:manipulation}html,body,#app{overscroll-behavior:none;height:100%;margin:0;padding:0}html{background:var(--bg-color);transition:all .3s ease-in-out}html.dark{--bg-color:var(--bg-color-dark);--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}#nprogress{pointer-events:none}#nprogress .bar{background:color-mix(in srgb,oklch(95% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + ${0}))70%,#636363);opacity:.75;z-index:1031;width:100%;height:2px;position:fixed;top:0;left:0}@supports (color:lab(0% 0 0)){#nprogress .bar{background:color-mix(in srgb,oklch(95% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + ${0}))70%,lab(42% 0 0))}}.dark #nprogress .bar{background:`color-mix(in srgb,oklch(95% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + ${0}))90%,#dedede)`}@supports (color:lab(0% 0 0)){.dark #nprogress .bar{background:`color-mix(in srgb,oklch(95% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + ${0}))90%,lab(88.4% 0 0))`}}@media (display-mode:standalone){#nprogress,#nprogress .bar{display:none}}@font-face{font-family:DM Sans;font-style:normal;font-display:swap;font-weight:100 1000;src:url(https://cdn.jsdelivr.net/fontsource/fonts/dm-sans:vf@latest/latin-wght-normal.woff2)format("woff2-variations");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:DM Sans;font-style:normal;font-display:swap;font-weight:100 1000;src:url(https://cdn.jsdelivr.net/fontsource/fonts/dm-sans:vf@latest/latin-ext-wght-normal.woff2)format("woff2-variations");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:DM Serif Display;font-style:normal;font-display:swap;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/dm-serif-display@latest/latin-400-normal.woff2)format("woff2");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:DM Serif Display;font-style:normal;font-display:swap;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/dm-serif-display@latest/latin-ext-400-normal.woff2)format("woff2");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:DM Mono;font-style:normal;font-display:swap;font-weight:300;src:url(https://cdn.jsdelivr.net/fontsource/fonts/dm-mono@latest/latin-300-normal.woff2)format("woff2");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:DM Mono;font-style:normal;font-display:swap;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/dm-mono@latest/latin-400-normal.woff2)format("woff2");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:DM Mono;font-style:normal;font-display:swap;font-weight:500;src:url(https://cdn.jsdelivr.net/fontsource/fonts/dm-mono@latest/latin-500-normal.woff2)format("woff2");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:DM Mono;font-style:normal;font-display:swap;font-weight:300;src:url(https://cdn.jsdelivr.net/fontsource/fonts/dm-mono@latest/latin-ext-300-normal.woff2)format("woff2");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:DM Mono;font-style:normal;font-display:swap;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/dm-mono@latest/latin-ext-400-normal.woff2)format("woff2");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:DM Mono;font-style:normal;font-display:swap;font-weight:500;src:url(https://cdn.jsdelivr.net/fontsource/fonts/dm-mono@latest/latin-ext-500-normal.woff2)format("woff2");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Kiwi Maru;font-style:normal;font-display:swap;font-weight:300;src:url(https://cdn.jsdelivr.net/fontsource/fonts/kiwi-maru@latest/cyrillic-300-normal.woff2)format("woff2");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:Kiwi Maru;font-style:normal;font-display:swap;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/kiwi-maru@latest/cyrillic-400-normal.woff2)format("woff2");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:Kiwi Maru;font-style:normal;font-display:swap;font-weight:500;src:url(https://cdn.jsdelivr.net/fontsource/fonts/kiwi-maru@latest/cyrillic-500-normal.woff2)format("woff2");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:Kiwi Maru;font-style:normal;font-display:swap;font-weight:300;src:url(https://cdn.jsdelivr.net/fontsource/fonts/kiwi-maru@latest/japanese-300-normal.woff2)format("woff2")}@font-face{font-family:Kiwi Maru;font-style:normal;font-display:swap;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/kiwi-maru@latest/japanese-400-normal.woff2)format("woff2")}@font-face{font-family:Kiwi Maru;font-style:normal;font-display:swap;font-weight:500;src:url(https://cdn.jsdelivr.net/fontsource/fonts/kiwi-maru@latest/japanese-500-normal.woff2)format("woff2")}@font-face{font-family:Kiwi Maru;font-style:normal;font-display:swap;font-weight:300;src:url(https://cdn.jsdelivr.net/fontsource/fonts/kiwi-maru@latest/latin-300-normal.woff2)format("woff2");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Kiwi Maru;font-style:normal;font-display:swap;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/kiwi-maru@latest/latin-400-normal.woff2)format("woff2");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Kiwi Maru;font-style:normal;font-display:swap;font-weight:500;src:url(https://cdn.jsdelivr.net/fontsource/fonts/kiwi-maru@latest/latin-500-normal.woff2)format("woff2");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Kiwi Maru;font-style:normal;font-display:swap;font-weight:300;src:url(https://cdn.jsdelivr.net/fontsource/fonts/kiwi-maru@latest/latin-ext-300-normal.woff2)format("woff2");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Kiwi Maru;font-style:normal;font-display:swap;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/kiwi-maru@latest/latin-ext-400-normal.woff2)format("woff2");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Kiwi Maru;font-style:normal;font-display:swap;font-weight:500;src:url(https://cdn.jsdelivr.net/fontsource/fonts/kiwi-maru@latest/latin-ext-500-normal.woff2)format("woff2");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Sniglet;font-style:normal;font-display:swap;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/sniglet@latest/latin-400-normal.woff2)format("woff2");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Sniglet;font-style:normal;font-display:swap;font-weight:800;src:url(https://cdn.jsdelivr.net/fontsource/fonts/sniglet@latest/latin-800-normal.woff2)format("woff2");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Sniglet;font-style:normal;font-display:swap;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/sniglet@latest/latin-ext-400-normal.woff2)format("woff2");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Sniglet;font-style:normal;font-display:swap;font-weight:800;src:url(https://cdn.jsdelivr.net/fontsource/fonts/sniglet@latest/latin-ext-800-normal.woff2)format("woff2");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Jura;font-style:normal;font-display:swap;font-weight:300 700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/jura:vf@latest/cyrillic-wght-normal.woff2)format("woff2-variations");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:Jura;font-style:normal;font-display:swap;font-weight:300 700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/jura:vf@latest/cyrillic-ext-wght-normal.woff2)format("woff2-variations");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Jura;font-style:normal;font-display:swap;font-weight:300 700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/jura:vf@latest/greek-wght-normal.woff2)format("woff2-variations");unicode-range:U+370-377,U+37A-37F,U+384-38A,U+38C,U+38E-3A1,U+3A3-3FF}@font-face{font-family:Jura;font-style:normal;font-display:swap;font-weight:300 700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/jura:vf@latest/greek-ext-wght-normal.woff2)format("woff2-variations");unicode-range:U+1F??}@font-face{font-family:Jura;font-style:normal;font-display:swap;font-weight:300 700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/jura:vf@latest/kayah-li-wght-normal.woff2)format("woff2-variations");unicode-range:U+200C-200D,U+2010,U+25CC,U+A900-A92F}@font-face{font-family:Jura;font-style:normal;font-display:swap;font-weight:300 700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/jura:vf@latest/latin-wght-normal.woff2)format("woff2-variations");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Jura;font-style:normal;font-display:swap;font-weight:300 700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/jura:vf@latest/latin-ext-wght-normal.woff2)format("woff2-variations");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Jura;font-style:normal;font-display:swap;font-weight:300 700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/jura:vf@latest/vietnamese-wght-normal.woff2)format("woff2-variations");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Gugi;font-style:normal;font-display:swap;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/gugi@latest/korean-400-normal.woff2)format("woff2")}@font-face{font-family:Gugi;font-style:normal;font-display:swap;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/gugi@latest/latin-400-normal.woff2)format("woff2");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Quicksand;font-style:normal;font-display:swap;font-weight:300 700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/quicksand:vf@latest/latin-wght-normal.woff2)format("woff2-variations");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Quicksand;font-style:normal;font-display:swap;font-weight:300 700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/quicksand:vf@latest/latin-ext-wght-normal.woff2)format("woff2-variations");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Quicksand;font-style:normal;font-display:swap;font-weight:300 700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/quicksand:vf@latest/vietnamese-wght-normal.woff2)format("woff2-variations");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Urbanist;font-style:normal;font-display:swap;font-weight:100 900;src:url(https://cdn.jsdelivr.net/fontsource/fonts/urbanist:vf@latest/latin-wght-normal.woff2)format("woff2-variations");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Urbanist;font-style:normal;font-display:swap;font-weight:100 900;src:url(https://cdn.jsdelivr.net/fontsource/fonts/urbanist:vf@latest/latin-ext-wght-normal.woff2)format("woff2-variations");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Comfortaa;font-style:normal;font-display:swap;font-weight:300 700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/comfortaa:vf@latest/cyrillic-wght-normal.woff2)format("woff2-variations");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:Comfortaa;font-style:normal;font-display:swap;font-weight:300 700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/comfortaa:vf@latest/cyrillic-ext-wght-normal.woff2)format("woff2-variations");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Comfortaa;font-style:normal;font-display:swap;font-weight:300 700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/comfortaa:vf@latest/greek-wght-normal.woff2)format("woff2-variations");unicode-range:U+370-377,U+37A-37F,U+384-38A,U+38C,U+38E-3A1,U+3A3-3FF}@font-face{font-family:Comfortaa;font-style:normal;font-display:swap;font-weight:300 700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/comfortaa:vf@latest/latin-wght-normal.woff2)format("woff2-variations");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Comfortaa;font-style:normal;font-display:swap;font-weight:300 700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/comfortaa:vf@latest/latin-ext-wght-normal.woff2)format("woff2-variations");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Comfortaa;font-style:normal;font-display:swap;font-weight:300 700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/comfortaa:vf@latest/vietnamese-wght-normal.woff2)format("woff2-variations");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:100;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/cyrillic-100-normal.woff2)format("woff2");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:300;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/cyrillic-300-normal.woff2)format("woff2");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/cyrillic-400-normal.woff2)format("woff2");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:500;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/cyrillic-500-normal.woff2)format("woff2");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/cyrillic-700-normal.woff2)format("woff2");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:800;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/cyrillic-800-normal.woff2)format("woff2");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:900;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/cyrillic-900-normal.woff2)format("woff2");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:100;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/cyrillic-ext-100-normal.woff2)format("woff2");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:300;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/cyrillic-ext-300-normal.woff2)format("woff2");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/cyrillic-ext-400-normal.woff2)format("woff2");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:500;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/cyrillic-ext-500-normal.woff2)format("woff2");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/cyrillic-ext-700-normal.woff2)format("woff2");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:800;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/cyrillic-ext-800-normal.woff2)format("woff2");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:900;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/cyrillic-ext-900-normal.woff2)format("woff2");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:100;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/greek-100-normal.woff2)format("woff2");unicode-range:U+370-377,U+37A-37F,U+384-38A,U+38C,U+38E-3A1,U+3A3-3FF}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:300;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/greek-300-normal.woff2)format("woff2");unicode-range:U+370-377,U+37A-37F,U+384-38A,U+38C,U+38E-3A1,U+3A3-3FF}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/greek-400-normal.woff2)format("woff2");unicode-range:U+370-377,U+37A-37F,U+384-38A,U+38C,U+38E-3A1,U+3A3-3FF}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:500;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/greek-500-normal.woff2)format("woff2");unicode-range:U+370-377,U+37A-37F,U+384-38A,U+38C,U+38E-3A1,U+3A3-3FF}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/greek-700-normal.woff2)format("woff2");unicode-range:U+370-377,U+37A-37F,U+384-38A,U+38C,U+38E-3A1,U+3A3-3FF}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:800;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/greek-800-normal.woff2)format("woff2");unicode-range:U+370-377,U+37A-37F,U+384-38A,U+38C,U+38E-3A1,U+3A3-3FF}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:900;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/greek-900-normal.woff2)format("woff2");unicode-range:U+370-377,U+37A-37F,U+384-38A,U+38C,U+38E-3A1,U+3A3-3FF}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:100;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/greek-ext-100-normal.woff2)format("woff2");unicode-range:U+1F??}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:300;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/greek-ext-300-normal.woff2)format("woff2");unicode-range:U+1F??}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/greek-ext-400-normal.woff2)format("woff2");unicode-range:U+1F??}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:500;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/greek-ext-500-normal.woff2)format("woff2");unicode-range:U+1F??}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/greek-ext-700-normal.woff2)format("woff2");unicode-range:U+1F??}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:800;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/greek-ext-800-normal.woff2)format("woff2");unicode-range:U+1F??}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:900;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/greek-ext-900-normal.woff2)format("woff2");unicode-range:U+1F??}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:100;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/hebrew-100-normal.woff2)format("woff2");unicode-range:U+307-308,U+590-5FF,U+200C-2010,U+20AA,U+25CC,U+FB1D-FB4F}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:300;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/hebrew-300-normal.woff2)format("woff2");unicode-range:U+307-308,U+590-5FF,U+200C-2010,U+20AA,U+25CC,U+FB1D-FB4F}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/hebrew-400-normal.woff2)format("woff2");unicode-range:U+307-308,U+590-5FF,U+200C-2010,U+20AA,U+25CC,U+FB1D-FB4F}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:500;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/hebrew-500-normal.woff2)format("woff2");unicode-range:U+307-308,U+590-5FF,U+200C-2010,U+20AA,U+25CC,U+FB1D-FB4F}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/hebrew-700-normal.woff2)format("woff2");unicode-range:U+307-308,U+590-5FF,U+200C-2010,U+20AA,U+25CC,U+FB1D-FB4F}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:800;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/hebrew-800-normal.woff2)format("woff2");unicode-range:U+307-308,U+590-5FF,U+200C-2010,U+20AA,U+25CC,U+FB1D-FB4F}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:900;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/hebrew-900-normal.woff2)format("woff2");unicode-range:U+307-308,U+590-5FF,U+200C-2010,U+20AA,U+25CC,U+FB1D-FB4F}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:100;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/japanese-100-normal.woff2)format("woff2")}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:300;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/japanese-300-normal.woff2)format("woff2")}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/japanese-400-normal.woff2)format("woff2")}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:500;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/japanese-500-normal.woff2)format("woff2")}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/japanese-700-normal.woff2)format("woff2")}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:800;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/japanese-800-normal.woff2)format("woff2")}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:900;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/japanese-900-normal.woff2)format("woff2")}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:100;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/latin-100-normal.woff2)format("woff2");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:300;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/latin-300-normal.woff2)format("woff2");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/latin-400-normal.woff2)format("woff2");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:500;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/latin-500-normal.woff2)format("woff2");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/latin-700-normal.woff2)format("woff2");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:800;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/latin-800-normal.woff2)format("woff2");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:900;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/latin-900-normal.woff2)format("woff2");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:100;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/latin-ext-100-normal.woff2)format("woff2");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:300;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/latin-ext-300-normal.woff2)format("woff2");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/latin-ext-400-normal.woff2)format("woff2");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:500;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/latin-ext-500-normal.woff2)format("woff2");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/latin-ext-700-normal.woff2)format("woff2");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:800;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/latin-ext-800-normal.woff2)format("woff2");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:900;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/latin-ext-900-normal.woff2)format("woff2");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:100;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/vietnamese-100-normal.woff2)format("woff2");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:300;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/vietnamese-300-normal.woff2)format("woff2");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/vietnamese-400-normal.woff2)format("woff2");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:500;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/vietnamese-500-normal.woff2)format("woff2");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:700;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/vietnamese-700-normal.woff2)format("woff2");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:800;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/vietnamese-800-normal.woff2)format("woff2");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-display:swap;font-weight:900;src:url(https://cdn.jsdelivr.net/fontsource/fonts/m-plus-rounded-1c@latest/vietnamese-900-normal.woff2)format("woff2");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}*,:before,:after,::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 #0000;--un-ring-shadow:0 0 #0000;--un-shadow-inset: ;--un-shadow:0 0 #0000;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:#93c5fd80;--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }:root{--chromatic-hue:220.44;--chromatic-chroma:calc(.18 + (cos(var(--chromatic-hue)*3.14159/180)*.04));--chromatic-chroma-50:calc(var(--chromatic-chroma)*.3);--chromatic-chroma-100:calc(var(--chromatic-chroma)*.5);--chromatic-chroma-200:calc(var(--chromatic-chroma)*.6);--chromatic-chroma-300:calc(var(--chromatic-chroma)*.75);--chromatic-chroma-400:calc(var(--chromatic-chroma)*.85);--chromatic-chroma-500:var(--chromatic-chroma);--chromatic-chroma-600:calc(var(--chromatic-chroma)*1.15);--chromatic-chroma-700:calc(var(--chromatic-chroma)*1.1);--chromatic-chroma-800:calc(var(--chromatic-chroma)*.85);--chromatic-chroma-900:calc(var(--chromatic-chroma)*.7);--chromatic-chroma-950:calc(var(--chromatic-chroma)*.5)}.i-eos-icons\:three-dots-loading,[i-eos-icons\:three-dots-loading=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Ccircle cx='18' cy='12' r='0' fill='currentColor'%3E%3Canimate attributeName='r' begin='.67' calcMode='spline' dur='1.5s' keySplines='0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8' repeatCount='indefinite' values='0;2;0;0'/%3E%3C/circle%3E%3Ccircle cx='12' cy='12' r='0' fill='currentColor'%3E%3Canimate attributeName='r' begin='.33' calcMode='spline' dur='1.5s' keySplines='0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8' repeatCount='indefinite' values='0;2;0;0'/%3E%3C/circle%3E%3Ccircle cx='6' cy='12' r='0' fill='currentColor'%3E%3Canimate attributeName='r' begin='0' calcMode='spline' dur='1.5s' keySplines='0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8' repeatCount='indefinite' values='0;2;0;0'/%3E%3C/circle%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:alibabacloud{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M14.752 4.64h5.274C22.242 4.64 24 6.475 24 8.691V15.8a3.947 3.947 0 01-3.974 3.975h-5.274l1.299-1.835 3.822-1.222c.688-.23 1.146-.918 1.146-1.605v-5.81c0-.687-.458-1.375-1.146-1.605L16.05 6.475l-1.3-1.835zM2.98 15.111c0 .688.46 1.376 1.147 1.606l3.822 1.146 1.3 1.835H3.974A3.947 3.947 0 010 15.723V8.69c0-2.216 1.758-4.05 3.975-4.05h5.273L7.95 6.474 4.127 7.697c-.688.23-1.146.918-1.146 1.606v5.808z'/%3E%3Cpath d='M16.051 11.213H8.025v1.835h8.026v-1.835z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:anthropic{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M13.827 3.52h3.603L24 20h-3.603l-6.57-16.48zm-7.258 0h3.767L16.906 20h-3.674l-1.343-3.461H5.017l-1.344 3.46H0L6.57 3.522zm4.132 9.959L8.453 7.687 6.205 13.48H10.7z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:cloudflare{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cg%3E%3Cpath d='M16.493 17.4c.135-.52.08-.983-.161-1.338-.215-.328-.592-.519-1.05-.519l-8.663-.109a.148.148 0 01-.135-.082c-.027-.054-.027-.109-.027-.163.027-.082.108-.164.189-.164l8.744-.11c1.05-.054 2.153-.9 2.556-1.937l.511-1.31c.027-.055.027-.11.027-.164C17.92 8.91 15.66 7 12.942 7c-2.503 0-4.628 1.638-5.381 3.903a2.432 2.432 0 00-1.803-.491c-1.21.109-2.153 1.092-2.287 2.32-.027.328 0 .628.054.9C1.56 13.688 0 15.326 0 17.319c0 .19.027.355.027.545 0 .082.08.137.161.137h15.983c.08 0 .188-.055.215-.164l.107-.437'/%3E%3Cpath d='M19.238 11.75h-.242c-.054 0-.108.054-.135.109l-.35 1.2c-.134.52-.08.983.162 1.338.215.328.592.518 1.05.518l1.855.11c.054 0 .108.027.135.082.027.054.027.109.027.163-.027.082-.108.164-.188.164l-1.91.11c-1.05.054-2.153.9-2.557 1.937l-.134.355c-.027.055.026.137.107.137h6.592c.081 0 .162-.055.162-.137.107-.41.188-.846.188-1.31-.027-2.62-2.153-4.777-4.762-4.777'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:deepseek{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M23.748 4.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526 5.526 0 01-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365 11.365 0 00-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055 3.055 0 01-.465.137 9.597 9.597 0 00-2.883-.102c-1.885.21-3.39 1.102-4.497 2.623C.082 8.606-.231 10.684.152 12.85c.403 2.284 1.569 4.175 3.36 5.653 1.858 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.133-.284 4.994-1.86.47.234.962.327 1.78.397.63.059 1.236-.03 1.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926 1.096-1.296 2.746-2.642 3.392-7.003.05-.347.007-.565 0-.845-.004-.17.035-.237.23-.256a4.173 4.173 0 001.545-.475c1.396-.763 1.96-2.015 2.093-3.517.02-.23-.004-.467-.247-.588zM11.581 18c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696 4.696 0 011.529-.039c2.132.312 3.946 1.265 5.468 2.774.868.86 1.525 1.887 2.202 2.891.72 1.066 1.494 2.082 2.48 2.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306 0 01.415-.287.302.302 0 01.2.288.306.306 0 01-.31.307.303.303 0 01-.304-.308zm3.11 1.596c-.2.081-.399.151-.59.16a1.245 1.245 0 01-.798-.254c-.274-.23-.47-.358-.552-.758a1.73 1.73 0 01.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559 0 01-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:featherless-ai{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 36' width='1em' height='1em' %3E%3Cg fill='currentColor'%3E%3Cpath d='M40.0866 4.68482C38.2902 3.5825 35.863 3 33.0672 3C28.7842 3 24.0653 4.35865 19.8276 6.72206L19.7979 6.71083C19.7979 6.71083 19.7937 6.73344 19.7914 6.74423C18.5086 7.4617 17.2656 8.2629 16.0981 9.15731C9.22112 14.4248 7.29519 20.6748 8.92004 24.0156C7.14142 27.0728 6.0457 30.2332 6 33.9767C9.41949 27.421 11.4719 22.108 22.6146 13.1637C19.4309 13.8501 13.9281 17.1057 10.2271 22.0459C9.87793 19.156 12.1477 14.4895 17.2033 10.6174C17.8435 10.127 18.5092 9.66864 19.1886 9.23374C18.6577 10.8934 18.8269 10.4806 17.7254 12.8076C19.3543 11.2566 20.4268 10.2995 22.035 7.64145C24.123 6.60964 26.2948 5.83844 28.4482 5.37235C28.0919 6.56071 27.4137 8.57466 26.4955 10.1669C26.4955 10.1669 28.8258 9.66435 30.7518 9.77788C29.6995 10.9459 28.7527 12.2094 27.7926 13.5012C26.4777 15.2696 25.1184 17.0983 23.3778 18.8005C23.1683 19.0054 22.968 19.1912 22.7649 19.383C20.0902 19.1254 18.3235 20.1315 16.6683 21.9089C17.9737 21.2966 19.7273 20.7924 20.8266 21.0959C18.8008 22.7579 15.6106 24.9488 12.9893 24.7684C12.4922 25.5295 12.4608 25.5528 11.9144 26.4722C16.1664 27.537 21.507 23.1905 24.6498 20.1161C26.4926 18.3131 27.8964 16.4257 29.2534 14.6012C32.0481 10.8427 34.4616 7.5974 39.8153 6.3624L42 5.85877L40.0866 4.68482Z' class='logo-mark'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:fireworks{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath clip-rule='evenodd' d='M14.8 5l-2.801 6.795L9.195 5H7.397l3.072 7.428a1.64 1.64 0 003.038.002L16.598 5H14.8zm1.196 10.352l5.124-5.244-.699-1.669-5.596 5.739a1.664 1.664 0 00-.343 1.807 1.642 1.642 0 001.516 1.012L16 17l8-.02-.699-1.669-7.303.041h-.002zM2.88 10.104l.699-1.669 5.596 5.739c.468.479.603 1.189.343 1.807a1.643 1.643 0 01-1.516 1.012l-8-.018-.002.002.699-1.669 7.303.042-5.122-5.246z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:gemini{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M12 24A14.304 14.304 0 000 12 14.304 14.304 0 0012 0a14.305 14.305 0 0012 12 14.305 14.305 0 00-12 12'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:huggingface{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M16.781 3.277c2.997 1.704 4.844 4.851 4.844 8.258 0 .995-.155 1.955-.443 2.857a1.332 1.332 0 011.125.4 1.41 1.41 0 01.2 1.723c.204.165.352.385.428.632l.017.062c.06.222.12.69-.2 1.166.244.37.279.836.093 1.236-.255.57-.893 1.018-2.128 1.5l-.202.078-.131.048c-.478.173-.89.295-1.061.345l-.086.024c-.89.243-1.808.375-2.732.394-1.32 0-2.3-.36-2.923-1.067a9.852 9.852 0 01-3.18.018C9.778 21.647 8.802 22 7.494 22a11.249 11.249 0 01-2.541-.343l-.221-.06-.273-.08a16.574 16.574 0 01-1.175-.405c-1.237-.483-1.875-.93-2.13-1.501-.186-.4-.151-.867.093-1.236a1.42 1.42 0 01-.2-1.166c.069-.273.226-.516.447-.694a1.41 1.41 0 01.2-1.722c.233-.248.557-.391.917-.407l.078-.001a9.385 9.385 0 01-.44-2.85c0-3.407 1.847-6.554 4.844-8.258a9.822 9.822 0 019.687 0zM4.188 14.758c.125.687 2.357 2.35 2.14 2.707-.19.315-.796-.239-.948-.386l-.041-.04-.168-.147c-.561-.479-2.304-1.9-2.74-1.432-.43.46.119.859 1.055 1.42l.784.467.136.083c1.045.643 1.12.84.95 1.113-.188.295-3.07-2.1-3.34-1.083-.27 1.011 2.942 1.304 2.744 2.006-.2.7-2.265-1.324-2.685-.537-.425.79 2.913 1.718 2.94 1.725l.16.04.175.042c1.227.284 3.565.65 4.435-.604.673-.973.64-1.709-.248-2.61l-.057-.057c-.945-.928-1.495-2.288-1.495-2.288l-.017-.058-.025-.072c-.082-.22-.284-.639-.63-.584-.46.073-.798 1.21.12 1.933l.05.038c.977.721-.195 1.21-.573.534l-.058-.104-.143-.25c-.463-.799-1.282-2.111-1.739-2.397-.532-.332-.907-.148-.782.541zm14.842-.541c-.533.335-1.563 2.074-1.94 2.751a.613.613 0 01-.687.302.436.436 0 01-.176-.098.303.303 0 01-.049-.06l-.014-.028-.008-.02-.007-.019-.003-.013-.003-.017a.289.289 0 01-.004-.048c0-.12.071-.266.25-.427.026-.024.054-.047.084-.07l.047-.036c.022-.016.043-.032.063-.049.883-.71.573-1.81.131-1.917l-.031-.006-.056-.004a.368.368 0 00-.062.006l-.028.005-.042.014-.039.017-.028.015-.028.019-.036.027-.023.02c-.173.158-.273.428-.31.542l-.016.054s-.53 1.309-1.439 2.234l-.054.054c-.365.358-.596.69-.702 1.018-.143.437-.066.868.21 1.353.055.097.117.195.187.296.882 1.275 3.282.876 4.494.59l.286-.07.25-.074c.276-.084.736-.233 1.2-.42l.188-.077.065-.028.064-.028.124-.056.081-.038c.529-.252.964-.543.994-.827l.001-.036a.299.299 0 00-.037-.139c-.094-.176-.271-.212-.491-.168l-.045.01c-.044.01-.09.024-.136.04l-.097.035-.054.022c-.559.23-1.238.705-1.607.745h.006a.452.452 0 01-.05.003h-.024l-.024-.003-.023-.005c-.068-.016-.116-.06-.14-.142a.22.22 0 01-.005-.1c.062-.345.958-.595 1.713-.91l.066-.028c.528-.224.97-.483.985-.832v-.04a.47.47 0 00-.016-.098c-.048-.18-.175-.251-.36-.251-.785 0-2.55 1.36-2.92 1.36-.025 0-.048-.007-.058-.024a.6.6 0 01-.046-.088c-.1-.238.068-.462 1.06-1.066l.209-.126c.538-.32 1.01-.588 1.341-.831.29-.212.475-.406.503-.6l.003-.028c.008-.113-.038-.227-.147-.344a.266.266 0 00-.07-.054l-.034-.015-.013-.005a.403.403 0 00-.13-.02c-.162 0-.369.07-.595.18-.637.313-1.431.952-1.826 1.285l-.249.215-.033.033c-.08.078-.288.27-.493.386l-.071.037-.041.019a.535.535 0 01-.122.036h.005a.346.346 0 01-.031.003l.01-.001-.013.001c-.079.005-.145-.021-.19-.095a.113.113 0 01-.014-.065c.027-.465 2.034-1.991 2.152-2.642l.009-.048c.1-.65-.271-.817-.791-.493zM11.938 2.984c-4.798 0-8.688 3.829-8.688 8.55 0 .692.083 1.364.24 2.008l.008-.009c.252-.298.612-.46 1.017-.46.355.008.699.117.993.312.22.14.465.384.715.694.261-.372.69-.598 1.15-.605.852 0 1.367.728 1.562 1.383l.047.105.06.127c.192.396.595 1.139 1.143 1.68 1.06 1.04 1.324 2.115.8 3.266a8.865 8.865 0 002.024-.014c-.505-1.12-.26-2.17.74-3.186l.066-.066c.695-.684 1.157-1.69 1.252-1.912.195-.655.708-1.383 1.56-1.383.46.007.889.233 1.15.605.25-.31.495-.553.718-.694a1.87 1.87 0 01.99-.312c.357 0 .682.126.925.36.14-.61.215-1.245.215-1.898 0-4.722-3.89-8.55-8.687-8.55zm1.857 8.926l.439-.212c.553-.264.89-.383.89.152 0 1.093-.771 3.208-3.155 3.262h-.184c-2.325-.052-3.116-2.06-3.156-3.175l-.001-.087c0-1.107 1.452.586 3.25.586.716 0 1.379-.272 1.917-.526zm4.017-3.143c.45 0 .813.358.813.8 0 .441-.364.8-.813.8a.806.806 0 01-.812-.8c0-.442.364-.8.812-.8zm-11.624 0c.448 0 .812.358.812.8 0 .441-.364.8-.812.8a.806.806 0 01-.813-.8c0-.442.364-.8.813-.8zm7.79-.841c.32-.384.846-.54 1.33-.394.483.146.83.564.878 1.06.048.495-.212.97-.659 1.203-.322.168-.447-.477-.767-.585l.002-.003c-.287-.098-.772.362-.925.079a1.215 1.215 0 01.14-1.36zm-4.323 0c.322.384.377.92.14 1.36-.152.283-.64-.177-.925-.079l.003.003c-.108.036-.194.134-.273.24l-.118.165c-.11.15-.22.262-.377.18a1.226 1.226 0 01-.658-1.204c.048-.495.395-.913.878-1.059a1.262 1.262 0 011.33.394z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:microsoft{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M11.49 2H2v9.492h9.492V2h-.002z'/%3E%3Cpath d='M22 2h-9.492v9.492H22V2z'/%3E%3Cpath d='M11.49 12.508H2V22h9.492v-9.492h-.002z'/%3E%3Cpath d='M22 12.508h-9.492V22H22v-9.492z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:mistral{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath clip-rule='evenodd' d='M3.428 3.4h3.429v3.428h3.429v3.429h-.002 3.431V6.828h3.427V3.4h3.43v13.714H24v3.429H13.714v-3.428h-3.428v-3.429h-3.43v3.428h3.43v3.429H0v-3.429h3.428V3.4zm10.286 13.715h3.428v-3.429h-3.427v3.429z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:moonshot{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M1.052 16.916l9.539 2.552a21.007 21.007 0 00.06 2.033l5.956 1.593a11.997 11.997 0 01-5.586.865l-.18-.016-.044-.004-.084-.009-.094-.01a11.605 11.605 0 01-.157-.02l-.107-.014-.11-.016a11.962 11.962 0 01-.32-.051l-.042-.008-.075-.013-.107-.02-.07-.015-.093-.019-.075-.016-.095-.02-.097-.023-.094-.022-.068-.017-.088-.022-.09-.024-.095-.025-.082-.023-.109-.03-.062-.02-.084-.025-.093-.028-.105-.034-.058-.019-.08-.026-.09-.031-.066-.024a6.293 6.293 0 01-.044-.015l-.068-.025-.101-.037-.057-.022-.08-.03-.087-.035-.088-.035-.079-.032-.095-.04-.063-.028-.063-.027a5.655 5.655 0 01-.041-.018l-.066-.03-.103-.047-.052-.024-.096-.046-.062-.03-.084-.04-.086-.044-.093-.047-.052-.027-.103-.055-.057-.03-.058-.032a6.49 6.49 0 01-.046-.026l-.094-.053-.06-.034-.051-.03-.072-.041-.082-.05-.093-.056-.052-.032-.084-.053-.061-.039-.079-.05-.07-.047-.053-.035a7.785 7.785 0 01-.054-.036l-.044-.03-.044-.03a6.066 6.066 0 01-.04-.028l-.057-.04-.076-.054-.069-.05-.074-.054-.056-.042-.076-.057-.076-.059-.086-.067-.045-.035-.064-.052-.074-.06-.089-.073-.046-.039-.046-.039a7.516 7.516 0 01-.043-.037l-.045-.04-.061-.053-.07-.062-.068-.06-.062-.058-.067-.062-.053-.05-.088-.084a13.28 13.28 0 01-.099-.097l-.029-.028-.041-.042-.069-.07-.05-.051-.05-.053a6.457 6.457 0 01-.168-.179l-.08-.088-.062-.07-.071-.08-.042-.049-.053-.062-.058-.068-.046-.056a7.175 7.175 0 01-.027-.033l-.045-.055-.066-.082-.041-.052-.05-.064-.02-.025a11.99 11.99 0 01-1.44-2.402zm-1.02-5.794l11.353 3.037a20.468 20.468 0 00-.469 2.011l10.817 2.894a12.076 12.076 0 01-1.845 2.005L.657 15.923l-.016-.046-.035-.104a11.965 11.965 0 01-.05-.153l-.007-.023a11.896 11.896 0 01-.207-.741l-.03-.126-.018-.08-.021-.097-.018-.081-.018-.09-.017-.084-.018-.094c-.026-.141-.05-.283-.071-.426l-.017-.118-.011-.083-.013-.102a12.01 12.01 0 01-.019-.161l-.005-.047a12.12 12.12 0 01-.034-2.145zm1.593-5.15l11.948 3.196c-.368.605-.705 1.231-1.01 1.875l11.295 3.022c-.142.82-.368 1.612-.668 2.365l-11.55-3.09L.124 10.26l.015-.1.008-.049.01-.067.015-.087.018-.098c.026-.148.056-.295.088-.442l.028-.124.02-.085.024-.097c.022-.09.045-.18.07-.268l.028-.102.023-.083.03-.1.025-.082.03-.096.026-.082.031-.095a11.896 11.896 0 011.01-2.232zm4.442-4.4L17.352 4.59a20.77 20.77 0 00-1.688 1.721l7.823 2.093c.267.852.442 1.744.513 2.665L2.106 5.213l.045-.065.027-.04.04-.055.046-.065.055-.076.054-.072.064-.086.05-.065.057-.073.055-.07.06-.074.055-.069.065-.077.054-.066.066-.077.053-.06.072-.082.053-.06.067-.074.054-.058.073-.078.058-.06.063-.067.168-.17.1-.098.059-.056.076-.071a12.084 12.084 0 012.272-1.677zM12.017 0h.097l.082.001.069.001.054.002.068.002.046.001.076.003.047.002.06.003.054.002.087.005.105.007.144.011.088.007.044.004.077.008.082.008.047.005.102.012.05.006.108.014.081.01.042.006.065.01.207.032.07.012.065.011.14.026.092.018.11.022.046.01.075.016.041.01L14.7.3l.042.01.065.015.049.012.071.017.096.024.112.03.113.03.113.032.05.015.07.02.078.024.073.023.05.016.05.016.076.025.099.033.102.036.048.017.064.023.093.034.11.041.116.045.1.04.047.02.06.024.041.018.063.026.04.018.057.025.11.048.1.046.074.035.075.036.06.028.092.046.091.045.102.052.053.028.049.026.046.024.06.033.041.022.052.029.088.05.106.06.087.051.057.034.053.032.096.059.088.055.098.062.036.024.064.041.084.056.04.027.062.042.062.043.023.017c.054.037.108.075.161.114l.083.06.065.048.056.043.086.065.082.064.04.03.05.041.086.069.079.065.085.071c.712.6 1.353 1.283 1.909 2.031L7.222.994l.062-.027.065-.028.081-.034.086-.035c.113-.045.227-.09.341-.131l.096-.035.093-.033.084-.03.096-.031c.087-.03.176-.058.264-.085l.091-.027.086-.025.102-.03.085-.023.1-.026L9.04.37l.09-.023.091-.022.095-.022.09-.02.098-.021.091-.02.095-.018.092-.018.1-.018.091-.016.098-.017.092-.014.097-.015.092-.013.102-.013.091-.012.105-.012.09-.01.105-.01c.093-.01.186-.018.28-.024l.106-.008.09-.005.11-.006.093-.004.1-.004.097-.002.099-.002.197-.002z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:novita{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath clip-rule='evenodd' d='M9.167 4.17v5.665L0 19.003h9.167v-5.666l5.666 5.666H24L9.167 4.17z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:ollama{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M7.905 1.09c.216.085.411.225.588.41.295.306.544.744.734 1.263.191.522.315 1.1.362 1.68a5.054 5.054 0 012.049-.636l.051-.004c.87-.07 1.73.087 2.48.474.101.053.2.11.297.17.05-.569.172-1.134.36-1.644.19-.52.439-.957.733-1.264a1.67 1.67 0 01.589-.41c.257-.1.53-.118.796-.042.401.114.745.368 1.016.737.248.337.434.769.561 1.287.23.934.27 2.163.115 3.645l.053.04.026.019c.757.576 1.284 1.397 1.563 2.35.435 1.487.216 3.155-.534 4.088l-.018.021.002.003c.417.762.67 1.567.724 2.4l.002.03c.064 1.065-.2 2.137-.814 3.19l-.007.01.01.024c.472 1.157.62 2.322.438 3.486l-.006.039a.651.651 0 01-.747.536.648.648 0 01-.54-.742c.167-1.033.01-2.069-.48-3.123a.643.643 0 01.04-.617l.004-.006c.604-.924.854-1.83.8-2.72-.046-.779-.325-1.544-.8-2.273a.644.644 0 01.18-.886l.009-.006c.243-.159.467-.565.58-1.12a4.229 4.229 0 00-.095-1.974c-.205-.7-.58-1.284-1.105-1.683-.595-.454-1.383-.673-2.38-.61a.653.653 0 01-.632-.371c-.314-.665-.772-1.141-1.343-1.436a3.288 3.288 0 00-1.772-.332c-1.245.099-2.343.801-2.67 1.686a.652.652 0 01-.61.425c-1.067.002-1.893.252-2.497.703-.522.39-.878.935-1.066 1.588a4.07 4.07 0 00-.068 1.886c.112.558.331 1.02.582 1.269l.008.007c.212.207.257.53.109.785-.36.622-.629 1.549-.673 2.44-.05 1.018.186 1.902.719 2.536l.016.019a.643.643 0 01.095.69c-.576 1.236-.753 2.252-.562 3.052a.652.652 0 01-1.269.298c-.243-1.018-.078-2.184.473-3.498l.014-.035-.008-.012a4.339 4.339 0 01-.598-1.309l-.005-.019a5.764 5.764 0 01-.177-1.785c.044-.91.278-1.842.622-2.59l.012-.026-.002-.002c-.293-.418-.51-.953-.63-1.545l-.005-.024a5.352 5.352 0 01.093-2.49c.262-.915.777-1.701 1.536-2.269.06-.045.123-.09.186-.132-.159-1.493-.119-2.73.112-3.67.127-.518.314-.95.562-1.287.27-.368.614-.622 1.015-.737.266-.076.54-.059.797.042zm4.116 9.09c.936 0 1.8.313 2.446.855.63.527 1.005 1.235 1.005 1.94 0 .888-.406 1.58-1.133 2.022-.62.375-1.451.557-2.403.557-1.009 0-1.871-.259-2.493-.734-.617-.47-.963-1.13-.963-1.845 0-.707.398-1.417 1.056-1.946.668-.537 1.55-.849 2.485-.849zm0 .896a3.07 3.07 0 00-1.916.65c-.461.37-.722.835-.722 1.25 0 .428.21.829.61 1.134.455.347 1.124.548 1.943.548.799 0 1.473-.147 1.932-.426.463-.28.7-.686.7-1.257 0-.423-.246-.89-.683-1.256-.484-.405-1.14-.643-1.864-.643zm.662 1.21l.004.004c.12.151.095.37-.056.49l-.292.23v.446a.375.375 0 01-.376.373.375.375 0 01-.376-.373v-.46l-.271-.218a.347.347 0 01-.052-.49.353.353 0 01.494-.051l.215.172.22-.174a.353.353 0 01.49.051zm-5.04-1.919c.478 0 .867.39.867.871a.87.87 0 01-.868.871.87.87 0 01-.867-.87.87.87 0 01.867-.872zm8.706 0c.48 0 .868.39.868.871a.87.87 0 01-.868.871.87.87 0 01-.867-.87.87.87 0 01.867-.872zM7.44 2.3l-.003.002a.659.659 0 00-.285.238l-.005.006c-.138.189-.258.467-.348.832-.17.692-.216 1.631-.124 2.782.43-.128.899-.208 1.404-.237l.01-.001.019-.034c.046-.082.095-.161.148-.239.123-.771.022-1.692-.253-2.444-.134-.364-.297-.65-.453-.813a.628.628 0 00-.107-.09L7.44 2.3zm9.174.04l-.002.001a.628.628 0 00-.107.09c-.156.163-.32.45-.453.814-.29.794-.387 1.776-.23 2.572l.058.097.008.014h.03a5.184 5.184 0 011.466.212c.086-1.124.038-2.043-.128-2.722-.09-.365-.21-.643-.349-.832l-.004-.006a.659.659 0 00-.285-.239h-.004z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:openai{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M21.55 10.004a5.416 5.416 0 00-.478-4.501c-1.217-2.09-3.662-3.166-6.05-2.66A5.59 5.59 0 0010.831 1C8.39.995 6.224 2.546 5.473 4.838A5.553 5.553 0 001.76 7.496a5.487 5.487 0 00.691 6.5 5.416 5.416 0 00.477 4.502c1.217 2.09 3.662 3.165 6.05 2.66A5.586 5.586 0 0013.168 23c2.443.006 4.61-1.546 5.361-3.84a5.553 5.553 0 003.715-2.66 5.488 5.488 0 00-.693-6.497v.001zm-8.381 11.558a4.199 4.199 0 01-2.675-.954c.034-.018.093-.05.132-.074l4.44-2.53a.71.71 0 00.364-.623v-6.176l1.877 1.069c.02.01.033.029.036.05v5.115c-.003 2.274-1.87 4.118-4.174 4.123zM4.192 17.78a4.059 4.059 0 01-.498-2.763c.032.02.09.055.131.078l4.44 2.53c.225.13.504.13.73 0l5.42-3.088v2.138a.068.068 0 01-.027.057L9.9 19.288c-1.999 1.136-4.552.46-5.707-1.51h-.001zM3.023 8.216A4.15 4.15 0 015.198 6.41l-.002.151v5.06a.711.711 0 00.364.624l5.42 3.087-1.876 1.07a.067.067 0 01-.063.005l-4.489-2.559c-1.995-1.14-2.679-3.658-1.53-5.63h.001zm15.417 3.54l-5.42-3.088L14.896 7.6a.067.067 0 01.063-.006l4.489 2.557c1.998 1.14 2.683 3.662 1.529 5.633a4.163 4.163 0 01-2.174 1.807V12.38a.71.71 0 00-.363-.623zm1.867-2.773a6.04 6.04 0 00-.132-.078l-4.44-2.53a.731.731 0 00-.729 0l-5.42 3.088V7.325a.068.068 0 01.027-.057L14.1 4.713c2-1.137 4.555-.46 5.707 1.513.487.833.664 1.809.499 2.757h.001zm-11.741 3.81l-1.877-1.068a.065.065 0 01-.036-.051V6.559c.001-2.277 1.873-4.122 4.181-4.12.976 0 1.92.338 2.671.954-.034.018-.092.05-.131.073l-4.44 2.53a.71.71 0 00-.365.623l-.003 6.173v.002zm1.02-2.168L12 9.25l2.414 1.375v2.75L12 14.75l-2.415-1.375v-2.75z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:openrouter{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M16.804 1.957l7.22 4.105v.087L16.73 10.21l.017-2.117-.821-.03c-1.059-.028-1.611.002-2.268.11-1.064.175-2.038.577-3.147 1.352L8.345 11.03c-.284.195-.495.336-.68.455l-.515.322-.397.234.385.23.53.338c.476.314 1.17.796 2.701 1.866 1.11.775 2.083 1.177 3.147 1.352l.3.045c.694.091 1.375.094 2.825.033l.022-2.159 7.22 4.105v.087L16.589 22l.014-1.862-.635.022c-1.386.042-2.137.002-3.138-.162-1.694-.28-3.26-.926-4.881-2.059l-2.158-1.5a21.997 21.997 0 00-.755-.498l-.467-.28a55.927 55.927 0 00-.76-.43C2.908 14.73.563 14.116 0 14.116V9.888l.14.004c.564-.007 2.91-.622 3.809-1.124l1.016-.58.438-.274c.428-.28 1.072-.726 2.686-1.853 1.621-1.133 3.186-1.78 4.881-2.059 1.152-.19 1.974-.213 3.814-.138l.02-1.907z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:perplexity{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M19.785 0v7.272H22.5V17.62h-2.935V24l-7.037-6.194v6.145h-1.091v-6.152L4.392 24v-6.465H1.5V7.188h2.884V0l7.053 6.494V.19h1.09v6.49L19.786 0zm-7.257 9.044v7.319l5.946 5.234V14.44l-5.946-5.397zm-1.099-.08l-5.946 5.398v7.235l5.946-5.234V8.965zm8.136 7.58h1.844V8.349H13.46l6.105 5.54v2.655zm-8.982-8.28H2.59v8.195h1.8v-2.576l6.192-5.62zM5.475 2.476v4.71h5.115l-5.115-4.71zm13.219 0l-5.115 4.71h5.115v-4.71z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:player2{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M19.956 10.178C19.8934 10.7544 19.724 11.6784 19.1182 12.5274C18.3667 13.5817 17.3528 13.8824 16.9558 13.9746C16.6911 14.0049 16.3026 14.045 15.8323 14.0789C14.1804 14.2045 13.0525 14.1565 11.7041 14.131C10.81 14.1143 9.54304 14.1034 7.98548 14.131C7.97564 16.7493 7.96551 19.368 7.95508 21.987L5 22V15.8717C5.00358 14.6542 5.00983 12.9193 5.03397 10.7643C6.47441 10.7684 14.6905 10.7205 15.6696 10.7721C15.8672 10.7841 16.3621 10.8039 16.6764 10.4458C16.8842 10.2113 16.9696 9.83348 16.9763 9.26802C16.9835 8.82659 16.9902 8.38204 16.9763 7.94322C16.9459 6.90454 16.608 6.51472 15.7103 6.51107C12.8124 6.5069 9.91142 6.43915 7.01356 6.51107C6.60048 6.51888 5.90083 6.53087 5.02056 6.50325V3C5.43007 3.00782 6.13285 3.02397 7.00686 3.01563C11.1399 2.98436 12.7292 3.01199 15.5328 3.01563C18.3591 3.0198 19.994 4.94393 19.994 8.26009C19.9913 8.90059 20.0253 9.54944 19.956 10.178Z'/%3E%3Cpath d='M20 19H11V22H20V19Z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:together{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cg%3E%3Cpath d='M17.385 11.23a4.615 4.615 0 100-9.23 4.615 4.615 0 000 9.23zm0 10.77a4.615 4.615 0 100-9.23 4.615 4.615 0 000 9.23zm-10.77 0a4.615 4.615 0 100-9.23 4.615 4.615 0 000 9.23z' opacity='.2'/%3E%3Ccircle cx='6.615' cy='6.615' r='4.615'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:vllm{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M0 4.973h9.324V23L0 4.973z'/%3E%3Cpath d='M13.986 4.351L22.378 0l-6.216 23H9.324l4.662-18.649z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:volcengine{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M7.29 5.36L3.148 21.737a.215.215 0 00.203.261h8.29a.214.214 0 00.215-.261L7.7 5.359a.214.214 0 00-.41 0z' fill-opacity='.5'/%3E%3Cpath clip-rule='evenodd' d='M4.553 16.18l-1.406 5.558a.214.214 0 00.203.261h2.42-4.551a.214.214 0 01-.214-.26l2.275-8.961a.214.214 0 01.409 0l.864 3.402z'/%3E%3Cpath d='M14.44.15a.214.214 0 00-.41 0L8.366 21.739a.214.214 0 00.214.261H19.9a.214.214 0 00.215-.261L14.44.151z' fill-opacity='.5'/%3E%3Cpath clip-rule='evenodd' d='M16.694 22h3.207a.215.215 0 00.214-.262l-1.839-6.993 1.164-4.592a.214.214 0 01.411 0l2.951 11.586a.214.214 0 01-.214.261h-5.894z'/%3E%3Cpath d='M10.278 7.741L6.685 21.736a.214.214 0 00.214.264h7.17a.216.216 0 00.214-.166.216.216 0 000-.098L10.687 7.742a.214.214 0 00-.409 0z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:xai{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M6.469 8.776L16.512 23h-4.464L2.005 8.776H6.47zm-.004 7.9l2.233 3.164L6.467 23H2l4.465-6.324zM22 2.582V23h-3.659V7.764L22 2.582zM22 1l-9.952 14.095-2.233-3.163L17.533 1H22z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lucide\:ghost,[i-lucide\:ghost=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M9 10h.01M15 10h.01M12 2a8 8 0 0 0-8 8v12l3-3l2.5 2.5L12 19l2.5 2.5L17 19l3 3V10a8 8 0 0 0-8-8'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lucide\:mic,[i-lucide\:mic=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3E%3Cpath d='M12 19v3m7-12v2a7 7 0 0 1-14 0v-2'/%3E%3Crect width='6' height='13' x='9' y='2' rx='3'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lucide\:music,[i-lucide\:music=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3E%3Cpath d='M9 18V5l12-2v13'/%3E%3Ccircle cx='6' cy='18' r='3'/%3E%3Ccircle cx='18' cy='16' r='3'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-simple-icons\:discord{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M20.317 4.37a19.8 19.8 0 0 0-4.885-1.515a.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.3 18.3 0 0 0-5.487 0a13 13 0 0 0-.617-1.25a.08.08 0 0 0-.079-.037A19.7 19.7 0 0 0 3.677 4.37a.1.1 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.08.08 0 0 0 .031.057a19.9 19.9 0 0 0 5.993 3.03a.08.08 0 0 0 .084-.028a14 14 0 0 0 1.226-1.994a.076.076 0 0 0-.041-.106a13 13 0 0 1-1.872-.892a.077.077 0 0 1-.008-.128a10 10 0 0 0 .372-.292a.07.07 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.07.07 0 0 1 .078.01q.181.149.373.292a.077.077 0 0 1-.006.127a12.3 12.3 0 0 1-1.873.892a.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.08.08 0 0 0 .084.028a19.8 19.8 0 0 0 6.002-3.03a.08.08 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.06.06 0 0 0-.031-.03M8.02 15.33c-1.182 0-2.157-1.085-2.157-2.419c0-1.333.956-2.419 2.157-2.419c1.21 0 2.176 1.096 2.157 2.42c0 1.333-.956 2.418-2.157 2.418m7.975 0c-1.183 0-2.157-1.085-2.157-2.419c0-1.333.955-2.419 2.157-2.419c1.21 0 2.176 1.096 2.157 2.42c0 1.333-.946 2.418-2.157 2.418'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-simple-icons\:elevenlabs{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M4.604 0v24h4.931V0zm9.86 0v24h4.933V0z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-simple-icons\:github,[i-simple-icons\:github=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M12 .297c-6.63 0-12 5.373-12 12c0 5.303 3.438 9.8 8.205 11.385c.6.113.82-.258.82-.577c0-.285-.01-1.04-.015-2.04c-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729c1.205.084 1.838 1.236 1.838 1.236c1.07 1.835 2.809 1.305 3.495.998c.108-.776.417-1.305.76-1.605c-2.665-.3-5.466-1.332-5.466-5.93c0-1.31.465-2.38 1.235-3.22c-.135-.303-.54-1.523.105-3.176c0 0 1.005-.322 3.3 1.23c.96-.267 1.98-.399 3-.405c1.02.006 2.04.138 3 .405c2.28-1.552 3.285-1.23 3.285-1.23c.645 1.653.24 2.873.12 3.176c.765.84 1.23 1.91 1.23 3.22c0 4.61-2.805 5.625-5.475 5.92c.42.36.81 1.096.81 2.22c0 1.606-.015 2.896-.015 3.286c0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-simple-icons\:javascript{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M0 0h24v24H0zm22.034 18.276c-.175-1.095-.888-2.015-3.003-2.873c-.736-.345-1.554-.585-1.797-1.14c-.091-.33-.105-.51-.046-.705c.15-.646.915-.84 1.515-.66c.39.12.75.42.976.9c1.034-.676 1.034-.676 1.755-1.125c-.27-.42-.404-.601-.586-.78c-.63-.705-1.469-1.065-2.834-1.034l-.705.089c-.676.165-1.32.525-1.71 1.005c-1.14 1.291-.811 3.541.569 4.471c1.365 1.02 3.361 1.244 3.616 2.205c.24 1.17-.87 1.545-1.966 1.41c-.811-.18-1.26-.586-1.755-1.336l-1.83 1.051c.21.48.45.689.81 1.109c1.74 1.756 6.09 1.666 6.871-1.004c.029-.09.24-.705.074-1.65zm-8.983-7.245h-2.248c0 1.938-.009 3.864-.009 5.805c0 1.232.063 2.363-.138 2.711c-.33.689-1.18.601-1.566.48c-.396-.196-.597-.466-.83-.855c-.063-.105-.11-.196-.127-.196l-1.825 1.125c.305.63.75 1.172 1.324 1.517c.855.51 2.004.675 3.207.405c.783-.226 1.458-.691 1.811-1.411c.51-.93.402-2.07.397-3.346c.012-2.054 0-4.109 0-6.179z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-simple-icons\:x{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584l-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932ZM17.61 20.644h2.039L6.486 3.24H4.298Z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar-check-circle-line-duotone,.i-solar\:check-circle-line-duotone,[i-solar-check-circle-line-duotone=""],[i-solar\:check-circle-line-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Ccircle cx='12' cy='12' r='10' opacity='.5'/%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m8.5 12.5l2 2l5-5'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:add-circle-line-duotone,[i-solar\:add-circle-line-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Ccircle cx='12' cy='12' r='10' opacity='.5'/%3E%3Cpath stroke-linecap='round' d='M15 12h-3m0 0H9m3 0V9m0 3v3'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:add-square-line-duotone,[i-solar\:add-square-line-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Cpath d='M2 12c0-4.714 0-7.071 1.464-8.536C4.93 2 7.286 2 12 2s7.071 0 8.535 1.464C22 4.93 22 7.286 22 12s0 7.071-1.465 8.535C19.072 22 16.714 22 12 22s-7.071 0-8.536-1.465C2 19.072 2 16.714 2 12Z' opacity='.5'/%3E%3Cpath stroke-linecap='round' d='M15 12h-3m0 0H9m3 0V9m0 3v3'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:alt-arrow-down-linear,[i-solar\:alt-arrow-down-linear=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m19 9l-7 6l-7-6'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:alt-arrow-left-line-duotone,[i-solar\:alt-arrow-left-line-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m15 5l-6 7l6 7'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:alt-arrow-right-outline,[i-solar\:alt-arrow-right-outline=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M8.512 4.43a.75.75 0 0 1 1.057.082l6 7a.75.75 0 0 1 0 .976l-6 7a.75.75 0 0 1-1.138-.976L14.012 12L8.431 5.488a.75.75 0 0 1 .08-1.057' clip-rule='evenodd'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:armchair-2-bold-duotone,[i-solar\:armchair-2-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M16.533 18H6.75v2a.75.75 0 1 1-1.5 0v-2.324c-.829-.362-1.49-1.005-1.808-1.817l-.039-.102L2.1 12.264C1.685 11.15 2.613 10 3.927 10c.81 0 1.534.453 1.81 1.134l1.098 2.706c.1.246.15.37.222.47a1.2 1.2 0 0 0 .74.463c.13.027.277.027.57.027h6.98c.569 0 .853 0 1.091-.098q.196-.082.349-.219c.184-.166.281-.405.475-.883l1.001-2.466c.276-.68 1-1.134 1.81-1.134c1.314 0 2.242 1.15 1.827 2.264l-1.12 3c-.195.524-.292.785-.421 1.008a3.43 3.43 0 0 1-1.609 1.404V20a.75.75 0 1 1-1.5 0v-2.005c-.187.005-.415.005-.717.005'/%3E%3Cpath fill='currentColor' d='M13.236 3.5h-2.472c-1.1 0-1.976 0-2.66.088c-.706.09-1.285.28-1.746.72c-.464.441-.669 1.003-.765 1.685c-.093.658-.093 1.495-.093 2.54v2.195q.147.186.237.406l1.098 2.706c.1.246.15.37.222.47a1.2 1.2 0 0 0 .74.463c.13.027.277.027.57.027h6.98c.569 0 .853 0 1.091-.098q.196-.082.349-.219c.184-.166.281-.405.475-.883l1.001-2.466q.09-.221.237-.406V8.533c0-1.045 0-1.882-.093-2.54c-.096-.682-.301-1.244-.765-1.686c-.46-.438-1.04-.629-1.745-.72c-.685-.087-1.56-.087-2.661-.087' opacity='.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:arrow-right-line-duotone,[i-solar\:arrow-right-line-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none'%3E%3Cpath fill='currentColor' d='M4 11.25a.75.75 0 0 0 0 1.5zm0 1.5h16v-1.5H4z' opacity='.5'/%3E%3Cpath stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m14 6l6 6l-6 6'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:arrow-up-outline,[i-solar\:arrow-up-outline=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M11.47 3.47a.75.75 0 0 1 1.06 0l6 6a.75.75 0 1 1-1.06 1.06l-4.72-4.72V20a.75.75 0 0 1-1.5 0V5.81l-4.72 4.72a.75.75 0 1 1-1.06-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:book-bookmark-bold-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M12 20.028V18H8v2.028c0 .277 0 .416.095.472s.224-.006.484-.13l1.242-.593c.088-.042.132-.063.179-.063s.091.02.179.063l1.242.593c.26.124.39.186.484.13c.095-.056.095-.195.095-.472' opacity='.5'/%3E%3Cpath fill='currentColor' d='M8 18h-.574c-1.084 0-1.462.006-1.753.068c-.513.11-.96.347-1.285.667c-.11.108-.164.161-.291.505s-.107.489-.066.78l.022.15c.11.653.31.998.616 1.244c.307.246.737.407 1.55.494c.837.09 1.946.092 3.536.092h4.43c1.59 0 2.7-.001 3.536-.092c.813-.087 1.243-.248 1.55-.494s.506-.591.616-1.243c.091-.548.11-1.241.113-2.171h-8v2.028c0 .277 0 .416-.095.472s-.224-.006-.484-.13l-1.242-.593c-.088-.042-.132-.063-.179-.063s-.091.02-.179.063l-1.242.593c-.26.124-.39.186-.484.13C8 20.444 8 20.305 8 20.028z'/%3E%3Cpath fill='currentColor' d='M4.727 2.733c.306-.308.734-.508 1.544-.618C7.105 2.002 8.209 2 9.793 2h4.414c1.584 0 2.688.002 3.522.115c.81.11 1.238.31 1.544.618c.305.308.504.74.613 1.557c.112.84.114 1.955.114 3.552V18H7.426c-1.084 0-1.462.006-1.753.068c-.513.11-.96.347-1.285.667c-.11.108-.164.161-.291.505A1.3 1.3 0 0 0 4 19.7V7.842c0-1.597.002-2.711.114-3.552c.109-.816.308-1.249.613-1.557' opacity='.5'/%3E%3Cpath fill='currentColor' d='M7.25 7A.75.75 0 0 1 8 6.25h8a.75.75 0 0 1 0 1.5H8A.75.75 0 0 1 7.25 7M8 9.75a.75.75 0 0 0 0 1.5h5a.75.75 0 0 0 0-1.5z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:bookmark-bold-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M21 11.098v4.993c0 3.096 0 4.645-.734 5.321c-.35.323-.792.526-1.263.58c-.987.113-2.14-.907-4.445-2.946c-1.02-.901-1.529-1.352-2.118-1.47a2.2 2.2 0 0 0-.88 0c-.59.118-1.099.569-2.118 1.47c-2.305 2.039-3.458 3.059-4.445 2.945a2.24 2.24 0 0 1-1.263-.579C3 20.736 3 19.188 3 16.091v-4.994C3 6.81 3 4.666 4.318 3.333S7.758 2 12 2s6.364 0 7.682 1.332S21 6.81 21 11.098' opacity='.5'/%3E%3Cpath fill='currentColor' d='M9 5.25a.75.75 0 0 0 0 1.5h6a.75.75 0 0 0 0-1.5z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:box-minimalistic-bold-duotone,[i-solar\:box-minimalistic-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M8.422 20.618C10.178 21.54 11.056 22 12 22V12L2.638 7.073l-.04.067C2 8.154 2 9.417 2 11.942v.117c0 2.524 0 3.787.597 4.801c.598 1.015 1.674 1.58 3.825 2.709z'/%3E%3Cpath fill='currentColor' d='m17.577 4.432l-2-1.05C13.822 2.461 12.944 2 12 2c-.945 0-1.822.46-3.578 1.382l-2 1.05C4.318 5.536 3.242 6.1 2.638 7.072L12 12l9.362-4.927c-.606-.973-1.68-1.537-3.785-2.641' opacity='.7'/%3E%3Cpath fill='currentColor' d='m21.403 7.14l-.041-.067L12 12v10c.944 0 1.822-.46 3.578-1.382l2-1.05c2.151-1.129 3.227-1.693 3.825-2.708c.597-1.014.597-2.277.597-4.8v-.117c0-2.525 0-3.788-.597-4.802' opacity='.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:card-search-broken,[i-solar\:card-search-broken=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' d='M14 4c3.771 0 5.657 0 6.828 1.172S22 8.229 22 12v1M10 4C6.229 4 4.343 4 3.172 5.172S2 8.229 2 12s0 5.657 1.172 6.828S6.229 20 10 20h3m-3-4H6'/%3E%3Ccircle cx='18' cy='17' r='3'/%3E%3Cpath stroke-linecap='round' d='m20.5 19.5l1 1M2 10h5m15 0H11'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:chat-round-line-bold-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2S2 6.477 2 12c0 1.6.376 3.112 1.043 4.453c.178.356.237.763.134 1.148l-.595 2.226a1.3 1.3 0 0 0 1.591 1.592l2.226-.596a1.63 1.63 0 0 1 1.149.133A9.96 9.96 0 0 0 12 22' opacity='.5'/%3E%3Cpath fill='currentColor' d='M7.825 12.85a.825.825 0 0 0 0 1.65h6.05a.825.825 0 0 0 0-1.65zm0-3.85a.825.825 0 0 0 0 1.65h8.8a.825.825 0 0 0 0-1.65z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:chat-square-like-bold-duotone,[i-solar\:chat-square-like-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='m13.629 20.472l-.542.916c-.483.816-1.69.816-2.174 0l-.542-.916c-.42-.71-.63-1.066-.968-1.262c-.338-.197-.763-.204-1.613-.219c-1.256-.021-2.043-.098-2.703-.372a5 5 0 0 1-2.706-2.706C2 14.995 2 13.83 2 11.5v-1c0-3.273 0-4.91.737-6.112a5 5 0 0 1 1.65-1.651C5.59 2 7.228 2 10.5 2h3c3.273 0 4.91 0 6.113.737a5 5 0 0 1 1.65 1.65C22 5.59 22 7.228 22 10.5v1c0 2.33 0 3.495-.38 4.413a5 5 0 0 1-2.707 2.706c-.66.274-1.447.35-2.703.372c-.85.015-1.275.022-1.613.219c-.338.196-.548.551-.968 1.262' opacity='.5'/%3E%3Cpath fill='currentColor' d='M10.99 14.308c-1.327-.978-3.49-2.84-3.49-4.593c0-2.677 2.475-3.677 4.5-1.609c2.025-2.068 4.5-1.068 4.5 1.609c0 1.752-2.163 3.615-3.49 4.593c-.454.335-.681.502-1.01.502s-.556-.167-1.01-.502'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:check-circle-bold-duotone,[i-solar\:check-circle-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2s10 4.477 10 10' opacity='.5'/%3E%3Cpath fill='currentColor' d='M16.03 8.97a.75.75 0 0 1 0 1.06l-5 5a.75.75 0 0 1-1.06 0l-2-2a.75.75 0 1 1 1.06-1.06l1.47 1.47l2.235-2.235L14.97 8.97a.75.75 0 0 1 1.06 0'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:close-circle-line-duotone,[i-solar\:close-circle-line-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Ccircle cx='12' cy='12' r='10' opacity='.5'/%3E%3Cpath stroke-linecap='round' d='m14.5 9.5l-5 5m0-5l5 5'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:code-bold-duotone,[i-solar\:code-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M16.443 7.328a.75.75 0 0 1 1.059-.056l1.737 1.564c.737.663 1.347 1.212 1.767 1.71c.44.525.754 1.088.754 1.784c0 .695-.313 1.258-.754 1.782c-.42.499-1.03 1.049-1.767 1.711l-1.737 1.564a.75.75 0 1 1-1.004-1.115l1.697-1.527c.788-.709 1.319-1.19 1.663-1.598c.33-.393.402-.622.402-.817c0-.196-.072-.425-.402-.818c-.344-.409-.875-.889-1.663-1.598l-1.697-1.527a.75.75 0 0 1-.056-1.06m-8.94 1.06a.75.75 0 0 0-1.004-1.115L4.761 8.836c-.737.663-1.347 1.212-1.767 1.71c-.44.525-.754 1.088-.754 1.784c0 .695.313 1.258.754 1.782c.42.499 1.03 1.049 1.767 1.711l1.737 1.564a.75.75 0 1 0 1.004-1.115l-1.697-1.527c-.788-.709-1.319-1.19-1.663-1.598c-.33-.393-.402-.622-.402-.817c0-.196.072-.425.402-.818c.344-.409.875-.889 1.663-1.598z'/%3E%3Cpath fill='currentColor' d='M14.182 4.276a.75.75 0 0 1 .53.918l-3.974 14.83a.75.75 0 1 1-1.449-.389l3.974-14.83a.75.75 0 0 1 .919-.53' opacity='.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:danger-circle-bold-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M22 12c0-5.523-4.477-10-10-10S2 6.477 2 12s4.477 10 10 10s10-4.477 10-10' opacity='.5'/%3E%3Cpath fill='currentColor' d='M12 6.25a.75.75 0 0 1 .75.75v6a.75.75 0 0 1-1.5 0V7a.75.75 0 0 1 .75-.75M12 17a1 1 0 1 0 0-2a1 1 0 0 0 0 2'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:danger-circle-line-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none'%3E%3Ccircle cx='12' cy='12' r='10' stroke='currentColor' stroke-width='1.5' opacity='.5'/%3E%3Cpath stroke='currentColor' stroke-linecap='round' stroke-width='1.5' d='M12 7v6'/%3E%3Ccircle cx='12' cy='16' r='1' fill='currentColor'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:danger-triangle-bold-duotone,[i-solar\:danger-triangle-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M12 3c-2.31 0-3.77 2.587-6.688 7.762l-.364.644c-2.425 4.3-3.638 6.45-2.542 8.022S6.214 21 11.636 21h.728c5.422 0 8.134 0 9.23-1.572s-.117-3.722-2.542-8.022l-.364-.645C15.77 5.587 14.311 3 12 3' opacity='.5'/%3E%3Cpath fill='currentColor' d='M12 7.25a.75.75 0 0 1 .75.75v5a.75.75 0 0 1-1.5 0V8a.75.75 0 0 1 .75-.75M12 17a1 1 0 1 0 0-2a1 1 0 0 0 0 2'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:dialog-2-bold-duotone,[i-solar\:dialog-2-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='m10.404 22.48l.275-.465c.44-.745.66-1.117 1.012-1.325c.351-.207.81-.222 1.725-.252c.859-.027 1.436-.102 1.93-.306a4.24 4.24 0 0 0 2.295-2.296c.323-.779.323-1.767.323-3.743v-.848c0-2.777 0-4.165-.625-5.185c-.35-.57-.83-1.05-1.4-1.4c-1.02-.625-2.408-.625-5.185-.625H8.21c-2.777 0-4.165 0-5.185.625c-.57.35-1.05.83-1.4 1.4C1 9.08 1 10.468 1 13.245v.848c0 1.976 0 2.964.323 3.744a4.24 4.24 0 0 0 2.295 2.295c.494.204 1.07.28 1.93.306c.916.03 1.374.045 1.725.252c.35.208.571.58 1.012 1.325l.275.465c.41.692 1.434.692 1.844 0m2.789-7.963a1.06 1.06 0 1 0 0-2.12a1.06 1.06 0 0 0 0 2.12m-2.65-1.06a1.06 1.06 0 1 1-2.121 0a1.06 1.06 0 0 1 2.12 0m-4.772 1.06a1.06 1.06 0 1 0 0-2.12a1.06 1.06 0 0 0 0 2.12' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' d='M15.486 1c1.267 0 2.274 0 3.082.077c.829.079 1.53.244 2.153.626a4.8 4.8 0 0 1 1.575 1.575c.383.624.548 1.325.627 2.153c.076.808.076 1.816.076 3.082v.866c0 .901 0 1.619-.04 2.2c-.04.595-.125 1.106-.323 1.584a4.77 4.77 0 0 1-2.67 2.617q-.21.082-.368.135h-1.65c.016-.499.016-1.093.016-1.822v-.848c0-2.777 0-4.165-.625-5.185c-.35-.57-.83-1.05-1.4-1.4c-1.02-.625-2.408-.625-5.185-.625H8.21c-.986 0-1.796 0-2.478.028v-1.65q.05-.17.13-.396q.133-.389.346-.739a4.8 4.8 0 0 1 1.576-1.575c.624-.382 1.324-.547 2.153-.626C10.745 1 11.752 1 13.019 1z' opacity='.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:document-add-outline,[i-solar\:document-add-outline=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M10.944 1.25h2.112c1.838 0 3.294 0 4.433.153c1.172.158 2.121.49 2.87 1.238a.75.75 0 0 1-1.06 1.06c-.424-.422-1.004-.676-2.01-.811c-1.027-.138-2.382-.14-4.289-.14h-2c-1.907 0-3.261.002-4.29.14c-1.005.135-1.585.389-2.008.812S4.025 4.705 3.89 5.71c-.138 1.029-.14 2.383-.14 4.29v4c0 1.907.002 3.262.14 4.29c.135 1.005.389 1.585.812 2.008s1.003.677 2.009.812c1.028.138 2.382.14 4.289.14h2c1.907 0 3.262-.002 4.29-.14c1.005-.135 1.585-.389 2.008-.812c.696-.696.907-1.777.943-4.309a.75.75 0 0 1 1.5.022c-.035 2.427-.192 4.158-1.382 5.348c-.749.748-1.698 1.08-2.87 1.238c-1.14.153-2.595.153-4.433.153h-2.112c-1.838 0-3.294 0-4.433-.153c-1.172-.158-2.121-.49-2.87-1.238c-.748-.749-1.08-1.698-1.238-2.87c-.153-1.14-.153-2.595-.153-4.433V9.944c0-1.838 0-3.294.153-4.433c.158-1.172.49-2.121 1.238-2.87c.749-.748 1.698-1.08 2.87-1.238c1.14-.153 2.595-.153 4.433-.153m7.17 5.796a2.716 2.716 0 1 1 3.84 3.84L17.2 15.643a7 7 0 0 1-.63.587q-.346.27-.744.46c-.224.107-.46.185-.806.3l-2.084.695a1.28 1.28 0 0 1-1.62-1.62l.681-2.04l.014-.043c.116-.347.194-.582.301-.806a4 4 0 0 1 .46-.744c.153-.196.328-.371.587-.63l.031-.031zm2.78 1.06a1.216 1.216 0 0 0-1.72 0l-.182.182l.034.107c.094.27.273.63.611.968a2.55 2.55 0 0 0 1.075.645l.182-.182a1.216 1.216 0 0 0 0-1.72m-1.328 3.048a4 4 0 0 1-.99-.73a4 4 0 0 1-.73-.99L14.45 12.83c-.301.301-.407.409-.496.523q-.17.218-.289.467c-.062.131-.111.274-.246.678l-.4 1.2l.283.283l1.2-.4c.404-.135.547-.184.678-.246q.248-.12.467-.289c.114-.089.222-.195.523-.496zM7.25 9A.75.75 0 0 1 8 8.25h6.5a.75.75 0 0 1 0 1.5H8A.75.75 0 0 1 7.25 9m0 4a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5H8a.75.75 0 0 1-.75-.75m0 4a.75.75 0 0 1 .75-.75h1.5a.75.75 0 0 1 0 1.5H8a.75.75 0 0 1-.75-.75' clip-rule='evenodd'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:document-text-linear{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Cpath d='M3 10c0-3.771 0-5.657 1.172-6.828S7.229 2 11 2h2c3.771 0 5.657 0 6.828 1.172S21 6.229 21 10v4c0 3.771 0 5.657-1.172 6.828S16.771 22 13 22h-2c-3.771 0-5.657 0-6.828-1.172S3 17.771 3 14z'/%3E%3Cpath stroke-linecap='round' d='M8 12h8M8 8h8m-8 8h5'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:earth-outline,[i-solar\:earth-outline=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M5.578 5.343a9.25 9.25 0 0 0 6.803 15.9c-.206-.912-.234-2.138.393-3.319c.652-1.229 2.002-1.762 2.995-2.006a9.2 9.2 0 0 1 1.898-.254h.043c1.673-.018 2.426-.562 2.826-1.08c.342-.444.47-.887.602-1.336l.05-.172A9.22 9.22 0 0 0 18.6 5.519l-.027.1c-.163.594-.425 1.202-.711 1.636c-.256.388-.752.78-1.164 1.076a10 10 0 0 1-.902.56c-.228.132-.433.25-.63.38c-.432.286-.766.593-.991 1.056a.67.67 0 0 0-.035.49c.075.272.126.578.126.889c.002.649-.328 1.176-.753 1.518a2.4 2.4 0 0 1-1.521.526c-2.455-.027-3.965-2.02-4.164-4.236c-.08-.881-.466-1.773-.954-2.552a8.8 8.8 0 0 0-1.296-1.62m1.167-.956a10.5 10.5 0 0 1 1.4 1.779c.558.89 1.069 2.012 1.177 3.214c.15 1.68 1.213 2.854 2.686 2.87a.9.9 0 0 0 .563-.194c.146-.117.196-.24.195-.346c0-.156-.026-.328-.072-.495a2.16 2.16 0 0 1 .131-1.542c.385-.794.956-1.285 1.514-1.653c.239-.158.487-.3.71-.43l.09-.05c.255-.148.48-.28.683-.427c.431-.31.704-.557.787-.684c.183-.276.388-.734.518-1.207c.103-.374.131-.662.122-.84A9.2 9.2 0 0 0 12 2.75a9.2 9.2 0 0 0-5.255 1.637M22.68 13.24q.07-.61.071-1.24c0-5.937-4.813-10.75-10.75-10.75S1.25 6.063 1.25 12S6.063 22.75 12 22.75c5.46 0 9.97-4.071 10.659-9.344a3 3 0 0 1 .048-.156zm-2.774 3.567c-.596.218-1.314.348-2.179.357h-.031l-.09.003a7.7 7.7 0 0 0-1.477.208c-.902.221-1.693.62-2.029 1.252c-.456.859-.39 1.793-.22 2.432a9.26 9.26 0 0 0 6.026-4.252' clip-rule='evenodd'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:emoji-funny-square-bold-duotone,[i-solar\:emoji-funny-square-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M6.504 21.52c1.633.943 3.706.387 7.853-.724s6.22-1.666 7.163-3.3s.387-3.706-.724-7.853s-1.666-6.22-3.3-7.163s-3.706-.388-7.853.724c-4.147 1.11-6.22 1.666-7.163 3.3s-.388 3.706.724 7.853c1.11 4.147 1.666 6.22 3.3 7.163' opacity='.5'/%3E%3Cpath fill='currentColor' d='M14.898 11.224c.533-.143.792-.908.578-1.708s-.821-1.333-1.355-1.19c-.533.143-.792.907-.577 1.708c.214.8.82 1.333 1.354 1.19m-5.796 1.553c.534-.143.792-.908.578-1.708s-.82-1.333-1.354-1.19s-.792.907-.578 1.708s.82 1.333 1.354 1.19m-.917 2.974a.75.75 0 0 1 .91-.545c1.13.283 2.428.287 3.746-.066c1.318-.354 2.44-1.006 3.278-1.816a.75.75 0 1 1 1.043 1.078a8.4 8.4 0 0 1-1.15.928l.159.322a1.5 1.5 0 1 1-2.693 1.322l-.196-.4l-.053.014c-1.555.417-3.112.42-4.499.073a.75.75 0 0 1-.545-.91'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:eye-closed-bold-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M2.919 6.605a1 1 0 0 0-1.838.79l.002.003l.003.007l.01.021l.032.072q.04.09.12.25c.105.21.262.506.47.857c.41.687 1.027 1.6 1.872 2.52l-.797.797a1 1 0 1 0 1.414 1.414l.84-.84c.565.455 1.197.885 1.897 1.256l-.782 1.202a1 1 0 0 0 1.676 1.091l.985-1.514c.677.208 1.402.355 2.177.425V16.5a1 1 0 0 0 1 1V13c-2.748 0-4.819-1.199-6.304-2.59l-.024-.022a12 12 0 0 1-.564-.569a13.4 13.4 0 0 1-1.67-2.237a12 12 0 0 1-.516-.968zm-1.838.79L2 7c-.92.394-.919.395-.919.395' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' d='M15.22 12.398A8.7 8.7 0 0 1 12 13v4.5a1 1 0 0 0 1-1v-1.544c.772-.07 1.497-.217 2.176-.425l.986 1.515a1 1 0 0 0 1.676-1.091l-.782-1.203c.701-.37 1.332-.8 1.897-1.256l.84.84a1 1 0 1 0 1.414-1.414l-.797-.798a15.4 15.4 0 0 0 2.302-3.296a10 10 0 0 0 .19-.395l.011-.026l.004-.008l.002-.005a1 1 0 1 0-1.838-.788l-.005.011a5 5 0 0 1-.146.302a13 13 0 0 1-2.614 3.48c-.841.79-1.87 1.517-3.095 2' opacity='.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:face-scan-circle-bold-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M10.801 2.57a.71.71 0 0 1-.555.838a8.78 8.78 0 0 0-6.838 6.838a.71.71 0 1 1-1.394-.283a10.2 10.2 0 0 1 7.949-7.949a.71.71 0 0 1 .838.556M2.57 13.199a.71.71 0 0 1 .838.555a8.78 8.78 0 0 0 6.838 6.838a.71.71 0 1 1-.283 1.394a10.2 10.2 0 0 1-7.948-7.949a.71.71 0 0 1 .555-.838M13.199 2.57a.71.71 0 0 1 .838-.556a10.2 10.2 0 0 1 7.949 7.949a.711.711 0 0 1-1.394.283a8.78 8.78 0 0 0-6.838-6.838a.71.71 0 0 1-.555-.838m8.231 10.629a.71.71 0 0 1 .556.838a10.2 10.2 0 0 1-7.949 7.949a.711.711 0 0 1-.283-1.394a8.78 8.78 0 0 0 6.838-6.838a.71.71 0 0 1 .838-.555' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' d='M12 19.583a7.583 7.583 0 1 0 0-15.166a7.583 7.583 0 0 0 0 15.166' opacity='.5'/%3E%3Cpath fill='currentColor' d='M8.94 14.539a.71.71 0 0 1 .995-.148c.59.437 1.3.69 2.065.69a3.45 3.45 0 0 0 2.065-.69a.71.71 0 1 1 .847 1.142a4.87 4.87 0 0 1-2.912.97a4.87 4.87 0 0 1-2.911-.97a.71.71 0 0 1-.148-.994m5.547-2.895c.458 0 .83-.557.83-1.244s-.372-1.244-.83-1.244s-.83.557-.83 1.244s.372 1.244.83 1.244m-4.976 0c.458 0 .83-.557.83-1.244s-.372-1.244-.83-1.244s-.83.557-.83 1.244s.372 1.244.83 1.244'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:face-scan-circle-outline,[i-solar\:face-scan-circle-outline=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M16 10.5c0 .829-.448 1.5-1 1.5c-.553 0-1-.671-1-1.5c0-.828.447-1.5 1-1.5s1 .672 1 1.5m-6 0c0 .829-.448 1.5-1 1.5s-1-.671-1-1.5C8 9.672 8.448 9 9 9s1 .672 1 1.5'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M13.265 2.051a.75.75 0 0 1 .884-.586a10.76 10.76 0 0 1 8.386 8.386a.75.75 0 0 1-1.47.298a9.26 9.26 0 0 0-7.214-7.214a.75.75 0 0 1-.586-.884m-2.53 0a.75.75 0 0 1-.586.884a9.26 9.26 0 0 0-7.214 7.215a.75.75 0 0 1-1.47-.299A10.76 10.76 0 0 1 9.85 1.465a.75.75 0 0 1 .884.586M2.051 13.265a.75.75 0 0 1 .884.586a9.26 9.26 0 0 0 7.214 7.214a.75.75 0 1 1-.298 1.47a10.76 10.76 0 0 1-8.386-8.385a.75.75 0 0 1 .586-.885m19.898 0a.75.75 0 0 1 .586.885a10.76 10.76 0 0 1-8.386 8.385a.75.75 0 0 1-.298-1.47a9.26 9.26 0 0 0 7.214-7.214a.75.75 0 0 1 .884-.586M8.397 15.554a.75.75 0 0 1 1.05-.156c.728.54 1.607.852 2.553.852s1.825-.312 2.553-.852a.75.75 0 1 1 .893 1.205A5.77 5.77 0 0 1 12 17.75a5.77 5.77 0 0 1-3.447-1.147a.75.75 0 0 1-.156-1.05' clip-rule='evenodd'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:filters-bold-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M18 8A6 6 0 1 1 6 8a6 6 0 0 1 12 0'/%3E%3Cpath fill='currentColor' d='M13.58 13.79a6 6 0 0 1-7.16-3.58a6 6 0 1 0 7.16 3.58' opacity='.7'/%3E%3Cpath fill='currentColor' d='M13.58 13.79c.271.684.42 1.43.42 2.21a6 6 0 0 1-2 4.472a6 6 0 1 0 5.58-10.262a6.01 6.01 0 0 1-4 3.58' opacity='.4'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:forward-linear,[i-solar\:forward-linear=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m19.5 12l-5-5m5 5l-5 5m5-5h-10c-1.667 0-5 1-5 5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:ghost-bold-duotone,[i-solar\:ghost-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M22 19.206V12c0-5.523-4.477-10-10-10S2 6.477 2 12v7.206a1.727 1.727 0 0 0 2.5 1.544a2.89 2.89 0 0 1 2.896.18a2.89 2.89 0 0 0 3.208 0l.353-.234a1.88 1.88 0 0 1 2.086 0l.353.235a2.89 2.89 0 0 0 3.208 0a2.89 2.89 0 0 1 2.897-.18A1.727 1.727 0 0 0 22 19.206' opacity='.5'/%3E%3Cpath fill='currentColor' d='M15 12c.552 0 1-.672 1-1.5S15.552 9 15 9s-1 .672-1 1.5s.448 1.5 1 1.5m-5-1.5c0 .828-.448 1.5-1 1.5s-1-.672-1-1.5S8.448 9 9 9s1 .672 1 1.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:home-smile-outline,[i-solar\:home-smile-outline=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M9.447 15.398a.75.75 0 1 0-.894 1.204A5.77 5.77 0 0 0 12 17.75a5.77 5.77 0 0 0 3.447-1.148a.75.75 0 1 0-.894-1.204A4.27 4.27 0 0 1 12 16.25a4.27 4.27 0 0 1-2.553-.852'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M12 1.25c-.708 0-1.351.203-2.05.542c-.674.328-1.454.812-2.427 1.416L5.456 4.491c-.92.572-1.659 1.03-2.227 1.465c-.589.45-1.041.91-1.368 1.507c-.326.595-.472 1.229-.543 1.978c-.068.725-.068 1.613-.068 2.726v1.613c0 1.904 0 3.407.153 4.582c.156 1.205.486 2.178 1.23 2.947c.747.773 1.697 1.119 2.875 1.282c1.14.159 2.598.159 4.434.159h4.116c1.836 0 3.294 0 4.434-.159c1.177-.163 2.128-.509 2.876-1.282c.743-.769 1.073-1.742 1.23-2.947c.152-1.175.152-2.678.152-4.582v-1.613c0-1.113 0-2-.068-2.726c-.07-.75-.217-1.383-.543-1.978c-.327-.597-.78-1.056-1.368-1.507c-.568-.436-1.306-.893-2.227-1.465l-2.067-1.283c-.973-.604-1.753-1.088-2.428-1.416c-.697-.34-1.34-.542-2.049-.542M8.28 4.504c1.015-.63 1.73-1.072 2.327-1.363c.581-.283.993-.391 1.393-.391s.812.108 1.393.391c.598.29 1.312.733 2.327 1.363l2 1.241c.961.597 1.636 1.016 2.14 1.402c.489.375.77.684.963 1.036c.193.353.306.766.365 1.398c.061.648.062 1.465.062 2.623v1.521c0 1.97-.002 3.376-.14 4.443c-.136 1.048-.393 1.656-.82 2.099c-.425.439-1.003.7-2.004.839c-1.026.142-2.379.144-4.286.144h-4c-1.908 0-3.26-.002-4.286-.144c-1.001-.14-1.579-.4-2.003-.84c-.428-.442-.685-1.05-.82-2.098c-.14-1.067-.141-2.472-.141-4.443v-1.521c0-1.158 0-1.975.062-2.623c.059-.632.172-1.045.365-1.398c.193-.352.474-.661.964-1.036c.503-.386 1.178-.805 2.139-1.402z' clip-rule='evenodd'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:info-circle-line-duotone,[i-solar\:info-circle-line-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none'%3E%3Ccircle cx='12' cy='12' r='10' stroke='currentColor' stroke-width='1.5' opacity='.5'/%3E%3Cpath stroke='currentColor' stroke-linecap='round' stroke-width='1.5' d='M12 17v-6'/%3E%3Ccircle cx='1' cy='1' r='1' fill='currentColor' transform='matrix(1 0 0 -1 11 9)'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:info-circle-outline,[i-solar\:info-circle-outline=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M12 17.75a.75.75 0 0 0 .75-.75v-6a.75.75 0 0 0-1.5 0v6c0 .414.336.75.75.75M12 7a1 1 0 1 1 0 2a1 1 0 0 1 0-2'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M1.25 12C1.25 6.063 6.063 1.25 12 1.25S22.75 6.063 22.75 12S17.937 22.75 12 22.75S1.25 17.937 1.25 12M12 2.75a9.25 9.25 0 1 0 0 18.5a9.25 9.25 0 0 0 0-18.5' clip-rule='evenodd'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:layers-bold-duotone,[i-solar\:layers-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M4.979 9.685C2.993 8.891 2 8.494 2 8s.993-.89 2.979-1.685l2.808-1.123C9.773 4.397 10.767 4 12 4s2.227.397 4.213 1.192l2.808 1.123C21.007 7.109 22 7.506 22 8s-.993.89-2.979 1.685l-2.808 1.124C14.227 11.603 13.233 12 12 12s-2.227-.397-4.213-1.191z'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M2 8c0 .494.993.89 2.979 1.685l2.808 1.124C9.773 11.603 10.767 12 12 12s2.227-.397 4.213-1.191l2.808-1.124C21.007 8.891 22 8.494 22 8s-.993-.89-2.979-1.685l-2.808-1.123C14.227 4.397 13.233 4 12 4s-2.227.397-4.213 1.192L4.98 6.315C2.993 7.109 2 7.506 2 8' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' d='m5.766 10l-.787.315C2.993 11.109 2 11.507 2 12s.993.89 2.979 1.685l2.808 1.124C9.773 15.603 10.767 16 12 16s2.227-.397 4.213-1.191l2.808-1.124C21.007 12.891 22 12.493 22 12s-.993-.89-2.979-1.685L18.234 10l-2.021.809C14.227 11.603 13.233 12 12 12s-2.227-.397-4.213-1.191z' opacity='.7'/%3E%3Cpath fill='currentColor' d='m5.766 14l-.787.315C2.993 15.109 2 15.507 2 16s.993.89 2.979 1.685l2.808 1.124C9.773 19.603 10.767 20 12 20s2.227-.397 4.213-1.192l2.808-1.123C21.007 16.891 22 16.494 22 16c0-.493-.993-.89-2.979-1.685L18.234 14l-2.021.809C14.227 15.603 13.233 16 12 16s-2.227-.397-4.213-1.191z' opacity='.4'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:leaf-bold-duotone,[i-solar\:leaf-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M12 22c-4.418 0-8-3.646-8-8.143c0-4.462 2.553-9.67 6.537-11.531A3.45 3.45 0 0 1 12 2z' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' d='M13.463 2.326A3.45 3.45 0 0 0 12 2v7l4.432-4.432c-.863-.947-1.86-1.724-2.97-2.242' opacity='.3'/%3E%3Cpath fill='currentColor' d='M12 9v5.5l6.614-6.614c-.572-1.22-1.308-2.357-2.182-3.318z' opacity='.4'/%3E%3Cpath fill='currentColor' d='m12 19.5l7.811-7.811a15 15 0 0 0-1.197-3.803L12 14.5z' opacity='.6'/%3E%3Cpath fill='currentColor' d='M19.811 11.689L12 19.5V22c4.418 0 8-3.646 8-8.143c0-.71-.064-1.438-.189-2.168' opacity='.7'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:magic-stick-2-bold-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M16.714 2.127c-.836-.43-1.922.263-4.095 1.65l-.562.36c-.618.394-.927.591-1.273.648c-.347.056-.692-.034-1.382-.215l-.628-.164C6.345 3.769 5.13 3.45 4.436 4.13s-.412 1.908.157 4.363l.147.635c.161.697.242 1.046.177 1.393c-.066.346-.27.65-.68 1.26l-.372.555c-1.439 2.145-2.158 3.217-1.753 4.067c.406.85 1.668.915 4.192 1.045l.654.033c.717.037 1.076.056 1.382.213c.306.158.524.436.962.994l.398.507c1.539 1.962 2.309 2.943 3.255 2.788c.945-.154 1.441-1.342 2.433-3.717l.257-.614c.282-.675.422-1.012.677-1.261c.255-.25.595-.382 1.274-.647l.618-.24c2.39-.933 3.586-1.4 3.765-2.345s-.777-1.744-2.688-3.342l-.495-.413c-.543-.454-.815-.68-.963-.992s-.158-.672-.175-1.393l-.016-.657c-.062-2.538-.093-3.806-.928-4.236'/%3E%3Cpath fill='currentColor' d='M15.93 16.991c.127-.268.239-.45.392-.6c.172-.167.382-.282.71-.42l4.498 4.499a.75.75 0 0 1-1.06 1.06z' opacity='.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:magic-stick-3-bold-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M3.845 3.845a2.883 2.883 0 0 0 0 4.077L5.432 9.51c.012-.014.555.503.568.49l4-4c.013-.013-.504-.556-.49-.568L7.922 3.845a2.883 2.883 0 0 0-4.077 0m1.288 11.462a.483.483 0 0 1 .9 0l.157.4a.48.48 0 0 0 .272.273l.398.157a.486.486 0 0 1 0 .903l-.398.158a.48.48 0 0 0-.272.273l-.157.4a.483.483 0 0 1-.9 0l-.157-.4a.48.48 0 0 0-.272-.273l-.398-.158a.486.486 0 0 1 0-.903l.398-.157a.48.48 0 0 0 .272-.274z' opacity='.5'/%3E%3Cpath fill='currentColor' d='M19.967 9.13a.483.483 0 0 1 .9 0l.156.399c.05.125.148.224.273.273l.398.158a.486.486 0 0 1 0 .902l-.398.158a.5.5 0 0 0-.273.273l-.156.4a.483.483 0 0 1-.9 0l-.157-.4a.5.5 0 0 0-.272-.273l-.398-.158a.486.486 0 0 1 0-.902l.398-.158a.5.5 0 0 0 .272-.273z' opacity='.2'/%3E%3Cpath fill='currentColor' d='M16.1 2.307a.483.483 0 0 1 .9 0l.43 1.095a.48.48 0 0 0 .272.274l1.091.432a.486.486 0 0 1 0 .903l-1.09.432a.5.5 0 0 0-.273.273L17 6.81a.483.483 0 0 1-.9 0l-.43-1.095a.5.5 0 0 0-.273-.273l-1.09-.432a.486.486 0 0 1 0-.903l1.09-.432a.5.5 0 0 0 .273-.274z' opacity='.7'/%3E%3Cpath fill='currentColor' d='M10.568 6.49c-.012.014-.555-.503-.568-.49l-4 4c-.013.013.504.556.49.568l9.588 9.587a2.883 2.883 0 1 0 4.078-4.077z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:magnifer-line-duotone,[i-solar\:magnifer-line-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cdefs%3E%3Cmask id='solarMagniferLineDuotone0'%3E%3Cg fill='none' stroke-width='1.5'%3E%3Ccircle cx='11.5' cy='11.5' r='9.5' stroke='gray'/%3E%3Cpath stroke='%23fff' stroke-linecap='round' d='M18.5 18.5L22 22'/%3E%3C/g%3E%3C/mask%3E%3C/defs%3E%3Cpath fill='currentColor' d='M0 0h24v24H0z' mask='url(%23solarMagniferLineDuotone0)'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:microphone-3-bold-duotone,[i-solar\:microphone-3-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M4 9a.75.75 0 0 1 .75.75v1a7.25 7.25 0 1 0 14.5 0v-1a.75.75 0 0 1 1.5 0v1a8.75 8.75 0 0 1-8 8.718v2.282a.75.75 0 0 1-1.5 0v-2.282a8.75 8.75 0 0 1-8-8.718v-1A.75.75 0 0 1 4 9' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M12 2a5.75 5.75 0 0 0-5.75 5.75v3a5.75 5.75 0 0 0 11.5 0v-3A5.75 5.75 0 0 0 12 2m2 9.5a.75.75 0 0 0 0-1.5h-4a.75.75 0 0 0 0 1.5zm-.25-3.75a.75.75 0 0 1-.75.75h-2A.75.75 0 0 1 11 7h2a.75.75 0 0 1 .75.75' clip-rule='evenodd' opacity='.5'/%3E%3Cpath fill='currentColor' d='M14 11.5a.75.75 0 0 0 0-1.5h-4a.75.75 0 0 0 0 1.5zm-1-3A.75.75 0 0 0 13 7h-2a.75.75 0 0 0 0 1.5z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:minus-circle-line-duotone,[i-solar\:minus-circle-line-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Ccircle cx='12' cy='12' r='10' opacity='.5'/%3E%3Cpath stroke-linecap='round' d='M15 12H9'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:moon-outline,[i-solar\:moon-outline=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M11.017 2.802a9.25 9.25 0 1 0 10.181 10.181A7.25 7.25 0 1 1 11.017 2.802M1.25 12C1.25 6.063 6.063 1.25 12 1.25c.717 0 1.075.571 1.137 1.026c.059.438-.103.995-.606 1.299a5.75 5.75 0 1 0 7.894 7.894c.304-.503.861-.665 1.299-.606c.455.062 1.026.42 1.026 1.137c0 5.937-4.813 10.75-10.75 10.75S1.25 17.937 1.25 12' clip-rule='evenodd'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:notes-linear{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Cpath d='m20.312 12.647l.517-1.932c.604-2.255.907-3.382.68-4.358a4 4 0 0 0-1.162-2.011c-.731-.685-1.859-.987-4.114-1.591c-2.255-.605-3.383-.907-4.358-.68a4 4 0 0 0-2.011 1.162c-.587.626-.893 1.543-1.348 3.209l-.244.905l-.517 1.932c-.605 2.255-.907 3.382-.68 4.358a4 4 0 0 0 1.162 2.011c.731.685 1.859.987 4.114 1.592c2.032.544 3.149.843 4.064.73q.15-.019.294-.052a4 4 0 0 0 2.011-1.16c.685-.732.987-1.86 1.592-4.115Z'/%3E%3Cpath d='M16.415 17.974a4 4 0 0 1-1.068 1.678c-.731.685-1.859.987-4.114 1.591s-3.383.907-4.358.679a4 4 0 0 1-2.011-1.161c-.685-.731-.988-1.859-1.592-4.114l-.517-1.932c-.605-2.255-.907-3.383-.68-4.358a4 4 0 0 1 1.162-2.011c.731-.685 1.859-.987 4.114-1.592q.638-.172 1.165-.309'/%3E%3Cpath stroke-linecap='round' d='m11.777 10l4.83 1.294M11 12.898l2.898.776'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:pallete-2-bold-duotone,[i-solar\:pallete-2-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M10.847 21.934C5.867 21.362 2 17.133 2 12C2 6.477 6.477 2 12 2s10 4.477 10 10c0 5.157-3.283 4.733-6.086 4.37c-1.618-.209-3.075-.397-3.652.518c-.395.626.032 1.406.555 1.929a1.673 1.673 0 0 1 0 2.366c-.523.523-1.235.836-1.97.751' opacity='.5'/%3E%3Cpath fill='currentColor' d='M11.085 7a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0M6.5 13a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m11 0a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m-3-4.5a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:pause-circle-bold-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2s10 4.477 10 10' opacity='.5'/%3E%3Cpath fill='currentColor' d='M8.076 8.617C8 8.801 8 9.034 8 9.5v5c0 .466 0 .699.076.883a1 1 0 0 0 .541.54c.184.077.417.077.883.077s.699 0 .883-.076a1 1 0 0 0 .54-.541c.077-.184.077-.417.077-.883v-5c0-.466 0-.699-.076-.883a1 1 0 0 0-.541-.54C10.199 8 9.966 8 9.5 8s-.699 0-.883.076a1 1 0 0 0-.54.541m4.999 0C13 8.801 13 9.034 13 9.5v5c0 .466 0 .699.076.883a1 1 0 0 0 .541.54c.184.077.417.077.883.077s.699 0 .883-.076a1 1 0 0 0 .54-.541c.077-.184.077-.417.077-.883v-5c0-.466 0-.699-.076-.883a1 1 0 0 0-.541-.54C15.199 8 14.966 8 14.5 8s-.699 0-.883.076a1 1 0 0 0-.54.541'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:people-nearby-bold-duotone,[i-solar\:people-nearby-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M19.717 20.362C21.143 19.585 22 18.587 22 17.5c0-1.152-.963-2.204-2.546-3C17.623 13.58 14.962 13 12 13s-5.623.58-7.454 1.5C2.963 15.296 2 16.348 2 17.5s.963 2.204 2.546 3C6.377 21.42 9.038 22 12 22c3.107 0 5.882-.637 7.717-1.638' opacity='.6'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M9.25 4a2.75 2.75 0 1 1 5.5 0a2.75 2.75 0 0 1-5.5 0' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' d='m8.223 11.574l-2.175-.725a1.532 1.532 0 0 1 .805-2.952l1.898.407l.21.044a15 15 0 0 0 6.288-.044l1.897-.407a1.532 1.532 0 0 1 .806 2.952l-2.175.725c-.263.088-.394.132-.493.193a1 1 0 0 0-.466.986c.016.115.066.244.165.503l1.247 3.242a1.473 1.473 0 0 1-2.654 1.26L12 15l-1.576 2.757a1.473 1.473 0 0 1-2.654-1.26l1.247-3.241c.1-.259.149-.388.165-.503a1 1 0 0 0-.466-.986c-.099-.061-.23-.105-.493-.193'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:play-circle-bold-duotone,[i-solar\:play-circle-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2S2 6.477 2 12s4.477 10 10 10' clip-rule='evenodd' opacity='.5'/%3E%3Cpath fill='currentColor' d='m15.414 13.059l-4.72 2.787C9.934 16.294 9 15.71 9 14.786V9.214c0-.924.934-1.507 1.694-1.059l4.72 2.787c.781.462.781 1.656 0 2.118'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:play-circle-broken{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Cpath d='M13.888 9.935C14.963 10.812 15.5 11.25 15.5 12s-.537 1.188-1.612 2.065c-.297.242-.591.47-.862.66c-.237.167-.506.339-.784.508c-1.073.652-1.609.978-2.09.617c-.48-.36-.524-1.116-.612-2.628c-.024-.427-.04-.846-.04-1.222s.016-.795.04-1.222c.088-1.512.132-2.267.612-2.628c.481-.361 1.018-.035 2.09.617c.278.169.547.341.784.508c.27.19.565.418.862.66Z'/%3E%3Cpath stroke-linecap='round' d='M7 3.338A9.95 9.95 0 0 1 12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12c0-1.821.487-3.53 1.338-5'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:refresh-bold-duotone,[i-solar\:refresh-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M12.079 2.25c-4.794 0-8.734 3.663-9.118 8.333H2a.75.75 0 0 0-.528 1.283l1.68 1.666a.75.75 0 0 0 1.056 0l1.68-1.666a.75.75 0 0 0-.528-1.283h-.893c.38-3.831 3.638-6.833 7.612-6.833a7.66 7.66 0 0 1 6.537 3.643a.75.75 0 1 0 1.277-.786A9.16 9.16 0 0 0 12.08 2.25'/%3E%3Cpath fill='currentColor' d='M20.841 10.467a.75.75 0 0 0-1.054 0L18.1 12.133a.75.75 0 0 0 .527 1.284h.899c-.381 3.83-3.651 6.833-7.644 6.833a7.7 7.7 0 0 1-6.565-3.644a.75.75 0 1 0-1.276.788a9.2 9.2 0 0 0 7.84 4.356c4.809 0 8.766-3.66 9.151-8.333H22a.75.75 0 0 0 .527-1.284z' opacity='.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:round-double-alt-arrow-right-bold-duotone,[i-solar\:round-double-alt-arrow-right-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12' opacity='.5'/%3E%3Cpath fill='currentColor' d='M9.03 15.53a.75.75 0 0 1-1.06-1.06L10.44 12L7.97 9.53a.75.75 0 0 1 1.06-1.06l3 3a.75.75 0 0 1 0 1.06z'/%3E%3Cpath fill='currentColor' d='M13.03 15.53a.75.75 0 1 1-1.06-1.06L14.44 12l-2.47-2.47a.75.75 0 0 1 1.06-1.06l3 3a.75.75 0 0 1 0 1.06z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:running-2-line-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none'%3E%3Ccircle cx='18.5' cy='4.5' r='2.5' stroke='currentColor' stroke-width='1.5' opacity='.5'/%3E%3Cpath stroke='currentColor' stroke-linecap='round' stroke-width='1.5' d='m9 17l-1 1.2c-.738.886-1.107 1.328-1.61 1.564S5.31 20 4.157 20H3'/%3E%3Cpath fill='currentColor' d='M13.65 22a.75.75 0 0 0 1.5 0zm-1.085-5.754l.453-.598zm1.184 1.015l.587-.466zm.557 1.12l.727-.186zm-.802-6.826a.75.75 0 0 0-1.009-1.11zm-2.652 1.61l.703.26zm.07 1.555l-.677.323zm2.728 5.219v2.06h1.5v-2.06zm-1.538-3.095c.663.502.887.679 1.05.884l1.174-.934c-.308-.387-.717-.69-1.319-1.146zm3.038 3.095c0-.755.006-1.264-.117-1.744l-1.453.373c.065.254.07.538.07 1.37zm-1.988-2.211c.197.247.339.534.417.84l1.454-.373a3.75 3.75 0 0 0-.697-1.4zm-.667-7.283c-.42.381-.945.836-1.354 1.224c-.21.198-.41.398-.573.586c-.149.172-.327.4-.42.649l1.407.521c-.007.021.014-.035.146-.187c.116-.134.276-.295.471-.48c.4-.38.865-.778 1.332-1.203zm.523 5.203c-.488-.37-.818-.62-1.056-.832c-.233-.208-.32-.33-.363-.418l-1.354.645c.167.35.423.63.72.894c.292.26.679.552 1.147.907zm-2.87-2.744a2.75 2.75 0 0 0 .097 2.139l1.354-.645a1.25 1.25 0 0 1-.044-.973z' opacity='.5'/%3E%3Cpath fill='currentColor' d='m5.436 8.82l-.37-.652zm-1.807.164a.75.75 0 1 0 .742 1.304zm9.778-1.627l-.286.693zm-2.96-.715l-.055-.748zM21 12.75a.75.75 0 1 0 0-1.5zm-5.232-3.213l-.67.335zM5.065 8.168l-1.436.816l.742 1.304l1.435-.816zm8.627-1.505c-1.344-.553-2.08-.857-3.3-.769l.11 1.496c.823-.06 1.255.099 2.62.66zm-7.886 2.81c2.502-1.422 3.552-2 4.695-2.083l-.109-1.496c-1.56.114-2.949.923-5.327 2.274zm13.949 3.276H21v-1.5h-1.245zm-4.658-2.878a5.21 5.21 0 0 0 4.658 2.878v-1.5A3.71 3.71 0 0 1 16.439 9.2zm1.342-.67a5.33 5.33 0 0 0-2.747-2.538l-.57 1.387c.86.354 1.564 1 1.975 1.821z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:scale-bold-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M2 12c0-4.714 0-7.071 1.464-8.536C4.93 2 7.286 2 12 2s7.071 0 8.535 1.464C22 4.93 22 7.286 22 12s0 7.071-1.465 8.535C19.072 22 16.714 22 12 22s-7.071 0-8.536-1.465C2 19.072 2 16.714 2 12' opacity='.5'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M16.656 2.75a.75.75 0 0 1 0-1.5H22a.75.75 0 0 1 .75.75v5.344a.75.75 0 0 1-1.5 0V3.81l-7.44 7.439H16a.75.75 0 0 1 0 1.5h-4a.75.75 0 0 1-.75-.75V8a.75.75 0 0 1 1.5 0v2.19l7.44-7.44z' clip-rule='evenodd'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:settings-bold-duotone,[i-solar\:settings-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M14.279 2.152C13.909 2 13.439 2 12.5 2s-1.408 0-1.779.152a2 2 0 0 0-1.09 1.083c-.094.223-.13.484-.145.863a1.62 1.62 0 0 1-.796 1.353a1.64 1.64 0 0 1-1.579.008c-.338-.178-.583-.276-.825-.308a2.03 2.03 0 0 0-1.49.396c-.318.242-.553.646-1.022 1.453c-.47.807-.704 1.21-.757 1.605c-.07.526.074 1.058.4 1.479c.148.192.357.353.68.555c.477.297.783.803.783 1.361s-.306 1.064-.782 1.36c-.324.203-.533.364-.682.556a2 2 0 0 0-.399 1.479c.053.394.287.798.757 1.605s.704 1.21 1.022 1.453c.424.323.96.465 1.49.396c.242-.032.487-.13.825-.308a1.64 1.64 0 0 1 1.58.008c.486.28.774.795.795 1.353c.015.38.051.64.145.863c.204.49.596.88 1.09 1.083c.37.152.84.152 1.779.152s1.409 0 1.779-.152a2 2 0 0 0 1.09-1.083c.094-.223.13-.483.145-.863c.02-.558.309-1.074.796-1.353a1.64 1.64 0 0 1 1.579-.008c.338.178.583.276.825.308c.53.07 1.066-.073 1.49-.396c.318-.242.553-.646 1.022-1.453c.47-.807.704-1.21.757-1.605a2 2 0 0 0-.4-1.479c-.148-.192-.357-.353-.68-.555c-.477-.297-.783-.803-.783-1.361s.306-1.064.782-1.36c.324-.203.533-.364.682-.556a2 2 0 0 0 .399-1.479c-.053-.394-.287-.798-.757-1.605s-.704-1.21-1.022-1.453a2.03 2.03 0 0 0-1.49-.396c-.242.032-.487.13-.825.308a1.64 1.64 0 0 1-1.58-.008a1.62 1.62 0 0 1-.795-1.353c-.015-.38-.051-.64-.145-.863a2 2 0 0 0-1.09-1.083' clip-rule='evenodd' opacity='.5'/%3E%3Cpath fill='currentColor' d='M15.523 12c0 1.657-1.354 3-3.023 3s-3.023-1.343-3.023-3S10.83 9 12.5 9s3.023 1.343 3.023 3'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:settings-minimalistic-bold-duotone,[i-solar\:settings-minimalistic-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M12.428 2c-1.114 0-2.129.6-4.157 1.802l-.686.406C5.555 5.41 4.542 6.011 3.985 7c-.557.99-.557 2.19-.557 4.594v.812c0 2.403 0 3.605.557 4.594s1.57 1.59 3.6 2.791l.686.407C10.299 21.399 11.314 22 12.428 22s2.128-.6 4.157-1.802l.686-.407c2.028-1.2 3.043-1.802 3.6-2.791c.557-.99.557-2.19.557-4.594v-.812c0-2.403 0-3.605-.557-4.594s-1.572-1.59-3.6-2.792l-.686-.406C14.555 2.601 13.542 2 12.428 2' clip-rule='evenodd' opacity='.5'/%3E%3Cpath fill='currentColor' d='M12.428 8.25a3.75 3.75 0 1 0 0 7.5a3.75 3.75 0 0 0 0-7.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:settings-outline,[i-solar\:settings-outline=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='currentColor' fill-rule='evenodd' clip-rule='evenodd'%3E%3Cpath d='M12 8.25a3.75 3.75 0 1 0 0 7.5a3.75 3.75 0 0 0 0-7.5M9.75 12a2.25 2.25 0 1 1 4.5 0a2.25 2.25 0 0 1-4.5 0'/%3E%3Cpath d='M11.975 1.25c-.445 0-.816 0-1.12.02a2.8 2.8 0 0 0-.907.19a2.75 2.75 0 0 0-1.489 1.488c-.145.35-.184.72-.2 1.122a.87.87 0 0 1-.415.731a.87.87 0 0 1-.841-.005c-.356-.188-.696-.339-1.072-.389a2.75 2.75 0 0 0-2.033.545a2.8 2.8 0 0 0-.617.691c-.17.254-.356.575-.578.96l-.025.044c-.223.385-.408.706-.542.98c-.14.286-.25.568-.29.88a2.75 2.75 0 0 0 .544 2.033c.231.301.532.52.872.734a.87.87 0 0 1 .426.726a.87.87 0 0 1-.426.726c-.34.214-.64.433-.872.734a2.75 2.75 0 0 0-.545 2.033c.041.312.15.594.29.88c.135.274.32.595.543.98l.025.044c.222.385.408.706.578.96c.177.263.367.5.617.69a2.75 2.75 0 0 0 2.033.546c.376-.05.716-.2 1.072-.389a.87.87 0 0 1 .84-.005a.86.86 0 0 1 .417.731c.015.402.054.772.2 1.122a2.75 2.75 0 0 0 1.488 1.489c.29.12.59.167.907.188c.304.021.675.021 1.12.021h.05c.445 0 .816 0 1.12-.02c.318-.022.617-.069.907-.19a2.75 2.75 0 0 0 1.489-1.488c.145-.35.184-.72.2-1.122a.87.87 0 0 1 .415-.732a.87.87 0 0 1 .841.006c.356.188.696.339 1.072.388a2.75 2.75 0 0 0 2.033-.544c.25-.192.44-.428.617-.691c.17-.254.356-.575.578-.96l.025-.044c.223-.385.408-.706.542-.98c.14-.286.25-.569.29-.88a2.75 2.75 0 0 0-.544-2.033c-.231-.301-.532-.52-.872-.734a.87.87 0 0 1-.426-.726c0-.278.152-.554.426-.726c.34-.214.64-.433.872-.734a2.75 2.75 0 0 0 .545-2.033a2.8 2.8 0 0 0-.29-.88a18 18 0 0 0-.543-.98l-.025-.044a18 18 0 0 0-.578-.96a2.8 2.8 0 0 0-.617-.69a2.75 2.75 0 0 0-2.033-.546c-.376.05-.716.2-1.072.389a.87.87 0 0 1-.84.005a.87.87 0 0 1-.417-.731c-.015-.402-.054-.772-.2-1.122a2.75 2.75 0 0 0-1.488-1.489c-.29-.12-.59-.167-.907-.188c-.304-.021-.675-.021-1.12-.021zm-1.453 1.595c.077-.032.194-.061.435-.078c.247-.017.567-.017 1.043-.017s.796 0 1.043.017c.241.017.358.046.435.078c.307.127.55.37.677.677c.04.096.073.247.086.604c.03.792.439 1.555 1.165 1.974s1.591.392 2.292.022c.316-.167.463-.214.567-.227a1.25 1.25 0 0 1 .924.247c.066.051.15.138.285.338c.139.206.299.483.537.895s.397.69.506.912c.107.217.14.333.15.416a1.25 1.25 0 0 1-.247.924c-.064.083-.178.187-.48.377c-.672.422-1.128 1.158-1.128 1.996s.456 1.574 1.128 1.996c.302.19.416.294.48.377c.202.263.29.595.247.924c-.01.083-.044.2-.15.416c-.109.223-.268.5-.506.912s-.399.689-.537.895c-.135.2-.219.287-.285.338a1.25 1.25 0 0 1-.924.247c-.104-.013-.25-.06-.567-.227c-.7-.37-1.566-.398-2.292.021s-1.135 1.183-1.165 1.975c-.013.357-.046.508-.086.604a1.25 1.25 0 0 1-.677.677c-.077.032-.194.061-.435.078c-.247.017-.567.017-1.043.017s-.796 0-1.043-.017c-.241-.017-.358-.046-.435-.078a1.25 1.25 0 0 1-.677-.677c-.04-.096-.073-.247-.086-.604c-.03-.792-.439-1.555-1.165-1.974s-1.591-.392-2.292-.022c-.316.167-.463.214-.567.227a1.25 1.25 0 0 1-.924-.247c-.066-.051-.15-.138-.285-.338a17 17 0 0 1-.537-.895c-.238-.412-.397-.69-.506-.912c-.107-.217-.14-.333-.15-.416a1.25 1.25 0 0 1 .247-.924c.064-.083.178-.187.48-.377c.672-.422 1.128-1.158 1.128-1.996s-.456-1.574-1.128-1.996c-.302-.19-.416-.294-.48-.377a1.25 1.25 0 0 1-.247-.924c.01-.083.044-.2.15-.416c.109-.223.268-.5.506-.912s.399-.689.537-.895c.135-.2.219-.287.285-.338a1.25 1.25 0 0 1 .924-.247c.104.013.25.06.567.227c.7.37 1.566.398 2.292-.022c.726-.419 1.135-1.182 1.165-1.974c.013-.357.046-.508.086-.604c.127-.307.37-.55.677-.677'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:stop-circle-bold-duotone,[i-solar\:stop-circle-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2s10 4.477 10 10' opacity='.5'/%3E%3Cpath fill='currentColor' d='M8.586 8.586C8 9.172 8 10.114 8 12s0 2.828.586 3.414S10.114 16 12 16s2.828 0 3.414-.586S16 13.886 16 12s0-2.828-.586-3.414S13.886 8 12 8s-2.828 0-3.414.586'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:sun-2-outline,[i-solar\:sun-2-outline=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M12 1.25a.75.75 0 0 1 .75.75v2a.75.75 0 0 1-1.5 0V2a.75.75 0 0 1 .75-.75M3.669 3.716a.75.75 0 0 1 1.06-.047L6.95 5.7a.75.75 0 1 1-1.012 1.107L3.716 4.776a.75.75 0 0 1-.047-1.06m16.662 0a.75.75 0 0 1-.047 1.06l-2.222 2.031A.75.75 0 0 1 17.05 5.7l2.222-2.031a.75.75 0 0 1 1.06.047M12 7.75a4.25 4.25 0 1 0 0 8.5a4.25 4.25 0 0 0 0-8.5M6.25 12a5.75 5.75 0 1 1 11.5 0a5.75 5.75 0 0 1-11.5 0m-5 0a.75.75 0 0 1 .75-.75h2a.75.75 0 0 1 0 1.5H2a.75.75 0 0 1-.75-.75m18 0a.75.75 0 0 1 .75-.75h2a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1-.75-.75m-2.224 5.025a.75.75 0 0 1 1.06 0l2.222 2.223a.75.75 0 0 1-1.06 1.06l-2.222-2.222a.75.75 0 0 1 0-1.06m-10.051 0a.75.75 0 0 1 0 1.061l-2.223 2.222a.75.75 0 0 1-1.06-1.06l2.222-2.223a.75.75 0 0 1 1.06 0M12 19.25a.75.75 0 0 1 .75.75v2a.75.75 0 0 1-1.5 0v-2a.75.75 0 0 1 .75-.75' clip-rule='evenodd'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:trash-bin-trash-linear,[i-solar\:trash-bin-trash-linear=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' d='M20.5 6h-17m15.333 2.5l-.46 6.9c-.177 2.654-.265 3.981-1.13 4.79s-2.196.81-4.856.81h-.774c-2.66 0-3.991 0-4.856-.81c-.865-.809-.954-2.136-1.13-4.79l-.46-6.9M9.5 11l.5 5m4.5-5l-.5 5'/%3E%3Cpath d='M6.5 6h.11a2 2 0 0 0 1.83-1.32l.034-.103l.097-.291c.083-.249.125-.373.18-.479a1.5 1.5 0 0 1 1.094-.788C9.962 3 10.093 3 10.355 3h3.29c.262 0 .393 0 .51.019a1.5 1.5 0 0 1 1.094.788c.055.106.097.23.18.479l.097.291A2 2 0 0 0 17.5 6'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:tuning-outline,[i-solar\:tuning-outline=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M16.959 9.75a.75.75 0 0 1-.75-.75V2a.75.75 0 0 1 1.5 0v7a.75.75 0 0 1-.75.75'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M7 5.75a3.75 3.75 0 1 1 0 7.5a3.75 3.75 0 0 1 0-7.5M9.25 9.5a2.25 2.25 0 1 0-4.5 0a2.25 2.25 0 0 0 4.5 0M17 18.25a3.75 3.75 0 1 0 0-7.5a3.75 3.75 0 0 0 0 7.5m2.25-3.75a2.25 2.25 0 1 1-4.5 0a2.25 2.25 0 0 1 4.5 0' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' d='M6.209 15a.75.75 0 0 1 1.5 0v7a.75.75 0 0 1-1.5 0zm10.75 7.75a.75.75 0 0 1-.75-.75v-2a.75.75 0 0 1 1.5 0v2a.75.75 0 0 1-.75.75M6.209 2a.75.75 0 0 1 1.5 0v2a.75.75 0 0 1-1.5 0z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:tuning-square-linear{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Cpath d='M2 12c0-4.714 0-7.071 1.464-8.536C4.93 2 7.286 2 12 2s7.071 0 8.535 1.464C22 4.93 22 7.286 22 12s0 7.071-1.465 8.535C19.072 22 16.714 22 12 22s-7.071 0-8.536-1.465C2 19.072 2 16.714 2 12Z'/%3E%3Ccircle cx='8' cy='10' r='2'/%3E%3Ccircle cx='2' cy='2' r='2' transform='matrix(1 0 0 -1 14 16)'/%3E%3Cpath stroke-linecap='round' d='M8 14v5m8-9V5M8 5v1m8 13v-1'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:undo-left-bold-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M7.53 3.47a.75.75 0 0 1 0 1.06L5.06 7l2.47 2.47a.75.75 0 1 1-1.06 1.06l-3-3a.75.75 0 0 1 0-1.06l3-3a.75.75 0 0 1 1.06 0' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' d='m5.06 7l.75-.75h9.226c.904 0 1.633 0 2.222.053c.606.055 1.136.172 1.617.45a3.75 3.75 0 0 1 1.372 1.372c.278.481.395 1.011.45 1.617c.053.589.053 1.318.053 2.222v.072c0 .904 0 1.633-.053 2.222c-.055.606-.172 1.136-.45 1.617a3.75 3.75 0 0 1-1.372 1.373c-.481.277-1.011.394-1.617.449c-.589.053-1.318.053-2.222.053H8a.75.75 0 0 1 0-1.5h7c.948 0 1.61 0 2.122-.047c.502-.046.788-.13 1.003-.254a2.25 2.25 0 0 0 .823-.824c.125-.215.21-.5.255-1.003c.046-.512.047-1.174.047-2.122s0-1.61-.047-2.122c-.046-.503-.13-.788-.255-1.003a2.25 2.25 0 0 0-.823-.824c-.215-.124-.5-.208-1.003-.254c-.512-.046-1.174-.047-2.122-.047H5.81z' opacity='.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:upload-minimalistic-bold,[i-solar\:upload-minimalistic-bold=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M12.554 2.494a.75.75 0 0 0-1.107 0l-4 4.375A.75.75 0 0 0 8.553 7.88l2.696-2.95V16a.75.75 0 0 0 1.5 0V4.932l2.697 2.95a.75.75 0 1 0 1.107-1.013z'/%3E%3Cpath fill='currentColor' d='M3.75 15a.75.75 0 0 0-1.5 0v.055c0 1.367 0 2.47.117 3.337c.12.9.38 1.658.981 2.26c.602.602 1.36.86 2.26.982c.867.116 1.97.116 3.337.116h6.11c1.367 0 2.47 0 3.337-.116c.9-.122 1.658-.38 2.26-.982s.86-1.36.982-2.26c.116-.867.116-1.97.116-3.337V15a.75.75 0 0 0-1.5 0c0 1.435-.002 2.436-.103 3.192c-.099.734-.28 1.122-.556 1.399c-.277.277-.665.457-1.4.556c-.755.101-1.756.103-3.191.103H9c-1.435 0-2.437-.002-3.192-.103c-.734-.099-1.122-.28-1.399-.556c-.277-.277-.457-.665-.556-1.4c-.101-.755-.103-1.756-.103-3.191'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:upload-square-line-duotone,[i-solar\:upload-square-line-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M12 17v-7m0 0l3 3m-3-3l-3 3'/%3E%3Cpath stroke-linecap='round' d='M16 7H8'/%3E%3Cpath d='M2 12c0-4.714 0-7.071 1.464-8.536C4.93 2 7.286 2 12 2s7.071 0 8.535 1.464C22 4.93 22 7.286 22 12s0 7.071-1.465 8.535C19.072 22 16.714 22 12 22s-7.071 0-8.536-1.465C2 19.072 2 16.714 2 12Z' opacity='.5'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:user-rounded-linear{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Ccircle cx='12' cy='6' r='4'/%3E%3Cellipse cx='12' cy='17' rx='7' ry='4'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:user-speak-rounded-bold-duotone,[i-solar\:user-speak-rounded-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Ccircle cx='10' cy='6.75' r='4' fill='currentColor'/%3E%3Cellipse cx='10' cy='17.75' fill='currentColor' opacity='.5' rx='7' ry='4'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M18.357 2.364a.75.75 0 0 1 1.029-.257L19 2.75l.386-.643h.001l.002.002l.004.002l.01.006l.113.076c.07.049.166.12.277.212c.222.185.512.462.802.838c.582.758 1.155 1.914 1.155 3.507s-.573 2.75-1.155 3.507c-.29.376-.58.653-.802.838a4 4 0 0 1-.363.27l-.028.018l-.01.006l-.003.002l-.002.001s-.001.001-.387-.642l.386.643a.75.75 0 0 1-.776-1.283l.005-.004l.041-.027q.06-.042.177-.136c.152-.128.362-.326.573-.6c.417-.542.844-1.386.844-2.593s-.427-2.05-.844-2.593a3.8 3.8 0 0 0-.573-.6a3 3 0 0 0-.218-.163l-.005-.003a.75.75 0 0 1-.253-1.027' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M16.33 4.415a.75.75 0 0 1 1.006-.336L17 4.75l.336-.67h.001l.002.001l.004.002l.008.004l.022.012a2 2 0 0 1 .233.153c.136.102.31.254.48.467c.349.436.664 1.099.664 2.031s-.316 1.595-.664 2.031a2.7 2.7 0 0 1-.654.586l-.06.034l-.02.012l-.01.004l-.003.002l-.002.001l-.33-.657l.329.658a.75.75 0 0 1-.685-1.335l.003-.001l.052-.036c.052-.04.13-.106.209-.205c.15-.189.335-.526.335-1.094s-.184-.905-.335-1.094a1.2 1.2 0 0 0-.261-.24l-.003-.002a.75.75 0 0 1-.322-1' clip-rule='evenodd'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-svg-spinners\:3-dots-fade{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Ccircle cx='4' cy='12' r='3' fill='currentColor'%3E%3Canimate id='svgSpinners3DotsFade0' fill='freeze' attributeName='opacity' begin='0;svgSpinners3DotsFade1.end-0.25s' dur='0.75s' values='1;.2'/%3E%3C/circle%3E%3Ccircle cx='12' cy='12' r='3' fill='currentColor' opacity='.4'%3E%3Canimate fill='freeze' attributeName='opacity' begin='svgSpinners3DotsFade0.begin+0.15s' dur='0.75s' values='1;.2'/%3E%3C/circle%3E%3Ccircle cx='20' cy='12' r='3' fill='currentColor' opacity='.3'%3E%3Canimate id='svgSpinners3DotsFade1' fill='freeze' attributeName='opacity' begin='svgSpinners3DotsFade0.begin+0.3s' dur='0.75s' values='1;.2'/%3E%3C/circle%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-svg-spinners\:ring-resize{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg stroke='currentColor'%3E%3Ccircle cx='12' cy='12' r='9.5' fill='none' stroke-linecap='round' stroke-width='3'%3E%3Canimate attributeName='stroke-dasharray' calcMode='spline' dur='1.5s' keySplines='0.42,0,0.58,1;0.42,0,0.58,1;0.42,0,0.58,1' keyTimes='0;0.475;0.95;1' repeatCount='indefinite' values='0 150;42 150;42 150;42 150'/%3E%3Canimate attributeName='stroke-dashoffset' calcMode='spline' dur='1.5s' keySplines='0.42,0,0.58,1;0.42,0,0.58,1;0.42,0,0.58,1' keyTimes='0;0.475;0.95;1' repeatCount='indefinite' values='0;-16;-59;-59'/%3E%3C/circle%3E%3CanimateTransform attributeName='transform' dur='2s' repeatCount='indefinite' type='rotate' values='0 12 12;360 12 12'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-vscode-icons\:file-type-minecraft{background:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='%2352a535' d='M30 2H2v28h28z'/%3E%3Cpath fill='%2386d562' d='M24.4 13.2h-5.6v.47h5.6zm-5.6 8.4h-5.6v.47h5.6zm2.8 2.8h-2.8v.47h2.8zm-8.4 0h-2.8v.47h2.8zm0-11.2H7.6v.47h5.6z'/%3E%3Cpath d='M24.4 13.2V7.6h-5.6v5.6h-5.6V16h-2.8v8.4h2.8v-2.8h5.6v2.8h2.8V16h-2.8v-2.8zM13.2 7.6H7.6v5.6h5.6z'/%3E%3Cpath fill='%232a641c' d='M24.4 7.6h-5.6v.47h5.6zm-5.6 5.6h-5.6v.47h5.6zm-5.6-5.6H7.6v.47h5.6zm0 8.4h-2.8v.47h2.8zm8.4 0h-2.8v.47h2.8z'/%3E%3C/svg%3E") 0 0/100% 100% no-repeat;width:1.2em;height:1.2em}.prose :where(h1,h2,h3,h4,h5,h6):not(:where(.not-prose,.not-prose *)){color:var(--un-prose-headings);font-weight:600;line-height:1.25}.prose :where(a):not(:where(.not-prose,.not-prose *)){color:var(--un-prose-links);font-weight:500;text-decoration:underline}.prose :where(a code):not(:where(.not-prose,.not-prose *)){color:var(--un-prose-links)}.prose :where(p,ul,ol,pre):not(:where(.not-prose,.not-prose *)){margin:1em 0;line-height:1.75}.prose :where(blockquote):not(:where(.not-prose,.not-prose *)){border-left:.25em solid var(--un-prose-borders);margin:1em 0;padding-left:1em;font-style:italic}.prose :where(h1):not(:where(.not-prose,.not-prose *)){margin:1rem 0;font-size:2.25em}.prose :where(h2):not(:where(.not-prose,.not-prose *)){margin:1.75em 0 .5em;font-size:1.75em}.prose :where(h3):not(:where(.not-prose,.not-prose *)){margin:1.5em 0 .5em;font-size:1.375em}.prose :where(h4):not(:where(.not-prose,.not-prose *)){margin:1em 0;font-size:1.125em}.prose :where(img,video):not(:where(.not-prose,.not-prose *)){max-width:100%}.prose :where(figure,picture):not(:where(.not-prose,.not-prose *)){margin:1em 0}.prose :where(figcaption):not(:where(.not-prose,.not-prose *)){color:var(--un-prose-captions);font-size:.875em}.prose :where(code):not(:where(.not-prose,.not-prose *)){color:var(--un-prose-code);font-family:DM Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:.875em;font-weight:600}.prose :where(:not(pre)>code):not(:where(.not-prose,.not-prose *)):before,.prose :where(:not(pre)>code):not(:where(.not-prose,.not-prose *)):after{content:"`"}.prose :where(pre):not(:where(.not-prose,.not-prose *)){border-radius:.375rem;padding:1.25rem 1.5rem;overflow-x:auto}.prose :where(pre,code):not(:where(.not-prose,.not-prose *)){white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;tab-size:4;-webkit-hyphens:none;hyphens:none;background:0 0}.prose :where(pre code):not(:where(.not-prose,.not-prose *)){font-weight:inherit}.prose :where(ol,ul):not(:where(.not-prose,.not-prose *)){padding-left:1.25em}.prose :where(ol):not(:where(.not-prose,.not-prose *)){list-style-type:decimal}.prose :where(ol[type=A]):not(:where(.not-prose,.not-prose *)){list-style-type:upper-alpha}.prose :where(ol[type=a]):not(:where(.not-prose,.not-prose *)){list-style-type:lower-alpha}.prose :where(ol[type=A s]):not(:where(.not-prose,.not-prose *)){list-style-type:upper-alpha}.prose :where(ol[type=a s]):not(:where(.not-prose,.not-prose *)){list-style-type:lower-alpha}.prose :where(ol[type=I]):not(:where(.not-prose,.not-prose *)){list-style-type:upper-roman}.prose :where(ol[type=i]):not(:where(.not-prose,.not-prose *)){list-style-type:lower-roman}.prose :where(ol[type=I s]):not(:where(.not-prose,.not-prose *)){list-style-type:upper-roman}.prose :where(ol[type=i s]):not(:where(.not-prose,.not-prose *)){list-style-type:lower-roman}.prose :where(ol[type="1"]):not(:where(.not-prose,.not-prose *)){list-style-type:decimal}.prose :where(ul):not(:where(.not-prose,.not-prose *)){list-style-type:disc}.prose :where(ol>li):not(:where(.not-prose,.not-prose *))::marker{color:var(--un-prose-lists)}.prose :where(ul>li):not(:where(.not-prose,.not-prose *))::marker{color:var(--un-prose-lists)}.prose :where(summary):not(:where(.not-prose,.not-prose *))::marker{color:var(--un-prose-lists)}.prose :where(hr):not(:where(.not-prose,.not-prose *)){border:1px solid var(--un-prose-hr);margin:2em 0}.prose :where(table):not(:where(.not-prose,.not-prose *)){border-collapse:collapse;margin:1em 0;display:block;overflow-x:auto}.prose :where(tr):not(:where(.not-prose,.not-prose *)):nth-child(2n){background:var(--un-prose-bg-soft)}.prose :where(td,th):not(:where(.not-prose,.not-prose *)){border:1px solid var(--un-prose-borders);padding:.625em 1em}.prose :where(abbr):not(:where(.not-prose,.not-prose *)){cursor:help}.prose :where(kbd):not(:where(.not-prose,.not-prose *)){color:var(--un-prose-code);border:1px solid;border-radius:.25rem;padding:.25rem .5rem;font-size:.875em}.prose :where(details):not(:where(.not-prose,.not-prose *)){background:var(--un-prose-bg-soft);margin:1em 0;padding:1.25rem 1.5rem}.prose :where(summary):not(:where(.not-prose,.not-prose *)){cursor:pointer;font-weight:600}.prose{color:var(--un-prose-body);max-width:65ch}.container,[container=""]{width:100%}.scrollbar-none,[scrollbar-none=""]{scrollbar-width:none}.scrollbar-none::-webkit-scrollbar{display:none}[scrollbar-none=""]::-webkit-scrollbar{display:none}@media (min-width:640px){.container,[container=""]{max-width:640px}}@media (min-width:768px){.container,[container=""]{max-width:768px}}@media (min-width:1024px){.container,[container=""]{max-width:1024px}}@media (min-width:1280px){.container,[container=""]{max-width:1280px}}@media (min-width:1536px){.container,[container=""]{max-width:1536px}}.\[input\:checked\~\&\]{input:checked~&}.sr-only{clip:rect(0,0,0,0);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.pointer-events-none,[pointer-events-none=""],.disabled\:pointer-events-none:disabled{pointer-events:none}.\!visible{visibility:visible!important}.visible{visibility:visible}.absolute,[absolute=""]{position:absolute}.fixed,[fixed=""]{position:fixed}.relative,[relative=""]{position:relative}.sticky,[sticky=""]{position:sticky}.before-position-absolute:before,[before~=absolute]:before,.after\:absolute:after,[after~=absolute]:after{position:absolute}.inset-0,[inset-0=""],.before\:inset-0:before,[before~=inset-0]:before,[after~=inset-0]:after{inset:0}.inset-x-0,[inset-x-0=""]{left:0;right:0}.inset-y-0{top:0;bottom:0}.bottom-0,[bottom-0=""]{bottom:0}.bottom-2{bottom:.5rem}.left-0,[left-0=""]{left:0}.left-1\/2{left:50%}.left-10,[left-10=""]{left:2.5rem}.left-2{left:.5rem}.right--10,[right--10=""]{right:-2.5rem}.right--15,[right--15=""]{right:-3.75rem}.right--5,[right--5=""]{right:-1.25rem}.right-0,[right-0=""]{right:0}.right-2,[right-2=""]{right:.5rem}.right-4,[right-4=""]{right:1rem}.top--20,[top--20=""]{top:-5rem}.top-\[-32px\]{top:-32px}.top-0,[top-0=""],[top~="0"]{top:0}.top-1\/2,[top~="50%"]{top:50%}.top-2,[top-2=""]{top:.5rem}[top~="[65dvh]"]{top:65dvh}[top~="[calc(100dvh-12rem)]"]{top:calc(100dvh - 12rem)}[top~="[calc(100dvh-15rem)]"]{top:calc(100dvh - 15rem)}.after\:left-\[2px\]:after{left:2px}.after\:top-\[2px\]:after{top:2px}.line-clamp-1,[line-clamp-1=""]{-webkit-line-clamp:1;line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-2{-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-3,[line-clamp-3=""]{-webkit-line-clamp:3;line-clamp:3;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.z--1,[z--1=""]{z-index:-1}.z--2{z-index:-2}.z-\[9999\]{z-index:9999}.z-0{z-index:0}.z-1,[z-1=""]{z-index:1}.z-10,[z-10=""]{z-index:10}.z-100,[z-100=""]{z-index:100}.z-1000{z-index:1000}.z-15,[z-15=""]{z-index:15}.z-2,[z-2=""]{z-index:2}.z-3,[z-3=""]{z-index:3}.z-4,[z-4=""]{z-index:4}.z-5,[z-5=""]{z-index:5}.z-99,[z-99=""]{z-index:99}[before~=z-0]:before{z-index:0}[after~=z--2]:after{z-index:-2}.\[\&\>div\]\:grid>div,.grid,[grid=""],[grid~=\~]{display:grid}.col-span-full{grid-column:1/-1}.auto-cols-\[350px\]{grid-auto-columns:350px}.auto-cols-auto{grid-auto-columns:auto}.grid-auto-rows-\[minmax\(min-content\,max-content\)\]{grid-auto-rows:minmax(min-content,max-content)}.grid-auto-flow-dense{grid-auto-flow:dense}.grid-flow-col{grid-auto-flow:column}.grid-flow-row{grid-auto-flow:row}.\[\&\>div\]\:grid-cols-\[4fr_2fr\]>div{grid-template-columns:4fr 2fr}.cols-\[150px_1fr\],[grid~="cols-[150px_1fr]"]{grid-template-columns:150px 1fr}.cols-\[70px_1fr\],[grid~="cols-[70px_1fr]"]{grid-template-columns:70px 1fr}.grid-cols-\[repeat\(auto-fill\,minmax\(280px\,1fr\)\)\]{grid-template-columns:repeat(auto-fill,minmax(280px,1fr))}.cols-1,.grid-cols-1,[grid~=cols-1]{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2,[grid-cols-2=""]{grid-template-columns:repeat(2,minmax(0,1fr))}.m-0,[m0=""]{margin:0}.m-1{margin:.25rem}.m-auto{margin:auto}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-5,[mx-5=""]{margin-left:1.25rem;margin-right:1.25rem}.mx-auto,[mx-auto=""]{margin-left:auto;margin-right:auto}.my,.my-4{margin-top:1rem;margin-bottom:1rem}.my-0,[my-0=""]{margin-top:0;margin-bottom:0}.my-10,[my-10=""]{margin-top:2.5rem;margin-bottom:2.5rem}.my-3{margin-top:.75rem;margin-bottom:.75rem}.my-5,[my-5=""]{margin-top:1.25rem;margin-bottom:1.25rem}.my-auto,[my-auto=""]{margin-top:auto;margin-bottom:auto}.-mb-px{margin-bottom:-1px}.mb-0{margin-bottom:0}.mb-1,[mb-1=""]{margin-bottom:.25rem}.mb-14,[mb-14=""]{margin-bottom:3.5rem}.mb-2,[mb-2=""]{margin-bottom:.5rem}.mb-3,[mb-3=""]{margin-bottom:.75rem}.mb-4,[mb-4=""]{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.ml{margin-left:1rem}.ml-0\.5,[ml-0\.5=""]{margin-left:.125rem}.ml-1,[ml-1=""]{margin-left:.25rem}.ml-auto{margin-left:auto}.mr{margin-right:1rem}.mr-0\!{margin-right:0!important}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mr-auto{margin-right:auto}.ms{margin-inline-start:1rem}.mt-0\.5{margin-top:.125rem}.mt-1,[mt-1=""]{margin-top:.25rem}.mt-2,[mt-2=""]{margin-top:.5rem}.mt-20{margin-top:5rem}.mt-3{margin-top:.75rem}.mt-4,[mt-4=""]{margin-top:1rem}.mt-auto{margin-top:auto}[ml~="12"]{margin-left:3rem}[mr~="12"]{margin-right:3rem}[box~=border]{box-sizing:border-box}.inline,[inline=""]{display:inline}.block,[block=""]{display:block}.inline-block,[inline-block=""]{display:inline-block}.contents{display:contents}.aspect-square,[aspect-square=""]{aspect-ratio:1}.size-16,[size-16=""]{width:4rem;height:4rem}.size-2{width:.5rem;height:.5rem}.size-20,[size-20=""]{width:5rem;height:5rem}.size-24,[size-24=""],[size~="24"]{width:6rem;height:6rem}.size-3,[size-3=""]{width:.75rem;height:.75rem}.size-5,[size-5=""]{width:1.25rem;height:1.25rem}.size-6,[size-6=""],[size~="6"]{width:1.5rem;height:1.5rem}.size-60,[size-60=""]{width:15rem;height:15rem}.size-8,[size-8=""]{width:2rem;height:2rem}[size~="1"]{width:.25rem;height:.25rem}[size~=sm]{width:24rem;height:24rem}.h-\[calc\(100\%-40px\)\]{height:calc(100% - 40px)}.h-0\.5,[h-0\.5=""]{height:.125rem}.h-0\.5lh{height:.5lh}.h-1\.5,[h-1\.5=""]{height:.375rem}.h-10{height:2.5rem}.h-100dvh,[h-100dvh=""],[h~="100dvh"]{height:100dvh}.h-12{height:3rem}.h-16{height:4rem}.h-18,[h-18=""]{height:4.5rem}.h-1lh{height:1lh}.h-2,.h2,[h-2=""]{height:.5rem}.h-24,[h-24=""]{height:6rem}.h-3\.5{height:.875rem}.h-30,[h-30=""]{height:7.5rem}.h-4,[h-4=""]{height:1rem}.h-48,[h-48=""]{height:12rem}.h-5,[h-5=""]{height:1.25rem}.h-6{height:1.5rem}.h-60,[h-60=""]{height:15rem}.h-7,[h-7=""]{height:1.75rem}.h-8,[h-8=""]{height:2rem}.h-auto,[h-auto=""],[h~=auto]{height:auto}.h-fit,[h-fit=""]{height:fit-content}.h-full,[h-full=""],[h~="100%"]{height:100%}.h1{height:.25rem}.h3{height:.75rem}.max-h-\[10lh\],[max-h~="[10lh]"]{max-height:10lh}.max-h-\[90vh\]{max-height:90vh}.max-h-\[96\%\]{max-height:96%}.max-h-\[calc\(100dvh-100px-56px\)\]{max-height:calc(100dvh - 156px)}.max-h-\[calc\(100dvh-17rem\)\]{max-height:calc(100dvh - 17rem)}.max-h-\[calc\(100dvh-7lh\)\]{max-height:calc(100dvh - 7lh)}.max-h-100dvh,[max-h-100dvh=""],[max-h~="100dvh"]{max-height:100dvh}.max-h-60,[max-h-60=""]{max-height:15rem}.max-h-full{max-height:100%}.max-h-none,[max-h-none=""]{max-height:none}.max-w-100dvw,[max-w-100dvw=""]{max-width:100dvw}.max-w-2xl{max-width:42rem}.max-w-6xl{max-width:72rem}.max-w-full,[max-w-full=""]{max-width:100%}.max-w-md{max-width:28rem}.min-h-\[120px\],.min-h-120px,[min-h-120px=""]{min-height:120px}.min-h-\[1lh\]{min-height:1lh}.min-h-16,[min-h-16=""]{min-height:4rem}.min-h-40px,[min-h-40px=""]{min-height:40px}.min-h-70dvh,[min-h-70dvh=""]{min-height:70dvh}.min-w-\[150px\]{min-width:150px}.min-w-\[160px\],[min-w~="[160px]"]{min-width:160px}.min-w-\[200px\]{min-width:200px}.min-w-\[max-content\]{min-width:max-content}.min-w-0,[min-w-0=""]{min-width:0}.min-w-2,[min-w-2=""]{min-width:.5rem}.min-w-20,[min-w-20=""]{min-width:5rem}.min-w-20px{min-width:20px}.min-w-50,[min-w-50=""]{min-width:12.5rem}.w-\[92dvw\]{width:92dvw}.w-\[92vw\]{width:92vw}.w-0\!{width:0!important}.w-1{width:.25rem}.w-1\.5,[w-1\.5=""]{width:.375rem}.w-1\/2,[w~="[50%]"]{width:50%}.w-10\%{width:10%}.w-100,[w-100=""]{width:25rem}.w-100\%,.w-full,[w-full=""],[w~="100%"],[w~=full]{width:100%}.w-100vw,[w-100vw=""]{width:100vw}.w-11{width:2.75rem}.w-18,[w-18=""]{width:4.5rem}.w-1lh{width:1lh}.w-2,[w-2=""]{width:.5rem}.w-25\%{width:25%}.w-3\.5{width:.875rem}.w-30,[w-30=""]{width:7.5rem}.w-4{width:1rem}.w-4\/5{width:80%}.w-5,[w-5=""]{width:1.25rem}.w-8,[w-8=""]{width:2rem}.w-90\%{width:90%}.w-95\%{width:95%}.w-auto,[w-auto=""]{width:auto}.w-fit,[w-fit=""]{width:fit-content}[h~="[14px]"]{height:14px}[h~="[calc(1lh+4px+4px)]"]{height:calc(1lh + 8px)}[h~="300"]{height:75rem}[h~="50%"]{height:50%}[h~="85dvh"]{height:85dvh}[h~=unset]{height:unset}[max-h~="[300px]"]{max-height:300px}[max-h~="[4.5rem]"]{max-height:4.5rem}[max-h~="[85vh]"]{max-height:85vh}[max-h~="100"]{max-height:25rem}[max-h~="35dvh"]{max-height:35dvh}[max-h~="50"]{max-height:12.5rem}[max-w~="[calc(100%-3.5rem)]"]{max-width:calc(100% - 3.5rem)}[max-w~="500px"]{max-width:500px}[min-h~="[100px]"]{min-height:100px}[min-h~="[calc(1lh+4px+4px)]"]{min-height:calc(1lh + 8px)}[min-h~="100"]{min-height:25rem}[min-h~="120"]{min-height:30rem}[min-w~="1/2"],[min-w~="50%"]{min-width:50%}[min-w~="30%"]{min-width:30%}[min-w~="3em"]{min-width:3em}[w~="[1px]"]{width:1px}[w~="[calc(1lh+4px+4px)]"]{width:calc(1lh + 8px)}[w~="100dvw"]{width:100dvw}[w~="12.5"]{width:3.125rem}[w~="70%"]{width:70%}.hover\:h-13:hover{height:3.25rem}.hover\:w-2:hover{width:.5rem}.before\:h-full:before{height:100%}.before\:w-1:before{width:.25rem}[before~=h-full]:before{height:100%}[before~=w-25\%]:before{width:25%}.after\:h-5:after{height:1.25rem}.after\:w-5:after{width:1.25rem}[after~=h-full]:after{height:100%}[after~=w-full]:after{width:100%}.max-w-screen-xl,[max-w-screen-xl=""]{max-width:1280px}.flex,[flex=""],[flex~=\~]{display:flex}.inline-flex,[inline-flex=""],[inline-flex~=\~]{display:inline-flex}.flex-1,[flex-1=""],[flex~="1"]{flex:1}.flex-shrink-0,.shrink-0,[flex-shrink-0=""],[shrink-0=""]{flex-shrink:0}.flex-row,[flex-row=""],[flex~=row]{flex-direction:row}[flex~=row-reverse]{flex-direction:row-reverse}.flex-col,[flex-col=""],[flex~=col]{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap,[flex-wrap=""]{flex-wrap:wrap}.origin-left,[origin-left=""]{transform-origin:0}[perspective~="800"]{perspective:800px}.-translate-x-1\/2,.translate-x-\[-50\%\]{--un-translate-x:-50%;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.-translate-y-1\/2,.translate-y-\[-50\%\],[transform~="translate-y-[-50%]"],[translate-y~="[-50%]"]{--un-translate-y:-50%;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.translate-x-\[50\%\],[transform~="translate-x-[50%]"]{--un-translate-x:50%;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.translate-y--2,[transform~=translate-y--2]{--un-translate-y:-.5rem;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.translate-y-\[0\.25lh\]{--un-translate-y:.25lh;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.translate-y-\[50\%\]{--un-translate-y:50%;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.translate-y-1,[translate-y-1=""]{--un-translate-y:.25rem;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.translate-y-2,[translate-y-2=""]{--un-translate-y:.5rem;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.translate-y-4,[translate-y-4=""]{--un-translate-y:1rem;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}[translate-x~="0.5"]{--un-translate-x:.125rem;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}[translate-x~="data-[state=checked]:full"][data-state=checked]{--un-translate-x:100%;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}[translate-y~="[-100%]"]{--un-translate-y:-100%;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}[translate-y~="[-80%]"]{--un-translate-y:-80%;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}[translate-y~="[2px]"]{--un-translate-y:2px;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.peer:checked~.peer-checked\:after\:translate-x-full:after{--un-translate-x:100%;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.\[\&_\.card-cover_img\]\:hover\:translate-y-2:hover .card-cover img,[hover\:translate-y-2=""]:hover{--un-translate-y:.5rem;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.rotate-180{--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-rotate:180deg;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.scale-100{--un-scale-x:1;--un-scale-y:1;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.scale-120{--un-scale-x:1.2;--un-scale-y:1.2;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.scale-125{--un-scale-x:1.25;--un-scale-y:1.25;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.\[\&_\.card-cover_img\]\:hover\:scale-102:hover .card-cover img{--un-scale-x:1.02;--un-scale-y:1.02;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.hover\:scale-110:hover{--un-scale-x:1.1;--un-scale-y:1.1;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}[hover~=scale-100]:hover{--un-scale-x:1;--un-scale-y:1;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.active\:scale-95:active{--un-scale-x:.95;--un-scale-y:.95;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.transform-scale-x--100,[transform-scale-x--100=""]{--un-scale-x:-1;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.preserve-3d{transform-style:preserve-3d}.transform,[transform=""]{transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.animate-pulse,[animate-pulse=""]{animation:2s cubic-bezier(.4,0,.6,1) infinite pulse}.animate-spin{animation:1s linear infinite spin}.disabled\:cursor-default:disabled{cursor:default}.cursor-pointer,[cursor-pointer=""],[cursor~=pointer]{cursor:pointer}.cursor-not-allowed,.disabled\:cursor-not-allowed:disabled,[cursor~=disabled\:not-allowed]:disabled,[disabled\:cursor-not-allowed=""]:disabled{cursor:not-allowed}.cursor-col-resize{cursor:col-resize}.cursor-ew-resize,[cursor-ew-resize=""]{cursor:ew-resize}.resize-none,[resize-none=""]{resize:none}.appearance-none{appearance:none}.items-start,[flex~=items-start],[items-start=""]{align-items:flex-start}.items-end,[items-end=""]{align-items:flex-end}.items-center,[flex~=items-center],[items-center=""]{align-items:center}.self-start,[self-start=""]{align-self:flex-start}.self-end,[self-end=""]{align-self:flex-end}.justify-start{justify-content:flex-start}.justify-end,[justify-end=""]{justify-content:flex-end}.justify-center,[flex~=justify-center],[justify-center=""]{justify-content:center}.justify-between,[justify-between=""]{justify-content:space-between}.justify-self-end,[justify-self-end=""]{justify-self:end}.gap-0\.5,[gap-0\.5=""]{gap:.125rem}.gap-1,[flex~=gap-1],[gap-1=""]{gap:.25rem}.gap-1\.5,[gap-1\.5=""]{gap:.375rem}.gap-2,[flex~=gap-2],[gap-2=""]{gap:.5rem}.gap-3,[flex~=gap-3],[gap-3=""]{gap:.75rem}.gap-4,[flex~=gap-4],[gap-4=""],[grid~=gap-4]{gap:1rem}.gap-5,[gap-5=""]{gap:1.25rem}.gap-6,[flex~=gap-6]{gap:1.5rem}.gap-8{gap:2rem}.gap-x-2,[flex~=gap-x-2]{column-gap:.5rem}.gap-y-0,[flex~=gap-y-0]{row-gap:0}.space-x-1>:not([hidden])~:not([hidden]){--un-space-x-reverse:0;margin-left:calc(.25rem*calc(1 - var(--un-space-x-reverse)));margin-right:calc(.25rem*var(--un-space-x-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--un-space-y-reverse:0;margin-top:calc(.25rem*calc(1 - var(--un-space-y-reverse)));margin-bottom:calc(.25rem*var(--un-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--un-space-y-reverse:0;margin-top:calc(.5rem*calc(1 - var(--un-space-y-reverse)));margin-bottom:calc(.5rem*var(--un-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--un-space-y-reverse:0;margin-top:calc(.75rem*calc(1 - var(--un-space-y-reverse)));margin-bottom:calc(.75rem*var(--un-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--un-space-y-reverse:0;margin-top:calc(1rem*calc(1 - var(--un-space-y-reverse)));margin-bottom:calc(1rem*var(--un-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--un-space-y-reverse:0;margin-top:calc(1.5rem*calc(1 - var(--un-space-y-reverse)));margin-bottom:calc(1.5rem*var(--un-space-y-reverse))}.of-hidden,.overflow-hidden,[of-hidden=""],[overflow-hidden=""],[overflow~=hidden]{overflow:hidden}.overflow-auto,[overflow-auto=""]{overflow:auto}.overflow-scroll,[overflow-scroll=""]{overflow:scroll}.of-x-scroll,[of-x-scroll=""]{overflow-x:scroll}.overflow-x-auto{overflow-x:auto}.overflow-y-auto,[overflow-y-auto=""]{overflow-y:auto}.overflow-y-scroll,[overflow-y-scroll=""]{overflow-y:scroll}.scroll-smooth,[scroll-smooth=""]{scroll-behavior:smooth}.truncate,[truncate=""]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.text-ellipsis,[text-ellipsis=""]{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line,[whitespace-pre-line=""]{white-space:pre-line}.whitespace-pre-wrap,[whitespace-pre-wrap=""]{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.b,.border,[b=""],[b~=\~],[border=""],[border~=\~]{border-width:1px}.border-2,[border~="2"],[border~="2px"]{border-width:2px}[border~="4"]{border-width:4px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-t{border-top-width:1px}.\[\&\:checked\+div\]\:border-primary-500:checked+div,.border-primary-500{--un-border-opacity:1;border-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/var(--un-border-opacity))}.b-green{--un-border-opacity:1;border-color:rgb(74 222 128/var(--un-border-opacity))}.b-orange{--un-border-opacity:1;border-color:rgb(251 146 60/var(--un-border-opacity))}.b-purple{--un-border-opacity:1;border-color:rgb(192 132 252/var(--un-border-opacity))}.b-red{--un-border-opacity:1;border-color:rgb(248 113 113/var(--un-border-opacity))}.border-amber-200{--un-border-opacity:1;border-color:rgb(253 230 138/var(--un-border-opacity))}.border-neutral-100,[border~=neutral-100]{--un-border-opacity:1;border-color:rgb(245 245 245/var(--un-border-opacity))}.border-neutral-100\/60,[border~=neutral-100\/60]{border-color:#f5f5f599}.border-neutral-200,.dark [border~=dark\:neutral-200],[border-neutral-200=""],[border~=neutral-200]{--un-border-opacity:1;border-color:rgb(229 229 229/var(--un-border-opacity))}.border-neutral-300,[border~="data-[state=unchecked]:neutral-300"][data-state=unchecked],[border~=neutral-300]{--un-border-opacity:1;border-color:rgb(212 212 212/var(--un-border-opacity))}.border-neutral-300\/30{border-color:#d4d4d44d}.border-neutral-400{--un-border-opacity:1;border-color:rgb(163 163 163/var(--un-border-opacity))}.border-neutral-500{--un-border-opacity:1;border-color:rgb(115 115 115/var(--un-border-opacity))}.border-primary-100,[border~=primary-100]{--un-border-opacity:1;border-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/var(--un-border-opacity))80%,oklch(100% 0 360/var(--un-border-opacity)))}.border-primary-200,[border~="data-[state=checked]:primary-200"][data-state=checked]{--un-border-opacity:1;border-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/var(--un-border-opacity))}.border-primary-400,.dark .dark\:\[\&\:checked\+div\]\:border-primary-400:checked+div,.dark .dark\:border-primary-400{--un-border-opacity:1;border-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/var(--un-border-opacity))}.border-primary-500\/5{border-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.05)}.border-red-200{--un-border-opacity:1;border-color:rgb(254 202 202/var(--un-border-opacity))}.border-red-200\/30{border-color:#fecaca4d}.border-white,[border~=white]{--un-border-opacity:1;border-color:rgb(255 255 255/var(--un-border-opacity))}.dark .dark\:border-amber-800{--un-border-opacity:1;border-color:rgb(146 64 14/var(--un-border-opacity))}.dark .dark\:border-neutral-600,.dark [border~=dark\:neutral-600]{--un-border-opacity:1;border-color:rgb(82 82 82/var(--un-border-opacity))}.dark .dark\:border-neutral-700,.dark [border~=dark\:neutral-700],.dark [dark\:border-neutral-700=""]{--un-border-opacity:1;border-color:rgb(64 64 64/var(--un-border-opacity))}.dark .dark\:border-neutral-700\/30,.dark [border~="dark:neutral-700/30"]{border-color:#4040404d}.dark .dark\:border-neutral-800,.dark [border~=dark\:neutral-800],.dark [dark\:border-neutral-800=""],[border~=neutral-800]{--un-border-opacity:1;border-color:rgb(38 38 38/var(--un-border-opacity))}.dark .dark\:border-neutral-800\/25,.dark [border~="dark:neutral-800/25"]{border-color:#26262640}.dark .dark\:border-neutral-800\/30,.dark [border~="dark:neutral-800/30"]{border-color:#2626264d}.dark .dark\:border-neutral-900,.dark [border~=dark\:neutral-900]{--un-border-opacity:1;border-color:rgb(23 23 23/var(--un-border-opacity))}.dark .dark\:border-primary-600{--un-border-opacity:1;border-color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/var(--un-border-opacity))}.dark .dark\:border-primary-800,.dark [border~=dark\:primary-800]{--un-border-opacity:1;border-color:oklch(42% var(--chromatic-chroma-800)calc(var(--chromatic-hue) + 0)/var(--un-border-opacity))}.dark .dark\:border-primary-900,.dark [border~=dark\:primary-900]{--un-border-opacity:1;border-color:oklch(37% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + 0)/var(--un-border-opacity))}.dark .dark\:border-primary-900\/40{border-color:oklch(37% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + 0)/.4)}.dark .dark\:border-red-800{--un-border-opacity:1;border-color:rgb(153 27 27/var(--un-border-opacity))}.dark .dark\:border-red-900\/30{border-color:#7f1d1d4d}.dark [border~="dark:cyan-500/50"]{border-color:#06b6d480}.dark [border~="dark:neutral-700/60"]{border-color:#40404099}.dark [border~="dark:primary-400/20"]{border-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.2)}.dark [border~="dark:primary-500/50"]{border-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.5)}.dark [border~="dark:violet-500/50"]{border-color:#8b5cf680}[border~=cyan-200\/50]{border-color:#a5f3fc80}[border~=neutral-200\/50]{border-color:#e5e5e580}[border~=neutral-200\/60]{border-color:#e5e5e599}[border~=primary-200\/20]{border-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/.2)}[border~=primary-200\/50]{border-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/.5)}[border~=primary-300]{--un-border-opacity:1;border-color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/var(--un-border-opacity))}[border~=violet-200\/50]{border-color:#ddd6fe80}.peer:checked~.peer-checked\:after\:border-white:after{--un-border-opacity:1;border-color:rgb(255 255 255/var(--un-border-opacity))}[border~=focus-within\:neutral-800]:focus-within{--un-border-opacity:1;border-color:rgb(38 38 38/var(--un-border-opacity))}.dark .dark\:hover\:border-primary-400\/30:hover{border-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.3)}.dark .dark\:hover\:border-primary-700:hover{--un-border-opacity:1;border-color:oklch(49% var(--chromatic-chroma-700)calc(var(--chromatic-hue) + 0)/var(--un-border-opacity))}.dark [border~="dark:hover:primary-400/30"]:hover{border-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.3)}.hover\:border-primary-300:hover{--un-border-opacity:1;border-color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/var(--un-border-opacity))}.hover\:border-primary-500\/30:hover,[border~="hover:primary-500/30"]:hover{border-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.3)}.dark [border~="dark:focus:neutral-600"]:focus{--un-border-opacity:1;border-color:rgb(82 82 82/var(--un-border-opacity))}.dark [border~="dark:focus:neutral-700"]:focus{--un-border-opacity:1;border-color:rgb(64 64 64/var(--un-border-opacity))}.dark [border~="dark:focus:primary-400/50"]:focus{border-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.5)}[border~=focus\:neutral-200]:focus{--un-border-opacity:1;border-color:rgb(229 229 229/var(--un-border-opacity))}[border~=focus\:neutral-400]:focus{--un-border-opacity:1;border-color:rgb(163 163 163/var(--un-border-opacity))}[border~=focus\:primary-100]:focus{--un-border-opacity:1;border-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/var(--un-border-opacity))80%,oklch(100% 0 360/var(--un-border-opacity)))}[border~=focus\:primary-300]:focus{--un-border-opacity:1;border-color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/var(--un-border-opacity))}.rounded,[rounded=""]{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-full,[rounded-full=""]{border-radius:9999px}.rounded-lg,[rounded-lg=""],[rounded~=lg]{border-radius:.5rem}.rounded-md,[rounded-md=""]{border-radius:.375rem}.rounded-sm,[rounded-sm=""]{border-radius:.125rem}.rounded-xl,[rounded-xl=""]{border-radius:.75rem}[rounded~="[1lh]"]{border-radius:1lh}.before\:rounded-full:before,.after\:rounded-full:after{border-radius:9999px}.rounded-l-xl,[rounded-l-xl=""]{border-top-left-radius:.75rem;border-bottom-left-radius:.75rem}.rounded-r-xl,[rounded-r-xl=""]{border-top-right-radius:.75rem;border-bottom-right-radius:.75rem}.rounded-t-2xl{border-top-left-radius:1rem;border-top-right-radius:1rem}.rounded-t-xl,[rounded-t-xl=""]{border-top-left-radius:.75rem;border-top-right-radius:.75rem}.border-solid,[border~=solid]{border-style:solid}[b~=dashed],[border~=dashed]{border-style:dashed}.bg-amber-50{--un-bg-opacity:1;background-color:rgb(255 251 235/var(--un-bg-opacity))}.bg-black\/50,[bg~=black\/50]{background-color:#00000080}.bg-blue-50,[bg-blue-50=""]{--un-bg-opacity:1;background-color:rgb(239 246 255/var(--un-bg-opacity))}.bg-green-50,[bg-green-50=""]{--un-bg-opacity:1;background-color:rgb(240 253 244/var(--un-bg-opacity))}.bg-green-500,[bg-green-500=""],[bg~=green-500]{--un-bg-opacity:1;background-color:rgb(34 197 94/var(--un-bg-opacity))}.bg-lime-100\/60{background-color:#ecfccb99}.bg-neutral-100,[bg~=neutral-100]{--un-bg-opacity:1;background-color:rgb(245 245 245/var(--un-bg-opacity))}.bg-neutral-100\/55{background-color:#f5f5f58c}.bg-neutral-200,[bg-neutral-200=""],[bg~=neutral-200]{--un-bg-opacity:1;background-color:rgb(229 229 229/var(--un-bg-opacity))}.bg-neutral-200\/45{background-color:#e5e5e573}.bg-neutral-300,.dark [bg~=dark\:neutral-300],[bg~="data-[state=unchecked]:neutral-300"][data-state=unchecked]{--un-bg-opacity:1;background-color:rgb(212 212 212/var(--un-bg-opacity))}.bg-neutral-400,.dark [bg~=dark\:neutral-400],[bg~=neutral-400]{--un-bg-opacity:1;background-color:rgb(163 163 163/var(--un-bg-opacity))}.bg-neutral-50,[bg-neutral-50=""],[bg~=neutral-50]{--un-bg-opacity:1;background-color:rgb(250 250 250/var(--un-bg-opacity))}.bg-neutral-50\/70,[bg~=neutral-50\/70]{background-color:#fafafab3}.bg-neutral-600,.dark .dark\:bg-neutral-600{--un-bg-opacity:1;background-color:rgb(82 82 82/var(--un-bg-opacity))}.bg-neutral-800,.dark .dark\:bg-neutral-800,.dark [bg~="dark:data-[state=unchecked]:neutral-800"][data-state=unchecked],.dark [bg~=dark\:neutral-800],.dark [dark\:bg-neutral-800=""]{--un-bg-opacity:1;background-color:rgb(38 38 38/var(--un-bg-opacity))}.bg-orange-100\/60{background-color:#ffedd599}.bg-primary{--un-bg-opacity:1;background-color:oklch(62% var(--chromatic-chroma)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))}.bg-primary-100,[bg-primary-100=""],[bg~=primary-100]{--un-bg-opacity:1;background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))80%,oklch(100% 0 360/var(--un-bg-opacity)))}.bg-primary-100\/10{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.1)80%,#ffffff1a)}@supports (color:lab(0% 0 0)){.bg-primary-100\/10{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.1)80%,lab(100% 0 0/.1))}}.bg-primary-100\/100{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/1)80%,#fff)}@supports (color:lab(0% 0 0)){.bg-primary-100\/100{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/1)80%,lab(100% 0 0))}}.bg-primary-100\/20{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.2)80%,#fff3)}@supports (color:lab(0% 0 0)){.bg-primary-100\/20{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.2)80%,lab(100% 0 0/.2))}}.bg-primary-100\/30{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.3)80%,#ffffff4d)}@supports (color:lab(0% 0 0)){.bg-primary-100\/30{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.3)80%,lab(100% 0 0/.3))}}.bg-primary-100\/40{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.4)80%,#fff6)}@supports (color:lab(0% 0 0)){.bg-primary-100\/40{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.4)80%,lab(100% 0 0/.4))}}.bg-primary-100\/5{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.05)80%,#ffffff0d)}@supports (color:lab(0% 0 0)){.bg-primary-100\/5{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.05)80%,lab(100% 0 0/.05))}}.bg-primary-100\/50{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.5)80%,#ffffff80)}@supports (color:lab(0% 0 0)){.bg-primary-100\/50{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.5)80%,lab(100% 0 0/.5))}}.bg-primary-100\/60{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.6)80%,#fff9)}@supports (color:lab(0% 0 0)){.bg-primary-100\/60{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.6)80%,lab(100% 0 0/.6))}}.bg-primary-100\/70{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.7)80%,#ffffffb3)}@supports (color:lab(0% 0 0)){.bg-primary-100\/70{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.7)80%,lab(100% 0 0/.7))}}.bg-primary-100\/80{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.8)80%,#fffc)}@supports (color:lab(0% 0 0)){.bg-primary-100\/80{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.8)80%,lab(100% 0 0/.8))}}.bg-primary-100\/90{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.9)80%,#ffffffe6)}@supports (color:lab(0% 0 0)){.bg-primary-100\/90{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.9)80%,lab(100% 0 0/.9))}}.bg-primary-200,[bg-primary-200=""]{--un-bg-opacity:1;background-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))}.bg-primary-200\/10{background-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/.1)}.bg-primary-200\/100{background-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/1)}.bg-primary-200\/20,[bg~=primary-200\/20]{background-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/.2)}.bg-primary-200\/30{background-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/.3)}.bg-primary-200\/40{background-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/.4)}.bg-primary-200\/5{background-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/.05)}.bg-primary-200\/50{background-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/.5)}.bg-primary-200\/60{background-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/.6)}.bg-primary-200\/70{background-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/.7)}.bg-primary-200\/80{background-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/.8)}.bg-primary-200\/90{background-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/.9)}.bg-primary-300,[bg-primary-300=""]{--un-bg-opacity:1;background-color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))}.bg-primary-300\/10{background-color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/.1)}.bg-primary-300\/100{background-color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/1)}.bg-primary-300\/20{background-color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/.2)}.bg-primary-300\/30{background-color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/.3)}.bg-primary-300\/40{background-color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/.4)}.bg-primary-300\/5{background-color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/.05)}.bg-primary-300\/50,.dark .dark\:bg-primary-300\/50{background-color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/.5)}.bg-primary-300\/60{background-color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/.6)}.bg-primary-300\/70{background-color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/.7)}.bg-primary-300\/80{background-color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/.8)}.bg-primary-300\/90{background-color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/.9)}.bg-primary-400,.dark .dark\:bg-primary-400,.dark [bg~=dark\:primary-400],[bg-primary-400=""],[bg~="data-[state=checked]:primary-400"][data-state=checked],[bg~=primary-400]{--un-bg-opacity:1;background-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))}.bg-primary-400\/10{background-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.1)}.bg-primary-400\/100{background-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/1)}.bg-primary-400\/20,.dark [bg~="dark:primary-400/20"]{background-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.2)}.bg-primary-400\/30{background-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.3)}.bg-primary-400\/40{background-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.4)}.bg-primary-400\/5{background-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.05)}.bg-primary-400\/50{background-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.5)}.bg-primary-400\/60{background-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.6)}.bg-primary-400\/70{background-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.7)}.bg-primary-400\/80,.dark [bg~="data-[state=checked]:dark:primary-400/80"][data-state=checked]{background-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.8)}.bg-primary-400\/90{background-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.9)}.bg-primary-50,[bg-primary-50=""]{--un-bg-opacity:1;background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))30%,oklch(100% 0 360/var(--un-bg-opacity)))}.bg-primary-50\/10,.dark .dark\:bg-primary-50\/10{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.1)30%,#ffffff1a)}@supports (color:lab(0% 0 0)){.bg-primary-50\/10,.dark .dark\:bg-primary-50\/10{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.1)30%,lab(100% 0 0/.1))}}.bg-primary-50\/100{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/1)30%,#fff)}@supports (color:lab(0% 0 0)){.bg-primary-50\/100{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/1)30%,lab(100% 0 0))}}.bg-primary-50\/20{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.2)30%,#fff3)}@supports (color:lab(0% 0 0)){.bg-primary-50\/20{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.2)30%,lab(100% 0 0/.2))}}.bg-primary-50\/30{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.3)30%,#ffffff4d)}@supports (color:lab(0% 0 0)){.bg-primary-50\/30{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.3)30%,lab(100% 0 0/.3))}}.bg-primary-50\/40{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.4)30%,#fff6)}@supports (color:lab(0% 0 0)){.bg-primary-50\/40{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.4)30%,lab(100% 0 0/.4))}}.bg-primary-50\/5{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.05)30%,#ffffff0d)}@supports (color:lab(0% 0 0)){.bg-primary-50\/5{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.05)30%,lab(100% 0 0/.05))}}.bg-primary-50\/50,[bg~=primary-50\/50]{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.5)30%,#ffffff80)}@supports (color:lab(0% 0 0)){.bg-primary-50\/50,[bg~=primary-50\/50]{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.5)30%,lab(100% 0 0/.5))}}.bg-primary-50\/60{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.6)30%,#fff9)}@supports (color:lab(0% 0 0)){.bg-primary-50\/60{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.6)30%,lab(100% 0 0/.6))}}.bg-primary-50\/70{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.7)30%,#ffffffb3)}@supports (color:lab(0% 0 0)){.bg-primary-50\/70{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.7)30%,lab(100% 0 0/.7))}}.bg-primary-50\/80,[bg~=primary-50\/80]{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.8)30%,#fffc)}@supports (color:lab(0% 0 0)){.bg-primary-50\/80,[bg~=primary-50\/80]{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.8)30%,lab(100% 0 0/.8))}}.bg-primary-50\/90{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.9)30%,#ffffffe6)}@supports (color:lab(0% 0 0)){.bg-primary-50\/90{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.9)30%,lab(100% 0 0/.9))}}.bg-primary-500,.dark [bg~=dark\:primary-500],[bg-primary-500=""],[bg~=primary-500],.peer:checked~.peer-checked\:bg-primary-500{--un-bg-opacity:1;background-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))}.bg-primary-500\/10,[bg~=primary-500\/10]{background-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.1)}.bg-primary-500\/100{background-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/1)}.bg-primary-500\/15{background-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.15)}.bg-primary-500\/20,[bg~=primary-500\/20]{background-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.2)}.bg-primary-500\/30,[bg~=primary-500\/30]{background-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.3)}.bg-primary-500\/40,[bg~=primary-500\/40]{background-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.4)}.bg-primary-500\/5,[bg~=primary-500\/5]{background-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.05)}.bg-primary-500\/50,[bg~=primary-500\/50]{background-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.5)}.bg-primary-500\/60,[bg~=primary-500\/60]{background-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.6)}.bg-primary-500\/70,[bg~=primary-500\/70]{background-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.7)}.bg-primary-500\/80,[bg~=primary-500\/80]{background-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.8)}.bg-primary-500\/90,[bg~=primary-500\/90]{background-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.9)}.bg-primary-600,.dark .dark\:bg-primary-600,[bg-primary-600=""]{--un-bg-opacity:1;background-color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))}.bg-primary-600\/10{background-color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/.1)}.bg-primary-600\/100{background-color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/1)}.bg-primary-600\/20{background-color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/.2)}.bg-primary-600\/30{background-color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/.3)}.bg-primary-600\/40{background-color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/.4)}.bg-primary-600\/5{background-color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/.05)}.bg-primary-600\/50{background-color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/.5)}.bg-primary-600\/60{background-color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/.6)}.bg-primary-600\/70{background-color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/.7)}.bg-primary-600\/80{background-color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/.8)}.bg-primary-600\/90{background-color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/.9)}.bg-primary-700,.dark .dark\:bg-primary-700,.dark [dark\:bg-primary-700=""],[bg-primary-700=""]{--un-bg-opacity:1;background-color:oklch(49% var(--chromatic-chroma-700)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))}.bg-primary-700\/10{background-color:oklch(49% var(--chromatic-chroma-700)calc(var(--chromatic-hue) + 0)/.1)}.bg-primary-700\/100{background-color:oklch(49% var(--chromatic-chroma-700)calc(var(--chromatic-hue) + 0)/1)}.bg-primary-700\/20{background-color:oklch(49% var(--chromatic-chroma-700)calc(var(--chromatic-hue) + 0)/.2)}.bg-primary-700\/30,.dark .dark\:bg-primary-700\/30{background-color:oklch(49% var(--chromatic-chroma-700)calc(var(--chromatic-hue) + 0)/.3)}.bg-primary-700\/40{background-color:oklch(49% var(--chromatic-chroma-700)calc(var(--chromatic-hue) + 0)/.4)}.bg-primary-700\/5{background-color:oklch(49% var(--chromatic-chroma-700)calc(var(--chromatic-hue) + 0)/.05)}.bg-primary-700\/50{background-color:oklch(49% var(--chromatic-chroma-700)calc(var(--chromatic-hue) + 0)/.5)}.bg-primary-700\/60{background-color:oklch(49% var(--chromatic-chroma-700)calc(var(--chromatic-hue) + 0)/.6)}.bg-primary-700\/70{background-color:oklch(49% var(--chromatic-chroma-700)calc(var(--chromatic-hue) + 0)/.7)}.bg-primary-700\/80{background-color:oklch(49% var(--chromatic-chroma-700)calc(var(--chromatic-hue) + 0)/.8)}.bg-primary-700\/90{background-color:oklch(49% var(--chromatic-chroma-700)calc(var(--chromatic-hue) + 0)/.9)}.bg-primary-800,.dark [bg~=dark\:primary-800],[bg-primary-800=""]{--un-bg-opacity:1;background-color:oklch(42% var(--chromatic-chroma-800)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))}.bg-primary-800\/10{background-color:oklch(42% var(--chromatic-chroma-800)calc(var(--chromatic-hue) + 0)/.1)}.bg-primary-800\/100{background-color:oklch(42% var(--chromatic-chroma-800)calc(var(--chromatic-hue) + 0)/1)}.bg-primary-800\/20{background-color:oklch(42% var(--chromatic-chroma-800)calc(var(--chromatic-hue) + 0)/.2)}.bg-primary-800\/30{background-color:oklch(42% var(--chromatic-chroma-800)calc(var(--chromatic-hue) + 0)/.3)}.bg-primary-800\/40{background-color:oklch(42% var(--chromatic-chroma-800)calc(var(--chromatic-hue) + 0)/.4)}.bg-primary-800\/5{background-color:oklch(42% var(--chromatic-chroma-800)calc(var(--chromatic-hue) + 0)/.05)}.bg-primary-800\/50{background-color:oklch(42% var(--chromatic-chroma-800)calc(var(--chromatic-hue) + 0)/.5)}.bg-primary-800\/60{background-color:oklch(42% var(--chromatic-chroma-800)calc(var(--chromatic-hue) + 0)/.6)}.bg-primary-800\/70{background-color:oklch(42% var(--chromatic-chroma-800)calc(var(--chromatic-hue) + 0)/.7)}.bg-primary-800\/80{background-color:oklch(42% var(--chromatic-chroma-800)calc(var(--chromatic-hue) + 0)/.8)}.bg-primary-800\/90{background-color:oklch(42% var(--chromatic-chroma-800)calc(var(--chromatic-hue) + 0)/.9)}.bg-primary-900,.dark .dark\:bg-primary-900,[bg-primary-900=""]{--un-bg-opacity:1;background-color:oklch(37% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))}.bg-primary-900\/10,.dark .dark\:bg-primary-900\/10{background-color:oklch(37% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + 0)/.1)}.bg-primary-900\/100{background-color:oklch(37% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + 0)/1)}.bg-primary-900\/20,.dark .dark\:bg-primary-900\/20{background-color:oklch(37% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + 0)/.2)}.bg-primary-900\/30,.dark .dark\:bg-primary-900\/30{background-color:oklch(37% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + 0)/.3)}.bg-primary-900\/40,.dark .dark\:bg-primary-900\/40,.dark [bg~="dark:primary-900/40"]{background-color:oklch(37% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + 0)/.4)}.bg-primary-900\/5,.dark .dark\:bg-primary-900\/5{background-color:oklch(37% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + 0)/.05)}.bg-primary-900\/50{background-color:oklch(37% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + 0)/.5)}.bg-primary-900\/60{background-color:oklch(37% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + 0)/.6)}.bg-primary-900\/70{background-color:oklch(37% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + 0)/.7)}.bg-primary-900\/80{background-color:oklch(37% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + 0)/.8)}.bg-primary-900\/90{background-color:oklch(37% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + 0)/.9)}.bg-primary-950,.dark .dark\:bg-primary-950,[bg-primary-950=""]{--un-bg-opacity:1;background-color:oklch(29% var(--chromatic-chroma-950)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))}.bg-primary-950\/10{background-color:oklch(29% var(--chromatic-chroma-950)calc(var(--chromatic-hue) + 0)/.1)}.bg-primary-950\/100{background-color:oklch(29% var(--chromatic-chroma-950)calc(var(--chromatic-hue) + 0)/1)}.bg-primary-950\/20{background-color:oklch(29% var(--chromatic-chroma-950)calc(var(--chromatic-hue) + 0)/.2)}.bg-primary-950\/30{background-color:oklch(29% var(--chromatic-chroma-950)calc(var(--chromatic-hue) + 0)/.3)}.bg-primary-950\/40{background-color:oklch(29% var(--chromatic-chroma-950)calc(var(--chromatic-hue) + 0)/.4)}.bg-primary-950\/5{background-color:oklch(29% var(--chromatic-chroma-950)calc(var(--chromatic-hue) + 0)/.05)}.bg-primary-950\/50{background-color:oklch(29% var(--chromatic-chroma-950)calc(var(--chromatic-hue) + 0)/.5)}.bg-primary-950\/60{background-color:oklch(29% var(--chromatic-chroma-950)calc(var(--chromatic-hue) + 0)/.6)}.bg-primary-950\/70,.dark [bg~="dark:primary-950/70"]{background-color:oklch(29% var(--chromatic-chroma-950)calc(var(--chromatic-hue) + 0)/.7)}.bg-primary-950\/80{background-color:oklch(29% var(--chromatic-chroma-950)calc(var(--chromatic-hue) + 0)/.8)}.bg-primary-950\/90{background-color:oklch(29% var(--chromatic-chroma-950)calc(var(--chromatic-hue) + 0)/.9)}.bg-primary\/10{background-color:oklch(62% var(--chromatic-chroma)calc(var(--chromatic-hue) + 0)/.1)}.bg-primary\/100{background-color:oklch(62% var(--chromatic-chroma)calc(var(--chromatic-hue) + 0)/1)}.bg-primary\/20{background-color:oklch(62% var(--chromatic-chroma)calc(var(--chromatic-hue) + 0)/.2)}.bg-primary\/30{background-color:oklch(62% var(--chromatic-chroma)calc(var(--chromatic-hue) + 0)/.3)}.bg-primary\/40{background-color:oklch(62% var(--chromatic-chroma)calc(var(--chromatic-hue) + 0)/.4)}.bg-primary\/5{background-color:oklch(62% var(--chromatic-chroma)calc(var(--chromatic-hue) + 0)/.05)}.bg-primary\/50{background-color:oklch(62% var(--chromatic-chroma)calc(var(--chromatic-hue) + 0)/.5)}.bg-primary\/60{background-color:oklch(62% var(--chromatic-chroma)calc(var(--chromatic-hue) + 0)/.6)}.bg-primary\/70{background-color:oklch(62% var(--chromatic-chroma)calc(var(--chromatic-hue) + 0)/.7)}.bg-primary\/80{background-color:oklch(62% var(--chromatic-chroma)calc(var(--chromatic-hue) + 0)/.8)}.bg-primary\/90{background-color:oklch(62% var(--chromatic-chroma)calc(var(--chromatic-hue) + 0)/.9)}.bg-red-50,[bg-red-50=""]{--un-bg-opacity:1;background-color:rgb(254 242 242/var(--un-bg-opacity))}.bg-red-500{--un-bg-opacity:1;background-color:rgb(239 68 68/var(--un-bg-opacity))}.bg-red-500\/15{background-color:#ef444426}.bg-red900,.dark [dark\:bg-red-900=""]{--un-bg-opacity:1;background-color:rgb(127 29 29/var(--un-bg-opacity))}.bg-transparent,.dark [bg~=dark\:transparent],[bg-transparent=""],[bg~=transparent]{background-color:#0000}.bg-violet-100\/60{background-color:#ede9fe99}.bg-white,[bg-white=""],[bg~=white]{--un-bg-opacity:1;background-color:rgb(255 255 255/var(--un-bg-opacity))}.bg-white\/60,[bg~=white\/60]{background-color:#fff9}.bg-white\/80{background-color:#fffc}.bg-white\/90{background-color:#ffffffe6}.bg-yellow-500{--un-bg-opacity:1;background-color:rgb(234 179 8/var(--un-bg-opacity))}.dark .dark\:bg-amber-900\/20{background-color:#78350f33}.dark .dark\:bg-black\/30,.dark [bg~="dark:black/30"]{background-color:#0000004d}.dark .dark\:bg-black\/40{background-color:#0006}.dark .dark\:bg-black\/75{background-color:#000000bf}.dark .dark\:bg-blue-900\/30{background-color:#1e3a8a4d}.dark .dark\:bg-green-900\/30{background-color:#14532d4d}.dark .dark\:bg-lime-50\/10{background-color:#f7fee71a}.dark .dark\:bg-lime-900\/10{background-color:#3653141a}.dark .dark\:bg-neutral-500\/70{background-color:#737373b3}.dark .dark\:bg-neutral-700,.dark [bg~=dark\:neutral-700],.dark [dark\:bg-neutral-700=""],[bg~=neutral-700]{--un-bg-opacity:1;background-color:rgb(64 64 64/var(--un-bg-opacity))}.dark .dark\:bg-neutral-700\/50{background-color:#40404080}.dark .dark\:bg-neutral-700\/60{background-color:#40404099}.dark .dark\:bg-neutral-800\/50,.dark [bg~="dark:neutral-800/50"]{background-color:#26262680}.dark .dark\:bg-neutral-800\/70,.dark [bg~="dark:neutral-800/70"]{background-color:#262626b3}.dark .dark\:bg-neutral-900,.dark [bg~=dark\:neutral-900]{--un-bg-opacity:1;background-color:rgb(23 23 23/var(--un-bg-opacity))}.dark .dark\:bg-neutral-900\/20{background-color:#17171733}.dark .dark\:bg-neutral-900\/95{background-color:#171717f2}.dark .dark\:bg-orange-50\/10{background-color:#fff7ed1a}.dark .dark\:bg-orange-900\/10{background-color:#7c2d121a}.dark .dark\:bg-primary-800\/25{background-color:oklch(42% var(--chromatic-chroma-800)calc(var(--chromatic-hue) + 0)/.25)}.dark .dark\:bg-red-700\/30{background-color:#b91c1c4d}.dark .dark\:bg-red-900\/20{background-color:#7f1d1d33}.dark .dark\:bg-red-900\/30{background-color:#7f1d1d4d}.dark .dark\:bg-violet-50\/10{background-color:#f5f3ff1a}.dark .dark\:bg-violet-900\/10{background-color:#4c1d951a}.dark [bg~="dark:[#4e34b9]"]{--un-bg-opacity:1;background-color:rgb(78 52 185/var(--un-bg-opacity))}.dark [bg~="dark:[#676085]"]{--un-bg-opacity:1;background-color:rgb(103 96 133/var(--un-bg-opacity))}.dark [bg~="dark:[rgba(0,0,0,0.3)]"]{--un-bg-opacity:.3;background-color:rgba(0,0,0,var(--un-bg-opacity))}.dark [bg~="dark:black/10"]{background-color:#0000001a}.dark [bg~=dark\:blue-900],.dark [dark\:bg-blue-900=""]{--un-bg-opacity:1;background-color:rgb(30 58 138/var(--un-bg-opacity))}.dark [bg~=dark\:green-600]{--un-bg-opacity:1;background-color:rgb(22 163 74/var(--un-bg-opacity))}.dark [bg~="dark:neutral-100/80"],[bg~=neutral-100\/80]{background-color:#f5f5f5cc}.dark [bg~=dark\:neutral-500]{--un-bg-opacity:1;background-color:rgb(115 115 115/var(--un-bg-opacity))}.dark [bg~="dark:neutral-900/50"]{background-color:#17171780}.dark [bg~="dark:neutral-900/70"]{background-color:#171717b3}.dark [bg~=dark\:neutral-950]{--un-bg-opacity:1;background-color:rgb(10 10 10/var(--un-bg-opacity))}.dark [bg~="dark:neutral-950/80"]{background-color:#0a0a0acc}.dark [bg~="dark:orange-900/20"]{background-color:#7c2d1233}.dark [bg~=dark\:violet-800]{--un-bg-opacity:1;background-color:rgb(91 33 182/var(--un-bg-opacity))}.dark [dark\:bg-green-900=""]{--un-bg-opacity:1;background-color:rgb(20 83 45/var(--un-bg-opacity))}[bg~="[#cabeff]"]{--un-bg-opacity:1;background-color:rgb(202 190 255/var(--un-bg-opacity))}[bg~="[#e6e1fc]"]{--un-bg-opacity:1;background-color:rgb(230 225 252/var(--un-bg-opacity))}[bg~=\$bg-color]{background-color:var(--bg-color)}[bg~=black\/0]{background-color:#0000}[bg~=black\/4]{background-color:#0000000a}[bg~=blue-100]{--un-bg-opacity:1;background-color:rgb(219 234 254/var(--un-bg-opacity))}[bg~=emerald-500]{--un-bg-opacity:1;background-color:rgb(16 185 129/var(--un-bg-opacity))}[bg~=gray-200\/30]{background-color:#e5e7eb4d}[bg~=inherit]{background-color:inherit }[bg~=neutral-100\/50]{background-color:#f5f5f580}[bg~=neutral-200\/50]{background-color:#e5e5e580}[bg~=neutral-50\/50]{background-color:#fafafa80}[bg~=orange-50]{--un-bg-opacity:1;background-color:rgb(255 247 237/var(--un-bg-opacity))}[bg~=violet-500]{--un-bg-opacity:1;background-color:rgb(139 92 246/var(--un-bg-opacity))}[bg~=white\/70]{background-color:#ffffffb3}.dark .dark\:hover\:bg-black\/40:hover{background-color:#0006}.dark .dark\:hover\:bg-neutral-600:hover{--un-bg-opacity:1;background-color:rgb(82 82 82/var(--un-bg-opacity))}.dark .dark\:hover\:bg-neutral-700\/80:hover{background-color:#404040cc}.dark .dark\:hover\:bg-neutral-800:hover{--un-bg-opacity:1;background-color:rgb(38 38 38/var(--un-bg-opacity))}.dark .dark\:hover\:bg-primary-700\/40:hover{background-color:oklch(49% var(--chromatic-chroma-700)calc(var(--chromatic-hue) + 0)/.4)}.dark .dark\:hover\:bg-red-700\/40:hover{background-color:#b91c1c66}.dark .hover\:dark\:bg-neutral-800\/50:hover{background-color:#26262680}.dark [bg~="dark:hover:neutral-800"]:hover{--un-bg-opacity:1;background-color:rgb(38 38 38/var(--un-bg-opacity))}.dark [bg~="dark:hover:white/30"]:hover{background-color:#ffffff4d}.dark [hover~="dark:bg-black/40"]:hover{background-color:#0006}.dark [hover~=dark\:bg-neutral-700]:hover{--un-bg-opacity:1;background-color:rgb(64 64 64/var(--un-bg-opacity))}.dark [hover~="dark:bg-neutral-700/50"]:hover{background-color:#40404080}.group:hover [bg~="group-hover:black/20"]{background-color:#0003}.hover\:bg-neutral-100:hover{--un-bg-opacity:1;background-color:rgb(245 245 245/var(--un-bg-opacity))}.hover\:bg-neutral-300:hover{--un-bg-opacity:1;background-color:rgb(212 212 212/var(--un-bg-opacity))}.hover\:bg-neutral-400:hover{--un-bg-opacity:1;background-color:rgb(163 163 163/var(--un-bg-opacity))}.hover\:bg-neutral-400\/20:hover{background-color:#a3a3a333}.hover\:bg-neutral-50\/50:hover{background-color:#fafafa80}.hover\:bg-primary-500\/20:hover{background-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.2)}.hover\:bg-primary-600:hover{--un-bg-opacity:1;background-color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))}.hover\:bg-red-500\/20:hover{background-color:#ef444433}.hover\:bg-white\/80:hover{background-color:#fffc}[bg~=hover\:emerald-600]:hover{--un-bg-opacity:1;background-color:rgb(5 150 105/var(--un-bg-opacity))}[bg~=hover\:neutral-200]:hover{--un-bg-opacity:1;background-color:rgb(229 229 229/var(--un-bg-opacity))}[bg~=hover\:neutral-50]:hover{--un-bg-opacity:1;background-color:rgb(250 250 250/var(--un-bg-opacity))}[hover\:bg-neutral-300=""]:hover{--un-bg-opacity:1;background-color:rgb(212 212 212/var(--un-bg-opacity))}[hover\:bg-primary-600=""]:hover{--un-bg-opacity:1;background-color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))}[hover~=bg-neutral-200]:hover{--un-bg-opacity:1;background-color:rgb(229 229 229/var(--un-bg-opacity))}[hover~=bg-white\/80]:hover{background-color:#fffc}.dark [bg~="dark:focus:neutral-900"]:focus{--un-bg-opacity:1;background-color:rgb(23 23 23/var(--un-bg-opacity))}[bg~=focus\:neutral-50]:focus{--un-bg-opacity:1;background-color:rgb(250 250 250/var(--un-bg-opacity))}.active\:bg-neutral-400\/30:active{background-color:#a3a3a34d}.active\:bg-neutral-50\/90:active{background-color:#fafafae6}.active\:bg-primary-500\/30:active{background-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.3)}.active\:bg-red-500\/30:active{background-color:#ef44444d}.dark .active\:dark\:bg-neutral-800\/90:active{background-color:#262626e6}.dark .dark\:active\:bg-neutral-700\/60:active{background-color:#40404099}.dark .dark\:active\:bg-primary-700\/30:active{background-color:oklch(49% var(--chromatic-chroma-700)calc(var(--chromatic-hue) + 0)/.3)}.dark .dark\:active\:bg-red-700\/30:active{background-color:#b91c1c4d}.dark [bg~="dark:active:neutral-700"]:active{--un-bg-opacity:1;background-color:rgb(64 64 64/var(--un-bg-opacity))}[bg~=active\:gray-50]:active{--un-bg-opacity:1;background-color:rgb(249 250 251/var(--un-bg-opacity))}[bg~=active\:neutral-300]:active{--un-bg-opacity:1;background-color:rgb(212 212 212/var(--un-bg-opacity))}.dark [bg~="dark:disabled:neutral-900"]:disabled{--un-bg-opacity:1;background-color:rgb(23 23 23/var(--un-bg-opacity))}[bg~=disabled\:neutral-100]:disabled{--un-bg-opacity:1;background-color:rgb(245 245 245/var(--un-bg-opacity))}.before\:bg-lime-400:before{--un-bg-opacity:1;background-color:rgb(163 230 53/var(--un-bg-opacity))}.before\:bg-orange-400:before{--un-bg-opacity:1;background-color:rgb(251 146 60/var(--un-bg-opacity))}.before\:bg-primary-400:before{--un-bg-opacity:1;background-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))}.before\:bg-violet-400:before{--un-bg-opacity:1;background-color:rgb(167 139 250/var(--un-bg-opacity))}.dark .before\:dark\:bg-lime-900:before{--un-bg-opacity:1;background-color:rgb(54 83 20/var(--un-bg-opacity))}.dark .before\:dark\:bg-orange-900:before{--un-bg-opacity:1;background-color:rgb(124 45 18/var(--un-bg-opacity))}.dark .before\:dark\:bg-primary-900:before{--un-bg-opacity:1;background-color:oklch(37% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))}.dark .before\:dark\:bg-violet-900:before{--un-bg-opacity:1;background-color:rgb(76 29 149/var(--un-bg-opacity))}.after\:bg-white:after{--un-bg-opacity:1;background-color:rgb(255 255 255/var(--un-bg-opacity))}.dark .dark\:from-neutral-800,.dark [dark\:from-neutral-800=""]{--un-gradient-from-position:0%;--un-gradient-from:rgb(38 38 38/var(--un-from-opacity,1))var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:#26262600 var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),var(--un-gradient-to)}.dark .dark\:from-primary-400\/0{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),var(--un-gradient-to)}.dark .dark\:from-primary-400\/20{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.2)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),var(--un-gradient-to)}.from-neutral-50,[from-neutral-50=""]{--un-gradient-from-position:0%;--un-gradient-from:rgb(250 250 250/var(--un-from-opacity,1))var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:#fafafa00 var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),var(--un-gradient-to)}.from-primary-500{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/var(--un-from-opacity,1))var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),var(--un-gradient-to)}.from-primary-500\/0{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),var(--un-gradient-to)}.from-primary-500\/20,.before\:from-primary-500\/20:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.2)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),var(--un-gradient-to)}.dark .before\:dark\:from-primary-400\/20:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.2)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),var(--un-gradient-to)}.dark [before~="dark:from-primary-400/0"]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),var(--un-gradient-to)}.dark [hover~="before:dark:from-primary-400/20"]:hover:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.2)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),var(--un-gradient-to)}[before~=from-primary-500\/0]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),var(--un-gradient-to)}[hover~="before:from-primary-500/20"]:hover:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.2)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),var(--un-gradient-to)}.dark .dark\:via-primary-400\/10{--un-gradient-via-position:50%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/0);--un-gradient-stops:var(--un-gradient-from),oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.1)var(--un-gradient-via-position),var(--un-gradient-to)}.via-primary-500\/10,.before\:via-primary-500\/10:before{--un-gradient-via-position:50%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/0);--un-gradient-stops:var(--un-gradient-from),oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.1)var(--un-gradient-via-position),var(--un-gradient-to)}.dark .before\:dark\:via-primary-400\/10:before,.dark [hover~="before:dark:via-primary-400/10"]:hover:before{--un-gradient-via-position:50%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/0);--un-gradient-stops:var(--un-gradient-from),oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.1)var(--un-gradient-via-position),var(--un-gradient-to)}[hover~="before:via-primary-500/10"]:hover:before{--un-gradient-via-position:50%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/0);--un-gradient-stops:var(--un-gradient-from),oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.1)var(--un-gradient-via-position),var(--un-gradient-to)}.dark .dark\:to-neutral-900{--un-gradient-to-position:100%;--un-gradient-to:rgb(23 23 23/var(--un-to-opacity,1))var(--un-gradient-to-position)}.dark .dark\:to-primary-400\/0{--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position)}.dark .dark\:to-transparent,.to-transparent{--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position)}.to-neutral-100,[to-neutral-100=""]{--un-gradient-to-position:100%;--un-gradient-to:rgb(245 245 245/var(--un-to-opacity,1))var(--un-gradient-to-position)}.to-primary-400{--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/var(--un-to-opacity,1))var(--un-gradient-to-position)}.to-primary-500\/0{--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position)}.before\:to-transparent:before,.dark .before\:dark\:to-transparent:before{--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position)}.dark [before~="dark:to-primary-400/0"]:before{--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position)}.dark [hover~="before:dark:to-transparent"]:hover:before{--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position)}[before~=to-primary-500\/0]:before{--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position)}[hover~=before\:to-transparent]:hover:before{--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position)}.bg-gradient-to-b,[bg-gradient-to-b=""]{--un-gradient-shape:to bottom in oklch;--un-gradient:var(--un-gradient-shape),var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient))}.bg-gradient-to-r,.before\:bg-gradient-to-r:before,[before~=bg-gradient-to-r]:before,[hover~=before\:bg-gradient-to-r]:hover:before{--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape),var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient))}.bg-clip-text{-webkit-background-clip:text;background-clip:text}.dark .dark\:fill-neutral-800,.dark [dark\:fill-neutral-800=""]{--un-fill-opacity:1;fill:rgb(38 38 38/var(--un-fill-opacity))}.fill-white,[fill-white=""]{--un-fill-opacity:1;fill:rgb(255 255 255/var(--un-fill-opacity))}[stroke-width~="0.5"]{stroke-width:.5px}[stroke-width~="1.5"]{stroke-width:1.5px}[stroke-width~="2"]{stroke-width:2px}[stroke~="163"]{stroke-width:163px}[stroke~="175"]{stroke-width:175px}.object-cover,[object-cover=""]{object-fit:cover}.object-contain,[object-contain=""]{object-fit:contain}.p-1,[p-1=""]{padding:.25rem}.p-1\.5,[p-1\.5=""]{padding:.375rem}.p-2,[p-2=""],[p~="2"]{padding:.5rem}.p-2\.5,[p~="2.5"]{padding:.625rem}.p-3,[p-3=""]{padding:.75rem}.p-4,[p-4=""]{padding:1rem}.p-5,[p-5=""]{padding:1.25rem}.p-6{padding:1.5rem}.p-8,[p-8=""]{padding:2rem}.px,.px-4,[px-4=""],[px=""]{padding-left:1rem;padding-right:1rem}.px-0{padding-left:0;padding-right:0}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2,.px2,[px-2=""],[px~="2"],[px2=""]{padding-left:.5rem;padding-right:.5rem}.px-3,[px-3=""]{padding-left:.75rem;padding-right:.75rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py,.py-4,[py-4=""],[py~="4"]{padding-top:1rem;padding-bottom:1rem}.py-\.5,.py-0\.5,[py-\.5=""],[py-0\.5=""]{padding-top:.125rem;padding-bottom:.125rem}.py-0{padding-top:0;padding-bottom:0}.py-1,.py1,[py-1=""],[py1=""]{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5,[py-1\.5=""]{padding-top:.375rem;padding-bottom:.375rem}.py-2,[py-2=""]{padding-top:.5rem;padding-bottom:.5rem}.py-3,[py-3=""]{padding-top:.75rem;padding-bottom:.75rem}.pb-0{padding-bottom:0}.pb-12,[pb-12=""]{padding-bottom:3rem}.pb-2,[pb-2=""]{padding-bottom:.5rem}.pb-3,[pb-3=""]{padding-bottom:.75rem}.pb-4,[pb-4=""]{padding-bottom:1rem}.pb-6,[pb-6=""]{padding-bottom:1.5rem}.pl,.pl-4,[pl-4=""]{padding-left:1rem}.pl-10{padding-left:2.5rem}.pl-3,[pl-3=""]{padding-left:.75rem}.pl-5,[pl-5=""]{padding-left:1.25rem}.pr-\[20px\]{padding-right:20px}.pr-1,[pr-1=""]{padding-right:.25rem}.pr-3,[pr-3=""]{padding-right:.75rem}.pr-4,[pr-4=""]{padding-right:1rem}.pt,.pt-4,[pt-4=""]{padding-top:1rem}.pt-0{padding-top:0}.pt-1,[pt-1=""]{padding-top:.25rem}.pt-10,[pt-10=""]{padding-top:2.5rem}.pt-14,[pt-14=""]{padding-top:3.5rem}.pt-2,[pt-2=""]{padding-top:.5rem}.pt-3{padding-top:.75rem}.text-center,[text-center=""],[text~=center]{text-align:center}.text-left,[text-left=""]{text-align:left}.text-wrap,[text-wrap=""]{text-wrap:wrap}.text-nowrap,[text-nowrap=""]{text-wrap:nowrap}.text-\[10px\]{font-size:10px}.text-2xl,[text-2xl=""],[text~="2xl"]{font-size:1.5rem;line-height:2rem}.text-3xl,[text-3xl=""]{font-size:1.875rem;line-height:2.25rem}.text-5xl,[text-5xl=""]{font-size:3rem;line-height:1}.text-6xl,[text-6xl=""]{font-size:3.75rem;line-height:1}.text-base,[text-base=""],[text~=base]{font-size:1rem;line-height:1.5rem}.text-lg,[text-lg=""],[text~=lg]{font-size:1.125rem;line-height:1.75rem}.text-sm,[text-sm=""],[text~=sm]{font-size:.875rem;line-height:1.25rem}.text-xl,[text-xl=""]{font-size:1.25rem;line-height:1.75rem}.text-xs,[text-xs=""],[text~=xs]{font-size:.75rem;line-height:1rem}[text~="4xl"]{font-size:2.25rem;line-height:2.5rem}[text~="60"]{font-size:15rem}[default-text~="2"]:default{font-size:.5rem}.dark .dark\:text-amber-300{--un-text-opacity:1;color:rgb(252 211 77/var(--un-text-opacity))}.dark .dark\:text-amber-400{--un-text-opacity:1;color:rgb(251 191 36/var(--un-text-opacity))}.dark .dark\:text-blue-300{--un-text-opacity:1;color:rgb(147 197 253/var(--un-text-opacity))}.dark .dark\:text-green-300{--un-text-opacity:1;color:rgb(134 239 172/var(--un-text-opacity))}.dark .dark\:text-green-400,.text-green{--un-text-opacity:1;color:rgb(74 222 128/var(--un-text-opacity))}.dark .dark\:text-lime-400{--un-text-opacity:1;color:rgb(163 230 53/var(--un-text-opacity))}.dark .dark\:text-neutral-100,.dark [text~=dark\:neutral-100],[text~=neutral-100]{--un-text-opacity:1;color:rgb(245 245 245/var(--un-text-opacity))}.dark .dark\:text-neutral-100\/80{color:#f5f5f5cc}.dark .dark\:text-neutral-200,.dark [dark\:text-neutral-200=""],.dark [text~=dark\:neutral-200]{--un-text-opacity:1;color:rgb(229 229 229/var(--un-text-opacity))}.dark .dark\:text-neutral-300,.dark [dark\:text-neutral-300=""],.dark [text~=dark\:neutral-300],[text~=neutral-300]{--un-text-opacity:1;color:rgb(212 212 212/var(--un-text-opacity))}.dark .dark\:text-neutral-400,.dark [dark\:text-neutral-400=""],.dark [text~=dark\:neutral-400],.text-neutral-400,[text-neutral-400=""],[text~=neutral-400]{--un-text-opacity:1;color:rgb(163 163 163/var(--un-text-opacity))}.dark .dark\:text-neutral-500,.dark [text~=dark\:neutral-500],.text-neutral-500,[text-neutral-500=""],[text~=neutral-500]{--un-text-opacity:1;color:rgb(115 115 115/var(--un-text-opacity))}.dark .dark\:text-neutral-600,.dark [text~=dark\:neutral-600],.text-neutral-600,[text~=neutral-600]{--un-text-opacity:1;color:rgb(82 82 82/var(--un-text-opacity))}.dark .dark\:text-neutral-600\/20,.dark [text~="dark:neutral-600/20"]{color:#52525233}.dark .dark\:text-orange-400,.text-orange{--un-text-opacity:1;color:rgb(251 146 60/var(--un-text-opacity))}.dark .dark\:color-primary-100,.dark .dark\:text-primary-100,.dark [dark\:color-primary-100=""]{--un-text-opacity:1;color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity))80%,oklch(100% 0 360/var(--un-text-opacity)))}.dark .dark\:text-primary-300,.dark [text~=dark\:primary-300],.text-primary-300,[text~=primary-300]{--un-text-opacity:1;color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity))}.dark .dark\:text-primary-300\/80{color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/.8)}.color-primary-400,.dark .dark\:text-primary-400,.dark [text~=dark\:primary-400],.text-primary-400,[color-primary-400=""]{--un-text-opacity:1;color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity))}.dark .dark\:text-primary-500,.text-primary-500,[text~=primary-500]{--un-text-opacity:1;color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity))}.dark .dark\:text-primary-600,.text-primary-600,[text~=primary-600]{--un-text-opacity:1;color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity))}.dark .dark\:text-red-100{--un-text-opacity:1;color:rgb(254 226 226/var(--un-text-opacity))}.dark .dark\:text-red-300{--un-text-opacity:1;color:rgb(252 165 165/var(--un-text-opacity))}.dark .dark\:text-red-400,.text-red{--un-text-opacity:1;color:rgb(248 113 113/var(--un-text-opacity))}.dark .dark\:text-slate-100{--un-text-opacity:1;color:rgb(241 245 249/var(--un-text-opacity))}.dark .dark\:text-violet-400{--un-text-opacity:1;color:rgb(167 139 250/var(--un-text-opacity))}.dark .dark\:text-white,.text-white,[text-white=""],[text~=white]{--un-text-opacity:1;color:rgb(255 255 255/var(--un-text-opacity))}.dark [text~="dark:cyan-600/90"]{color:#0891b2e6}.dark [text~=dark\:gray-200]{--un-text-opacity:1;color:rgb(229 231 235/var(--un-text-opacity))}.dark [text~="dark:neutral-100/65"]{color:#f5f5f5a6}.dark [text~="dark:neutral-600/50"]{color:#52525280}.dark [text~=dark\:neutral-900]{--un-text-opacity:1;color:rgb(23 23 23/var(--un-text-opacity))}.dark [text~=dark\:orange-500],.text-orange-500{--un-text-opacity:1;color:rgb(249 115 22/var(--un-text-opacity))}.dark [text~="dark:pink-300/90"]{color:#f9a8d4e6}.dark [text~="dark:primary-300/50"]{color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/.5)}.dark [text~="dark:primary-600/90"]{color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/.9)}.dark [text~="dark:violet-600/90"]{color:#7c3aede6}.text-amber-500{--un-text-opacity:1;color:rgb(245 158 11/var(--un-text-opacity))}.text-amber-600{--un-text-opacity:1;color:rgb(217 119 6/var(--un-text-opacity))}.text-amber-700{--un-text-opacity:1;color:rgb(180 83 9/var(--un-text-opacity))}.text-black,[text-black=""]{--un-text-opacity:1;color:rgb(0 0 0/var(--un-text-opacity))}.text-blue-500{--un-text-opacity:1;color:rgb(59 130 246/var(--un-text-opacity))}.text-blue-700,[text-blue-700=""]{--un-text-opacity:1;color:rgb(29 78 216/var(--un-text-opacity))}.text-green-600{--un-text-opacity:1;color:rgb(22 163 74/var(--un-text-opacity))}.text-green-700,[text-green-700=""]{--un-text-opacity:1;color:rgb(21 128 61/var(--un-text-opacity))}.text-lime-500{--un-text-opacity:1;color:rgb(132 204 22/var(--un-text-opacity))}.text-neutral-200\/50,[text~=neutral-200\/50]{color:#e5e5e580}.text-neutral-400\/50,[text~=neutral-400\/50]{color:#a3a3a380}.text-neutral-500\/50,[text~=neutral-500\/50]{color:#73737380}.text-neutral-700,[text-neutral-700=""],[text~=neutral-700]{--un-text-opacity:1;color:rgb(64 64 64/var(--un-text-opacity))}.text-neutral-800{--un-text-opacity:1;color:rgb(38 38 38/var(--un-text-opacity))}.text-neutral-900\/80{color:#171717cc}.text-neutral-950{--un-text-opacity:1;color:rgb(10 10 10/var(--un-text-opacity))}.text-primary-600\/80{color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/.8)}.text-primary-700{--un-text-opacity:1;color:oklch(49% var(--chromatic-chroma-700)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity))}.text-primary-800{--un-text-opacity:1;color:oklch(42% var(--chromatic-chroma-800)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity))}.text-primary-950{--un-text-opacity:1;color:oklch(29% var(--chromatic-chroma-950)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity))}.text-purple{--un-text-opacity:1;color:rgb(192 132 252/var(--un-text-opacity))}.text-red-500{--un-text-opacity:1;color:rgb(239 68 68/var(--un-text-opacity))}.text-red-700,[text-red-700=""]{--un-text-opacity:1;color:rgb(185 28 28/var(--un-text-opacity))}.text-red-950{--un-text-opacity:1;color:rgb(69 10 10/var(--un-text-opacity))}.text-slate-700{--un-text-opacity:1;color:rgb(51 65 85/var(--un-text-opacity))}.text-transparent{color:#0000}.text-violet-500,[text-violet-500=""]{--un-text-opacity:1;color:rgb(139 92 246/var(--un-text-opacity))}[text~=cyan-400\/90]{color:#22d3eee6}[text~=gray-700]{--un-text-opacity:1;color:rgb(55 65 81/var(--un-text-opacity))}[text~=orange-700]{--un-text-opacity:1;color:rgb(194 65 12/var(--un-text-opacity))}[text~=pink-400]{--un-text-opacity:1;color:rgb(244 114 182/var(--un-text-opacity))}[text~=primary-400\/90]{color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.9)}[text~=violet-400\/90]{color:#a78bfae6}.dark .dark\:hover\:text-neutral-300:hover{--un-text-opacity:1;color:rgb(212 212 212/var(--un-text-opacity))}.dark [hover~="dark:text-primary-300/80"]:hover{color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/.8)}.dark [text~="dark:hover:neutral-200"]:hover{--un-text-opacity:1;color:rgb(229 229 229/var(--un-text-opacity))}.dark [text~="dark:hover:neutral-800"]:hover{--un-text-opacity:1;color:rgb(38 38 38/var(--un-text-opacity))}.dark [text~="dark:hover:primary-500"]:hover{--un-text-opacity:1;color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity))}.hover\:text-neutral-700:hover{--un-text-opacity:1;color:rgb(64 64 64/var(--un-text-opacity))}[hover~=text-primary-600\/80]:hover{color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/.8)}[text~=hover\:neutral-600]:hover{--un-text-opacity:1;color:rgb(82 82 82/var(--un-text-opacity))}[text~=hover\:primary-500]:hover{--un-text-opacity:1;color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity))}[text~=hover\:primary-600]:hover{--un-text-opacity:1;color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity))}.dark [text~="dark:disabled:neutral-600"]:disabled{--un-text-opacity:1;color:rgb(82 82 82/var(--un-text-opacity))}[text~=disabled\:neutral-400]:disabled,.dark [text~="placeholder:dark:hover:neutral-400"]:hover::placeholder{--un-text-opacity:1;color:rgb(163 163 163/var(--un-text-opacity))}.dark [text~="placeholder:dark:hover:primary-500"]:hover::placeholder{--un-text-opacity:1;color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity))}.dark [text~="placeholder:dark:neutral-300"]::placeholder{--un-text-opacity:1;color:rgb(212 212 212/var(--un-text-opacity))}.dark [text~="placeholder:dark:primary-300/50"]::placeholder{color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/.5)}[text~="placeholder:hover:neutral-500"]:hover::placeholder{--un-text-opacity:1;color:rgb(115 115 115/var(--un-text-opacity))}[text~="placeholder:hover:primary-500"]:hover::placeholder{--un-text-opacity:1;color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity))}[text~=placeholder\:neutral-400]::placeholder{--un-text-opacity:1;color:rgb(163 163 163/var(--un-text-opacity))}[text~=placeholder\:primary-400]::placeholder{--un-text-opacity:1;color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity))}.font-bold,[font-bold=""]{font-weight:700}.font-medium,[font-medium=""]{font-weight:500}.font-normal,[font-normal=""]{font-weight:400}.font-semibold,[font-semibold=""]{font-weight:600}.leading-10,.lh-10{line-height:2.5rem}[leading~="[0.75]"]{line-height:.75}[leading~="[1]"]{line-height:1}.font-cuteen,[font-cuteen=""]{font-family:Sniglet}.font-jura,[font-jura=""]{font-family:Jura}.font-mono,[font-mono=""]{font-family:DM Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.font-quicksand,[font-quicksand=""]{font-family:Quicksand}.font-sans,[font-sans=""]{font-family:DM Sans,DM Sans Variant,ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.font-sans-rounded,[font-sans-rounded=""]{font-family:Comfortaa Variable,Comfortaa,DM Sans,ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.font-italic,.italic,[font-italic=""]{font-style:italic}.decoration-underline,.underline,[decoration-underline=""],[underline=""]{text-decoration-line:underline}.decoration-dotted,[decoration-dotted=""]{text-decoration-style:dotted}.decoration-dashed,[decoration-dashed=""]{text-decoration-style:dashed}.tab,[aria-checked~=tab][aria-checked=true],[tab=""],[checked~=tab]:checked{tab-size:4}.text-stroke-1,[text-stroke-1=""]{-webkit-text-stroke-width:1px}.text-shadow{--un-text-shadow:0 0 1px var(--un-text-shadow-color,#0003),0 0 1px var(--un-text-shadow-color,#0100051a);text-shadow:var(--un-text-shadow)}.write-vertical-left,[write-vertical-left=""]{writing-mode:vertical-lr}.\[\&\:checked\+div_\.radio-dot\]\:opacity-100:checked+div .radio-dot,.opacity-100,.group:hover .group-hover\:opacity-100,.group:hover [group-hover\:opacity-100=""]{opacity:1}.op-0,.opacity-0,[op-0=""],[opacity-0=""]{opacity:0}.op50,.opacity-50,[op50=""]{opacity:.5}.opacity-25{opacity:.25}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-95,[opacity-95=""]{opacity:.95}.\[\&_\.round-range-tooltip\]\:hover\:opacity-100:hover .round-range-tooltip,[hover~=opacity-100]:hover{opacity:1}.disabled\:opacity-50:disabled,[disabled\:opacity-50=""]:disabled{opacity:.5}.before\:opacity-100:before{opacity:1}[before~=opacity-0]:before{opacity:0}[hover~=before\:opacity-100]:hover:before{opacity:1}.mix-blend-screen,[mix-blend-screen=""]{mix-blend-mode:screen}.dark .dark\:shadow-lg,.shadow-lg{--un-shadow:var(--un-shadow-inset)0 10px 15px -3px var(--un-shadow-color,#0000001a),var(--un-shadow-inset)0 4px 6px -4px var(--un-shadow-color,#0000001a);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.dark [shadow~=dark\:none]{--un-shadow:0 0 var(--un-shadow-color,#0000);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.shadow{--un-shadow:var(--un-shadow-inset)0 1px 3px 0 var(--un-shadow-color,#0000001a),var(--un-shadow-inset)0 1px 2px -1px var(--un-shadow-color,#0000001a);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.shadow-green-500\/50{--un-shadow-color:#22c55e80 }.shadow-md,[shadow-md=""],[shadow~=md]{--un-shadow:var(--un-shadow-inset)0 4px 6px -1px var(--un-shadow-color,#0000001a),var(--un-shadow-inset)0 2px 4px -2px var(--un-shadow-color,#0000001a);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.shadow-sm,[shadow-sm=""],[shadow~=sm]{--un-shadow:var(--un-shadow-inset)0 1px 2px 0 var(--un-shadow-color,#0000000d);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.shadow-xl,[shadow-xl=""]{--un-shadow:var(--un-shadow-inset)0 20px 25px -5px var(--un-shadow-color,#0000001a),var(--un-shadow-inset)0 8px 10px -6px var(--un-shadow-color,#0000001a);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.shadow-yellow-500\/30{--un-shadow-color:#eab3084d }[shadow~=cyan-200\/20]{--un-shadow-color:#a5f3fc33 }[shadow~=cyan-200\/50]{--un-shadow-color:#a5f3fc80 }[shadow~=primary-200\/20]{--un-shadow-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/.2)}[shadow~=primary-200\/50]{--un-shadow-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/.5)}[shadow~=violet-200\/20]{--un-shadow-color:#ddd6fe33 }[shadow~=violet-200\/50]{--un-shadow-color:#ddd6fe80 }.focus-within\:shadow-neutral-800:focus-within{--un-shadow-opacity:1;--un-shadow-color:rgb(38 38 38/var(--un-shadow-opacity))}[shadow~="focus-within:[0_0_0_1px]"]:focus-within{--un-shadow:0 0 0 1px var(--un-shadow-color);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.dark [hover~=dark\:shadow-lg]:hover{--un-shadow:var(--un-shadow-inset)0 10px 15px -3px var(--un-shadow-color,#0000001a),var(--un-shadow-inset)0 4px 6px -4px var(--un-shadow-color,#0000001a);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}[hover~=shadow-md]:hover{--un-shadow:var(--un-shadow-inset)0 4px 6px -1px var(--un-shadow-color,#0000001a),var(--un-shadow-inset)0 2px 4px -2px var(--un-shadow-color,#0000001a);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.outline{outline-style:solid}.outline-none,[outline-none=""],[outline~=focus-within\:none]:focus-within,.focus\:outline-none:focus{outline-offset:2px;outline:2px solid #0000}.ring-2,.focus\:ring-2:focus{--un-ring-width:2px;--un-ring-offset-shadow:var(--un-ring-inset)0 0 0 var(--un-ring-offset-width)var(--un-ring-offset-color);--un-ring-shadow:var(--un-ring-inset)0 0 0 calc(var(--un-ring-width) + var(--un-ring-offset-width))var(--un-ring-color);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.dark .dark\:ring-neutral-600\/30{--un-ring-color:#5252524d }.dark .dark\:ring-neutral-600\/60{--un-ring-color:#52525299 }.ring-neutral-300\/30{--un-ring-color:#d4d4d44d }.dark .dark\:focus\:ring-neutral-600\/30:focus{--un-ring-color:#5252524d }.dark .dark\:focus\:ring-neutral-600\/60:focus{--un-ring-color:#52525299 }.dark .dark\:focus\:ring-primary-600\/30:focus{--un-ring-color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/.3)}.dark .dark\:focus\:ring-red-600\/30:focus{--un-ring-color:#dc26264d }.dark .dark\:focus\:ring-red-600\/60:focus{--un-ring-color:#dc262699 }.focus\:ring-black\/10:focus{--un-ring-color:#0000001a }.focus\:ring-neutral-300\/30:focus{--un-ring-color:#d4d4d44d }.focus\:ring-primary-300\/60:focus{--un-ring-color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/.6)}.focus\:ring-red-300\/30:focus{--un-ring-color:#fca5a54d }.backdrop-blur-lg{--un-backdrop-blur:blur(16px);-webkit-backdrop-filter:var(--un-backdrop-blur)var(--un-backdrop-brightness)var(--un-backdrop-contrast)var(--un-backdrop-grayscale)var(--un-backdrop-hue-rotate)var(--un-backdrop-invert)var(--un-backdrop-opacity)var(--un-backdrop-saturate)var(--un-backdrop-sepia);backdrop-filter:var(--un-backdrop-blur)var(--un-backdrop-brightness)var(--un-backdrop-contrast)var(--un-backdrop-grayscale)var(--un-backdrop-hue-rotate)var(--un-backdrop-invert)var(--un-backdrop-opacity)var(--un-backdrop-saturate)var(--un-backdrop-sepia)}.backdrop-blur-md,[backdrop-blur-md=""]{--un-backdrop-blur:blur(12px);-webkit-backdrop-filter:var(--un-backdrop-blur)var(--un-backdrop-brightness)var(--un-backdrop-contrast)var(--un-backdrop-grayscale)var(--un-backdrop-hue-rotate)var(--un-backdrop-invert)var(--un-backdrop-opacity)var(--un-backdrop-saturate)var(--un-backdrop-sepia);backdrop-filter:var(--un-backdrop-blur)var(--un-backdrop-brightness)var(--un-backdrop-contrast)var(--un-backdrop-grayscale)var(--un-backdrop-hue-rotate)var(--un-backdrop-invert)var(--un-backdrop-opacity)var(--un-backdrop-saturate)var(--un-backdrop-sepia)}.backdrop-blur-sm,[backdrop-blur-sm=""]{--un-backdrop-blur:blur(4px);-webkit-backdrop-filter:var(--un-backdrop-blur)var(--un-backdrop-brightness)var(--un-backdrop-contrast)var(--un-backdrop-grayscale)var(--un-backdrop-hue-rotate)var(--un-backdrop-invert)var(--un-backdrop-opacity)var(--un-backdrop-saturate)var(--un-backdrop-sepia);backdrop-filter:var(--un-backdrop-blur)var(--un-backdrop-brightness)var(--un-backdrop-contrast)var(--un-backdrop-grayscale)var(--un-backdrop-hue-rotate)var(--un-backdrop-invert)var(--un-backdrop-opacity)var(--un-backdrop-saturate)var(--un-backdrop-sepia)}.backdrop-blur-xl,[backdrop-blur-xl=""]{--un-backdrop-blur:blur(24px);-webkit-backdrop-filter:var(--un-backdrop-blur)var(--un-backdrop-brightness)var(--un-backdrop-contrast)var(--un-backdrop-grayscale)var(--un-backdrop-hue-rotate)var(--un-backdrop-invert)var(--un-backdrop-opacity)var(--un-backdrop-saturate)var(--un-backdrop-sepia);backdrop-filter:var(--un-backdrop-blur)var(--un-backdrop-brightness)var(--un-backdrop-contrast)var(--un-backdrop-grayscale)var(--un-backdrop-hue-rotate)var(--un-backdrop-invert)var(--un-backdrop-opacity)var(--un-backdrop-saturate)var(--un-backdrop-sepia)}.blur{--un-blur:blur(8px);filter:var(--un-blur)var(--un-brightness)var(--un-contrast)var(--un-drop-shadow)var(--un-grayscale)var(--un-hue-rotate)var(--un-invert)var(--un-saturate)var(--un-sepia)}.drop-shadow{--un-drop-shadow:drop-shadow(0 1px 2px var(--un-drop-shadow-color,#0000001a))drop-shadow(0 1px 1px var(--un-drop-shadow-color,#0000000f));filter:var(--un-blur)var(--un-brightness)var(--un-contrast)var(--un-drop-shadow)var(--un-grayscale)var(--un-hue-rotate)var(--un-invert)var(--un-saturate)var(--un-sepia)}.drop-shadow-sm,[drop-shadow-sm=""]{--un-drop-shadow:drop-shadow(0 1px 1px var(--un-drop-shadow-color,#0000000d));filter:var(--un-blur)var(--un-brightness)var(--un-contrast)var(--un-drop-shadow)var(--un-grayscale)var(--un-hue-rotate)var(--un-invert)var(--un-saturate)var(--un-sepia)}[drop-shadow~=none],.dark [drop-shadow~="dark:hover:none"]:hover{--un-drop-shadow:drop-shadow(0 0 var(--un-drop-shadow-color,#0000));filter:var(--un-blur)var(--un-brightness)var(--un-contrast)var(--un-drop-shadow)var(--un-grayscale)var(--un-hue-rotate)var(--un-invert)var(--un-saturate)var(--un-sepia)}[drop-shadow~="hover:[0px_4px_4px_rgba(220,220,220,0.4)]"]:hover{--un-drop-shadow:drop-shadow(0px 4px 4px #dcdcdc66);filter:var(--un-blur)var(--un-brightness)var(--un-contrast)var(--un-drop-shadow)var(--un-grayscale)var(--un-hue-rotate)var(--un-invert)var(--un-saturate)var(--un-sepia)}[drop-shadow~="active:[0px_0px_0px_rgba(220,220,220,0.25)]"]:active{--un-drop-shadow:drop-shadow(0px 0px 0px #dcdcdc40);filter:var(--un-blur)var(--un-brightness)var(--un-contrast)var(--un-drop-shadow)var(--un-grayscale)var(--un-hue-rotate)var(--un-invert)var(--un-saturate)var(--un-sepia)}.\[\&_\.provider-icon\]\:grayscale-100 .provider-icon,.grayscale-100,[grayscale-100=""]{--un-grayscale:grayscale(1);filter:var(--un-blur)var(--un-brightness)var(--un-contrast)var(--un-drop-shadow)var(--un-grayscale)var(--un-hue-rotate)var(--un-invert)var(--un-saturate)var(--un-sepia)}.\[\&_\.provider-icon\]\:hover\:grayscale-0:hover .provider-icon{--un-grayscale:grayscale(0);filter:var(--un-blur)var(--un-brightness)var(--un-contrast)var(--un-drop-shadow)var(--un-grayscale)var(--un-hue-rotate)var(--un-invert)var(--un-saturate)var(--un-sepia)}.filter{filter:var(--un-blur)var(--un-brightness)var(--un-contrast)var(--un-drop-shadow)var(--un-grayscale)var(--un-hue-rotate)var(--un-invert)var(--un-saturate)var(--un-sepia)}.backdrop-filter{-webkit-backdrop-filter:var(--un-backdrop-blur)var(--un-backdrop-brightness)var(--un-backdrop-contrast)var(--un-backdrop-grayscale)var(--un-backdrop-hue-rotate)var(--un-backdrop-invert)var(--un-backdrop-opacity)var(--un-backdrop-saturate)var(--un-backdrop-sepia);backdrop-filter:var(--un-backdrop-blur)var(--un-backdrop-brightness)var(--un-backdrop-contrast)var(--un-backdrop-grayscale)var(--un-backdrop-hue-rotate)var(--un-backdrop-invert)var(--un-backdrop-opacity)var(--un-backdrop-saturate)var(--un-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter,backdrop-filter;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-\[width\,margin\]{transition-property:width,margin;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-100,[transition~="100"]{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter,backdrop-filter;transition-duration:.1s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-all,[transition-all=""],[transition~=all]{transition-property:all;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors,[transition-colors=""],[transition~=colors]{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors\,transform\,width\,height{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,transform,width,height;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-opacity,[transition-opacity=""]{transition-property:opacity;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-transform,[transition~=transform]{transition-property:transform;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}[transition~=border]{transition-property:border;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}[transition~=colors\,transform]{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,transform;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}[transition~=width]{transition-property:width;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}[transition~=placeholder\:all]::placeholder,[before~=transition-all]:before,.after\:transition-all:after,[after~=transition-all]:after{transition-property:all;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-150,[duration-150=""]{transition-duration:.15s}.duration-200,[duration-200=""],[transition~=duration-200]{transition-duration:.2s}.duration-250,[duration-250=""],[duration~="250"],[transition~=duration-250]{transition-duration:.25s}.duration-300,[transition~=duration-300]{transition-duration:.3s}.duration-400,[transition~=duration-400]{transition-duration:.4s}.duration-500,[duration-500=""],[duration~="500"],[transition~=duration-500]{transition-duration:.5s}.duration-75{transition-duration:75ms}[duration~="10"]{transition-duration:10ms}[duration~="1000"]{transition-duration:1s}.placeholder\:duration-250::placeholder,[placeholder\:duration-250=""]::placeholder,[transition~=placeholder\:duration-250]::placeholder{transition-duration:.25s}[before~=duration-400]:before,[after~=duration-400]:after{transition-duration:.4s}[delay~="10"]{transition-delay:10ms}[delay~="100"]{transition-delay:.1s}[delay~="11"]{transition-delay:11ms}[delay~="19"]{transition-delay:19ms}[delay~="2"]{transition-delay:2ms}[delay~="20"]{transition-delay:20ms}[delay~="200"]{transition-delay:.2s}[delay~="3"]{transition-delay:3ms}[delay~="4"]{transition-delay:4ms}[delay~="5"]{transition-delay:5ms}[delay~="50"]{transition-delay:50ms}[delay~="6"]{transition-delay:6ms}[delay~="7"]{transition-delay:7ms}[delay~="8"]{transition-delay:8ms}[delay~="9"]{transition-delay:9ms}.ease,.ease-in-out,[ease-in-out=""],[transition~=ease-in-out]{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.ease-linear,[ease-linear=""]{transition-timing-function:linear}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.placeholder\:ease-in-out::placeholder,[transition~=placeholder\:ease-in-out]::placeholder,[before~=ease-in-out]:before,[after~=ease-in-out]:after{transition-timing-function:cubic-bezier(.4,0,.2,1)}.will-change-background-color,[will-change-background-color=""]{will-change:background-color}.will-change-color,[will-change-color=""]{will-change:color}.will-change-transform,[will-change-transform=""]{will-change:transform}.will-change-width,[will-change-width=""]{will-change:width}.before\:content-\[\'\'\]:before,.after\:content-\[\'\'\]:after,.content-empty,[before~=content-empty]:before,[after~=content-empty]:after{content:""}.hidden,[hidden=""]{display:none}.bg-dotted-\[neutral-200\/60\]{background-image:radial-gradient(circle at 1px 1px,rgb(229 229 229/var(--un-background-opacity))1px,transparent 0);--un-background-opacity:.6}.bg-dotted-\[neutral-200\/80\]{background-image:radial-gradient(circle at 1px 1px,rgb(229 229 229/var(--un-background-opacity))1px,transparent 0);--un-background-opacity:.8}.dark .dark\:bg-dotted-\[neutral-700\/25\]{background-image:radial-gradient(circle at 1px 1px,rgb(64 64 64/var(--un-background-opacity))1px,transparent 0);--un-background-opacity:.25}.dark .dark\:bg-dotted-\[neutral-700\/40\]{background-image:radial-gradient(circle at 1px 1px,rgb(64 64 64/var(--un-background-opacity))1px,transparent 0);--un-background-opacity:.4}.dark .dark\:hover\:bg-dotted-\[primary-200\/20\]:hover{background-image:radial-gradient(circle at 1px 1px,oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/var(--un-background-opacity))1px,transparent 0);--un-background-opacity:%alpha}.hover\:bg-dotted-\[primary-300\/50\]:hover,.after\:bg-dotted-\[primary-300\/50\]:after{background-image:radial-gradient(circle at 1px 1px,oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/var(--un-background-opacity))1px,transparent 0);--un-background-opacity:%alpha}.dark .dark\:after\:bg-dotted-\[primary-200\/20\]:after,.dark [hover~="dark:after:bg-dotted-[primary-200/20]"]:hover:after{background-image:radial-gradient(circle at 1px 1px,oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/var(--un-background-opacity))1px,transparent 0);--un-background-opacity:%alpha}[after~="bg-dotted-[neutral-200/80]"]:after{background-image:radial-gradient(circle at 1px 1px,rgb(229 229 229/var(--un-background-opacity))1px,transparent 0);--un-background-opacity:.8}[hover~="after:bg-dotted-[primary-300/50]"]:hover:after{background-image:radial-gradient(circle at 1px 1px,oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/var(--un-background-opacity))1px,transparent 0);--un-background-opacity:%alpha}.transition-colors-none,.placeholder\:transition-colors-none::placeholder{transition-property:color,background-color,border-color,text-color;transition-duration:0s}@media (max-width:1023.9px){[min-w~="i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/default-BjhJ8iTT.js","assets/HeaderLink-C5rYwZW4.js","assets/HeaderLink-4n3ShASi.css","assets/settings-DGA0gtM5.js","assets/theme-color-BcLm08J4.js","assets/pages-DgHFu8YX.js","assets/AnimatedWave-BNwebIpR.js","assets/Scenes-CEy5mzwe.js","assets/import-url-browser-BymzNjKM.js","assets/duckdb-mvp-1eM9E9sB.js","assets/Basic-Cwa2X3hA.js","assets/AnimatedWave-Dw0iAXrn.css","assets/route-block-DVyt-3Cw.js","assets/background-remove-Doptaj1n.js","assets/transformers.web-DPuLqcmp.js","assets/InputFile-DYGPp1hR.js","assets/gesture-circle-BBMVN_ye.js","assets/image-ByPuRM0v.js","assets/image-BhuwcwI9.css","assets/polaroid-Ch51z8b2.js","assets/vibrant-D7XJhUFd.js","assets/browser-UfbE_1lV.js","assets/settings-C_Bl0Dic.js","assets/IconAnimation-BEHmQAW0.js","assets/airi-card-23m5t20W.js","assets/CardCreate-BlTH4Xox.js","assets/CardCreationDialog-BV9G3q2c.js","assets/CardCreationDialog-CG2KLbdk.css","assets/CardDetailDialog-DkixqMs_.js","assets/DeleteCardDialog-UKAwGyZQ.js","assets/CardListItem-CfAvmf_x.js","assets/CardCreate-eYkmqupR.js","assets/CardCreationDialog-CSbQbKao.js","assets/CardDetailDialog-BKAC6QHD.js","assets/CardListItem-CaTpYoW4.js","assets/DeleteCardDialog-DTWpW-2T.js","assets/appearance-CbLkQE_9.js","assets/color-scheme-Dk37f8SX.js","assets/color-scheme-r2m6hu6X.css","assets/developer-G1V3X_27.js","assets/general-B2Scnzyg.js","assets/memory-CFffyGxF.js","assets/models-WA_l83eR.js","assets/icon-animation-kCs3SNq8.js","assets/modules-CMn92Qgp.js","assets/consciousness-CYrl8QXs.js","assets/hearing-DoOHup8T.js","assets/memory-long-term-DiDwEey2.js","assets/memory-short-term-ajNCalDy.js","assets/speech-DILdLlfV.js","assets/Textarea-C55W7JzB.js","assets/providers-BEf5BA57.js","assets/alibaba-cloud-model-studio-Bc3aTr9J.js","assets/anthropic-BY1KMERF.js","assets/azure-ai-foundry-CkLpWPUt.js","assets/cloudflare-workers-ai-BaI_Rwef.js","assets/deepseek-DnJanhZ7.js","assets/elevenlabs-D_o9OBbz.js","assets/featherless-ai-2oNxwFxi.js","assets/fireworks-ai-CW9vBjr8.js","assets/google-generative-ai-BwVpRZEr.js","assets/microsoft-speech-C7ThD9iN.js","assets/mistral-ai-CbjOvuKb.js","assets/moonshot-ai-CFXUeFnc.js","assets/novita-ai-CDmSyd2p.js","assets/ollama-DEbOkWEd.js","assets/openai-CfOD6NWP.js","assets/openai-audio-speech-tr83Tays.js","assets/openai-audio-transcription-53P1cwTz.js","assets/openrouter-ai-BGXHC_hT.js","assets/player2-92SQ5DhN.js","assets/player2-speech-QfJzu0W0.js","assets/together-ai-BHolxZvd.js","assets/volcengine-CYOv3NuR.js","assets/xai-DViBdpac.js","assets/scene-ePckR2Tm.js","assets/stage-Ckabb-ev.js","assets/filter-message-BcMyfSi6.js","assets/delays-DJ8ppqmz.js","assets/emotions-DvokzTuq.js","assets/messages-CgBnFGDa.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$6,res)=>()=>(fn$6&&(res=fn$6(fn$6=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$2,from,except,desc)=>{if(from&&typeof from==`object`||typeof from==`function`)for(var keys$3=__getOwnPropNames(from),i$1=0,n$2=keys$3.length,key$2;i$1from[k$4]).bind(null,key$2),enumerable:!(desc=__getOwnPropDesc(from,key$2))||desc.enumerable});return to$2},__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$3=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(x$3,{get:(a$2,b$4)=>(typeof require<`u`?require:a$2)[b$4]}):x$3)(function(x$3){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+x$3+"\" 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.17 @@ -3835,7 +3835,7 @@ void main() { }`;var WebXRDepthSensing=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(renderer$1,depthData,renderState){if(this.texture===null){let texture=new Texture,texProps=renderer$1.properties.get(texture);texProps.__webglTexture=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=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,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$1=0;i$1=0&&(controllerInputSources[index$1]=null,controllers[index$1].disconnect(inputSource))}for(let i$1=0;i$1=controllerInputSources.length){controllerInputSources.push(inputSource),controllerIndex=i$2;break}else if(controllerInputSources[i$2]===null){controllerInputSources[i$2]=inputSource,controllerIndex=i$2;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),cameraL.layers.mask=camera.layers.mask|2,cameraR.layers.mask=camera.layers.mask|4,cameraXR.layers.mask=cameraL.layers.mask|cameraR.layers.mask;let parent=camera.parent,cameras$1=cameraXR.cameras;updateCamera(cameraXR,parent);for(let i$1=0;i$10&&(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$1=0;i$10&&(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$1 in buffers)gl.deleteBuffer(buffers[id$1]);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,reverseDepthBuffer=!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,_currentProjectionMatrix=new Matrix4,_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.reverseDepthBuffer&&reverseDepthBuffer&&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$3,y$3,width,height){x$3.isVector4?_viewport.set(x$3.x,x$3.y,x$3.z,x$3.w):_viewport.set(x$3,y$3,width,height),state.viewport(_currentViewport.copy(_viewport).multiplyScalar(_pixelRatio).round())},this.getScissor=function(target$1){return target$1.copy(_scissor)},this.setScissor=function(x$3,y$3,width,height){x$3.isVector4?_scissor.set(x$3.x,x$3.y,x$3.z,x$3.w):_scissor.set(x$3,y$3,width,height),state.scissor(_currentScissor.copy(_scissor).multiplyScalar(_pixelRatio).round())},this.getScissorTest=function(){return _scissorTest},this.setScissorTest=function(boolean$1){state.setScissorTest(_scissorTest=boolean$1)},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$2=background.getClearAlpha(),r$2=clearColor.r,g$2=clearColor.g,b$4=clearColor.b;isUnsignedType?(uintClearColor[0]=r$2,uintClearColor[1]=g$2,uintClearColor[2]=b$4,uintClearColor[3]=a$2,_gl.clearBufferuiv(_gl.COLOR,0,uintClearColor)):(intClearColor[0]=r$2,intClearColor[1]=g$2,intClearColor[2]=b$4,intClearColor[3]=a$2,_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,group){scene===null&&(scene=_emptyScene);let frontFaceCW=object.isMesh&&object.matrixWorld.determinant()<0,program=setProgram(camera,scene,geometry,material,object);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,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.isMesh)material.wireframe===!0?(state.setLineWidth(material.wireframeLinewidth*getTargetPixelRatio()),renderer$1.setMode(_gl.LINES)):renderer$1.setMode(_gl.TRIANGLES);else if(object.isLine){let lineWidth=material.linewidth;lineWidth===void 0&&(lineWidth=1),state.setLineWidth(lineWidth*getTargetPixelRatio()),object.isLineSegments?renderer$1.setMode(_gl.LINES):object.isLineLoop?renderer$1.setMode(_gl.LINE_LOOP):renderer$1.setMode(_gl.LINE_STRIP)}else object.isPoints?renderer$1.setMode(_gl.POINTS):object.isSprite&&renderer$1.setMode(_gl.TRIANGLES);if(object.isBatchedMesh)if(object._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._multiDrawStarts,object._multiDrawCounts,object._multiDrawCount,object._multiDrawInstances);else if(extensions.get(`WEBGL_multi_draw`))renderer$1.renderMultiDraw(object._multiDrawStarts,object._multiDrawCounts,object._multiDrawCount);else{let starts=object._multiDrawStarts,counts=object._multiDrawCounts,drawCount$1=object._multiDrawCount,bytesPerElement=index$1?attributes.get(index$1).bytesPerElement:1,uniforms=properties.get(material).currentProgram.getUniforms();for(let i$1=0;i$1{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){onAnimationFrameCallback&&onAnimationFrameCallback(time)}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),_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$1=0,l$1=cameras.length;i$10&&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,camera,groupOrder,sortObjects){if(object.visible===!1)return;let visible=object.layers.test(camera.layers);if(visible){if(object.isGroup)groupOrder=object.renderOrder;else if(object.isLOD)object.autoUpdate===!0&&object.update(camera);else if(object.isLight)currentRenderState.pushLight(object),object.castShadow&¤tRenderState.pushShadow(object);else if(object.isSprite){if(!object.frustumCulled||_frustum$2.intersectsSprite(object)){sortObjects&&_vector4.setFromMatrixPosition(object.matrixWorld).applyMatrix4(_projScreenMatrix$3);let geometry=objects.update(object),material=object.material;material.visible&¤tRenderList.push(object,geometry,material,groupOrder,_vector4.z,null)}}else if((object.isMesh||object.isLine||object.isPoints)&&(!object.frustumCulled||_frustum$2.intersectsObject(object))){let geometry=objects.update(object),material=object.material;if(sortObjects&&(object.boundingSphere===void 0?(geometry.boundingSphere===null&&geometry.computeBoundingSphere(),_vector4.copy(geometry.boundingSphere.center)):(object.boundingSphere===null&&object.computeBoundingSphere(),_vector4.copy(object.boundingSphere.center)),_vector4.applyMatrix4(object.matrixWorld).applyMatrix4(_projScreenMatrix$3)),Array.isArray(material)){let groups=geometry.groups;for(let i$1=0,l$1=groups.length;i$10&&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$1=0,l$1=transmissiveObjects.length;i$10),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.isBatchedMesh&&materialProperties.batching===!1||!object.isBatchedMesh&&materialProperties.batching===!0||object.isBatchedMesh&&materialProperties.batchingColor===!0&&object.colorTexture===null||object.isBatchedMesh&&materialProperties.batchingColor===!1&&object.colorTexture!==null||object.isInstancedMesh&&materialProperties.instancing===!1||!object.isInstancedMesh&&materialProperties.instancing===!0||object.isSkinnedMesh&&materialProperties.skinning===!1||!object.isSkinnedMesh&&materialProperties.skinning===!0||object.isInstancedMesh&&materialProperties.instancingColor===!0&&object.instanceColor===null||object.isInstancedMesh&&materialProperties.instancingColor===!1&&object.instanceColor!==null||object.isInstancedMesh&&materialProperties.instancingMorph===!0&&object.morphTexture===null||object.isInstancedMesh&&materialProperties.instancingMorph===!1&&object.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));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 reverseDepthBuffer$1=state.buffers.depth.getReversed();reverseDepthBuffer$1?(_currentProjectionMatrix.copy(camera.projectionMatrix),toNormalizedProjectionMatrix(_currentProjectionMatrix),toReversedProjectionMatrix(_currentProjectionMatrix),p_uniforms.setValue(_gl,`projectionMatrix`,_currentProjectionMatrix)):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.isSkinnedMesh){p_uniforms.setOptional(_gl,object,`bindMatrix`),p_uniforms.setOptional(_gl,object,`bindMatrixInverse`);let skeleton=object.skeleton;skeleton&&(skeleton.boneTexture===null&&skeleton.computeBoneTexture(),p_uniforms.setValue(_gl,`boneTexture`,skeleton.boneTexture,textures))}object.isBatchedMesh&&(p_uniforms.setOptional(_gl,object,`batchingTexture`),p_uniforms.setValue(_gl,`batchingTexture`,object._matricesTexture,textures),p_uniforms.setOptional(_gl,object,`batchingIdTexture`),p_uniforms.setValue(_gl,`batchingIdTexture`,object._indirectTexture,textures),p_uniforms.setOptional(_gl,object,`batchingColorTexture`),object._colorsTexture!==null&&p_uniforms.setValue(_gl,`batchingColorTexture`,object._colorsTexture,textures));let morphAttributes=geometry.morphAttributes;if((morphAttributes.position!==void 0||morphAttributes.normal!==void 0||morphAttributes.color!==void 0)&&morphtargets.update(object,geometry,program),(refreshMaterial||materialProperties.receiveShadow!==object.receiveShadow)&&(materialProperties.receiveShadow=object.receiveShadow,p_uniforms.setValue(_gl,`receiveShadow`,object.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.center),p_uniforms.setValue(_gl,`modelViewMatrix`,object.modelViewMatrix),p_uniforms.setValue(_gl,`normalMatrix`,object.normalMatrix),p_uniforms.setValue(_gl,`modelMatrix`,object.matrixWorld),material.isShaderMaterial||material.isRawShaderMaterial){let groups=material.uniformsGroups;for(let i$1=0,l$1=groups.length;i$10&&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 textureProperties=properties.get(renderTarget.texture),layer=activeCubeFace;_gl.framebufferTextureLayer(_gl.FRAMEBUFFER,_gl.COLOR_ATTACHMENT0,textureProperties.__webglTexture,activeMipmapLevel,layer)}else if(renderTarget!==null&&activeMipmapLevel!==0){let textureProperties=properties.get(renderTarget.texture);_gl.framebufferTexture2D(_gl.FRAMEBUFFER,_gl.COLOR_ATTACHMENT0,_gl.TEXTURE_2D,textureProperties.__webglTexture,activeMipmapLevel)}_currentMaterialId=-1},this.readRenderTargetPixels=function(renderTarget,x$3,y$3,width,height,buffer$1,activeCubeFaceIndex,textureIndex=0){if(!(renderTarget&&renderTarget.isWebGLRenderTarget)){console.error(`THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.`);return}let framebuffer=properties.get(renderTarget).__webglFramebuffer;if(renderTarget.isWebGLCubeRenderTarget&&activeCubeFaceIndex!==void 0&&(framebuffer=framebuffer[activeCubeFaceIndex]),framebuffer){state.bindFramebuffer(_gl.FRAMEBUFFER,framebuffer);try{let texture=renderTarget.textures[textureIndex],textureFormat=texture.format,textureType=texture.type;if(!capabilities.textureFormatReadable(textureFormat)){console.error(`THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.`);return}if(!capabilities.textureTypeReadable(textureType)){console.error(`THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.`);return}x$3>=0&&x$3<=renderTarget.width-width&&y$3>=0&&y$3<=renderTarget.height-height&&(renderTarget.textures.length>1&&_gl.readBuffer(_gl.COLOR_ATTACHMENT0+textureIndex),_gl.readPixels(x$3,y$3,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$3,y$3,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$3>=0&&x$3<=renderTarget.width-width&&y$3>=0&&y$3<=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$3,y$3,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$3=position$2===null?0:position$2.x,y$3=position$2===null?0:position$2.y;textures.setTexture2D(texture,0),_gl.copyTexSubImage2D(_gl.TEXTURE_2D,level,0,0,x$3,y$3,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$1=0;i$1{fns.delete(fn$6)},clear=()=>{fns.clear()},on$2=fn$6=>{fns.add(fn$6);let offFn=()=>off(fn$6);return tryOnScopeDispose$1(offFn),{off:offFn}},trigger$1=(...args)=>Promise.all(Array.from(fns).map(fn$6=>fn$6(...args)));return{on:on$2,off,trigger:trigger$1,clear}}function createGlobalState(stateFactory){let initialized=!1,state,scope=effectScope(!0);return(...args)=>(initialized||(state=scope.run(()=>stateFactory(...args)),initialized=!0),state)}const localProvidedStateMap$1=new WeakMap,injectLocal$1=(...args)=>{var _a$3;let key$2=args[0],instance=(_a$3=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,dispose$1=()=>{--subscribers,scope&&subscribers<=0&&(scope.stop(),state=void 0,scope=void 0)};return(...args)=>(subscribers+=1,scope||(scope=effectScope(!0),state=scope.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$4=val=>toString$3.call(val)===`[object Object]`,noop$4=()=>{},isIOS=getIsIOS();function getIsIOS(){var _a$3,_b;return isClient$1&&(_a$3=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$6){function wrapper(...args){return new Promise((resolve$1,reject)=>{Promise.resolve(filter$1(()=>fn$6.apply(this,args),{fn:fn$6,thisArg:this,args})).then(resolve$1).catch(reject)})}return wrapper}function debounceFilter$1(ms$1,options$1={}){let timer,maxTimer,lastRejector=noop$4,_clearTimeout=timer2=>{clearTimeout(timer2),lastRejector(),lastRejector=noop$4},lastInvoker,filter$1=invoke$1=>{let duration=toValue$1(ms$1),maxDuration$1=toValue$1(options$1.maxWait);return timer&&_clearTimeout(timer),duration<=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)})};return filter$1}function cacheStringFunction$1(fn$6){let cache$1=Object.create(null);return str=>{let hit=cache$1[str];return hit||(cache$1[str]=fn$6(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,(_$2,c$4)=>c$4?c$4.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$2,k$4)=>(k$4 in obj&&(!omitUndefined||obj[k$4]!==void 0)&&(n$2[k$4]=obj[k$4]),n$2),{})}function getLifeCycleTarget$1(target$1){return target$1||getCurrentInstance()}function toArray$1(value$1){return Array.isArray(value$1)?value$1:[value$1]}function useDebounceFn$1(fn$6,ms$1=200,options$1={}){return createFilterWrapper$1(debounceFilter$1(ms$1,options$1),fn$6)}function refDebounced$1(value$1,ms$1=200,options$1={}){let debounced=ref(value$1.value),updater=useDebounceFn$1(()=>{debounced.value=value$1.value},ms$1,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$2){var _a$3;let replaceRef=(_a$3=toValue$1(options$1.replaceRef))??!0;if(replaceRef)if(Array.isArray(objectRef.value)){let copy=[...objectRef.value];copy[key$2]=v$2,objectRef.value=copy}else{let newObject={...objectRef.value,[key$2]:v$2};Object.setPrototypeOf(newObject,Object.getPrototypeOf(objectRef.value)),objectRef.value=newObject}else objectRef.value[key$2]=v$2}}));return result}const toValue=toValue$1;function tryOnBeforeUnmount(fn$6,target$1){let instance=getLifeCycleTarget$1(target$1);instance&&onBeforeUnmount(fn$6,target$1)}function tryOnMounted$1(fn$6,sync$2=!0,target$1){let instance=getLifeCycleTarget$1();instance?onMounted(fn$6,target$1):sync$2?fn$6():nextTick(fn$6)}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 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(elRef){var _a$3;let plain=toValue$1(elRef);return(_a$3=plain?.$el)??plain}function useEventListener(...args){let cleanups=[],cleanup=()=>{cleanups.forEach(fn$6=>fn$6()),cleanups.length=0},register=(el$1,event,listener,options$1)=>(el$1.addEventListener(event,listener,options$1),()=>el$1.removeEventListener(event,listener,options$1)),firstParamTargets=computed(()=>{let test$1=toArray$1(toValue$1(args[0])).filter(e$3=>e$3!=null);return test$1.every(e$3=>typeof e$3!=`string`)?test$1:void 0}),stopWatch=watchImmediate$1(()=>{var _a$3,_b;return[(_b=(_a$3=firstParamTargets.value)?.map(e$3=>unrefElement(e$3)))??[defaultWindow].filter(e$3=>e$3!=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$4(raw_options)?{...raw_options}:raw_options;cleanups.push(...raw_targets.flatMap(el$1=>raw_events.flatMap(event=>raw_listeners.map(listener=>register(el$1,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).filter(notNullish$1);return new Set(items)}),stopWatch=watch(()=>targets.value,targets2=>{cleanup(),isSupported.value&&targets2.size&&(observer=new MutationObserver(callback),targets2.forEach(el$1=>observer.observe(el$1,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$3=>{e$3.repeat&&toValue$1(dedupe)||predicate(e$3)&&handler(e$3)};return useEventListener(target$1,eventName,listener,passive)}function useRafFn(fn$6,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(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(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$1=>unrefElement(el$1)):[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$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$3=shallowRef(0),y$3=shallowRef(0);function recalculate(){let el$1=unrefElement(target$1);if(!el$1){reset&&(height.value=0,bottom.value=0,left.value=0,right.value=0,top.value=0,width.value=0,x$3.value=0,y$3.value=0);return}let rect=el$1.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$3.value=rect.x,y$3.value=rect.y}function update(){updateTiming===`sync`?recalculate():updateTiming===`next-frame`&&requestAnimationFrame(()=>recalculate())}return useResizeObserver$1(target$1,update),watch(()=>unrefElement(target$1),ele=>!ele&&update()),useMutationObserver$1(target$1,update,{attributeFilter:[`style`,`class`]}),windowScroll&&useEventListener(`scroll`,update,{capture:!0,passive:!0}),windowResize&&useEventListener(`resize`,update,{passive:!0}),tryOnMounted$1(()=>{immediate&&update()}),{height,bottom,left,right,top,width,x:x$3,y:y$3,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$3,_b;return(_b=(_a$3=unrefElement(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(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(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(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$3;let fps=shallowRef(0);if(typeof performance>`u`)return fps;let every=(_a$3=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(target$1,[`pointerdown`,`pointermove`,`pointerup`],handler,listenerOptions),useEventListener(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`}];function useVModel(props,key$2,emit$1,options$1={}){var _a$3,_b,_c$1;let{clone:clone$2=!1,passive=!1,eventName,deep=!1,defaultValue,shouldEmit}=options$1,vm$1=getCurrentInstance(),_emit=emit$1||vm$1?.emit||(_a$3=vm$1?.$emit)?.bind(vm$1)||(_c$1=(_b=vm$1?.proxy)?.$emit)?.bind(vm$1?.proxy),event=eventName;key$2||=`modelValue`,event||=`update:${key$2.toString()}`;let cloneFn=val=>clone$2?typeof clone$2==`function`?clone$2(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$2=>{isUpdating||(isUpdating=!0,proxy.value=cloneFn(v$2),nextTick(()=>isUpdating=!1))}),watch(proxy,v$2=>{!isUpdating&&(v$2!==props[key$2]||deep)&&triggerEmit(v$2)},{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(`resize`,update,listenerOptions),window$1&&type===`visual`&&window$1.visualViewport&&useEventListener(window$1.visualViewport,`resize`,update,listenerOptions),listenOrientation){let matches$1=useMediaQuery$1(`(orientation: portrait)`);watch(matches$1,()=>update())}return{width,height}}var At$1=Object.defineProperty,xt$1=(e$3,t,r$2)=>t in e$3?At$1(e$3,t,{enumerable:!0,configurable:!0,writable:!0,value:r$2}):e$3[t]=r$2,de$2=(e$3,t,r$2)=>xt$1(e$3,typeof t==`symbol`?t:t+``,r$2);const gr=`@tresjs/core`,hr$1=`module`,vr$1=`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$1={name:gr,type:hr$1,version:vr$1,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$2){super(...r$2),de$2(this,`type`,`HightlightMesh`),de$2(this,`createTime`),this.createTime=Date.now()}onBeforeRender(){let n$2=(Date.now()-this.createTime)/1e3,s$1=1+.07*Math.sin(2.5*n$2);this.scale.set(s$1,s$1,s$1)}};function be$1(e$3){return typeof e$3>`u`}function ke(e$3){return Array.isArray(e$3)}function Hr(e$3){return typeof e$3==`number`}function dt$4(e$3){return typeof e$3==`string`}function Y$1(e$3){return typeof e$3==`function`}function j(e$3){return e$3===Object(e$3)&&!ke(e$3)&&!Y$1(e$3)}function N$1(e$3){return j(e$3)&&!!e$3.isObject3D}function mt$2(e$3){return j(e$3)&&!!e$3.isColor}function Ur$1(e$3){return e$3!=null&&(typeof e$3==`string`||typeof e$3==`number`||mt$2(e$3))}function Me$1(e$3){return typeof e$3==`object`&&!!e$3&&`set`in e$3&&typeof e$3.set==`function`}function Fr(e$3){return Me$1(e$3)&&`copy`in e$3&&typeof e$3.copy==`function`}function Wr$1(e$3){return!!(e$3!=null&&e$3.constructor)}function Ge$1(e$3){return e$3 instanceof Layers}function Ve(e$3){return j(e$3)&&!!e$3.isCamera}function Nr(e$3){return j(e$3)&&!!e$3.isBufferGeometry}function zr(e$3){return j(e$3)&&!!e$3.isMaterial}function Gr$1(e$3){return j(e$3)&&!!e$3.isLight}function Vr(e$3){return j(e$3)&&!!e$3.isFog}function Yr$1(e$3){return j(e$3)&&!!e$3.isScene}function ne$1(e$3){return N$1(e$3)||Nr(e$3)||zr(e$3)||Vr(e$3)}function qr$1(e$3){return j(e$3)&&!!e$3.isPrimitive}const gt$2=(e$3,t)=>{for(let r$2 of Object.keys(t))t[r$2]instanceof Object&&Object.assign(t[r$2],gt$2(e$3[r$2],t[r$2]));return Object.assign(e$3||{},t),e$3},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$1=Zr$1(Kr);function Ye(e$3){return e$3&&e$3.nodeType===1}function he$1(e$3){return e$3.replace(/-([a-z])/g,(t,r$2)=>r$2.toUpperCase())}const Qr$1=/\B([A-Z])/g;function Xr$1(e$3){return e$3.replace(Qr$1,`-$1`).toLowerCase()}function Zr$1(e$3,t){let r$2=Object.create(null),n$2=e$3.split(`,`);for(let o$1=0;o$1!!r$2[o$1.toLowerCase()]:o$1=>!!r$2[o$1]}const qe$1=(e$3,t)=>{if(!t)return;let r$2=Array.isArray(t)?t:t.match(/([^[.\]])+/g);return r$2?.reduce((n$2,o$1)=>n$2&&n$2[o$1],e$3)},en$1=(e$3,t,r$2)=>{let n$2=Array.isArray(t)?t:t.match(/([^[.\]])+/g);n$2&&n$2.reduce((o$1,l$1,s$1)=>(o$1[l$1]===void 0&&(o$1[l$1]={}),s$1===n$2.length-1&&(o$1[l$1]=r$2),o$1[l$1]),e$3)};function ht$3(e$3,t){if(Ye(e$3)&&Ye(t)){let o$1=e$3.attributes,l$1=t.attributes;return o$1.length===l$1.length?Array.from(o$1).every(({name:s$1,value:a$2})=>t.getAttribute(s$1)===a$2):!1}if(e$3===t)return!0;if(typeof e$3!=`object`||!e$3||typeof t!=`object`||!t)return!1;let r$2=Object.keys(e$3),n$2=Object.keys(t);if(r$2.length!==n$2.length)return!1;for(let o$1 of r$2)if(!n$2.includes(o$1)||!ht$3(e$3[o$1],t[o$1]))return!1;return!0}function tn$1(e$3,t){if(!Array.isArray(e$3)||!Array.isArray(t)||e$3.length!==t.length)return!1;for(let r$2=0;r$2{if(c$4.uuid===t)return c$4;for(let i$1 of c$4.children){let f$3=o$1(i$1);if(f$3)return f$3}},l$1=o$1(e$3);if(!l$1){console.warn(`Object with UUID not found in the scene.`);return}let s$1=l$1;for(let c$4=0;c$4vt$3(o$1)),!(e$3 instanceof Scene)){let o$1=e$3;e$3&&((n$2=e$3.dispose)==null||n$2.call(e$3)),o$1.geometry&&o$1.geometry.dispose(),Array.isArray(o$1.material)?o$1.material.forEach(l$1=>Ke(l$1)):o$1.material&&Ke(o$1.material)}}function ln$1(e$3,t){let r$2=0;for(let n$2=0;n$2r$2===0?t:t.charAt(0).toUpperCase()+t.slice(1)).join(``)}const Qe$1=/-\d+$/;function cn$2(e$3,t,r$2){if(dt$4(r$2)){if(Qe$1.test(r$2)){let l$1=r$2.replace(Qe$1,``),{target:s$1,key:a$2}=Pe$2(e$3,l$1);if(!Array.isArray(s$1[a$2])){let c$4=s$1[a$2],i$1=[];i$1.__tresDetach=()=>{i$1.every(f$3=>be$1(f$3))&&(s$1[a$2]=c$4)},s$1[a$2]=i$1}}let{target:n$2,key:o$1}=Pe$2(e$3,r$2);t.__tres.previousAttach=n$2[o$1],n$2[o$1]=J$1(t)}else t.__tres.previousAttach=r$2(e$3,t)}function un$3(e$3,t,r$2){var n$2,o$1,l$1;if(dt$4(r$2)){let{target:s$1,key:a$2}=Pe$2(e$3,r$2),c$4=t.__tres.previousAttach;c$4===void 0?delete s$1[a$2]:s$1[a$2]=c$4,`__tresDetach`in s$1&&s$1.__tresDetach()}else (o$1=(n$2=t.__tres)?.previousAttach)==null||o$1.call(n$2,e$3,t);(l$1=t.__tres)==null||delete l$1.previousAttach}function z$2(e$3,t,r$2){let n$2=e$3;return n$2.__tres={type:`unknown`,eventCount:0,root:r$2,handlers:{},memoizedProps:{},objects:[],parent:null,previousAttach:null,...t},n$2.__tres.attach||(n$2.isMaterial?n$2.__tres.attach=`material`:n$2.isBufferGeometry?n$2.__tres.attach=`geometry`:n$2.isFog&&(n$2.__tres.attach=`fog`)),n$2}function yt$3(e$3){var r$2;let t=(r$2=e$3?.__tres)?.root;t&&t.render&&t.render.canBeInvalidated.value&&t.invalidate()}function fn$5(e$3,t,r$2){var o$1;if(!Y$1(e$3.setPixelRatio))return;let n$2=0;if(r$2&&ke(r$2)&&r$2.length>=2){let[l$1,s$1]=r$2;n$2=MathUtils.clamp(t,l$1,s$1)}else n$2=Hr(r$2)?r$2:t;n$2!==(o$1=e$3.getPixelRatio)?.call(e$3)&&e$3.setPixelRatio(n$2)}function pn$1(e$3,t,r$2,n$2,o$1){let l$1=[...t.__tres.objects],s$1=J$1(t);if(e$3=J$1(e$3),s$1===e$3)return!0;let a$2=z$2(e$3,t.__tres??{},o$1),c$4=t.parent??t.__tres.parent??null,i$1={...t.__tres.memoizedProps};delete i$1.object;for(let f$3 of l$1)_t$3(f$3,o$1),wt$3(f$3,o$1);s$1.__tres.objects=[],n$2.remove(t);for(let[f$3,v$2]of Object.entries(i$1))n$2.patchProp(a$2,f$3,a$2[f$3],v$2);r$2(e$3),n$2.insert(t,c$4);for(let f$3 of l$1)n$2.insert(f$3,t);return!0}function J$1(e$3){return qr$1(e$3)?(e$3.object.__tres=e$3.__tres,e$3.object):e$3}function _t$3(e$3,t){var n$2,o$1,l$1,s$1;let r$2=(n$2=e$3.__tres)?.parent||t.scene.value;e$3.__tres&&(e$3.__tres.parent=null),r$2&&r$2.__tres&&`objects`in r$2.__tres&&ln$1(r$2.__tres.objects,a$2=>a$2!==e$3),(o$1=e$3.__tres)!=null&&o$1.attach?un$3(r$2,e$3,e$3.__tres.attach):((s$1=(l$1=e$3.parent)?.remove)==null||s$1.call(l$1,J$1(e$3)),e$3.parent=null)}function wt$3(e$3,t){var r$2;(r$2=e$3.traverse)==null||r$2.call(e$3,n$2=>{var o$1;t.deregisterCamera(n$2),(o$1=t.eventManager)==null||o$1.deregisterPointerMissedObject(n$2)}),t.deregisterCamera(e$3),yt$3(e$3)}async function dn$1(e$3,t){let r$2=new TextureLoader(t),n$2=o$1=>new Promise((l$1,s$1)=>{r$2.load(o$1,a$2=>l$1(a$2),()=>null,()=>{s$1(Error(`[useTextures] - Failed to load texture`))})});if(rn$1(e$3)){let o$1=await Promise.all(e$3.map(l$1=>n$2(l$1)));return e$3.length>1?o$1:o$1[0]}else{let{map:o$1,displacementMap:l$1,normalMap:s$1,roughnessMap:a$2,metalnessMap:c$4,aoMap:i$1,alphaMap:f$3,matcap:v$2}=e$3;return{map:o$1?await n$2(o$1):null,displacementMap:l$1?await n$2(l$1):null,normalMap:s$1?await n$2(s$1):null,roughnessMap:a$2?await n$2(a$2):null,metalnessMap:c$4?await n$2(c$4):null,aoMap:i$1?await n$2(i$1):null,alphaMap:f$3?await n$2(f$3):null,matcap:v$2?await n$2(v$2):null}}}const to$1=defineComponent({__name:`component`,props:{map:{},displacementMap:{},normalMap:{},roughnessMap:{},metalnessMap:{},aoMap:{},alphaMap:{},matcap:{}},async setup(e$3){let t,r$2,n$2=e$3,o$1=([t,r$2]=withAsyncContext(()=>reactive(dn$1(n$2))),t=await t,r$2(),t);return(l$1,s$1)=>renderSlot(l$1.$slots,`default`,{textures:unref(o$1)})}}),mn$1=({sizes:e$3})=>{let t=ref([]),r$2=computed(()=>t.value[0]),n$2=s$1=>{let a$2=s$1 instanceof Camera?s$1:t.value.find(i$1=>i$1.uuid===s$1);if(!a$2)return;let c$4=t.value.filter(({uuid:i$1})=>i$1!==a$2.uuid);t.value=[a$2,...c$4]},o$1=(s$1,a$2=!1)=>{if(Ve(s$1)){let c$4=s$1;if(t.value.some(({uuid:i$1})=>i$1===c$4.uuid))return;a$2?n$2(c$4):t.value.push(c$4)}},l$1=s$1=>{if(Ve(s$1)){let a$2=s$1;t.value=t.value.filter(({uuid:c$4})=>c$4!==a$2.uuid)}};return watchEffect(()=>{e$3.aspectRatio.value&&t.value.forEach(s$1=>{!s$1.manual&&(s$1 instanceof PerspectiveCamera||gn$1(s$1))&&(s$1 instanceof PerspectiveCamera?s$1.aspect=e$3.aspectRatio.value:(s$1.left=e$3.width.value*-.5,s$1.right=e$3.width.value*.5,s$1.top=e$3.height.value*.5,s$1.bottom=e$3.height.value*-.5),s$1.updateProjectionMatrix())})}),onUnmounted(()=>{t.value=[]}),{camera:r$2,cameras:t,registerCamera:o$1,deregisterCamera:l$1,setCameraActive:n$2}};function gn$1(e$3){return e$3.hasOwnProperty(`isOrthographicCamera`)&&e$3.isOrthographicCamera}const ro$1=!0,fe$1=`[TresJS ▲ ■ ●] `;function hn$1(...e$3){typeof e$3[0]==`string`?e$3[0]=fe$1+e$3[0]:e$3.unshift(fe$1),console.error(...e$3)}function vn$3(...e$3){typeof e$3[0]==`string`?e$3[0]=fe$1+e$3[0]:e$3.unshift(fe$1),console.warn(...e$3)}function yn$1(e$3,t){}function Q$2(){return{logError:hn$1,logWarning:vn$3,logMessage:yn$1}}const Ce$2=ref({}),Ee$1=e$3=>Object.assign(Ce$2.value,e$3);function ve(){let e$3=new Map,t=new Set,r$2=0,n$2=!1,o$1=()=>{let i$1=Array.from(e$3.entries()).sort((f$3,v$2)=>{let u$1=f$3[1].priority-v$2[1].priority;return u$1===0?f$3[1].addI-v$2[1].addI:u$1});t.clear(),i$1.forEach(f$3=>t.add(f$3[0]))},l$1=i$1=>{e$3.delete(i$1),t.delete(i$1)};return{on:(i$1,f$3=0)=>{e$3.set(i$1,{priority:f$3,addI:r$2++});let v$2=()=>l$1(i$1);return tryOnScopeDispose$1(v$2),n$2=!0,{off:v$2}},off:l$1,trigger:(...i$1)=>{n$2&&(o$1(),n$2=!1),t.forEach(f$3=>f$3(...i$1))},dispose:()=>{e$3.clear(),t.clear()},get count(){return e$3.size}}}function _n$1(){let e$3=!0,t=!0,r$2=!1,n$2=new Clock$1(!1),o$1=ref(n$2.running),l$1=ref(!1),s$1,a$2=MathUtils.generateUUID(),c$4=null,i$1=ve(),f$3=ve(),v$2=ve();S$2();let u$1={};function _$2(M$1){u$1=M$1}function d$2(M$1,x$3,m$3=0){switch(x$3){case`before`:return i$1.on(M$1,m$3);case`render`:return c$4||=M$1,f$3.dispose(),f$3.on(M$1);case`after`:return v$2.on(M$1,m$3)}}function y$3(){t&&(t=!1,S$2(),E$2())}function p$5(){t=!0,S$2(),cancelAnimationFrame(s$1)}function h$3(){r$2=!1,S$2()}function P$2(){r$2=!0,S$2()}function C$3(){l$1.value=!0}function b$4(){l$1.value=!1}function E$2(){if(!e$3){s$1=requestAnimationFrame(E$2);return}let M$1=n$2.getDelta(),x$3=n$2.getElapsedTime(),m$3={camera:unref(u$1.camera),scene:unref(u$1.scene),renderer:unref(u$1.renderer),raycaster:unref(u$1.raycaster),controls:unref(u$1.controls),invalidate:u$1.invalidate,advance:u$1.advance},w$2={delta:M$1,elapsed:x$3,clock:n$2,...m$3};o$1.value&&i$1.trigger(w$2),l$1.value||(f$3.count?f$3.trigger(w$2):c$4&&c$4(w$2)),o$1.value&&v$2.trigger(w$2),s$1=requestAnimationFrame(E$2)}function S$2(){let M$1=!t&&!r$2;n$2.running!==M$1&&(n$2.running?n$2.stop():n$2.start()),o$1.value=n$2.running}return{loopId:a$2,register:(M$1,x$3,m$3)=>d$2(M$1,x$3,m$3),start:y$3,stop:p$5,pause:P$2,resume:h$3,pauseRender:C$3,resumeRender:b$4,isRenderPaused:l$1,isActive:o$1,setContext:_$2,setReady:M$1=>e$3=M$1}}function Le$1(e$3){let t=0;return e$3.traverse(r$2=>{if(r$2.isMesh&&r$2.geometry&&r$2.type!==`HightlightMesh`){let n$2=r$2.geometry,o$1=n$2.attributes.position.count*3*Float32Array.BYTES_PER_ELEMENT,l$1=n$2.index?n$2.index.count*Uint32Array.BYTES_PER_ELEMENT:0,s$1=n$2.attributes.normal?n$2.attributes.normal.count*3*Float32Array.BYTES_PER_ELEMENT:0,a$2=n$2.attributes.uv?n$2.attributes.uv.count*2*Float32Array.BYTES_PER_ELEMENT:0,c$4=o$1+l$1+s$1+a$2;t+=c$4}}),t}function wn$1(e$3){return(e$3/1024).toFixed(2)}const bn$1=Number.parseInt(REVISION.replace(`dev`,``));function Mn$1(e$3){return e$3 instanceof Color?e$3:Array.isArray(e$3)?new Color(...e$3):new Color(e$3)}const oe$1={realistic:{shadows:!0,physicallyCorrectLights:!0,outputColorSpace:SRGBColorSpace,toneMapping:ACESFilmicToneMapping,toneMappingExposure:3,shadowMap:{enabled:!0,type:PCFSoftShadowMap}},flat:{toneMapping:NoToneMapping,toneMappingExposure:1}};function Pn$1({canvas:e$3,options:t,contextParts:{sizes:r$2,render:n$2,invalidate:o$1,advance:l$1}}){let s$1=computed(()=>({alpha:toValue(t.alpha)??!0,depth:toValue(t.depth),canvas:unrefElement(e$3),context:toValue(t.context),stencil:toValue(t.stencil),antialias:toValue(t.antialias)??!0,precision:toValue(t.precision),powerPreference:toValue(t.powerPreference),premultipliedAlpha:toValue(t.premultipliedAlpha),preserveDrawingBuffer:toValue(t.preserveDrawingBuffer),logarithmicDepthBuffer:toValue(t.logarithmicDepthBuffer),failIfMajorPerformanceCaveat:toValue(t.failIfMajorPerformanceCaveat)})),a$2=shallowRef(new WebGLRenderer(s$1.value));function c$4(){t.renderMode===`on-demand`&&o$1()}watch(s$1,()=>{a$2.value.dispose(),a$2.value=new WebGLRenderer(s$1.value),c$4()}),watch([r$2.width,r$2.height],()=>{a$2.value.setSize(r$2.width.value,r$2.height.value),c$4()},{immediate:!0}),watch(()=>t.clearColor,c$4);let{pixelRatio:i$1}=useDevicePixelRatio(),{logError:f$3}=Q$2(),u$1=(()=>{let d$2=new WebGLRenderer,y$3={shadowMap:{enabled:d$2.shadowMap.enabled,type:d$2.shadowMap.type},toneMapping:d$2.toneMapping,toneMappingExposure:d$2.toneMappingExposure,outputColorSpace:d$2.outputColorSpace};return d$2.dispose(),y$3})(),_$2=toValue(t.renderMode);return _$2===`on-demand`&&o$1(),_$2===`manual`&&setTimeout(()=>{l$1()},100),watchEffect(()=>{let d$2=toValue(t.preset);d$2&&(d$2 in oe$1||f$3(`Renderer Preset must be one of these: ${Object.keys(oe$1).join(`, `)}`),gt$2(a$2.value,oe$1[d$2])),fn$5(a$2.value,i$1.value,toValue(t.dpr)),_$2===`always`&&(n$2.frames.value=Math.max(1,n$2.frames.value));let y$3=(P$2,C$3)=>{let b$4=toValue(P$2),E$2=()=>{if(d$2)return qe$1(oe$1[d$2],C$3)};if(b$4!==void 0)return b$4;let S$2=E$2();return S$2===void 0?qe$1(u$1,C$3):S$2},p$5=(P$2,C$3)=>en$1(a$2.value,C$3,y$3(P$2,C$3));p$5(t.shadows,`shadowMap.enabled`),p$5(t.toneMapping??ACESFilmicToneMapping,`toneMapping`),p$5(t.shadowMapType,`shadowMap.type`),bn$1<150&&p$5(!t.useLegacyLights,`physicallyCorrectLights`),p$5(t.outputColorSpace,`outputColorSpace`),p$5(t.toneMappingExposure,`toneMappingExposure`);let h$3=y$3(t.clearColor,`clearColor`);h$3&&a$2.value.setClearColor(h$3?Mn$1(h$3):new Color(0))}),onUnmounted(()=>{a$2.value.dispose(),a$2.value.forceContextLoss()}),{renderer:a$2}}function Cn$1(e$3,t,r$2=10){let n$2=toValue(e$3)?useWindowSize$1():useElementSize(computed(()=>toValue(t).parentElement)),o$1=readonly(refDebounced$1(n$2.width,r$2)),l$1=readonly(refDebounced$1(n$2.height,r$2)),s$1=computed(()=>o$1.value/l$1.value);return{height:l$1,width:o$1,aspectRatio:s$1}}const En$1=(e$3,t)=>{let r$2=computed(()=>t.renderer.value.domElement),n$2=shallowRef([]),{x:o$1,y:l$1}=usePointer$1({target:r$2}),s$1=0,{width:a$2,height:c$4,top:i$1,left:f$3}=useElementBounding$1(r$2),v$2=({x:g$2,y:T$1})=>{if(r$2.value)return{x:(g$2-f$3.value)/a$2.value*2-1,y:-((T$1-i$1.value)/c$4.value)*2+1}},u$1=({x:g$2,y:T$1})=>{if(t.camera.value)return t.raycaster.value.setFromCamera(new Vector2(g$2,T$1),t.camera.value),n$2.value=t.raycaster.value.intersectObjects(e$3.value,!0),n$2.value},_$2=g$2=>{let T$1=v$2({x:g$2?.clientX??o$1.value,y:g$2?.clientY??l$1.value});return T$1&&u$1(T$1)||[]},d$2=createEventHook$1(),y$3=createEventHook$1(),p$5=createEventHook$1(),h$3=createEventHook$1(),P$2=createEventHook$1(),C$3=createEventHook$1(),b$4=createEventHook$1(),E$2=createEventHook$1();function S$2(g$2){let T$1={};for(let U in g$2)typeof U!=`function`&&(T$1[U]=g$2[U]);return T$1}let M$1=(g$2,T$1)=>{var Ie,$e$2,He$2;let U=S$2(T$1),re$3=new Vector3(T$1?.clientX,T$1?.clientY,0).unproject((Ie=t.camera)?.value);g$2.trigger({...U,intersections:n$2.value,unprojectedPoint:re$3,ray:($e$2=t.raycaster)?.value.ray,camera:(He$2=t.camera)?.value,sourceEvent:T$1,delta:s$1,stopPropagating:!1})},x$3,m$3=g$2=>{_$2(g$2),M$1(p$5,g$2),x$3=g$2},w$2=()=>{x$3&&m$3(x$3)},k$4,L$1,R$3,B$2=g$2=>{var T$1;k$4=(T$1=n$2.value[0])?.object,s$1=0,L$1=new Vector2(g$2?.clientX??o$1.value,g$2?.clientY??l$1.value),M$1(P$2,g$2)},O$3,G$2=!1,Oe$2=g$2=>{var T$1,U,re$3;g$2 instanceof PointerEvent&&(n$2.value.length===0&&M$1(C$3,g$2),k$4===(T$1=n$2.value[0])?.object&&(R$3=new Vector2(g$2?.clientX??o$1.value,g$2?.clientY??l$1.value),s$1=L$1?.distanceTo(R$3),g$2.button===0?(M$1(d$2,g$2),O$3===(U=n$2.value[0])?.object?G$2=!0:(O$3=(re$3=n$2.value[0])?.object,G$2=!1)):g$2.button===2&&M$1(b$4,g$2)),M$1(h$3,g$2))},De=g$2=>{G$2&&(M$1(y$3,g$2),O$3=void 0,G$2=!1)},je$1=g$2=>M$1(p$5,g$2),Be$2=g$2=>M$1(E$2,g$2);return r$2.value.addEventListener(`pointerup`,Oe$2),r$2.value.addEventListener(`pointerdown`,B$2),r$2.value.addEventListener(`pointermove`,m$3),r$2.value.addEventListener(`pointerleave`,je$1),r$2.value.addEventListener(`dblclick`,De),r$2.value.addEventListener(`wheel`,Be$2),onUnmounted(()=>{r$2!=null&&r$2.value&&(r$2.value.removeEventListener(`pointerup`,Oe$2),r$2.value.removeEventListener(`pointerdown`,B$2),r$2.value.removeEventListener(`pointermove`,m$3),r$2.value.removeEventListener(`pointerleave`,je$1),r$2.value.removeEventListener(`dblclick`,De),r$2.value.removeEventListener(`wheel`,Be$2))}),{intersects:n$2,onClick:g$2=>d$2.on(g$2).off,onDblClick:g$2=>y$3.on(g$2).off,onContextMenu:g$2=>b$4.on(g$2).off,onPointerMove:g$2=>p$5.on(g$2).off,onPointerUp:g$2=>h$3.on(g$2).off,onPointerDown:g$2=>P$2.on(g$2).off,onPointerMissed:g$2=>C$3.on(g$2).off,onWheel:g$2=>E$2.on(g$2).off,forceUpdate:w$2}};function ye(e$3,t){if(Array.isArray(e$3))for(let r$2 of e$3)r$2(t);typeof e$3==`function`&&e$3(t)}function Tn$1(e$3,t,r$2){var x$3;let n$2=shallowRef(),o$1=shallowRef();e$3&&(n$2.value=e$3),t&&(o$1.value=t);let l$1=m$3=>{var w$2;return(w$2=m$3.__tres)?.eventCount>0},s$1=m$3=>{var w$2;return(w$2=m$3.children)?.some(k$4=>s$1(k$4))||l$1(m$3)},a$2=shallowRef(((x$3=n$2.value)?.children).filter(s$1)||[]);function c$4(m$3,w$2){let k$4=[],L$1=()=>w$2.stopPropagating=!0;w$2.stopPropagation=L$1;for(let R$3 of w$2?.intersections){if(w$2.stopPropagating)return;w$2={...w$2,...R$3};let{object:B$2}=R$3;w$2.eventObject=B$2,ye(B$2[m$3],w$2),k$4.push(B$2);let O$3=B$2.parent;for(;O$3!==null&&!w$2.stopPropagating&&!k$4.includes(O$3);)w$2.eventObject=O$3,ye(O$3[m$3],w$2),k$4.push(O$3),O$3=O$3.parent;let G$2=Xr$1(m$3.slice(2));r$2(G$2,{intersection:R$3,event:w$2})}}let{onClick:i$1,onDblClick:f$3,onContextMenu:v$2,onPointerMove:u$1,onPointerDown:_$2,onPointerUp:d$2,onPointerMissed:y$3,onWheel:p$5,forceUpdate:h$3}=En$1(a$2,t);d$2(m$3=>c$4(`onPointerUp`,m$3)),_$2(m$3=>c$4(`onPointerDown`,m$3)),i$1(m$3=>c$4(`onClick`,m$3)),f$3(m$3=>c$4(`onDoubleClick`,m$3)),v$2(m$3=>c$4(`onContextMenu`,m$3)),p$5(m$3=>c$4(`onWheel`,m$3));let P$2=[];u$1(m$3=>{let w$2=m$3.intersections.map(({object:L$1})=>L$1),k$4=m$3.intersections;P$2.forEach(({object:L$1})=>{w$2.includes(L$1)||(m$3.intersections=P$2,c$4(`onPointerLeave`,m$3),c$4(`onPointerOut`,m$3))}),m$3.intersections=k$4,m$3.intersections.forEach(({object:L$1})=>{P$2.includes(L$1)||(c$4(`onPointerEnter`,m$3),c$4(`onPointerOver`,m$3))}),c$4(`onPointerMove`,m$3),P$2=m$3.intersections});let C$3=[];y$3(m$3=>{let w$2=()=>m$3.stopPropagating=!0;m$3.stopPropagation=w$2,C$3.forEach(k$4=>{m$3.stopPropagating||(m$3.eventObject=k$4,ye(k$4.onPointerMissed,m$3))}),r$2(`pointer-missed`,{event:m$3})});function b$4(m$3){ne$1(m$3)&&N$1(m$3)&&a$2.value.push(m$3)}function E$2(m$3){if(ne$1(m$3)&&N$1(m$3)){let w$2=a$2.value.indexOf(m$3);w$2>-1&&a$2.value.splice(w$2,1)}}function S$2(m$3){ne$1(m$3)&&N$1(m$3)&&m$3.onPointerMissed&&C$3.push(m$3)}function M$1(m$3){if(ne$1(m$3)&&N$1(m$3)){let w$2=C$3.indexOf(m$3);w$2>-1&&C$3.splice(w$2,1)}}return t.eventManager={forceUpdate:h$3,registerObject:b$4,deregisterObject:E$2,registerPointerMissedObject:S$2,deregisterPointerMissedObject:M$1},{forceUpdate:h$3,registerObject:b$4,deregisterObject:E$2,registerPointerMissedObject:S$2,deregisterPointerMissedObject:M$1}}function Sn$1(e$3,t,r$2=100){r$2=r$2<=0?100:r$2;let n$2=createEventHook$1(),o$1=new Set,l$1=!1,s$1=!1,a$2=null;function c$4(){a$2&&clearTimeout(a$2),!s$1&&!l$1&&e$3()?(n$2.trigger(t),o$1.forEach(u$1=>u$1()),o$1.clear(),l$1=!0):!s$1&&!l$1&&(a$2=setTimeout(c$4,r$2))}function i$1(){s$1=!0,a$2&&clearTimeout(a$2)}c$4();let f$3=(u$1,..._$2)=>{u$1(..._$2)};return{on:u$1=>{if(l$1)return f$3(u$1,t),{off:()=>{}};{let _$2=n$2.on(u$1);return o$1.add(_$2.off),n$2.on(u$1)}},off:n$2.off,trigger:n$2.trigger,clear:n$2.clear,cancel:i$1}}const ee$2=new WeakMap;function bt$3(e$3){if(e$3||=pe$2(),ee$2.has(e$3))return ee$2.get(e$3);let t=100,r$2=Date.now(),l$1=Sn$1(()=>{if(Date.now()-r$2>=t)return!0;{let s$1=e$3.renderer.value,a$2=s$1?.domElement||{width:0,height:0};return!!(s$1&&a$2.width>0&&a$2.height>0)}},e$3);return ee$2.set(e$3,l$1),l$1}function An({scene:e$3,canvas:t,windowSize:r$2,rendererOptions:n$2,emit:o$1}){let l$1=shallowRef(e$3),s$1=Cn$1(r$2,t),{camera:a$2,cameras:c$4,registerCamera:i$1,deregisterCamera:f$3,setCameraActive:v$2}=mn$1({sizes:s$1}),u$1={mode:ref(n$2.renderMode||`always`),priority:ref(0),frames:ref(0),maxFrames:60,canBeInvalidated:computed(()=>u$1.mode.value===`on-demand`&&u$1.frames.value===0)};function _$2(R$3=1){n$2.renderMode===`on-demand`&&(u$1.frames.value=Math.min(u$1.maxFrames,u$1.frames.value+R$3))}function d$2(){n$2.renderMode===`manual`&&(u$1.frames.value=1)}let{renderer:y$3}=Pn$1({canvas:t,options:n$2,contextParts:{sizes:s$1,render:u$1,invalidate:_$2,advance:d$2}}),p$5={sizes:s$1,scene:l$1,camera:a$2,cameras:readonly(c$4),renderer:y$3,raycaster:shallowRef(new Raycaster),controls:ref(null),perf:{maxFrames:160,fps:{value:0,accumulator:[]},memory:{currentMem:0,allocatedMem:0,accumulator:[]}},render:u$1,advance:d$2,extend:Ee$1,invalidate:_$2,registerCamera:i$1,setCameraActive:v$2,deregisterCamera:f$3,loop:_n$1()};provide(`useTres`,p$5),p$5.scene.value.__tres={root:p$5},p$5.loop.register(()=>{a$2.value&&u$1.frames.value>0&&(y$3.value.render(e$3,a$2.value),o$1(`render`,p$5.renderer.value)),u$1.priority.value=0,u$1.mode.value===`always`?u$1.frames.value=1:u$1.frames.value=Math.max(0,u$1.frames.value-1)},`render`);let{on:h$3,cancel:P$2}=bt$3(p$5);p$5.loop.setReady(!1),p$5.loop.start(),h$3(()=>{o$1(`ready`,p$5),p$5.loop.setReady(!0),Tn$1(e$3,p$5,o$1)}),onUnmounted(()=>{P$2(),p$5.loop.stop()});let C$3=100,b$4=useFps({every:C$3}),{isSupported:E$2,memory:S$2}=useMemory({interval:C$3}),M$1=160,x$3=performance.now(),m$3=({timestamp:R$3})=>{p$5.scene.value&&(p$5.perf.memory.allocatedMem=Le$1(p$5.scene.value)),R$3-x$3>=C$3&&(x$3=R$3,p$5.perf.fps.accumulator.push(b$4.value),p$5.perf.fps.accumulator.length>M$1&&p$5.perf.fps.accumulator.shift(),p$5.perf.fps.value=b$4.value,E$2.value&&S$2.value&&(p$5.perf.memory.accumulator.push(S$2.value.usedJSHeapSize/1024/1024),p$5.perf.memory.accumulator.length>M$1&&p$5.perf.memory.accumulator.shift(),p$5.perf.memory.currentMem=p$5.perf.memory.accumulator.reduce((B$2,O$3)=>B$2+O$3,0)/p$5.perf.memory.accumulator.length))},w$2=0,k$4=1,{pause:L$1}=useRafFn(({delta:R$3})=>{window.__TRES__DEVTOOLS__&&(m$3({timestamp:performance.now()}),w$2+=R$3,w$2>=k$4&&(window.__TRES__DEVTOOLS__.cb(p$5),w$2=0))},{immediate:!0});return onUnmounted(()=>{L$1()}),p$5}function pe$2(){let e$3=inject(`useTres`);if(!e$3)throw Error(`useTresContext must be used together with useTresContextProvider`);return e$3}function io$1(){let{camera:e$3,scene:t,renderer:r$2,loop:n$2,raycaster:o$1,controls:l$1,invalidate:s$1,advance:a$2}=pe$2();n$2.setContext({camera:e$3,scene:t,renderer:r$2,raycaster:o$1,controls:l$1,invalidate:s$1,advance:a$2});function c$4(v$2,u$1=0){return n$2.register(v$2,`before`,u$1)}function i$1(v$2){return n$2.register(v$2,`render`)}function f$3(v$2,u$1=0){return n$2.register(v$2,`after`,u$1)}return{pause:n$2.pause,resume:n$2.resume,pauseRender:n$2.pauseRender,resumeRender:n$2.resumeRender,isActive:n$2.isActive,onBeforeRender:c$4,render:i$1,onAfterRender:f$3}}const Mt$2=createEventHook$1(),Pt$2=createEventHook$1(),Re$1=createEventHook$1(),te$2=new Clock$1;let le$1=0,ce$1=0;const{pause:xn$1,resume:Xe,isActive:kn$1}=useRafFn(()=>{Mt$2.trigger({delta:le$1,elapsed:ce$1,clock:te$2}),Pt$2.trigger({delta:le$1,elapsed:ce$1,clock:te$2}),Re$1.trigger({delta:le$1,elapsed:ce$1,clock:te$2})},{immediate:!1});Re$1.on(()=>{le$1=te$2.getDelta(),ce$1=te$2.getElapsedTime()});function Ln(e$3,t={},r$2={}){let n$2=e$3,o$1=a$2=>{n$2=a$2},l$1=new Proxy({},{}),s$1={has(a$2,c$4){return c$4 in t||c$4 in n$2},get(a$2,c$4,i$1){return c$4 in t?t[c$4](n$2):n$2[c$4]},set(a$2,c$4,i$1){return r$2[c$4]?r$2[c$4](i$1,n$2,l$1,o$1):n$2[c$4]=i$1,!0}};return l$1=new Proxy({},s$1),l$1}const{logError:et$1}=Q$2(),tt$2=[`onClick`,`onContextMenu`,`onPointerMove`,`onPointerEnter`,`onPointerLeave`,`onPointerOver`,`onPointerOut`,`onDoubleClick`,`onPointerDown`,`onPointerUp`,`onPointerCancel`,`onPointerMissed`,`onLostPointerCapture`,`onWheel`],Rn$1=e$3=>{let t=e$3.scene.value;function r$2(i$1,f$3,v$2,u$1){if(u$1||={},u$1.args||=[],i$1===`template`||Jr$1(i$1))return null;let _$2=i$1.replace(`Tres`,``),d$2;if(i$1===`primitive`){(!j(u$1.object)||isRef(u$1.object))&&et$1(`Tres primitives need an 'object' prop, whose value is an object or shallowRef`),_$2=u$1.object.type;let y$3={};d$2=Ln(u$1.object,{object:h$3=>h$3,isPrimitive:()=>!0,__tres:()=>y$3},{object:(h$3,P$2,C$3,b$4)=>{pn$1(h$3,C$3,b$4,{patchProp:l$1,remove:o$1,insert:n$2},e$3)},__tres:h$3=>{Object.assign(y$3,h$3)}})}else{let y$3=Ce$2.value[_$2];y$3||et$1(`${_$2} is not defined on the THREE namespace. Use extend to add it to the catalog.`),d$2=new y$3(...u$1.args)}return d$2?(d$2.isCamera&&(u$1!=null&&u$1.position||d$2.position.set(3,3,3),u$1!=null&&u$1.lookAt||d$2.lookAt(0,0,0)),d$2=z$2(d$2,{...d$2.__tres,type:_$2,memoizedProps:u$1,eventCount:0,primitive:i$1===`primitive`,attach:u$1.attach},e$3),d$2):null}function n$2(i$1,f$3){var _$2,d$2,y$3;if(!i$1)return;f$3||=t;let v$2=i$1.__tres?i$1:z$2(i$1,{},e$3),u$1=f$3.__tres?f$3:z$2(f$3,{},e$3);i$1=J$1(v$2),f$3=J$1(u$1),i$1.__tres&&(_$2=i$1.__tres)?.eventCount>0&&((d$2=e$3.eventManager)==null||d$2.registerObject(i$1)),e$3.registerCamera(i$1),(y$3=e$3.eventManager)==null||y$3.registerPointerMissedObject(i$1),v$2.__tres.attach?cn$2(u$1,v$2,v$2.__tres.attach):N$1(i$1)&&N$1(u$1)&&(u$1.add(i$1),i$1.dispatchEvent({type:`added`})),v$2.__tres.parent=u$1,u$1.__tres.objects&&!u$1.__tres.objects.includes(v$2)&&u$1.__tres.objects.push(v$2)}function o$1(i$1,f$3){var d$2,y$3,p$5,h$3;if(!i$1)return;i$1!=null&&i$1.__tres&&(d$2=i$1.__tres)?.eventCount>0&&((y$3=e$3.eventManager)==null||y$3.deregisterObject(i$1)),f$3=be$1(f$3)?`default`:f$3;let v$2=(p$5=i$1.__tres)?.dispose;be$1(v$2)||(f$3=v$2===null?!1:v$2);let u$1=(h$3=i$1.__tres)?.primitive,_$2=f$3===`default`?!u$1:!!f$3;if(i$1.__tres&&`objects`in i$1.__tres&&[...i$1.__tres.objects].forEach(P$2=>o$1(P$2,f$3)),_$2&&i$1.children&&[...i$1.children].forEach(P$2=>o$1(P$2,f$3)),_t$3(i$1,e$3),wt$3(i$1,e$3),_$2&&!Yr$1(i$1)){if(Y$1(f$3))f$3(i$1);else if(Y$1(i$1.dispose))try{i$1.dispose()}catch{}}`__tres`in i$1&&delete i$1.__tres}function l$1(i$1,f$3,v$2,u$1){var P$2,C$3;if(!i$1)return;let _$2=i$1,d$2=f$3;if(i$1.__tres&&(i$1.__tres.memoizedProps[f$3]=u$1),f$3===`attach`){let b$4=(P$2=i$1.__tres)?.parent||i$1.parent;o$1(i$1),z$2(i$1,{attach:u$1},e$3),b$4&&n$2(i$1,b$4);return}if(f$3===`dispose`){i$1.__tres||(i$1=z$2(i$1,{},e$3)),i$1.__tres.dispose=u$1;return}if(N$1(i$1)&&d$2===`blocks-pointer-events`){u$1||u$1===``?i$1[d$2]=u$1:delete i$1[d$2];return}tt$2.includes(f$3)&&i$1.__tres&&(i$1.__tres.eventCount+=1);let y$3=he$1(d$2),p$5=_$2?.[y$3];if(d$2===`args`){let b$4=i$1,E$2=v$2??[],S$2=u$1??[],M$1=(C$3=i$1.__tres)?.type||i$1.type;M$1&&E$2.length&&!tn$1(E$2,S$2)&&(_$2=Object.assign(b$4,new Ce$2.value[M$1](...u$1)));return}if(_$2.type===`BufferGeometry`){if(d$2===`args`)return;_$2.setAttribute(he$1(d$2),new BufferAttribute(...u$1));return}if(d$2.includes(`-`)&&p$5===void 0){p$5=_$2;for(let b$4 of d$2.split(`-`))y$3=d$2=he$1(b$4),_$2=p$5,p$5=p$5?.[d$2]}let h$3=u$1;if(h$3===``&&(h$3=!0),Y$1(p$5)){tt$2.includes(f$3)||(ke(h$3)?i$1[y$3](...h$3):i$1[y$3](h$3)),y$3.startsWith(`on`)&&Y$1(h$3)&&(_$2[y$3]=h$3);return}Ge$1(p$5)&&Ge$1(h$3)?p$5.mask=h$3.mask:mt$2(p$5)&&Ur$1(h$3)?p$5.set(h$3):Fr(p$5)&&Wr$1(h$3)&&p$5.constructor===h$3.constructor?p$5.copy(h$3):Me$1(p$5)&&Array.isArray(h$3)?`fromArray`in p$5&&typeof p$5.fromArray==`function`?p$5.fromArray(h$3):p$5.set(...h$3):Me$1(p$5)&&typeof h$3==`number`?`setScalar`in p$5&&typeof p$5.setScalar==`function`?p$5.setScalar(h$3):p$5.set(h$3):_$2[y$3]=h$3,yt$3(i$1)}function s$1(i$1){var f$3;return(f$3=i$1?.__tres)?.parent||null}function a$2(i$1){let f$3=z$2(new Object3D,{type:`Comment`},e$3);return f$3.name=i$1,f$3}function c$4(i$1){var _$2;let f$3=s$1(i$1),v$2=(_$2=f$3?.__tres)?.objects||[],u$1=v$2.indexOf(i$1);return u$1<0||u$1>=v$2.length-1?null:v$2[u$1+1]}return{insert:n$2,remove:o$1,createElement:r$2,patchProp:l$1,parentNode:s$1,createText:()=>void 0,createComment:a$2,setText:()=>void 0,setElementText:()=>void 0,nextSibling:c$4,querySelector:()=>void 0,setScopeId:()=>void 0,cloneNode:()=>void 0,insertStaticContent:()=>void 0}};function On$1(){return Ct$2().__VUE_DEVTOOLS_GLOBAL_HOOK__}function Ct$2(){return typeof navigator<`u`&&typeof window<`u`?window:typeof globalThis<`u`?globalThis:{}}const Dn$1=typeof Proxy==`function`,jn$1=`devtools-plugin:setup`,Bn$1=`plugin:settings:set`;let V$1,Te$3;function In$1(){var e$3;return V$1!==void 0||(typeof window<`u`&&window.performance?(V$1=!0,Te$3=window.performance):typeof globalThis<`u`&&(e$3=globalThis.perf_hooks)!=null&&e$3.performance?(V$1=!0,Te$3=globalThis.perf_hooks.performance):V$1=!1),V$1}function $n$1(){return In$1()?Te$3.now():Date.now()}var Hn=class{constructor(t,r$2){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=t,this.hook=r$2;let n$2={};if(t.settings)for(let s$1 in t.settings){let a$2=t.settings[s$1];n$2[s$1]=a$2.defaultValue}let o$1=`__vue-devtools-plugin-settings__${t.id}`,l$1=Object.assign({},n$2);try{let s$1=localStorage.getItem(o$1),a$2=JSON.parse(s$1);Object.assign(l$1,a$2)}catch{}this.fallbacks={getSettings(){return l$1},setSettings(s$1){try{localStorage.setItem(o$1,JSON.stringify(s$1))}catch{}l$1=s$1},now(){return $n$1()}},r$2&&r$2.on(Bn$1,(s$1,a$2)=>{s$1===this.plugin.id&&this.fallbacks.setSettings(a$2)}),this.proxiedOn=new Proxy({},{get:(s$1,a$2)=>this.target?this.target.on[a$2]:(...c$4)=>{this.onQueue.push({method:a$2,args:c$4})}}),this.proxiedTarget=new Proxy({},{get:(s$1,a$2)=>this.target?this.target[a$2]:a$2===`on`?this.proxiedOn:Object.keys(this.fallbacks).includes(a$2)?(...c$4)=>(this.targetQueue.push({method:a$2,args:c$4,resolve:()=>{}}),this.fallbacks[a$2](...c$4)):(...c$4)=>new Promise(i$1=>{this.targetQueue.push({method:a$2,args:c$4,resolve:i$1})})})}async setRealTarget(t){this.target=t;for(let r$2 of this.onQueue)this.target.on[r$2.method](...r$2.args);for(let r$2 of this.targetQueue)r$2.resolve(await this.target[r$2.method](...r$2.args))}};function Un$1(e$3,t){let r$2=e$3,n$2=Ct$2(),o$1=On$1(),l$1=Dn$1&&r$2.enableEarlyProxy;if(o$1&&(n$2.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!l$1))o$1.emit(jn$1,e$3,t);else{let s$1=l$1?new Hn(r$2,o$1):null;(n$2.__VUE_DEVTOOLS_PLUGINS__=n$2.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:r$2,setupFn:t,proxy:s$1}),s$1&&t(s$1.proxiedTarget)}}function Fn(e$3,t){let r$2=`▲ ■ ●${e$3}`;typeof rt$4==`function`?rt$4(r$2,t):console.log(r$2)}function rt$4(e$3,t){throw Error(e$3+t)}const Et$1=e$3=>{let t={id:e$3.uuid,label:e$3.type,children:[],tags:[]};e$3.name!==``&&t.tags.push({label:e$3.name,textColor:5750629,backgroundColor:15793395});let r$2=Le$1(e$3);return r$2>0&&t.tags.push({label:`${wn$1(r$2)} KB`,textColor:15707189,backgroundColor:16775644,tooltip:`Memory usage`}),e$3.type.includes(`Light`)&&(Gr$1(e$3)&&t.tags.push({label:`${e$3.intensity}`,textColor:9738662,backgroundColor:16316922,tooltip:`Intensity`}),t.tags.push({label:`#${new Color(e$3.color).getHexString()}`,textColor:9738662,backgroundColor:16316922,tooltip:`Color`})),e$3.type.includes(`Camera`)&&(t.tags.push({label:`${e$3.fov}°`,textColor:9738662,backgroundColor:16316922,tooltip:`Field of view`}),t.tags.push({label:`x: ${Math.round(e$3.position.x)} y: ${Math.round(e$3.position.y)} z: ${Math.round(e$3.position.z)}`,textColor:9738662,backgroundColor:16316922,tooltip:`Position`})),t};function Tt$3(e$3,t,r$2=``){e$3.children.forEach(n$2=>{if(n$2.type===`HightlightMesh`||r$2&&!n$2.type.includes(r$2)&&!n$2.name.includes(r$2))return;let o$1=Et$1(n$2);t.children.push(o$1),Tt$3(n$2,o$1,r$2)})}const Wn$1=[],X$1=`tres:inspector`,Nn=reactive({sceneGraph:null});function zn(e$3,t){Un$1({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$1,app:e$3},r$2=>{typeof r$2.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$2.addInspector({id:X$1,label:`TresJS 🪐`,icon:`account_tree`,treeFilterPlaceholder:`Search instances`}),setInterval(()=>{r$2.sendInspectorTree(X$1)},1e3),setInterval(()=>{r$2.notifyComponentUpdate()},5e3),r$2.on.getInspectorTree(l$1=>{if(l$1.inspectorId===X$1){let s$1=Et$1(t.scene.value);Tt$3(t.scene.value,s$1,l$1.filter),Nn.sceneGraph=s$1,l$1.rootNodes=[s$1]}});let n$2=null,o$1=null;r$2.on.getInspectorState(l$1=>{var s$1;if(l$1.inspectorId===X$1){let[a$2]=t.scene.value.getObjectsByProperty(`uuid`,l$1.nodeId);if(!a$2)return;if(o$1&&n$2&&n$2.parent&&o$1.remove(n$2),a$2.isMesh){let c$4=on$1(a$2);a$2.add(c$4),n$2=c$4,o$1=a$2}l$1.state={object:Object.entries(a$2).map(([c$4,i$1])=>c$4===`children`?{key:c$4,value:i$1.filter(f$3=>f$3.type!==`HightlightMesh`)}:{key:c$4,value:i$1,editable:!0}).filter(({key:c$4})=>c$4!==`parent`)},a$2.isScene&&(l$1.state={...l$1.state,state:[{key:`Scene Info`,value:{objects:a$2.children.length,memory:Le$1(a$2),calls:t.renderer.value.info.render.calls,triangles:t.renderer.value.info.render.triangles,points:t.renderer.value.info.render.points,lines:t.renderer.value.info.render.lines}},{key:`Programs`,value:(s$1=t.renderer.value.info.programs)?.map(c$4=>({...c$4,programName:c$4.name}))||[]}]})}}),r$2.on.editInspectorState(l$1=>{l$1.inspectorId===X$1&&nn$1(t.scene.value,l$1.nodeId,l$1.path,l$1.state.value)})})}const Gn$1=[`data-scene`,`data-tres`],Vn$1=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$3,{expose:t,emit:r$2}){let n$2=e$3,o$1=r$2,l$1=useSlots(),s$1=ref(),a$2=shallowRef(new Scene),c$4=getCurrentInstance();Ee$1(three_module_exports);let i$1=(d$2,y$3=!1)=>defineComponent({setup(){var C$3;let p$5=(C$3=getCurrentInstance())?.appContext;p$5&&(p$5.app=c$4?.appContext.app);let h$3={};function P$2(b$4){b$4&&(b$4.parent&&P$2(b$4.parent),b$4.provides&&Object.assign(h$3,b$4.provides))}return c$4!=null&&c$4.parent&&n$2.enableProvideBridge&&(P$2(c$4.parent),Reflect.ownKeys(h$3).forEach(b$4=>{provide(b$4,h$3[b$4])})),provide(`useTres`,d$2),provide(`extend`,Ee$1),typeof window<`u`&&zn(p$5?.app,d$2),()=>h(Fragment,null,y$3?[]:l$1.default())}}),f$3=(d$2,y$3=!1)=>{let p$5=i$1(d$2,y$3),{render:h$3}=createRenderer(Rn$1(d$2));h$3(h(p$5),a$2.value)},v$2=(d$2,y$3=!1)=>{vt$3(d$2.scene.value),y$3&&(d$2.renderer.value.dispose(),d$2.renderer.value.renderLists.dispose(),d$2.renderer.value.forceContextLoss()),a$2.value.__tres={root:d$2}},u$1=shallowRef(null);t({context:u$1,dispose:()=>v$2(u$1.value,!0)});let _$2=()=>{v$2(u$1.value),f$3(u$1.value,!0)};return onMounted(()=>{let d$2=s$1;u$1.value=An({scene:a$2.value,canvas:d$2,windowSize:n$2.windowSize??!1,rendererOptions:n$2,emit:o$1});let{registerCamera:y$3,camera:p$5,cameras:h$3,deregisterCamera:P$2}=u$1.value;f$3(u$1.value);let C$3=()=>{let b$4=new PerspectiveCamera(45,window.innerWidth/window.innerHeight,.1,1e3);b$4.position.set(3,3,3),b$4.lookAt(0,0,0),y$3(b$4);let E$2=watchEffect(()=>{h$3.value.length>=2&&(b$4.removeFromParent(),P$2(b$4),E$2?.())})};watch(()=>n$2.camera,(b$4,E$2)=>{b$4&&y$3(b$4),E$2&&(E$2.removeFromParent(),P$2(E$2))},{immediate:!0}),p$5.value||C$3()}),onUnmounted(_$2),(d$2,y$3)=>(openBlock(),createElementBlock(`canvas`,{ref_key:`canvas`,ref:s$1,"data-scene":a$2.value.uuid,class:normalizeClass(d$2.$attrs.class),"data-tres":`tresjs ${unref(jr$1).version}`,style:normalizeStyle({display:`block`,width:`100%`,height:`100%`,position:d$2.windowSize?`fixed`:`relative`,top:0,left:0,pointerEvents:`auto`,touchAction:`none`,...d$2.$attrs.style})},null,14,Gn$1))}}),Yn$1=[`TresCanvas`,`TresLeches`,`TresScene`],co$1={template:{compilerOptions:{isCustomElement:e$3=>e$3.startsWith(`Tres`)&&!Yn$1.includes(e$3)||e$3===`primitive`}}},{logWarning:qn$1}=Q$2();var St$3=class extends Line{constructor(t,r$2){let n$2=[1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],o$1=new BufferGeometry;o$1.setAttribute(`position`,new Float32BufferAttribute(n$2,3)),o$1.computeBoundingSphere();let l$1=new LineBasicMaterial({fog:!1});super(o$1,l$1),this.light=t,this.color=r$2,this.type=`RectAreaLightHelper`;let s$1=[1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],a$2=new BufferGeometry;a$2.setAttribute(`position`,new Float32BufferAttribute(s$1,3)),a$2.computeBoundingSphere(),this.add(new Mesh(a$2,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=this.material.color,r$2=Math.max(t.r,t.g,t.b);r$2>1&&t.multiplyScalar(1/r$2),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$2}=Q$2();let se,F$1;const Kn={DirectionalLight:DirectionalLightHelper,PointLight:PointLightHelper,SpotLight:SpotLightHelper,HemisphereLight:HemisphereLightHelper,RectAreaLight:St$3},fo$1={mounted:e$3=>{if(!e$3.isLight){nt$2(`${e$3.type} is not a light`);return}se=Kn[e$3.type],e$3.parent.add(new se(e$3,1,e$3.color.getHex()))},updated:e$3=>{F$1=e$3.parent.children.find(t=>t instanceof se),!(F$1 instanceof St$3)&&F$1.update()},unmounted:e$3=>{if(!e$3.isLight){nt$2(`${e$3.type} is not a light`);return}F$1=e$3.parent.children.find(t=>t instanceof se),F$1&&F$1.dispose&&F$1.dispose(),e$3.parent&&e$3.parent.remove(F$1)}},po$1={mounted:(e$3,t)=>{if(t.arg){console.log(`v-log:${t.arg}`,e$3[t.arg]);return}console.log(`v-log`,e$3)}},mo={install(e$3){e$3.component(`TresCanvas`,Vn$1)}};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$2){var started=NProgress$1.isStarted();n$2=clamp$8(n$2,Settings.minimum,1),NProgress$1.status=n$2===1?null:n$2;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$2,speed,ease)),n$2===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$2=NProgress$1.status;return n$2?(typeof amount!=`number`&&(amount=(1-n$2)*clamp$8(Math.random()*n$2,.1,.95)),n$2=clamp$8(n$2+amount,0,.994),NProgress$1.set(n$2)):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$2,min$1,max$1){return n$2max$1?max$1:n$2}function toBarPerc(n$2){return(-1+n$2)*100}function barPositionCSS(n$2,speed,ease){var barCSS;return barCSS=Settings.positionUsing===`translate3d`?{transform:`translate3d(`+toBarPerc(n$2)+`%,0,0)`}:Settings.positionUsing===`translate`?{transform:`translate(`+toBarPerc(n$2)+`%,0)`}:{"margin-left":toBarPerc(n$2)+`%`},barCSS.transition=`all `+speed+`ms `+ease,barCSS}var queue$1=function(){var pending=[];function next(){var fn$6=pending.shift();fn$6&&fn$6(next)}return function(fn$6){pending.push(fn$6),pending.length==1&&next()}}(),css=function(){var cssPrefixes=[`Webkit`,`O`,`Moz`,`ms`],cssProps={};function camelCase(string$2){return string$2.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$1=cssPrefixes.length,capName=name$2.charAt(0).toUpperCase()+name$2.slice(1),vendorName;i$1--;)if(vendorName=cssPrefixes[i$1]+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$1=>animate$2(el$1))},handleResizes=entries=>{entries.forEach(entry=>{entry.target===root$2&&updateAllPos(),coords.has(entry.target)&&updatePos(entry.target)})};function observePosition(el$1){let oldObserver=intersections.get(el$1);oldObserver?.disconnect();let rect=coords.get(el$1),invocations=0,buffer$1=5;rect||(rect=getCoords(el$1),coords.set(el$1,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$1)},{root:root$2,threshold:1,rootMargin});observer.observe(el$1),intersections.set(el$1,observer)}function updatePos(el$1){clearTimeout(debounces.get(el$1));let optionsOrPlugin=getOptions(el$1),delay=isPlugin(optionsOrPlugin)?500:optionsOrPlugin.duration;debounces.set(el$1,setTimeout(async()=>{let currentAnimation=animations.get(el$1);try{await currentAnimation?.finished,coords.set(el$1,getCoords(el$1)),observePosition(el$1)}catch{}},delay))}function updateAllPos(){clearTimeout(debounces.get(root$2)),debounces.set(root$2,setTimeout(()=>{parents.forEach(parent=>forEach(parent,el$1=>lowPriority(()=>updatePos(el$1))))},100))}function poll(el$1){setTimeout(()=>{intervals.set(el$1,setInterval(()=>lowPriority(updatePos.bind(null,el$1)),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$1=0;i$1callback(parent,options.has(parent)));for(let i$1=0;i$1callback(child,options.has(child)))}}function getPluginTuple(pluginReturn){return Array.isArray(pluginReturn)?pluginReturn:[pluginReturn]}function isPlugin(config){return typeof config==`function`}function remain(el$1){let oldCoords=coords.get(el$1),newCoords=getCoords(el$1);if(!isEnabled(el$1))return coords.set(el$1,newCoords);let animation;if(!oldCoords)return;let pluginOrOptions=getOptions(el$1);if(typeof pluginOrOptions!=`function`){let deltaX=oldCoords.left-newCoords.left,deltaY=oldCoords.top-newCoords.top,[widthFrom,widthTo,heightFrom,heightTo]=getTransitionSizes(el$1,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$1.animate([start,end],{duration:pluginOrOptions.duration,easing:pluginOrOptions.easing})}else{let[keyframes$4]=getPluginTuple(pluginOrOptions(el$1,`remain`,oldCoords,newCoords));animation=new Animation(keyframes$4),animation.play()}animations.set(el$1,animation),coords.set(el$1,newCoords),animation.addEventListener(`finish`,updatePos.bind(null,el$1))}function add(el$1){NEW in el$1&&delete el$1[NEW];let newCoords=getCoords(el$1);coords.set(el$1,newCoords);let pluginOrOptions=getOptions(el$1);if(!isEnabled(el$1))return;let animation;if(typeof pluginOrOptions!=`function`)animation=el$1.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$1,`add`,newCoords));animation=new Animation(keyframes$4),animation.play()}animations.set(el$1,animation),animation.addEventListener(`finish`,updatePos.bind(null,el$1))}function cleanUp(el$1,styles){var _a$3;el$1.remove(),coords.delete(el$1),siblings$1.delete(el$1),animations.delete(el$1),(_a$3=intersections.get(el$1))==null||_a$3.disconnect(),setTimeout(()=>{if(DEL in el$1&&delete el$1[DEL],Object.defineProperty(el$1,NEW,{value:!0,configurable:!0}),styles&&el$1 instanceof HTMLElement)for(let style in styles)el$1.style[style]=``},0)}function remove$1(el$1){var _a$3;if(!siblings$1.has(el$1)||!coords.has(el$1))return;let[prev,next]=siblings$1.get(el$1);Object.defineProperty(el$1,DEL,{value:!0,configurable:!0});let finalX=window.scrollX,finalY=window.scrollY;if(next&&next.parentNode&&next.parentNode instanceof Element?next.parentNode.insertBefore(el$1,next):prev&&prev.parentNode?prev.parentNode.appendChild(el$1):(_a$3=getTarget(el$1))==null||_a$3.appendChild(el$1),!isEnabled(el$1))return cleanUp(el$1);let[top,left,width,height]=deletePosition(el$1),optionsOrPlugin=getOptions(el$1),oldCoords=coords.get(el$1);(finalX!==scrollX||finalY!==scrollY)&&adjustScroll(el$1,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$1.style,styleReset),animation=el$1.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$1,`remove`,oldCoords));options$1?.styleReset!==!1&&(styleReset=options$1?.styleReset||styleReset,Object.assign(el$1.style,styleReset)),animation=new Animation(keyframes$4),animation.play()}animations.set(el$1,animation),animation.addEventListener(`finish`,cleanUp.bind(null,el$1,styleReset))}function adjustScroll(el$1,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$1.parentElement)return;let parent=el$1.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$1){let oldCoords=coords.get(el$1),[width,,height]=getTransitionSizes(el$1,oldCoords,getCoords(el$1)),offsetParent=el$1.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$1,config={}){if(mutations&&resize){let mediaQuery=window.matchMedia(`(prefers-reduced-motion: reduce)`),isDisabledDueToReduceMotion=mediaQuery.matches&&!isPlugin(config)&&!config.disrespectUserMotionPreference;isDisabledDueToReduceMotion||(enabled.add(el$1),getComputedStyle(el$1).position===`static`&&Object.assign(el$1.style,{position:`relative`}),forEach(el$1,updatePos,poll,element$3=>resize?.observe(element$3)),isPlugin(config)?options.set(el$1,config):options.set(el$1,{duration:250,easing:`ease-in-out`,...config}),mutations.observe(el$1,{childList:!0}),parents.add(el$1))}return Object.freeze({parent:el$1,enable:()=>{enabled.add(el$1)},disable:()=>{enabled.delete(el$1)},isEnabled:()=>enabled.has(el$1)})}const vAutoAnimate={mounted:(el$1,binding)=>{autoAnimate(el$1,binding.value||{})},getSSRProps:()=>({})},vAutoAnimate$1=vAutoAnimate,autoAnimatePlugin={install(app){app.directive(`auto-animate`,vAutoAnimate$1)}};function isPlainObject$5(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$5(defaults$1))return _defu(baseObject,{},namespace,merger);let object=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,key$2,value$1,namespace))continue;Array.isArray(value$1)&&Array.isArray(object[key$2])?object[key$2]=[...value$1,...object[key$2]]:isPlainObject$5(value$1)&&isPlainObject$5(object[key$2])?object[key$2]=_defu(value$1,object[key$2],(namespace?`${namespace}.`:``)+key$2.toString(),merger):object[key$2]=value$1}return object}function createDefu(merger){return(...arguments_)=>arguments_.reduce((p$5,c$4)=>_defu(p$5,c$4,``,merger),{})}const defu=createDefu(),defuFn=createDefu((object,key$2,currentValue)=>{if(object[key$2]!==void 0&&typeof currentValue==`function`)return object[key$2]=currentValue(object[key$2]),!0}),defuArrayFn=createDefu((object,key$2,currentValue)=>{if(Array.isArray(object[key$2])&&typeof currentValue==`function`)return object[key$2]=currentValue(object[key$2]),!0});function tryOnScopeDispose(fn$6){return getCurrentScope()?(onScopeDispose(fn$6),!0):!1}function createEventHook(){let fns=new Set,off=fn$6=>{fns.delete(fn$6)},clear=()=>{fns.clear()},on$2=fn$6=>{fns.add(fn$6);let offFn=()=>off(fn$6);return tryOnScopeDispose(offFn),{off:offFn}},trigger$1=(...args)=>Promise.all(Array.from(fns).map(fn$6=>fn$6(...args)));return{on:on$2,off,trigger:trigger$1,clear}}const localProvidedStateMap=new WeakMap,injectLocal=(...args)=>{var _a$3;let key$2=args[0],instance=(_a$3=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$1=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$2=args[0];return typeof r$2==`function`?readonly(customRef(()=>({get:r$2,set:noop$3}))):ref(r$2)}function createFilterWrapper(filter$1,fn$6){function wrapper(...args){return new Promise((resolve$1,reject)=>{Promise.resolve(filter$1(()=>fn$6.apply(this,args),{fn:fn$6,thisArg:this,args})).then(resolve$1).catch(reject)})}return wrapper}const bypassFilter=invoke$1=>invoke$1();function debounceFilter(ms$1,options$1={}){let timer,maxTimer,lastRejector=noop$3,_clearTimeout=timer2=>{clearTimeout(timer2),lastRejector(),lastRejector=noop$3},lastInvoker,filter$1=invoke$1=>{let duration=toValue$1(ms$1),maxDuration$1=toValue$1(options$1.maxWait);return timer&&_clearTimeout(timer),duration<=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)})};return filter$1}function throttleFilter(...args){let lastExec=0,timer,isLeading=!0,lastRejector=noop$3,lastValue,ms$1,trailing,leading,rejectOnCancel;!isRef(args[0])&&typeof args[0]==`object`?{delay:ms$1,trailing=!0,leading=!0,rejectOnCancel=!1}=args[0]:[ms$1,trailing=!0,leading=!0,rejectOnCancel=!1]=args;let clear=()=>{timer&&(clearTimeout(timer),timer=void 0,lastRejector(),lastRejector=noop$3)},filter$1=_invoke=>{let duration=toValue$1(ms$1),elapsed=Date.now()-lastExec,invoke$1=()=>lastValue=_invoke();return clear(),duration<=0?(lastExec=Date.now(),invoke$1()):(elapsed>duration&&(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-elapsed))})),!leading&&!timer&&(timer=setTimeout(()=>isLeading=!0,duration)),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(isActive),pause,resume,eventFilter}}function promiseTimeout(ms$1,throwOnTimeout=!1,reason=`Timeout`){return new Promise((resolve$1,reject)=>{throwOnTimeout?setTimeout(()=>reject(reason),ms$1):setTimeout(resolve$1,ms$1)})}function createSingletonPromise(fn$6){let _promise;function wrapper(){return _promise||=fn$6(),_promise}return wrapper.reset=async()=>{let _prev=_promise;_promise=void 0,_prev&&await _prev},wrapper}function increaseWithUnit(target$1,delta){var _a$3;if(typeof target$1==`number`)return target$1+delta;let value$1=(_a$3=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$2,k$4)=>(k$4 in obj&&(!omitUndefined||obj[k$4]!==void 0)&&(n$2[k$4]=obj[k$4]),n$2),{})}function toArray(value$1){return Array.isArray(value$1)?value$1:[value$1]}function cacheStringFunction(fn$6){let cache$1=Object.create(null);return str=>{let hit=cache$1[str];return hit||(cache$1[str]=fn$6(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,(_$2,c$4)=>c$4?c$4.toUpperCase():``));function getLifeCycleTarget(target$1){return target$1||getCurrentInstance()}function useDebounceFn(fn$6,ms$1=200,options$1={}){return createFilterWrapper(debounceFilter(ms$1,options$1),fn$6)}function refDebounced(value$1,ms$1=200,options$1={}){let debounced=ref(toValue$1(value$1)),updater=useDebounceFn(()=>{debounced.value=value$1.value},ms$1,options$1);return watch(value$1,()=>updater()),shallowReadonly(debounced)}function useThrottleFn(fn$6,ms$1=200,trailing=!1,leading=!0,rejectOnCancel=!1){return createFilterWrapper(throttleFilter(ms$1,trailing,leading,rejectOnCancel),fn$6)}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$2){var _a$3;let replaceRef=(_a$3=toValue$1(options$1.replaceRef))??!0;if(replaceRef)if(Array.isArray(objectRef.value)){let copy=[...objectRef.value];copy[key$2]=v$2,objectRef.value=copy}else{let newObject={...objectRef.value,[key$2]:v$2};Object.setPrototypeOf(newObject,Object.getPrototypeOf(objectRef.value)),objectRef.value=newObject}else objectRef.value[key$2]=v$2}}));return result}function tryOnMounted(fn$6,sync$2=!0,target$1){let instance=getLifeCycleTarget(target$1);instance?onMounted(fn$6,target$1):sync$2?fn$6():nextTick(fn$6)}function tryOnUnmounted(fn$6,target$1){let instance=getLifeCycleTarget(target$1);instance&&onUnmounted(fn$6,target$1)}function createUntil(r$2,isNot=!1){function toMatch(condition,{flush=`sync`,deep=!1,timeout,throwOnTimeout}={}){let stop$1=null,watcher=new Promise(resolve$1=>{stop$1=watch(r$2,v$2=>{condition(v$2)!==isNot&&(stop$1?stop$1():nextTick(()=>stop$1?.()),resolve$1(v$2))},{flush,deep,immediate:!0})}),promises=[watcher];return timeout!=null&&promises.push(promiseTimeout(timeout,throwOnTimeout).then(()=>toValue$1(r$2)).finally(()=>stop$1?.())),Promise.race(promises)}function toBe(value$1,options$1){if(!isRef(value$1))return toMatch(v$2=>v$2===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$2,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$2)).finally(()=>(stop$1?.(),toValue$1(r$2)))),Promise.race(promises)}function toBeTruthy(options$1){return toMatch(v$2=>!!v$2,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$2=>{let array=Array.from(v$2);return array.includes(value$1)||array.includes(toValue$1(value$1))},options$1)}function changed(options$1){return changedTimes(1,options$1)}function changedTimes(n$2=1,options$1){let count$1=-1;return toMatch(()=>(count$1+=1,count$1>=n$2),options$1)}if(Array.isArray(toValue$1(r$2))){let instance={toMatch,toContains,changed,changedTimes,get not(){return createUntil(r$2,!isNot)}};return instance}else{let instance={toMatch,toBe,toBeTruthy,toBeNull,toBeNaN,toBeUndefined,changed,changedTimes,get not(){return createUntil(r$2,!isNot)}};return instance}}function until(r$2){return createUntil(r$2)}function useTimeoutFn(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$3){onError(e$3)}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$1(elRef){var _a$3;let plain=toValue$1(elRef);return(_a$3=plain?.$el)??plain}function useEventListener$1(...args){let cleanups=[],cleanup=()=>{cleanups.forEach(fn$6=>fn$6()),cleanups.length=0},register=(el$1,event,listener,options$1)=>(el$1.addEventListener(event,listener,options$1),()=>el$1.removeEventListener(event,listener,options$1)),firstParamTargets=computed(()=>{let test$1=toArray(toValue$1(args[0])).filter(e$3=>e$3!=null);return test$1.every(e$3=>typeof e$3!=`string`)?test$1:void 0}),stopWatch=watchImmediate(()=>{var _a$3,_b;return[(_b=(_a$3=firstParamTargets.value)?.map(e$3=>unrefElement$1(e$3)))??[defaultWindow$1].filter(e$3=>e$3!=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$1(raw_options)?{...raw_options}:raw_options;cleanups.push(...raw_targets.flatMap(el$1=>raw_events.flatMap(event=>raw_listeners.map(listener=>register(el$1,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$1).filter(notNullish);return new Set(items)}),stopWatch=watch(()=>targets.value,targets2=>{cleanup(),isSupported.value&&targets2.size&&(observer=new MutationObserver(callback),targets2.forEach(el$1=>observer.observe(el$1,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$1(mediaQuery,`change`,handler,{passive:!0}),computed(()=>matches$1.value)}const breakpointsTailwind={sm:640,md:768,lg:1024,xl:1280,"2xl":1536};function useBreakpoints(breakpoints,options$1={}){function getValue$2(k$4,delta){let v$2=toValue$1(breakpoints[toValue$1(k$4)]);return delta!=null&&(v$2=increaseWithUnit(v$2,delta)),typeof v$2==`number`&&(v$2=`${v$2}px`),v$2}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$4=>useMediaQuery(()=>`(min-width: ${getValue$2(k$4)})`,options$1),smallerOrEqual=k$4=>useMediaQuery(()=>`(max-width: ${getValue$2(k$4)})`,options$1),shortcutMethods=Object.keys(breakpoints).reduce((shortcuts,k$4)=>(Object.defineProperty(shortcuts,k$4,{get:()=>strategy===`min-width`?greaterOrEqual(k$4):smallerOrEqual(k$4),enumerable:!0,configurable:!0}),shortcuts),{});function current(){let points=Object.keys(breakpoints).map(k$4=>[k$4,shortcutMethods[k$4],pxValue(getValue$2(k$4))]).sort((a$2,b$4)=>a$2[2]-b$4[2]);return computed(()=>points.filter(([,v$2])=>v$2.value).map(([k$4])=>k$4))}return Object.assign(shortcutMethods,{greaterOrEqual,smallerOrEqual,greater(k$4){return useMediaQuery(()=>`(min-width: ${getValue$2(k$4,.1)})`,options$1)},smaller(k$4){return useMediaQuery(()=>`(max-width: ${getValue$2(k$4,-.1)})`,options$1)},between(a$2,b$4){return useMediaQuery(()=>`(min-width: ${getValue$2(a$2)}) and (max-width: ${getValue$2(b$4,-.1)})`,options$1)},isGreater(k$4){return match(`min`,getValue$2(k$4,.1))},isGreaterOrEqual(k$4){return match(`min`,getValue$2(k$4))},isSmaller(k$4){return match(`max`,getValue$2(k$4,-.1))},isSmallerOrEqual(k$4){return match(`max`,getValue$2(k$4))},isInBetween(a$2,b$4){return match(`min`,getValue$2(a$2))&&match(`max`,getValue$2(b$4,-.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$3,_b;state.value=(_b=(_a$3=permissionStatus.value)?.state)??`prompt`};useEventListener$1(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(()=>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$1([`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$1=document.createElement(`textarea`);ta$1.value=value$1??``,ta$1.style.position=`absolute`,ta$1.style.opacity=`0`,document.body.appendChild(ta$1),ta$1.select(),document.execCommand(`copy`),ta$1.remove()}function legacyRead(){var _a$3,_b,_c$1;return(_c$1=(_b=(_a$3=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$2=>v$2===`true`,write:v$2=>String(v$2)},object:{read:v$2=>JSON.parse(v$2),write:v$2=>JSON.stringify(v$2)},number:{read:v$2=>Number.parseFloat(v$2),write:v$2=>String(v$2)},any:{read:v$2=>v$2,write:v$2=>String(v$2)},string:{read:v$2=>v$2,write:v$2=>String(v$2)},map:{read:v$2=>new Map(JSON.parse(v$2)),write:v$2=>JSON.stringify(Array.from(v$2.entries()))},set:{read:v$2=>new Set(JSON.parse(v$2)),write:v$2=>JSON.stringify(Array.from(v$2))},date:{read:v$2=>new Date(v$2),write:v$2=>v$2.toISOString()}},customStorageEventName=`vueuse-storage`;function useStorage(key$2,defaults$1,storage,options$1={}){var _a$3;let{flush=`pre`,deep=!0,listenToStorageChanges=!0,writeDefaults=!0,mergeDefaults:mergeDefaults$1=!1,shallow,window:window$1=defaultWindow$1,eventFilter,onError=e$3=>{console.error(e$3)},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$3){onError(e$3)}if(!storage)return data$12;let rawInit=toValue$1(defaults$1),type=guessSerializerType(rawInit),serializer$1=(_a$3=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$1=>{initOnMounted&&!firstMounted||update(ev$1)},onStorageCustomEvent=ev$1=>{initOnMounted&&!firstMounted||updateFromCustomEvent(ev$1)};window$1&&listenToStorageChanges&&(storage instanceof Storage?useEventListener$1(window$1,`storage`,onStorageEvent,{passive:!0}):useEventListener$1(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$2){try{let oldValue=storage.getItem(keyComputed.value);if(v$2==null)dispatchWriteEvent(oldValue,null),storage.removeItem(keyComputed.value);else{let serialized=serializer$1.write(v$2);oldValue!==serialized&&(storage.setItem(keyComputed.value,serialized),dispatchWriteEvent(oldValue,serialized))}}catch(e$3){onError(e$3)}}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$3){onError(e$3)}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$1=typeof selector2==`string`?window$1?.document.querySelector(selector2):unrefElement$1(selector2);if(!el$1)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$1=>(i$1||``).split(/\s/g)).filter(Boolean).forEach(v$2=>{current.includes(v$2)?classesToAdd.add(v$2):classesToRemove.add(v$2)})}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$4 of classesToAdd)el$1.classList.add(c$4);for(let c$4 of classesToRemove)el$1.classList.remove(c$4);attributeToChange&&el$1.setAttribute(attributeToChange.key,attributeToChange.value),disableTransition&&(window$1.getComputedStyle(style).opacity,document.head.removeChild(style))});function defaultOnChanged(mode){var _a$3;updateHTMLAttrs(selector,attribute,(_a$3=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$2){store.value=v$2}});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$3;return unrefElement$1(target$1)||(_a$3=window$1?.document)?.documentElement});function updateCssVar(){var _a$3;let key$2=toValue$1(prop),el$1=toValue$1(elRef);if(el$1&&window$1&&key$2){let value$1=(_a$3=window$1.getComputedStyle(el$1).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)],(_$2,old)=>{old[0]&&old[1]&&old[0].style.removeProperty(old[1]),updateCssVar()},{immediate:!0}),watch([variable,elRef],([val,el$1])=>{let raw_prop=toValue$1(prop);el$1?.style&&raw_prop&&(val==null?el$1.style.removeProperty(raw_prop):el$1.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$3;options$1.onChanged?(_a$3=options$1.onChanged)==null||_a$3.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$2){let modeVal=v$2?`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$1=>i$1.kind===`videoinput`)),audioInputs=computed(()=>devices.value.filter(i$1=>i$1.kind===`audioinput`)),audioOutputs=computed(()=>devices.value.filter(i$1=>i$1.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=>t.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$1(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$1=>unrefElement$1(el$1)):[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(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$3=shallowRef(0),y$3=shallowRef(0);function recalculate(){let el$1=unrefElement$1(target$1);if(!el$1){reset&&(height.value=0,bottom.value=0,left.value=0,right.value=0,top.value=0,width.value=0,x$3.value=0,y$3.value=0);return}let rect=el$1.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$3.value=rect.x,y$3.value=rect.y}function update(){updateTiming===`sync`?recalculate():updateTiming===`next-frame`&&requestAnimationFrame(()=>recalculate())}return useResizeObserver(target$1,update),watch(()=>unrefElement$1(target$1),ele=>!ele&&update()),useMutationObserver(target$1,update,{attributeFilter:[`style`,`class`]}),windowScroll&&useEventListener$1(`scroll`,update,{capture:!0,passive:!0}),windowResize&&useEventListener$1(`resize`,update,{passive:!0}),tryOnMounted(()=>{immediate&&update()}),{height,bottom,left,right,top,width,x:x$3,y:y$3,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$1).filter(notNullish)}),cleanup=noop$3,isActive=shallowRef(immediate),stopWatch=isSupported.value?watch(()=>[targets.value,unrefElement$1(root$3),isActive.value],([targets2,root2])=>{if(cleanup(),!isActive.value||!targets2.length)return;let observer=new IntersectionObserver(callback,{root:unrefElement$1(root2),rootMargin,threshold});targets2.forEach(el$1=>el$1&&observer.observe(el$1)),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$5=new DataTransfer;for(let file of files)dt$5.items.add(file);return dt$5.files}function useFileDialog(options$1={}){let{document:document$3=defaultDocument}=options$1,files=ref(prepareInitialFiles(options$1.initialFiles)),{on:onChange,trigger:changeTrigger}=createEventHook(),{on:onCancel,trigger:cancelTrigger}=createEventHook(),input;document$3&&(input=unrefElement$1(options$1.input)||document$3.createElement(`input`),input.type=`file`,input.onchange=event=>{let result=event.target;files.value=result.files,changeTrigger(files.value)},input.oncancel=()=>{cancelTrigger()});let reset=()=>{files.value=null,input&&input.value&&(input.value=``,changeTrigger(null))},open$1=localOptions=>{if(!input)return;let _options={...DEFAULT_OPTIONS,...options$1,...localOptions};input.multiple=_options.multiple,input.accept=_options.accept,input.webkitdirectory=_options.directory,hasOwn$2(_options,`capture`)&&(input.capture=_options.capture),_options.reset&&reset(),input.click()};return{files:readonly(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$3=shallowRef(initialValue.x),y$3=shallowRef(initialValue.y),sourceType=shallowRef(null),extractor=typeof type==`function`?type:UseMouseBuiltinExtractors[type],mouseHandler=event=>{let result=extractor(event);_prevMouseEvent=event,result&&([x$3.value,y$3.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$3.value,y$3.value]=result,sourceType.value=`touch`)}},scrollHandler=()=>{if(!_prevMouseEvent||!window$1)return;let pos=extractor(_prevMouseEvent);_prevMouseEvent instanceof MouseEvent&&pos&&(x$3.value=pos[0]+window$1.scrollX-_prevScrollX,y$3.value=pos[1]+window$1.scrollY-_prevScrollY)},reset=()=>{x$3.value=initialValue.x,y$3.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$1(target$1,[`mousemove`,`dragover`],mouseHandlerWrapper,listenerOptions),touch&&type!==`movement`&&(useEventListener$1(target$1,[`touchstart`,`touchmove`],touchHandlerWrapper,listenerOptions),resetOnTouchEnds&&useEventListener$1(target$1,`touchend`,reset,listenerOptions)),scroll&&type===`page`&&useEventListener$1(window$1,`scroll`,scrollHandlerWrapper,listenerOptions)}return{x:x$3,y:y$3,sourceType}}function useObjectUrl(object){let url=shallowRef(),release=()=>{url.value&&URL.revokeObjectURL(url.value),url.value=void 0};return watch(()=>toValue$1(object),newObject=>{release(),newObject&&(url.value=URL.createObjectURL(newObject))},{immediate:!0}),tryOnScopeDispose(release),readonly(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$1(target$1,[`pointerdown`,`pointermove`,`pointerup`],handler,listenerOptions),useEventListener$1(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$1(`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`}];function useUserMedia(options$1={}){var _a$3,_b;let enabled$1=shallowRef((_a$3=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=>t.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$2=>{v$2?_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$3=>{data$12.value=e$3.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$1(`resize`,update,listenerOptions),window$1&&type===`visual`&&window$1.visualViewport&&useEventListener$1(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$1=0;i$1(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$1,e$3){var t={};for(var p$5 in s$1)Object.prototype.hasOwnProperty.call(s$1,p$5)&&e$3.indexOf(p$5)<0&&(t[p$5]=s$1[p$5]);if(s$1!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i$1=0,p$5=Object.getOwnPropertySymbols(s$1);i$1Math.min(Math.max(v$2,min$1),max$1),safeMin=.001,minDuration=.01,maxDuration=10,minDamping=.05,maxDamping=1;function findSpring({duration=800,bounce=.25,velocity=0,mass=1}){let envelope,derivative;warning(duration<=maxDuration*1e3,`Spring duration must be 10 seconds or less`);let dampingRatio=1-bounce;dampingRatio=clamp$3(minDamping,maxDamping,dampingRatio),duration=clamp$3(minDuration,maxDuration,duration/1e3),dampingRatio<1?(envelope=undampedFreq$1=>{let exponentialDecay=undampedFreq$1*dampingRatio,delta=exponentialDecay*duration,a$2=exponentialDecay-velocity,b$4=calcAngularFreq(undampedFreq$1,dampingRatio),c$4=Math.exp(-delta);return safeMin-a$2/b$4*c$4},derivative=undampedFreq$1=>{let exponentialDecay=undampedFreq$1*dampingRatio,delta=exponentialDecay*duration,d$2=delta*velocity+velocity,e$3=dampingRatio**2*undampedFreq$1**2*duration,f$3=Math.exp(-delta),g$2=calcAngularFreq(undampedFreq$1**2,dampingRatio),factor$1=-envelope(undampedFreq$1)+safeMin>0?-1:1;return factor$1*((d$2-e$3)*f$3)/g$2}):(envelope=undampedFreq$1=>{let a$2=Math.exp(-undampedFreq$1*duration),b$4=(undampedFreq$1-velocity)*duration+1;return-safeMin+a$2*b$4},derivative=undampedFreq$1=>{let a$2=Math.exp(-undampedFreq$1*duration),b$4=(velocity-undampedFreq$1)*(duration*duration);return a$2*b$4});let initialGuess=5/duration,undampedFreq=approximateRoot(envelope,derivative,initialGuess);if(duration*=1e3,isNaN(undampedFreq))return{stiffness:100,damping:10,duration};{let stiffness=undampedFreq**2*mass;return{stiffness,damping:dampingRatio*2*Math.sqrt(mass*stiffness),duration}}}const rootIterations=12;function approximateRoot(envelope,derivative,initialGuess){let result=initialGuess;for(let i$1=1;i$1options$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$3){var{from=0,to:to$2=1,restSpeed=2,restDelta}=_a$3,options$1=__rest(_a$3,[`from`,`to`,`restSpeed`,`restDelta`]);let state={done:!1,value:from},{stiffness,damping,mass,velocity,duration,isResolvedFromDuration}=getSpringOptions(options$1),resolveSpring=zero,resolveVelocity=zero;function createSpring(){let initialVelocity=velocity?-(velocity/1e3):0,initialDelta=to$2-from,dampingRatio=damping/(2*Math.sqrt(stiffness*mass)),undampedAngularFreq=Math.sqrt(stiffness/mass)/1e3;if(restDelta===void 0&&(restDelta=Math.min(Math.abs(to$2-from)/100,.4)),dampingRatio<1){let angularFreq=calcAngularFreq(undampedAngularFreq,dampingRatio);resolveSpring=t=>{let envelope=Math.exp(-dampingRatio*undampedAngularFreq*t);return to$2-envelope*((initialVelocity+dampingRatio*undampedAngularFreq*initialDelta)/angularFreq*Math.sin(angularFreq*t)+initialDelta*Math.cos(angularFreq*t))},resolveVelocity=t=>{let envelope=Math.exp(-dampingRatio*undampedAngularFreq*t);return dampingRatio*undampedAngularFreq*envelope*(Math.sin(angularFreq*t)*(initialVelocity+dampingRatio*undampedAngularFreq*initialDelta)/angularFreq+initialDelta*Math.cos(angularFreq*t))-envelope*(Math.cos(angularFreq*t)*(initialVelocity+dampingRatio*undampedAngularFreq*initialDelta)-angularFreq*initialDelta*Math.sin(angularFreq*t))}}else if(dampingRatio===1)resolveSpring=t=>to$2-Math.exp(-undampedAngularFreq*t)*(initialDelta+(initialVelocity+undampedAngularFreq*initialDelta)*t);else{let dampedAngularFreq=undampedAngularFreq*Math.sqrt(dampingRatio*dampingRatio-1);resolveSpring=t=>{let envelope=Math.exp(-dampingRatio*undampedAngularFreq*t),freqForT=Math.min(dampedAngularFreq*t,300);return to$2-envelope*((initialVelocity+dampingRatio*undampedAngularFreq*initialDelta)*Math.sinh(freqForT)+dampedAngularFreq*initialDelta*Math.cosh(freqForT))/dampedAngularFreq}}}return createSpring(),{next:t=>{let current=resolveSpring(t);if(isResolvedFromDuration)state.done=t>=duration;else{let currentVelocity=resolveVelocity(t)*1e3,isBelowVelocityThreshold=Math.abs(currentVelocity)<=restSpeed,isBelowDisplacementThreshold=Math.abs(to$2-current)<=restDelta;state.done=isBelowVelocityThreshold&&isBelowDisplacementThreshold}return state.value=state.done?to$2:current,state},flipTarget:()=>{velocity=-velocity,[from,to$2]=[to$2,from],createSpring()}}}spring.needsInterpolation=(a$2,b$4)=>typeof a$2==`string`||typeof b$4==`string`;const zero=_t$4=>0,progress=(from,to$2,value$1)=>{let toFromDifference=to$2-from;return toFromDifference===0?1:(value$1-from)/toFromDifference},mix=(from,to$2,progress$1)=>-progress$1*from+progress$1*to$2+from,clamp$4=(min$1,max$1)=>v$2=>Math.max(Math.min(v$2,max$1),min$1),sanitize=v$2=>v$2%1?Number(v$2.toFixed(5)):v$2,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$2){return typeof v$2==`string`}const number$2={test:v$2=>typeof v$2==`number`,parse:parseFloat,transform:v$2=>v$2},alpha=Object.assign(Object.assign({},number$2),{transform:clamp$4(0,1)}),scale=Object.assign(Object.assign({},number$2),{default:1}),createUnitType=unit=>({test:v$2=>isString$1(v$2)&&v$2.endsWith(unit)&&v$2.split(` `).length===1,parse:parseFloat,transform:v$2=>`${v$2}${unit}`}),degrees=createUnitType(`deg`),percent=createUnitType(`%`),px=createUnitType(`px`),vh$1=createUnitType(`vh`),vw=createUnitType(`vw`),progressPercentage=Object.assign(Object.assign({},percent),{parse:v$2=>percent.parse(v$2)/100,transform:v$2=>percent.transform(v$2*100)}),isColorString=(type,testProp)=>v$2=>!!(isString$1(v$2)&&singleColorRegex.test(v$2)&&v$2.startsWith(type)||testProp&&Object.prototype.hasOwnProperty.call(v$2,testProp)),splitColor=(aName,bName,cName)=>v$2=>{if(!isString$1(v$2))return v$2;let[a$2,b$4,c$4,alpha$1]=v$2.match(floatRegex);return{[aName]:parseFloat(a$2),[bName]:parseFloat(b$4),[cName]:parseFloat(c$4),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$2),{transform:v$2=>Math.round(clampRgbUnit(v$2))}),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$2){let r$2=``,g$2=``,b$4=``,a$2=``;return v$2.length>5?(r$2=v$2.substr(1,2),g$2=v$2.substr(3,2),b$4=v$2.substr(5,2),a$2=v$2.substr(7,2)):(r$2=v$2.substr(1,1),g$2=v$2.substr(2,1),b$4=v$2.substr(3,1),a$2=v$2.substr(4,1),r$2+=r$2,g$2+=g$2,b$4+=b$4,a$2+=a$2),{red:parseInt(r$2,16),green:parseInt(g$2,16),blue:parseInt(b$4,16),alpha:a$2?parseInt(a$2,16)/255:1}}const hex$1={test:isColorString(`#`),parse:parseHex$1,transform:rgba.transform},color$1={test:v$2=>rgba.test(v$2)||hex$1.test(v$2)||hsla.test(v$2),parse:v$2=>rgba.test(v$2)?rgba.parse(v$2):hsla.test(v$2)?hsla.parse(v$2):hex$1.parse(v$2),transform:v$2=>isString$1(v$2)?v$2:v$2.hasOwnProperty(`red`)?rgba.transform(v$2):hsla.transform(v$2)},colorToken="${c}",numberToken="${n}";function test(v$2){var _a$3,_b,_c$1,_d$1;return isNaN(v$2)&&isString$1(v$2)&&((_b=(_a$3=v$2.match(floatRegex))?.length)??0)+((_d$1=(_c$1=v$2.match(colorRegex))?.length)??0)>0}function analyse$1(v$2){typeof v$2==`number`&&(v$2=`${v$2}`);let values=[],numColors=0,colors=v$2.match(colorRegex);colors&&(numColors=colors.length,v$2=v$2.replace(colorRegex,colorToken),values.push(...colors.map(color$1.parse)));let numbers=v$2.match(floatRegex);return numbers&&(v$2=v$2.replace(floatRegex,numberToken),values.push(...numbers.map(number$2.parse))),{values,numColors,tokenised:v$2}}function parse$3(v$2){return analyse$1(v$2).values}function createTransformer$1(v$2){let{values,numColors,tokenised}=analyse$1(v$2),numValues=values.length;return v$3=>{let output=tokenised;for(let i$1=0;i$1typeof v$2==`number`?0:v$2;function getAnimatableNone$2(v$2){let parsed=parse$3(v$2),transformer=createTransformer$1(v$2);return transformer(parsed.map(convertNumbersToZero))}const complex={test,parse:parse$3,createTransformer:createTransformer$1,getAnimatableNone:getAnimatableNone$2},maxDefaults=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function applyDefaultFilter(v$2){let[name$2,value$1]=v$2.slice(0,-1).split(`(`);if(name$2===`drop-shadow`)return v$2;let[number$3]=value$1.match(floatRegex)||[];if(!number$3)return v$2;let unit=value$1.replace(number$3,``),defaultValue=maxDefaults.has(name$2)?1:0;return number$3!==value$1&&(defaultValue*=100),name$2+`(`+defaultValue+unit+`)`}const functionRegex=/([a-z-]*)\(.*?\)/g,filter=Object.assign(Object.assign({},complex),{getAnimatableNone:v$2=>{let functions=v$2.match(functionRegex);return functions?functions.map(applyDefaultFilter).join(` `):v$2}});function hueToRgb(p$5,q$2,t){return t<0&&(t+=1),t>1&&--t,t<1/6?p$5+(q$2-p$5)*6*t:t<1/2?q$2:t<2/3?p$5+(q$2-p$5)*(2/3-t)*6:p$5}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$2=lightness<.5?lightness*(1+saturation):lightness+saturation-lightness*saturation,p$5=2*lightness-q$2;red=hueToRgb(p$5,q$2,hue$2+1/3),green=hueToRgb(p$5,q$2,hue$2),blue=hueToRgb(p$5,q$2,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$2,v$2)=>{let fromExpo=from*from,toExpo=to$2*to$2;return Math.sqrt(Math.max(0,v$2*(toExpo-fromExpo)+fromExpo))},colorTypes=[hex$1,rgba,hsla],getColorType=v$2=>colorTypes.find(type=>type.test(v$2)),notAnimatable=color$2=>`'${color$2}' is not an animatable color. Use the equivalent color code instead.`,mixColor=(from,to$2)=>{let fromColorType=getColorType(from),toColorType=getColorType(to$2);invariant(!!fromColorType,notAnimatable(from)),invariant(!!toColorType,notAnimatable(to$2));let fromColor=fromColorType.parse(from),toColor=toColorType.parse(to$2);fromColorType===hsla&&(fromColor=hslaToRgba(fromColor),fromColorType=rgba),toColorType===hsla&&(toColor=hslaToRgba(toColor),toColorType=rgba);let blended=Object.assign({},fromColor);return v$2=>{for(let key$2 in blended)key$2!==`alpha`&&(blended[key$2]=mixLinearColor(fromColor[key$2],toColor[key$2],v$2));return blended.alpha=mix(fromColor.alpha,toColor.alpha,v$2),fromColorType.transform(blended)}},isNum$1=v$2=>typeof v$2==`number`,combineFunctions=(a$2,b$4)=>v$2=>b$4(a$2(v$2)),pipe=(...transformers)=>transformers.reduce(combineFunctions);function getMixer(origin,target$1){return isNum$1(origin)?v$2=>mix(origin,target$1,v$2):color$1.test(origin)?mixColor(origin,target$1):mixComplex(origin,target$1)}const mixArray=(from,to$2)=>{let output=[...from],numValues=output.length,blendValue=from.map((fromThis,i$1)=>getMixer(fromThis,to$2[i$1]));return v$2=>{for(let i$1=0;i$1{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$2=>{for(let key$2 in blendValue)output[key$2]=blendValue[key$2](v$2);return output}};function analyse(value$1){let parsed=complex.parse(value$1),numValues=parsed.length,numNumbers=0,numRGB=0,numHSL=0;for(let i$1=0;i$1{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(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$5=>`${p$5>0?target$1:origin}`)},mixNumber=(from,to$2)=>p$5=>mix(from,to$2,p$5);function detectMixerFactory(v$2){if(typeof v$2==`number`)return mixNumber;if(typeof v$2==`string`)return color$1.test(v$2)?mixColor:mixComplex;if(Array.isArray(v$2))return mixArray;if(typeof v$2==`object`)return mixObject}function createMixers(output,ease,customMixer){let mixers=[],mixerFactory=customMixer||detectMixerFactory(output[0]),numMixers=output.length-1;for(let i$1=0;i$1mixer(progress(from,to$2,v$2))}function slowInterpolate(input,mixers){let inputLength=input.length,lastInputIndex=inputLength-1;return v$2=>{let mixerIndex=0,foundMixerIndex=!1;if(v$2<=input[0]?foundMixerIndex=!0:v$2>=input[lastInputIndex]&&(mixerIndex=lastInputIndex-1,foundMixerIndex=!0),!foundMixerIndex){let i$1=1;for(;i$1v$2||i$1===lastInputIndex);i$1++);mixerIndex=i$1-1}let progressInRange=progress(input[mixerIndex],input[mixerIndex+1],v$2);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$2=>interpolator(clamp$3(input[0],input[inputLength-1],v$2)):interpolator}const reverseEasing=easing=>p$5=>1-easing(1-p$5),mirrorEasing=easing=>p$5=>p$5<=.5?easing(2*p$5)/2:(2-easing(2*(1-p$5)))/2,createExpoIn=power=>p$5=>p$5**+power,createBackIn=power=>p$5=>p$5*p$5*((power+1)*p$5-power),createAnticipate=power=>{let backEasing=createBackIn(power);return p$5=>(p$5*=2)<1?.5*backEasing(p$5):.5*(2-2**(-10*(p$5-1)))},DEFAULT_OVERSHOOT_STRENGTH=1.525,BOUNCE_FIRST_THRESHOLD=4/11,BOUNCE_SECOND_THRESHOLD=8/11,BOUNCE_THIRD_THRESHOLD=9/10,linear$1=p$5=>p$5,easeIn=createExpoIn(2),easeOut=reverseEasing(easeIn),easeInOut=mirrorEasing(easeIn),circIn=p$5=>1-Math.sin(Math.acos(p$5)),circOut=reverseEasing(circIn),circInOut=mirrorEasing(circOut),backIn=createBackIn(DEFAULT_OVERSHOOT_STRENGTH),backOut=reverseEasing(backIn),backInOut=mirrorEasing(backIn),anticipate=createAnticipate(DEFAULT_OVERSHOOT_STRENGTH),ca$1=4356/361,cb=35442/1805,cc$1=16061/1805,bounceOut=p$5=>{if(p$5===1||p$5===0)return p$5;let p2=p$5*p$5;return p$5p$5<.5?.5*(1-bounceOut(1-p$5*2)):.5*bounceOut(p$5*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$1)=>i$1===0?0:i$1/(numValues-1))}function convertOffsetToTimes(offset$2,duration){return offset$2.map(o$1=>o$1*duration)}function keyframes$3({from=0,to:to$2=1,ease,offset:offset$2,duration=300}){let state={done:!1,value:from},values=Array.isArray(to$2)?to$2:[from,to$2],times=convertOffsetToTimes(offset$2&&offset$2.length===values.length?offset$2:defaultOffset(values),duration);function createInterpolator(){return interpolate$1(times,values,{ease:Array.isArray(ease)?ease:defaultEasing(values,ease)})}let interpolator=createInterpolator();return{next:t=>(state.value=interpolator(t),state.done=t>=duration,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=>{let delta=-amplitude*Math.exp(-t/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){if(Array.isArray(config.to))return keyframes$3;if(types[config.type])return types[config.type];let keys$3=new Set(Object.keys(config));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,delay=0){return elapsed-duration-delay}function reverseElapsed(elapsed,duration,delay=0,isForwardPlayback=!0){return isForwardPlayback?loopElapsed(duration+-elapsed,duration,delay):duration-(elapsed-duration)+delay}function hasRepeatDelayElapsed(elapsed,duration,delay,isForwardPlayback){return isForwardPlayback?elapsed>=duration+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$3){var _b,_c$1,{from,autoplay=!0,driver=framesync,elapsed=0,repeat:repeatMax=0,repeatType=`loop`,repeatDelay=0,onPlay,onStop,onComplete,onRepeat,onUpdate}=_a$3,options$1=__rest(_a$3,[`from`,`autoplay`,`driver`,`elapsed`,`repeat`,`repeatType`,`repeatDelay`,`onPlay`,`onStop`,`onComplete`,`onRepeat`,`onUpdate`]);let{to:to$2}=options$1,driverControls,repeatCount=0,computedDuration=options$1.duration,latest,isComplete=!1,isForwardPlayback=!0,interpolateFromNumber,animator=detectAnimationFromOptions(options$1);(_c$1=(_b=animator).needsInterpolation)?.call(_b,from,to$2)&&(interpolateFromNumber=interpolate$1([0,100],[from,to$2],{clamp:!1}),from=0,to$2=100);let animation=animator(Object.assign(Object.assign({},options$1),{from,to:to$2}));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$2){return min$1!==void 0&&v$2max$1}function boundaryNearest(v$2){return min$1===void 0?max$1:max$1===void 0||Math.abs(min$1-v$2){var _a$3;onUpdate?.(v$2),(_a$3=options$1.onUpdate)==null||_a$3.call(options$1,v$2)},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$2=>{prev=current,current=v$2,velocity=velocityPerSecond(v$2-prev,getFrameData().delta),(heading$1===1&&v$2>boundary||heading$1===-1&&v$2currentAnimation?.stop()}}const a$1=(a1,a2)=>1-3*a2+3*a1,b$3=(a1,a2)=>3*a2-6*a1,c$3=a1=>3*a1,calcBezier$1=(t,a1,a2)=>((a$1(a1,a2)*t+b$3(a1,a2))*t+c$3(a1))*t,getSlope=(t,a1,a2)=>3*a$1(a1,a2)*t*t+2*b$3(a1,a2)*t+c$3(a1),subdivisionPrecision=1e-7,subdivisionMaxIterations=10;function binarySubdivide$1(aX,aA,aB,mX1,mX2){let currentX,currentT,i$1=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$1=newtonMinSlope?newtonRaphsonIterate(aX,guessForT,mX1,mX2):initialSlope===0?guessForT:binarySubdivide$1(aX,intervalStart,intervalStart+kSampleStepSize,mX1,mX2)}return t=>t===0||t===1?t:calcBezier$1(getTForX(t),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={};var SubscriptionManager$1=class{subscriptions=new Set;add(handler){return this.subscriptions.add(handler),()=>this.subscriptions.delete(handler)}notify(a$2,b$4,c$4){if(this.subscriptions.size)for(let handler of this.subscriptions)handler(a$2,b$4,c$4)}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$2){this.updateAndNotify(v$2)}updateAndNotify=v$2=>{this.prev=this.current,this.current=v$2;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$2=>target$1[key$2]=v$2),motionValues.value[key$2]=motionValue,motionValue};return tryOnUnmounted(stop$1),{motionValues,get,stop:stop$1}}function isKeyframesTarget$1(v$2){return Array.isArray(v$2)}function underDampedSpring$1(){return{type:`spring`,stiffness:500,damping:25,restDelta:.5,restSpeed:10}}function criticallyDampedSpring$1(to$2){return{type:`spring`,stiffness:550,damping:to$2===0?2*Math.sqrt(550):30,restDelta:.01,restSpeed:10}}function overDampedSpring$1(to$2){return{type:`spring`,stiffness:550,damping:to$2===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$2){let transitionFactory;return transitionFactory=isKeyframesTarget$1(to$2)?keyframes$2:defaultTransitions$1[valueKey]||defaultTransitions$1.default,{to:to$2,...transitionFactory(to$2)}}const int$1={...number$2,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$1,filter,WebkitFilter:filter,fillOpacity:alpha,strokeOpacity:alpha,numOctaves:int$1},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$2=>value$1.set(v$2)};return valueTransition.type===`inertia`||valueTransition.type===`decay`?inertia({...options$1,...valueTransition}):animate$1({...getPopmotionAnimationOptions$1(valueTransition,options$1,key$2),onUpdate:v$2=>{options$1.onUpdate(v$2),valueTransition.onUpdate&&valueTransition.onUpdate(v$2)},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])=>{if(key$2!==`transition`)return 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$1(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$1(target$1,`mouseenter`,()=>hovered.value=!0),useEventListener$1(target$1,`mouseleave`,()=>{hovered.value=!1,tapped.value=!1})),_variants.tapped&&(supportsMouseEvents$1()&&(useEventListener$1(target$1,`mousedown`,()=>tapped.value=!0),useEventListener$1(target$1,`mouseup`,()=>tapped.value=!1)),supportsPointerEvents$1()&&(useEventListener$1(target$1,`pointerdown`,()=>tapped.value=!0),useEventListener$1(target$1,`pointerup`,()=>tapped.value=!1)),supportsTouchEvents$1()&&(useEventListener$1(target$1,`touchstart`,()=>tapped.value=!0),useEventListener$1(target$1,`touchend`,()=>tapped.value=!1))),_variants.focused&&(useEventListener$1(target$1,`focus`,()=>focused.value=!0),useEventListener$1(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$1(target$1),el$1=>{el$1&&onTarget(el$1)},{immediate:!0})}const translateAlias$1={x:`translateX`,y:`translateY`,z:`translateZ`};function reactiveTransform$1(props={},enableHardwareAcceleration=!0){let state=reactive({...props}),transform$1=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$1.value=result.trim()},{immediate:!0,deep:!0}),{state,transform:transform$1}}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$1={},style={};return Object.entries(variant).forEach(([key$2,value$1])=>{isTransformProp$1(key$2)||isTransformOriginProp$1(key$2)?transform$1[key$2]=value$1:style[key$2]=value$1}),{transform:transform$1,style}}function variantToStyle$1(variant){let{transform:_transform,style:_style}=splitValues$1(variant),{transform:transform$1}=reactiveTransform$1(_transform),{style}=reactiveStyle$1(_style);return transform$1.value&&(style.value.transform=transform$1.value),style.value}function useElementStyle$1(target$1,onInit){let _cache$1,_target$1,{state,style}=reactiveStyle$1();return usePermissiveTarget$1(target$1,el$1=>{_target$1=el$1;for(let key$2 of Object.keys(valueTypes$2)){if(el$1.style[key$2]===null||el$1.style[key$2]===``||isTransformProp$1(key$2)||isTransformOriginProp$1(key$2))continue;state[key$2]=el$1.style[key$2]}_cache$1&&Object.entries(_cache$1).forEach(([key$2,value$1])=>el$1.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$1){let transforms=transform$1.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$1){Object.entries(parseTransform$1(transform$1)).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$1}=reactiveTransform$1();return usePermissiveTarget$1(target$1,el$1=>{_target$1=el$1,el$1.style.transform&&stateFromTransform$1(state,el$1.style.transform),_cache$1&&(el$1.style.transform=_cache$1),onInit&&onInit(state)}),watch(transform$1,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$1}=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$1: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$1}}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(val){return transitionKeys$1.includes(val)}function resolveVariants(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$1(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(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$1(target$1[key$2])){let prop=target$1[key$2];key$2===`visible-once`&&(key$2=`visibleOnce`),variantsRef.value[key$2]=prop}}}}function directive(variants,isPreset=!1){let register=(el$1,binding,node$1)=>{let key$2=binding.value&&typeof binding.value==`string`?binding.value:node$1.key;key$2&&motionState[key$2]&&motionState[key$2].stop();let variantsObject=isPreset?structuredClone(toRaw(variants)||{}):variants||{},variantsRef=ref(variantsObject);typeof binding.value==`object`&&(variantsRef.value=binding.value),resolveVariants(node$1,variantsRef);let motionOptions={eventListeners:!0,lifeCycleHooks:!0,syncVariants:!0,visibilityHooks:!1},motionInstance=useMotion$1(el$1,variantsRef,motionOptions);el$1.motionInstance=motionInstance,key$2&&(motionState[key$2]=motionInstance)},mounted=(el$1,_binding,_node)=>{el$1.motionInstance&®isterVisibilityHooks$1(el$1.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(str){let a$2=`àáâäæãåāăąçćčđďèéêëēėęěğǵḧîïíīįìłḿñńǹňôöòóœøōõőṕŕřßśšşșťțûüùúūǘůűųẃẍÿýžźż·/_,:;`,b$4=`aaaaaaaaaacccddeeeeeeeegghiiiiiilmnnnnoooooooooprrsssssttuuuuuuuuuwxyyzzz------`,p$5=new RegExp(a$2.split(``).join(`|`),`g`);return str.toString().replace(/[A-Z]/g,s$1=>`-${s$1}`).toLowerCase().replace(/\s+/g,`-`).replace(p$5,c$4=>b$4.charAt(a$2.indexOf(c$4))).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$3(val){return Object.prototype.toString.call(val)===`[object Object]`}function clone$1(v$2){if(Array.isArray(v$2))return v$2.map(clone$1);if(isObject$3(v$2)){let res={};for(let key$2 in v$2)res[key$2]=clone$1(v$2[key$2]);return res}return v$2}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,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[variantKey];if(variantConfig==null)continue;variantConfig.transition??={},variantConfig.transition[transitionKey]=transitionValueParsed}}return config}let motionConfig=computed(()=>{let config=defu({},propsConfig.value,preset.value,props.variants||{});return applyTransitionHelpers({...config},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$1(motionConfig.value),node$1.props);return node$1.props.onVnodeMounted=({el:el$1})=>{instances[index$1]=useMotion$1(el$1,elementMotionConfig)},node$1.props.onVnodeUpdated=({el:el$1})=>{let styles=variantToStyle$1(instances[index$1].state);for(let[key$2,val]of Object.entries(styles))el$1.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$1=0;i$1activePinia=pinia$1,piniaSymbol=Symbol();function isPlainObject$4(o$1){return o$1&&typeof o$1==`object`&&Object.prototype.toString.call(o$1)===`[object Object]`&&typeof o$1.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$2=document.createElement(`a`);a$2.download=name$2,a$2.rel=`noopener`,typeof blob==`string`?(a$2.href=blob,a$2.origin===location.origin?click(a$2):corsEnabled(a$2.href)?download(blob,name$2,opts):(a$2.target=`_blank`,click(a$2))):(a$2.href=URL.createObjectURL(blob),setTimeout(function(){URL.revokeObjectURL(a$2.href)},4e4),setTimeout(function(){click(a$2)},0))}function msSaveAs(blob,name$2=`download`,opts){if(typeof blob==`string`)if(corsEnabled(blob))download(blob,name$2,opts);else{let a$2=document.createElement(`a`);a$2.href=blob,a$2.target=`_blank`,setTimeout(function(){click(a$2)})}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{assign:assign$1$1}=Object;function createPinia(){let scope=effectScope(!0),state=scope.run(()=>ref({})),_p$1=[],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$1.push(plugin)),toBeInstalled=[]},use(plugin){return this._a?_p$1.push(plugin):toBeInstalled.push(plugin),this},_p:_p$1,_a:null,_e:scope,_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$6=>fn$6(),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$4(targetValue)&&isPlainObject$4(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$4(obj)||!Object.prototype.hasOwnProperty.call(obj,skipHydrateSymbol)}const{assign:assign$2}=Object;function isComputed(o$1){return!!(isRef(o$1)&&o$1.effect)}function createOptionsStore(id$1,options$1,pinia$1,hot){let{state,actions,getters}=options$1,initialState=pinia$1.state.value[id$1],store;function setup(){initialState||(pinia$1.state.value[id$1]=state?state():{});let localState=toRefs(pinia$1.state.value[id$1]);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$1);return getters[name$2].call(store$1,store$1)})),computedGetters),{}))}return store=createSetupStore(id$1,setup,options$1,pinia$1,hot,!0),store}function createSetupStore($id,setup,options$1={},pinia$1,hot,isOptionsStore){let scope,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.stop(),subscriptions=[],actionSubscriptions=[],pinia$1._s.delete($id)}let action=(fn$6,name$2=``)=>{if(ACTION_MARKER in fn$6)return fn$6[ACTION_NAME]=name$2,fn$6;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$6.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},_hmrPayload=markRaw({actions:{},getters:{},state:[],hotState}),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.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=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.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$1,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$1)||(isSetupStore?createSetupStore(id$1,setup,options$1,pinia$1):createOptionsStore(id$1,options$1,pinia$1));let store=pinia$1._s.get(id$1);return store}return useStore.$id=id$1,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-DhKdy896.js`),__vite__mapDeps([0,1,2])),"/src/layouts/home.vue":()=>__vitePreload(()=>import(`./home-_FSVNe9h.js`),[]),"/src/layouts/plain.vue":()=>__vitePreload(()=>import(`./plain-CNQFJoOP.js`),[]),"/src/layouts/settings.vue":()=>__vitePreload(()=>import(`./settings-V--rxRsA.js`),__vite__mapDeps([3,1,2,4])),"/src/layouts/stage.vue":()=>__vitePreload(()=>import(`./stage-BJhNntgU.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$2=>(r$2.path===``||r$2.path===`/`)&&r$2.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$6,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$6):fn$6(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$2,b$4){let aLastIndex=a$2.matched.length-1,bLastIndex=b$4.matched.length-1;return aLastIndex>-1&&aLastIndex===bLastIndex&&isSameRouteRecord(a$2.matched[aLastIndex],b$4.matched[bLastIndex])&&isSameRouteLocationParams(a$2.params,b$4.params)&&stringifyQuery$1(a$2.query)===stringifyQuery$1(b$4.query)&&a$2.hash===b$4.hash}function isSameRouteRecord(a$2,b$4){return(a$2.aliasOf||a$2)===(b$4.aliasOf||b$4)}function isSameRouteLocationParams(a$2,b$4){if(Object.keys(a$2).length!==Object.keys(b$4).length)return!1;for(let key$2 in a$2)if(!isSameRouteLocationParamsValue(a$2[key$2],b$4[key$2]))return!1;return!0}function isSameRouteLocationParamsValue(a$2,b$4){return isArray$3(a$2)?isEquivalentArray(a$2,b$4):isArray$3(b$4)?isEquivalentArray(b$4,a$2):a$2===b$4}function isEquivalentArray(a$2,b$4){return isArray$3(b$4)?a$2.length===b$4.length&&a$2.every((value$1,i$1)=>value$1===b$4[i$1]):a$2.length===1&&a$2[0]===b$4}function resolveRelativePath(to$2,from){if(to$2.startsWith(`/`))return to$2;if(!to$2)return from;let fromSegments=from.split(`/`),toSegments=to$2.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$1,offset$2){let docRect=document.documentElement.getBoundingClientRect(),elRect=el$1.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$1=typeof positionEl==`string`?isIdSelector?document.getElementById(positionEl.slice(1)):document.querySelector(positionEl):positionEl;if(!el$1)return;scrollToOptions=getElementPosition(el$1,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$2=createCurrentLocation(base,location),from=currentLocation.value,fromState=historyState.value,delta=0;if(state){if(currentLocation.value=to$2,historyState.value=state,pauseState&&pauseState===from){pauseState=null;return}delta=fromState?state.position-fromState.position:0}else replace(to$2);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$2,state,replace$1){let hashIndex=base.indexOf(`#`),url=hashIndex>-1?(location$1.host&&document.querySelector(`base`)?base:base.slice(hashIndex))+to$2:createBaseLocation()+base+to$2;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$2,data$12){let state=assign$1({},history$1.state,buildState(historyState.value.back,to$2,historyState.value.forward,!0),data$12,{position:historyState.value.position});changeLocation(to$2,state,!0),currentLocation.value=to$2}function push$1(to$2,data$12){let currentState=assign$1({},historyState.value,history$1.state,{forward:to$2,scroll:computeScrollPosition()});changeLocation(currentState.current,currentState,!0);let state=assign$1({},buildState(currentLocation.value,to$2,null),{position:currentState.position+1},data$12);changeLocation(to$2,state,!1),currentLocation.value=to$2}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$1(delta,triggerListeners=!0){triggerListeners||historyListeners.pauseListeners(),history.go(delta)}let routerHistory=assign$1({location:``,base,go:go$1,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$4.length?b$4.length===1&&b$4[0]===80?1:-1:0}function comparePathParserScore(a$2,b$4){let i$1=0,aScore=a$2.score,bScore=b$4.score;for(;i$10&&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$1=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$1{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$4=>!k$4.optional).concat(matcher.parent?matcher.parent.keys.filter(k$4=>k$4.optional):[]).map(k$4=>k$4.name)),location$1.params&¶msFromLocation(location$1.params,matcher.keys.map(k$4=>k$4.name))),path=matcher.stringify(params)}else if(location$1.path!=null)path=location$1.path,matcher=matchers.find(m$3=>m$3.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$3=>m$3.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$1=0;i$1v$2&&encodeQueryValue(v$2)):[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$2=>v$2==null?null:``+v$2):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$1=handlers$3.indexOf(handler);i$1>-1&&handlers$3.splice(i$1,1)}}function reset(){handlers$3=[]}return{add:add$1,list:()=>handlers$3.slice(),reset}}function guardToPromiseFn(guard,to$2,from,record,name$2,runWithContext=fn$6=>fn$6()){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$2})):valid$1 instanceof Error?reject(valid$1):isRouteLocation(valid$1)?reject(createRouterError(2,{from:to$2,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$2,from,next)),guardCall=Promise.resolve(guardReturn);guard.length<3&&(guardCall=guardCall.then(next)),guardCall.catch(err=>reject(err))})}function extractComponentsGuards(matched,guardType,to$2,from,runWithContext=fn$6=>fn$6()){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$2,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$2,from,record,name$2,runWithContext)()}))}}return guards}function useLink(props){let router$1=inject(routerKey),currentRoute=inject(routeLocationKey),hasPrevious=!1,previousTo=null,route=computed(()=>{let to$2=unref(props.to);return router$1.resolve(to$2)}),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$3={}){if(guardEvent(e$3)){let p$5=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$5),p$5}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$3){if(!(e$3.metaKey||e$3.altKey||e$3.ctrlKey||e$3.shiftKey)&&!e$3.defaultPrevented&&!(e$3.button!==void 0&&e$3.button!==0)){if(e$3.currentTarget&&e$3.currentTarget.getAttribute){let target$1=e$3.currentTarget.getAttribute(`target`);if(/\b_blank\b/i.test(target$1))return}return e$3.preventDefault&&e$3.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$1)=>value$1!==outerValue[i$1]))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$2,name$2],[oldInstance,from,oldName])=>{to$2&&(to$2.instances[name$2]=instance,from&&from!==to$2&&instance&&instance===oldInstance&&(to$2.leaveGuards.size||(to$2.leaveGuards=from.leaveGuards),to$2.updateGuards.size||(to$2.updateGuards=from.updateGuards))),instance&&to$2&&(!from||!isSameRouteRecord(to$2,from)||!oldInstance)&&(to$2.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=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(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$2){return typeof to$2==`string`?parseURL(parseQuery$1,to$2,currentRoute.value.path):assign$1({},to$2)}function checkCanceledNavigation(to$2,from){if(pendingLocation!==to$2)return createRouterError(8,{from,to:to$2})}function push$1(to$2){return pushWithRedirect(to$2)}function replace(to$2){return push$1(assign$1(locationAsObject(to$2),{replace:!0}))}function handleRedirectRecord(to$2){let lastMatched=to$2.matched[to$2.matched.length-1];if(lastMatched&&lastMatched.redirect){let{redirect}=lastMatched,newTargetLocation=typeof redirect==`function`?redirect(to$2):redirect;return typeof newTargetLocation==`string`&&(newTargetLocation=newTargetLocation.includes(`?`)||newTargetLocation.includes(`#`)?newTargetLocation=locationAsObject(newTargetLocation):{path:newTargetLocation},newTargetLocation.params={}),assign$1({query:to$2.query,hash:to$2.hash,params:newTargetLocation.path==null?to$2.params:{}},newTargetLocation)}}function pushWithRedirect(to$2,redirectedFrom){let targetLocation=pendingLocation=resolve$1(to$2),from=currentRoute.value,data$12=to$2.state,force=to$2.force,replace$1=to$2.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$2,from){let error=checkCanceledNavigation(to$2,from);return error?Promise.reject(error):Promise.resolve()}function runWithContext(fn$6){let app=installedApps.values().next().value;return app&&typeof app.runWithContext==`function`?app.runWithContext(fn$6):fn$6()}function navigate(to$2,from){let guards,[leavingRecords,updatingRecords,enteringRecords]=extractChangingRecords(to$2,from);guards=extractComponentsGuards(leavingRecords.reverse(),`beforeRouteLeave`,to$2,from);for(let record of leavingRecords)record.leaveGuards.forEach(guard=>{guards.push(guardToPromiseFn(guard,to$2,from))});let canceledNavigationCheck=checkCanceledNavigationAndReject.bind(null,to$2,from);return guards.push(canceledNavigationCheck),runGuardQueue(guards).then(()=>{guards=[];for(let guard of beforeGuards.list())guards.push(guardToPromiseFn(guard,to$2,from));return guards.push(canceledNavigationCheck),runGuardQueue(guards)}).then(()=>{guards=extractComponentsGuards(updatingRecords,`beforeRouteUpdate`,to$2,from);for(let record of updatingRecords)record.updateGuards.forEach(guard=>{guards.push(guardToPromiseFn(guard,to$2,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$2,from));else guards.push(guardToPromiseFn(record.beforeEnter,to$2,from));return guards.push(canceledNavigationCheck),runGuardQueue(guards)}).then(()=>(to$2.matched.forEach(record=>record.enterCallbacks={}),guards=extractComponentsGuards(enteringRecords,`beforeRouteEnter`,to$2,from,runWithContext),guards.push(canceledNavigationCheck),runGuardQueue(guards))).then(()=>{guards=[];for(let guard of beforeResolveGuards.list())guards.push(guardToPromiseFn(guard,to$2,from));return guards.push(canceledNavigationCheck),runGuardQueue(guards)}).catch(err=>isNavigationFailure(err,8)?err:Promise.reject(err))}function triggerAfterEach(to$2,from,failure){afterGuards.list().forEach(guard=>runWithContext(()=>guard(to$2,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$2,_from,info)=>{if(!router$1.listening)return;let toLocation=resolve$1(to$2),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$2,from){markAsReady(error);let list$2=errorListeners.list();return list$2.length?list$2.forEach(handler=>handler(error,to$2,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$2,from,isPush,isFirstNavigation){let{scrollBehavior}=options$1;if(!isBrowser$2||!scrollBehavior)return Promise.resolve();let scrollPosition=!isPush&&getSavedScrollPosition(getScrollKey(to$2.fullPath,0))||(isFirstNavigation||!isPush)&&history.state&&history.state.scroll||null;return nextTick().then(()=>scrollBehavior(to$2,from,scrollPosition)).then(position$2=>position$2&&scrollToPosition(position$2)).catch(err=>triggerError(err,to$2,from))}let go$1=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:go$1,back:()=>go$1(-1),forward:()=>go$1(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$2,from){let leavingRecords=[],updatingRecords=[],enteringRecords=[],len=Math.max(from.matched.length,to$2.matched.length);for(let i$1=0;i$1isSameRouteRecord(record,recordFrom))?updatingRecords.push(recordFrom):leavingRecords.push(recordFrom));let recordTo=to$2.matched[i$1];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-CTAnVDmW.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_-TBhc7L19.js`),[])},{path:`/audio`,name:`/audio`,component:()=>__vitePreload(()=>import(`./audio-BlXLxr75.js`),[])},{path:`/devtools`,children:[{path:`audio-record`,name:`/devtools/audio-record`,component:()=>__vitePreload(()=>import(`./audio-record-DrJXfolx.js`),[])},{path:`background-remove`,name:`/devtools/background-remove`,component:()=>__vitePreload(()=>import(`./background-remove-BnlMlOvh.js`),__vite__mapDeps([13,14,15]))},{path:`chat`,name:`/devtools/chat`,component:()=>__vitePreload(()=>import(`./chat-BUZwRCyI.js`),[])},{path:`gesture-circle`,name:`/devtools/gesture-circle`,component:()=>__vitePreload(()=>import(`./gesture-circle-NieW4uSY.js`),__vite__mapDeps([16,12])),meta:{layout:`plain`}},{path:`image`,name:`/devtools/image`,component:()=>__vitePreload(()=>import(`./image-CG6IRKrT.js`),__vite__mapDeps([17,18]))},{path:`polaroid`,name:`/devtools/polaroid`,component:()=>__vitePreload(()=>import(`./polaroid-qE5EuLqQ.js`),__vite__mapDeps([19,7,8,9]))},{path:`vibrant`,name:`/devtools/vibrant`,component:()=>__vitePreload(()=>import(`./vibrant-BnHhPWZj.js`),__vite__mapDeps([20,21,15]))}]},{path:`/queue`,name:`/queue`,component:()=>__vitePreload(()=>import(`./queue-ClKCooOo.js`),[])},{path:`/settings`,children:[{path:``,name:`/settings/`,component:()=>__vitePreload(()=>import(`./settings-DV-w6Z9d.js`),__vite__mapDeps([22,12,23])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`airi-card`,children:[{path:``,name:`/settings/airi-card/`,component:()=>__vitePreload(()=>import(`./airi-card-DVINiKa7.js`),__vite__mapDeps([24,12,25,26,27,28,29,30,15])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`components`,children:[{path:`CardCreate`,name:`/settings/airi-card/components/CardCreate`,component:()=>__vitePreload(()=>import(`./CardCreate-CQKwfgDh.js`),__vite__mapDeps([31,25]))},{path:`CardCreationDialog`,name:`/settings/airi-card/components/CardCreationDialog`,component:()=>__vitePreload(()=>import(`./CardCreationDialog-DzTU0wp7.js`),__vite__mapDeps([32,26,27]))},{path:`CardDetailDialog`,name:`/settings/airi-card/components/CardDetailDialog`,component:()=>__vitePreload(()=>import(`./CardDetailDialog-DhX59GOE.js`),__vite__mapDeps([33,28,29]))},{path:`CardListItem`,name:`/settings/airi-card/components/CardListItem`,component:()=>__vitePreload(()=>import(`./CardListItem-BPRbxcba.js`),__vite__mapDeps([34,30]))},{path:`DeleteCardDialog`,name:`/settings/airi-card/components/DeleteCardDialog`,component:()=>__vitePreload(()=>import(`./DeleteCardDialog-DUAm5fH5.js`),__vite__mapDeps([35,29]))}]}]},{path:`appearance`,children:[{path:``,name:`/settings/appearance/`,component:()=>__vitePreload(()=>import(`./appearance-BKBvMHL0.js`),__vite__mapDeps([36,12])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}},{path:`color-scheme`,name:`/settings/appearance/color-scheme`,component:()=>__vitePreload(()=>import(`./color-scheme-Cs2KuTF6.js`),__vite__mapDeps([37,12,38])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`developer`,name:`/settings/appearance/developer`,component:()=>__vitePreload(()=>import(`./developer-Dqo6PXeC.js`),__vite__mapDeps([39,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`general`,name:`/settings/appearance/general`,component:()=>__vitePreload(()=>import(`./general-CVrjEVIh.js`),__vite__mapDeps([40,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}}]},{path:`memory`,children:[{path:``,name:`/settings/memory/`,component:()=>__vitePreload(()=>import(`./memory-DFoYeFiJ.js`),__vite__mapDeps([41,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}}]},{path:`models`,children:[{path:``,name:`/settings/models/`,component:()=>__vitePreload(()=>import(`./models-C6mXogRh.js`),__vite__mapDeps([42,12,23,43,7,8,9,21])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}}]},{path:`modules`,children:[{path:``,name:`/settings/modules/`,component:()=>__vitePreload(()=>import(`./modules-BSQfB0qf.js`),__vite__mapDeps([44,12,23,43])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}},{path:`consciousness`,name:`/settings/modules/consciousness`,component:()=>__vitePreload(()=>import(`./consciousness-BLecufPV.js`),__vite__mapDeps([45,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`hearing`,name:`/settings/modules/hearing`,component:()=>__vitePreload(()=>import(`./hearing-DkgAkF88.js`),__vite__mapDeps([46,12,14])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`memory-long-term`,name:`/settings/modules/memory-long-term`,component:()=>__vitePreload(()=>import(`./memory-long-term-Bfhngu6P.js`),__vite__mapDeps([47,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`memory-short-term`,name:`/settings/modules/memory-short-term`,component:()=>__vitePreload(()=>import(`./memory-short-term-cIlmNFtC.js`),__vite__mapDeps([48,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`speech`,name:`/settings/modules/speech`,component:()=>__vitePreload(()=>import(`./speech-uucZ9CVe.js`),__vite__mapDeps([49,12,10,50])),meta:{layout:`settings`,stageTransition:{name:`slide`}}}]},{path:`providers`,children:[{path:``,name:`/settings/providers/`,component:()=>__vitePreload(()=>import(`./providers-DLjH9JAw.js`),__vite__mapDeps([51,12,23,43])),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-BJD00XEf.js`),__vite__mapDeps([52,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`anthropic`,name:`/settings/providers/anthropic`,component:()=>__vitePreload(()=>import(`./anthropic-Ds06Wuq-.js`),__vite__mapDeps([53,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`azure-ai-foundry`,name:`/settings/providers/azure-ai-foundry`,component:()=>__vitePreload(()=>import(`./azure-ai-foundry-D_2nNXRn.js`),__vite__mapDeps([54,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`cloudflare-workers-ai`,name:`/settings/providers/cloudflare-workers-ai`,component:()=>__vitePreload(()=>import(`./cloudflare-workers-ai-CL-TY-Cz.js`),__vite__mapDeps([55,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`deepseek`,name:`/settings/providers/deepseek`,component:()=>__vitePreload(()=>import(`./deepseek-BPOq0AFu.js`),__vite__mapDeps([56,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`elevenlabs`,name:`/settings/providers/elevenlabs`,component:()=>__vitePreload(()=>import(`./elevenlabs-tZGvWrsu.js`),__vite__mapDeps([57,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`featherless-ai`,name:`/settings/providers/featherless-ai`,component:()=>__vitePreload(()=>import(`./featherless-ai-B-HXyLKh.js`),__vite__mapDeps([58,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`fireworks-ai`,name:`/settings/providers/fireworks-ai`,component:()=>__vitePreload(()=>import(`./fireworks-ai-CI_8N3O3.js`),__vite__mapDeps([59,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`google-generative-ai`,name:`/settings/providers/google-generative-ai`,component:()=>__vitePreload(()=>import(`./google-generative-ai-CjRSvghG.js`),__vite__mapDeps([60,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`microsoft-speech`,name:`/settings/providers/microsoft-speech`,component:()=>__vitePreload(()=>import(`./microsoft-speech-CszGvA6L.js`),__vite__mapDeps([61,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`mistral-ai`,name:`/settings/providers/mistral-ai`,component:()=>__vitePreload(()=>import(`./mistral-ai-PlMgYfnI.js`),__vite__mapDeps([62,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`moonshot-ai`,name:`/settings/providers/moonshot-ai`,component:()=>__vitePreload(()=>import(`./moonshot-ai-CMPzQdws.js`),__vite__mapDeps([63,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`novita-ai`,name:`/settings/providers/novita-ai`,component:()=>__vitePreload(()=>import(`./novita-ai-B-sn63fK.js`),__vite__mapDeps([64,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`ollama`,name:`/settings/providers/ollama`,component:()=>__vitePreload(()=>import(`./ollama--RoUgpZl.js`),__vite__mapDeps([65,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`openai`,name:`/settings/providers/openai`,component:()=>__vitePreload(()=>import(`./openai-BaqtySWH.js`),__vite__mapDeps([66,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`openai-audio-speech`,name:`/settings/providers/openai-audio-speech`,component:()=>__vitePreload(()=>import(`./openai-audio-speech-DWlI47_x.js`),__vite__mapDeps([67,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`openai-audio-transcription`,name:`/settings/providers/openai-audio-transcription`,component:()=>__vitePreload(()=>import(`./openai-audio-transcription-DxV0q5KK.js`),__vite__mapDeps([68,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`openrouter-ai`,name:`/settings/providers/openrouter-ai`,component:()=>__vitePreload(()=>import(`./openrouter-ai-DVJv8zTp.js`),__vite__mapDeps([69,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`player2`,name:`/settings/providers/player2`,component:()=>__vitePreload(()=>import(`./player2-C8nhkznT.js`),__vite__mapDeps([70,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`player2-speech`,name:`/settings/providers/player2-speech`,component:()=>__vitePreload(()=>import(`./player2-speech-CYU2KX04.js`),__vite__mapDeps([71,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`together-ai`,name:`/settings/providers/together-ai`,component:()=>__vitePreload(()=>import(`./together-ai-COjt7TWP.js`),__vite__mapDeps([72,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`volcengine`,name:`/settings/providers/volcengine`,component:()=>__vitePreload(()=>import(`./volcengine-DGc8MHu2.js`),__vite__mapDeps([73,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`xai`,name:`/settings/providers/xai`,component:()=>__vitePreload(()=>import(`./xai-nQqFIsUV.js`),__vite__mapDeps([74,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}}]},{path:`scene`,children:[{path:``,name:`/settings/scene/`,component:()=>__vitePreload(()=>import(`./scene-XjDq2xJ1.js`),__vite__mapDeps([75,12,23,43])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}}]}]},{path:`/stage`,children:[{path:``,name:`StageScenePage`,component:()=>__vitePreload(()=>import(`./stage-DfACZXa2.js`),__vite__mapDeps([76,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-BZNjFRng.js`),__vite__mapDeps([77,10,50]))},{path:`queues`,children:[{path:`delays`,name:`/test/queues/delays`,component:()=>__vitePreload(()=>import(`./delays-BJ-K9VUB.js`),__vite__mapDeps([78,10,50]))},{path:`emotions`,name:`/test/queues/emotions`,component:()=>__vitePreload(()=>import(`./emotions-CUlnAOYu.js`),__vite__mapDeps([79,10,50]))},{path:`messages`,name:`/test/queues/messages`,component:()=>__vitePreload(()=>import(`./messages-CYxzuiqf.js`),__vite__mapDeps([80,10,50]))}]}]}];var 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$1=0;i$1renderSlot(_ctx.$slots,`default`,{frequencies:frequencies.value})}}),AudioSpectrum_default=AudioSpectrum_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$48={"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$48,[(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$47={key:0,class:`mb-2 flex items-center justify-between`},_hoisted_2$31={class:`text-sm font-medium`},_hoisted_3$25={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},(_$2,i$1)=>({active:i$1a$2.value-b$4.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$47,[createBaseVNode(`span`,_hoisted_2$31,toDisplayString(_ctx.label),1),createBaseVNode(`span`,_hoisted_3$25,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))}}),__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},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$46={key:0,class:`mb-2 flex items-center justify-between`},_hoisted_2$30={class:`text-sm font-medium`},_hoisted_3$24={class:`text-sm text-neutral-500`},_hoisted_4$20={key:1,class:`mt-1 flex gap-3 text-xs text-neutral-500`},_hoisted_5$16={class:`flex items-center gap-1`},_hoisted_6$14={class:`flex items-center gap-1`},_hoisted_7$9={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},(_$2,i$1)=>({active:i$1=thresholdBar,isBelowThreshold:i$1(openBlock(),createElementBlock(`div`,null,[_ctx.showHeader?(openBlock(),createElementBlock(`div`,_hoisted_1$46,[createBaseVNode(`span`,_hoisted_2$30,toDisplayString(_ctx.label),1),createBaseVNode(`span`,_hoisted_3$24,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$20,[createBaseVNode(`span`,_hoisted_5$16,[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$14,[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$9,[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$2=`\\s*,\\s*`,rx_num_per_none=RegExp(`^`+num_per_none+`$`),rgb_num_old=RegExp(`^rgba?\\(\\s*${num$1}${c$2}${num$1}${c$2}${num$1}\\s*(?:,\\s*${num_per}\\s*)?\\)$`),rgb_per_old=RegExp(`^rgba?\\(\\s*${per}${c$2}${per}${c$2}${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$2=>v$2,useMode=definition$29=>(converters[definition$29.mode]={...converters[definition$29.mode],...definition$29.toMode},Object.keys(definition$29.fromMode||{}).forEach(k$4=>{converters[k$4]||(converters[k$4]={}),converters[k$4][definition$29.mode]=definition$29.fromMode[k$4]}),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$1=0;function is_num(chars){let ch$1=chars[_i$1],ch1=chars[_i$1+1];return ch$1===`-`||ch$1===`+`?/\d/.test(ch1)||ch1===`.`&&/\d/.test(chars[_i$1+2]):ch$1===`.`?/\d/.test(ch1):/\d/.test(ch$1)}function is_ident(chars){if(_i$1>=chars.length)return!1;let ch$1=chars[_i$1];if(IdentStartCodePoint.test(ch$1))return!0;if(ch$1===`-`){if(chars.length-_i$1<2)return!1;let ch1=chars[_i$1+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$1]===`-`||chars[_i$1]===`+`)&&(value$1+=chars[_i$1++]),value$1+=digits(chars),chars[_i$1]===`.`&&/\d/.test(chars[_i$1+1])&&(value$1+=chars[_i$1++]+digits(chars)),(chars[_i$1]===`e`||chars[_i$1]===`E`)&&((chars[_i$1+1]===`-`||chars[_i$1+1]===`+`)&&/\d/.test(chars[_i$1+2])?value$1+=chars[_i$1++]+chars[_i$1++]+digits(chars):/\d/.test(chars[_i$1+1])&&(value$1+=chars[_i$1++]+digits(chars))),is_ident(chars)){let id$1=ident(chars);return id$1===`deg`||id$1===`rad`||id$1===`turn`||id$1===`grad`?{type:Tok.Hue,value:value$1*huenits[id$1]}:void 0}return chars[_i$1]===`%`?(_i$1++,{type:Tok.Percentage,value:+value$1}):{type:Tok.Number,value:+value$1}}function digits(chars){let v$2=``;for(;/\d/.test(chars[_i$1]);)v$2+=chars[_i$1++];return v$2}function ident(chars){let v$2=``;for(;_i$1store[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-BjhJ8iTT.js`),__vite__mapDeps([0,1,2])),"/src/layouts/home.vue":()=>__vitePreload(()=>import(`./home-kypUX7iO.js`),[]),"/src/layouts/plain.vue":()=>__vitePreload(()=>import(`./plain-vwAfWNiv.js`),[]),"/src/layouts/settings.vue":()=>__vitePreload(()=>import(`./settings-DGA0gtM5.js`),__vite__mapDeps([3,1,2,4])),"/src/layouts/stage.vue":()=>__vitePreload(()=>import(`./stage-BpXm32LC.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$2=>(r$2.path===``||r$2.path===`/`)&&r$2.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$6,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$6):fn$6(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$2,b$4){let aLastIndex=a$2.matched.length-1,bLastIndex=b$4.matched.length-1;return aLastIndex>-1&&aLastIndex===bLastIndex&&isSameRouteRecord(a$2.matched[aLastIndex],b$4.matched[bLastIndex])&&isSameRouteLocationParams(a$2.params,b$4.params)&&stringifyQuery$1(a$2.query)===stringifyQuery$1(b$4.query)&&a$2.hash===b$4.hash}function isSameRouteRecord(a$2,b$4){return(a$2.aliasOf||a$2)===(b$4.aliasOf||b$4)}function isSameRouteLocationParams(a$2,b$4){if(Object.keys(a$2).length!==Object.keys(b$4).length)return!1;for(let key$2 in a$2)if(!isSameRouteLocationParamsValue(a$2[key$2],b$4[key$2]))return!1;return!0}function isSameRouteLocationParamsValue(a$2,b$4){return isArray$3(a$2)?isEquivalentArray(a$2,b$4):isArray$3(b$4)?isEquivalentArray(b$4,a$2):a$2===b$4}function isEquivalentArray(a$2,b$4){return isArray$3(b$4)?a$2.length===b$4.length&&a$2.every((value$1,i$1)=>value$1===b$4[i$1]):a$2.length===1&&a$2[0]===b$4}function resolveRelativePath(to$2,from){if(to$2.startsWith(`/`))return to$2;if(!to$2)return from;let fromSegments=from.split(`/`),toSegments=to$2.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$1,offset$2){let docRect=document.documentElement.getBoundingClientRect(),elRect=el$1.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$1=typeof positionEl==`string`?isIdSelector?document.getElementById(positionEl.slice(1)):document.querySelector(positionEl):positionEl;if(!el$1)return;scrollToOptions=getElementPosition(el$1,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$2=createCurrentLocation(base,location),from=currentLocation.value,fromState=historyState.value,delta=0;if(state){if(currentLocation.value=to$2,historyState.value=state,pauseState&&pauseState===from){pauseState=null;return}delta=fromState?state.position-fromState.position:0}else replace(to$2);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$2,state,replace$1){let hashIndex=base.indexOf(`#`),url=hashIndex>-1?(location$1.host&&document.querySelector(`base`)?base:base.slice(hashIndex))+to$2:createBaseLocation()+base+to$2;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$2,data$12){let state=assign$1({},history$1.state,buildState(historyState.value.back,to$2,historyState.value.forward,!0),data$12,{position:historyState.value.position});changeLocation(to$2,state,!0),currentLocation.value=to$2}function push$1(to$2,data$12){let currentState=assign$1({},historyState.value,history$1.state,{forward:to$2,scroll:computeScrollPosition()});changeLocation(currentState.current,currentState,!0);let state=assign$1({},buildState(currentLocation.value,to$2,null),{position:currentState.position+1},data$12);changeLocation(to$2,state,!1),currentLocation.value=to$2}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$1(delta,triggerListeners=!0){triggerListeners||historyListeners.pauseListeners(),history.go(delta)}let routerHistory=assign$1({location:``,base,go:go$1,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$4.length?b$4.length===1&&b$4[0]===80?1:-1:0}function comparePathParserScore(a$2,b$4){let i$1=0,aScore=a$2.score,bScore=b$4.score;for(;i$10&&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$1=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$1{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$4=>!k$4.optional).concat(matcher.parent?matcher.parent.keys.filter(k$4=>k$4.optional):[]).map(k$4=>k$4.name)),location$1.params&¶msFromLocation(location$1.params,matcher.keys.map(k$4=>k$4.name))),path=matcher.stringify(params)}else if(location$1.path!=null)path=location$1.path,matcher=matchers.find(m$3=>m$3.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$3=>m$3.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$1=0;i$1v$2&&encodeQueryValue(v$2)):[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$2=>v$2==null?null:``+v$2):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$1=handlers$3.indexOf(handler);i$1>-1&&handlers$3.splice(i$1,1)}}function reset(){handlers$3=[]}return{add:add$1,list:()=>handlers$3.slice(),reset}}function guardToPromiseFn(guard,to$2,from,record,name$2,runWithContext=fn$6=>fn$6()){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$2})):valid$1 instanceof Error?reject(valid$1):isRouteLocation(valid$1)?reject(createRouterError(2,{from:to$2,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$2,from,next)),guardCall=Promise.resolve(guardReturn);guard.length<3&&(guardCall=guardCall.then(next)),guardCall.catch(err=>reject(err))})}function extractComponentsGuards(matched,guardType,to$2,from,runWithContext=fn$6=>fn$6()){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$2,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$2,from,record,name$2,runWithContext)()}))}}return guards}function useLink(props){let router$1=inject(routerKey),currentRoute=inject(routeLocationKey),hasPrevious=!1,previousTo=null,route=computed(()=>{let to$2=unref(props.to);return router$1.resolve(to$2)}),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$3={}){if(guardEvent(e$3)){let p$5=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$5),p$5}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$3){if(!(e$3.metaKey||e$3.altKey||e$3.ctrlKey||e$3.shiftKey)&&!e$3.defaultPrevented&&!(e$3.button!==void 0&&e$3.button!==0)){if(e$3.currentTarget&&e$3.currentTarget.getAttribute){let target$1=e$3.currentTarget.getAttribute(`target`);if(/\b_blank\b/i.test(target$1))return}return e$3.preventDefault&&e$3.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$1)=>value$1!==outerValue[i$1]))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$2,name$2],[oldInstance,from,oldName])=>{to$2&&(to$2.instances[name$2]=instance,from&&from!==to$2&&instance&&instance===oldInstance&&(to$2.leaveGuards.size||(to$2.leaveGuards=from.leaveGuards),to$2.updateGuards.size||(to$2.updateGuards=from.updateGuards))),instance&&to$2&&(!from||!isSameRouteRecord(to$2,from)||!oldInstance)&&(to$2.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=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(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$2){return typeof to$2==`string`?parseURL(parseQuery$1,to$2,currentRoute.value.path):assign$1({},to$2)}function checkCanceledNavigation(to$2,from){if(pendingLocation!==to$2)return createRouterError(8,{from,to:to$2})}function push$1(to$2){return pushWithRedirect(to$2)}function replace(to$2){return push$1(assign$1(locationAsObject(to$2),{replace:!0}))}function handleRedirectRecord(to$2){let lastMatched=to$2.matched[to$2.matched.length-1];if(lastMatched&&lastMatched.redirect){let{redirect}=lastMatched,newTargetLocation=typeof redirect==`function`?redirect(to$2):redirect;return typeof newTargetLocation==`string`&&(newTargetLocation=newTargetLocation.includes(`?`)||newTargetLocation.includes(`#`)?newTargetLocation=locationAsObject(newTargetLocation):{path:newTargetLocation},newTargetLocation.params={}),assign$1({query:to$2.query,hash:to$2.hash,params:newTargetLocation.path==null?to$2.params:{}},newTargetLocation)}}function pushWithRedirect(to$2,redirectedFrom){let targetLocation=pendingLocation=resolve$1(to$2),from=currentRoute.value,data$12=to$2.state,force=to$2.force,replace$1=to$2.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$2,from){let error=checkCanceledNavigation(to$2,from);return error?Promise.reject(error):Promise.resolve()}function runWithContext(fn$6){let app=installedApps.values().next().value;return app&&typeof app.runWithContext==`function`?app.runWithContext(fn$6):fn$6()}function navigate(to$2,from){let guards,[leavingRecords,updatingRecords,enteringRecords]=extractChangingRecords(to$2,from);guards=extractComponentsGuards(leavingRecords.reverse(),`beforeRouteLeave`,to$2,from);for(let record of leavingRecords)record.leaveGuards.forEach(guard=>{guards.push(guardToPromiseFn(guard,to$2,from))});let canceledNavigationCheck=checkCanceledNavigationAndReject.bind(null,to$2,from);return guards.push(canceledNavigationCheck),runGuardQueue(guards).then(()=>{guards=[];for(let guard of beforeGuards.list())guards.push(guardToPromiseFn(guard,to$2,from));return guards.push(canceledNavigationCheck),runGuardQueue(guards)}).then(()=>{guards=extractComponentsGuards(updatingRecords,`beforeRouteUpdate`,to$2,from);for(let record of updatingRecords)record.updateGuards.forEach(guard=>{guards.push(guardToPromiseFn(guard,to$2,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$2,from));else guards.push(guardToPromiseFn(record.beforeEnter,to$2,from));return guards.push(canceledNavigationCheck),runGuardQueue(guards)}).then(()=>(to$2.matched.forEach(record=>record.enterCallbacks={}),guards=extractComponentsGuards(enteringRecords,`beforeRouteEnter`,to$2,from,runWithContext),guards.push(canceledNavigationCheck),runGuardQueue(guards))).then(()=>{guards=[];for(let guard of beforeResolveGuards.list())guards.push(guardToPromiseFn(guard,to$2,from));return guards.push(canceledNavigationCheck),runGuardQueue(guards)}).catch(err=>isNavigationFailure(err,8)?err:Promise.reject(err))}function triggerAfterEach(to$2,from,failure){afterGuards.list().forEach(guard=>runWithContext(()=>guard(to$2,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$2,_from,info)=>{if(!router$1.listening)return;let toLocation=resolve$1(to$2),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$2,from){markAsReady(error);let list$2=errorListeners.list();return list$2.length?list$2.forEach(handler=>handler(error,to$2,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$2,from,isPush,isFirstNavigation){let{scrollBehavior}=options$1;if(!isBrowser$2||!scrollBehavior)return Promise.resolve();let scrollPosition=!isPush&&getSavedScrollPosition(getScrollKey(to$2.fullPath,0))||(isFirstNavigation||!isPush)&&history.state&&history.state.scroll||null;return nextTick().then(()=>scrollBehavior(to$2,from,scrollPosition)).then(position$2=>position$2&&scrollToPosition(position$2)).catch(err=>triggerError(err,to$2,from))}let go$1=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:go$1,back:()=>go$1(-1),forward:()=>go$1(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$2,from){let leavingRecords=[],updatingRecords=[],enteringRecords=[],len=Math.max(from.matched.length,to$2.matched.length);for(let i$1=0;i$1isSameRouteRecord(record,recordFrom))?updatingRecords.push(recordFrom):leavingRecords.push(recordFrom));let recordTo=to$2.matched[i$1];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-DgHFu8YX.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_-B7_146pG.js`),[])},{path:`/audio`,name:`/audio`,component:()=>__vitePreload(()=>import(`./audio-DYYSATQy.js`),[])},{path:`/devtools`,children:[{path:`audio-record`,name:`/devtools/audio-record`,component:()=>__vitePreload(()=>import(`./audio-record-Dpsb3s2S.js`),[])},{path:`background-remove`,name:`/devtools/background-remove`,component:()=>__vitePreload(()=>import(`./background-remove-Doptaj1n.js`),__vite__mapDeps([13,14,15]))},{path:`chat`,name:`/devtools/chat`,component:()=>__vitePreload(()=>import(`./chat-BIP9jXlU.js`),[])},{path:`gesture-circle`,name:`/devtools/gesture-circle`,component:()=>__vitePreload(()=>import(`./gesture-circle-BBMVN_ye.js`),__vite__mapDeps([16,12])),meta:{layout:`plain`}},{path:`image`,name:`/devtools/image`,component:()=>__vitePreload(()=>import(`./image-ByPuRM0v.js`),__vite__mapDeps([17,18]))},{path:`polaroid`,name:`/devtools/polaroid`,component:()=>__vitePreload(()=>import(`./polaroid-Ch51z8b2.js`),__vite__mapDeps([19,7,8,9]))},{path:`vibrant`,name:`/devtools/vibrant`,component:()=>__vitePreload(()=>import(`./vibrant-D7XJhUFd.js`),__vite__mapDeps([20,21,15]))}]},{path:`/queue`,name:`/queue`,component:()=>__vitePreload(()=>import(`./queue-BLcf1-Jv.js`),[])},{path:`/settings`,children:[{path:``,name:`/settings/`,component:()=>__vitePreload(()=>import(`./settings-C_Bl0Dic.js`),__vite__mapDeps([22,12,23])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`airi-card`,children:[{path:``,name:`/settings/airi-card/`,component:()=>__vitePreload(()=>import(`./airi-card-23m5t20W.js`),__vite__mapDeps([24,12,25,26,27,28,29,30,15])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`components`,children:[{path:`CardCreate`,name:`/settings/airi-card/components/CardCreate`,component:()=>__vitePreload(()=>import(`./CardCreate-eYkmqupR.js`),__vite__mapDeps([31,25]))},{path:`CardCreationDialog`,name:`/settings/airi-card/components/CardCreationDialog`,component:()=>__vitePreload(()=>import(`./CardCreationDialog-CSbQbKao.js`),__vite__mapDeps([32,26,27]))},{path:`CardDetailDialog`,name:`/settings/airi-card/components/CardDetailDialog`,component:()=>__vitePreload(()=>import(`./CardDetailDialog-BKAC6QHD.js`),__vite__mapDeps([33,28,29]))},{path:`CardListItem`,name:`/settings/airi-card/components/CardListItem`,component:()=>__vitePreload(()=>import(`./CardListItem-CaTpYoW4.js`),__vite__mapDeps([34,30]))},{path:`DeleteCardDialog`,name:`/settings/airi-card/components/DeleteCardDialog`,component:()=>__vitePreload(()=>import(`./DeleteCardDialog-DTWpW-2T.js`),__vite__mapDeps([35,29]))}]}]},{path:`appearance`,children:[{path:``,name:`/settings/appearance/`,component:()=>__vitePreload(()=>import(`./appearance-CbLkQE_9.js`),__vite__mapDeps([36,12])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}},{path:`color-scheme`,name:`/settings/appearance/color-scheme`,component:()=>__vitePreload(()=>import(`./color-scheme-Dk37f8SX.js`),__vite__mapDeps([37,12,38])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`developer`,name:`/settings/appearance/developer`,component:()=>__vitePreload(()=>import(`./developer-G1V3X_27.js`),__vite__mapDeps([39,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`general`,name:`/settings/appearance/general`,component:()=>__vitePreload(()=>import(`./general-B2Scnzyg.js`),__vite__mapDeps([40,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}}]},{path:`memory`,children:[{path:``,name:`/settings/memory/`,component:()=>__vitePreload(()=>import(`./memory-CFffyGxF.js`),__vite__mapDeps([41,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}}]},{path:`models`,children:[{path:``,name:`/settings/models/`,component:()=>__vitePreload(()=>import(`./models-WA_l83eR.js`),__vite__mapDeps([42,12,23,43,7,8,9,21])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}}]},{path:`modules`,children:[{path:``,name:`/settings/modules/`,component:()=>__vitePreload(()=>import(`./modules-CMn92Qgp.js`),__vite__mapDeps([44,12,23,43])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}},{path:`consciousness`,name:`/settings/modules/consciousness`,component:()=>__vitePreload(()=>import(`./consciousness-CYrl8QXs.js`),__vite__mapDeps([45,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`hearing`,name:`/settings/modules/hearing`,component:()=>__vitePreload(()=>import(`./hearing-DoOHup8T.js`),__vite__mapDeps([46,12,14])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`memory-long-term`,name:`/settings/modules/memory-long-term`,component:()=>__vitePreload(()=>import(`./memory-long-term-DiDwEey2.js`),__vite__mapDeps([47,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`memory-short-term`,name:`/settings/modules/memory-short-term`,component:()=>__vitePreload(()=>import(`./memory-short-term-ajNCalDy.js`),__vite__mapDeps([48,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`speech`,name:`/settings/modules/speech`,component:()=>__vitePreload(()=>import(`./speech-DILdLlfV.js`),__vite__mapDeps([49,12,10,50])),meta:{layout:`settings`,stageTransition:{name:`slide`}}}]},{path:`providers`,children:[{path:``,name:`/settings/providers/`,component:()=>__vitePreload(()=>import(`./providers-BEf5BA57.js`),__vite__mapDeps([51,12,23,43])),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-Bc3aTr9J.js`),__vite__mapDeps([52,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`anthropic`,name:`/settings/providers/anthropic`,component:()=>__vitePreload(()=>import(`./anthropic-BY1KMERF.js`),__vite__mapDeps([53,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`azure-ai-foundry`,name:`/settings/providers/azure-ai-foundry`,component:()=>__vitePreload(()=>import(`./azure-ai-foundry-CkLpWPUt.js`),__vite__mapDeps([54,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`cloudflare-workers-ai`,name:`/settings/providers/cloudflare-workers-ai`,component:()=>__vitePreload(()=>import(`./cloudflare-workers-ai-BaI_Rwef.js`),__vite__mapDeps([55,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`deepseek`,name:`/settings/providers/deepseek`,component:()=>__vitePreload(()=>import(`./deepseek-DnJanhZ7.js`),__vite__mapDeps([56,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`elevenlabs`,name:`/settings/providers/elevenlabs`,component:()=>__vitePreload(()=>import(`./elevenlabs-D_o9OBbz.js`),__vite__mapDeps([57,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`featherless-ai`,name:`/settings/providers/featherless-ai`,component:()=>__vitePreload(()=>import(`./featherless-ai-2oNxwFxi.js`),__vite__mapDeps([58,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`fireworks-ai`,name:`/settings/providers/fireworks-ai`,component:()=>__vitePreload(()=>import(`./fireworks-ai-CW9vBjr8.js`),__vite__mapDeps([59,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`google-generative-ai`,name:`/settings/providers/google-generative-ai`,component:()=>__vitePreload(()=>import(`./google-generative-ai-BwVpRZEr.js`),__vite__mapDeps([60,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`microsoft-speech`,name:`/settings/providers/microsoft-speech`,component:()=>__vitePreload(()=>import(`./microsoft-speech-C7ThD9iN.js`),__vite__mapDeps([61,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`mistral-ai`,name:`/settings/providers/mistral-ai`,component:()=>__vitePreload(()=>import(`./mistral-ai-CbjOvuKb.js`),__vite__mapDeps([62,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`moonshot-ai`,name:`/settings/providers/moonshot-ai`,component:()=>__vitePreload(()=>import(`./moonshot-ai-CFXUeFnc.js`),__vite__mapDeps([63,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`novita-ai`,name:`/settings/providers/novita-ai`,component:()=>__vitePreload(()=>import(`./novita-ai-CDmSyd2p.js`),__vite__mapDeps([64,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`ollama`,name:`/settings/providers/ollama`,component:()=>__vitePreload(()=>import(`./ollama-DEbOkWEd.js`),__vite__mapDeps([65,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`openai`,name:`/settings/providers/openai`,component:()=>__vitePreload(()=>import(`./openai-CfOD6NWP.js`),__vite__mapDeps([66,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`openai-audio-speech`,name:`/settings/providers/openai-audio-speech`,component:()=>__vitePreload(()=>import(`./openai-audio-speech-tr83Tays.js`),__vite__mapDeps([67,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`openai-audio-transcription`,name:`/settings/providers/openai-audio-transcription`,component:()=>__vitePreload(()=>import(`./openai-audio-transcription-53P1cwTz.js`),__vite__mapDeps([68,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`openrouter-ai`,name:`/settings/providers/openrouter-ai`,component:()=>__vitePreload(()=>import(`./openrouter-ai-BGXHC_hT.js`),__vite__mapDeps([69,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`player2`,name:`/settings/providers/player2`,component:()=>__vitePreload(()=>import(`./player2-92SQ5DhN.js`),__vite__mapDeps([70,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`player2-speech`,name:`/settings/providers/player2-speech`,component:()=>__vitePreload(()=>import(`./player2-speech-QfJzu0W0.js`),__vite__mapDeps([71,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`together-ai`,name:`/settings/providers/together-ai`,component:()=>__vitePreload(()=>import(`./together-ai-BHolxZvd.js`),__vite__mapDeps([72,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`volcengine`,name:`/settings/providers/volcengine`,component:()=>__vitePreload(()=>import(`./volcengine-CYOv3NuR.js`),__vite__mapDeps([73,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`xai`,name:`/settings/providers/xai`,component:()=>__vitePreload(()=>import(`./xai-DViBdpac.js`),__vite__mapDeps([74,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}}]},{path:`scene`,children:[{path:``,name:`/settings/scene/`,component:()=>__vitePreload(()=>import(`./scene-ePckR2Tm.js`),__vite__mapDeps([75,12,23,43])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}}]}]},{path:`/stage`,children:[{path:``,name:`StageScenePage`,component:()=>__vitePreload(()=>import(`./stage-Ckabb-ev.js`),__vite__mapDeps([76,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-BcMyfSi6.js`),__vite__mapDeps([77,10,50]))},{path:`queues`,children:[{path:`delays`,name:`/test/queues/delays`,component:()=>__vitePreload(()=>import(`./delays-DJ8ppqmz.js`),__vite__mapDeps([78,10,50]))},{path:`emotions`,name:`/test/queues/emotions`,component:()=>__vitePreload(()=>import(`./emotions-DvokzTuq.js`),__vite__mapDeps([79,10,50]))},{path:`messages`,name:`/test/queues/messages`,component:()=>__vitePreload(()=>import(`./messages-CgBnFGDa.js`),__vite__mapDeps([80,10,50]))}]}]}];var 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$1=0;i$1renderSlot(_ctx.$slots,`default`,{frequencies:frequencies.value})}}),AudioSpectrum_default=AudioSpectrum_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$48={"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$48,[(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$47={key:0,class:`mb-2 flex items-center justify-between`},_hoisted_2$31={class:`text-sm font-medium`},_hoisted_3$25={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},(_$2,i$1)=>({active:i$1a$2.value-b$4.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$47,[createBaseVNode(`span`,_hoisted_2$31,toDisplayString(_ctx.label),1),createBaseVNode(`span`,_hoisted_3$25,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))}}),__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},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$46={key:0,class:`mb-2 flex items-center justify-between`},_hoisted_2$30={class:`text-sm font-medium`},_hoisted_3$24={class:`text-sm text-neutral-500`},_hoisted_4$20={key:1,class:`mt-1 flex gap-3 text-xs text-neutral-500`},_hoisted_5$16={class:`flex items-center gap-1`},_hoisted_6$14={class:`flex items-center gap-1`},_hoisted_7$9={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},(_$2,i$1)=>({active:i$1=thresholdBar,isBelowThreshold:i$1(openBlock(),createElementBlock(`div`,null,[_ctx.showHeader?(openBlock(),createElementBlock(`div`,_hoisted_1$46,[createBaseVNode(`span`,_hoisted_2$30,toDisplayString(_ctx.label),1),createBaseVNode(`span`,_hoisted_3$24,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$20,[createBaseVNode(`span`,_hoisted_5$16,[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$14,[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$9,[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$2=`\\s*,\\s*`,rx_num_per_none=RegExp(`^`+num_per_none+`$`),rgb_num_old=RegExp(`^rgba?\\(\\s*${num$1}${c$2}${num$1}${c$2}${num$1}\\s*(?:,\\s*${num_per}\\s*)?\\)$`),rgb_per_old=RegExp(`^rgba?\\(\\s*${per}${c$2}${per}${c$2}${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$2=>v$2,useMode=definition$29=>(converters[definition$29.mode]={...converters[definition$29.mode],...definition$29.toMode},Object.keys(definition$29.fromMode||{}).forEach(k$4=>{converters[k$4]||(converters[k$4]={}),converters[k$4][definition$29.mode]=definition$29.fromMode[k$4]}),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$1=0;function is_num(chars){let ch$1=chars[_i$1],ch1=chars[_i$1+1];return ch$1===`-`||ch$1===`+`?/\d/.test(ch1)||ch1===`.`&&/\d/.test(chars[_i$1+2]):ch$1===`.`?/\d/.test(ch1):/\d/.test(ch$1)}function is_ident(chars){if(_i$1>=chars.length)return!1;let ch$1=chars[_i$1];if(IdentStartCodePoint.test(ch$1))return!0;if(ch$1===`-`){if(chars.length-_i$1<2)return!1;let ch1=chars[_i$1+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$1]===`-`||chars[_i$1]===`+`)&&(value$1+=chars[_i$1++]),value$1+=digits(chars),chars[_i$1]===`.`&&/\d/.test(chars[_i$1+1])&&(value$1+=chars[_i$1++]+digits(chars)),(chars[_i$1]===`e`||chars[_i$1]===`E`)&&((chars[_i$1+1]===`-`||chars[_i$1+1]===`+`)&&/\d/.test(chars[_i$1+2])?value$1+=chars[_i$1++]+chars[_i$1++]+digits(chars):/\d/.test(chars[_i$1+1])&&(value$1+=chars[_i$1++]+digits(chars))),is_ident(chars)){let id$1=ident(chars);return id$1===`deg`||id$1===`rad`||id$1===`turn`||id$1===`grad`?{type:Tok.Hue,value:value$1*huenits[id$1]}:void 0}return chars[_i$1]===`%`?(_i$1++,{type:Tok.Percentage,value:+value$1}):{type:Tok.Number,value:+value$1}}function digits(chars){let v$2=``;for(;/\d/.test(chars[_i$1]);)v$2+=chars[_i$1++];return v$2}function ident(chars){let v$2=``;for(;_i$14)){if(coords$1.length===4){if(coords$1[3].type!==Tok.Alpha)return;coords$1[3]=coords$1[3].value}return coords$1.length===3&&coords$1.push({type:Tok.None,value:void 0}),coords$1.every(c$4=>c$4.type!==Tok.Alpha)?coords$1:void 0}}function parseModernSyntax(tokens,includeHue){tokens._i=0;let token=tokens[tokens._i++];if(!token||token.type!==Tok.Function)return;let coords$1=consumeCoords(tokens,includeHue);if(coords$1)return coords$1.unshift(token.value),coords$1}const parse$2=color$2=>{if(typeof color$2!=`string`)return;let tokens=tokenize(color$2),parsed=tokens?parseModernSyntax(tokens,!0):void 0,result,i$1=0,len=parsers.length;for(;i$1c$4===`transparent`?{mode:`rgb`,r:0,g:0,b:0,alpha:0}:void 0;var parseTransparent_default=parseTransparent;const lerp$2=(a$2,b$4,t)=>a$2+t*(b$4-a$2),get_classes=arr=>{let classes=[];for(let i$1=0;i$1arr=>{let classes=get_classes(arr);return t=>{let cls=t*classes.length,idx=t>=1?classes.length-1:Math.max(Math.floor(cls),0),pair=classes[idx];return pair===void 0?void 0:interpolator(pair[0],pair[1],cls-idx)}},interpolatorLinear=interpolatorPiecewise(lerp$2),fixupAlpha=arr=>{let some_defined=!1,res=arr.map(v$2=>v$2===void 0?1:(some_defined=!0,v$2));return some_defined?res:arr},definition$28={mode:`rgb`,channels:[`r`,`g`,`b`,`alpha`],parse:[parseRgb_default,parseHex_default,parseRgbLegacy_default,parseNamed_default,parseTransparent_default,`srgb`],serialize:`srgb`,interpolate:{r:interpolatorLinear,g:interpolatorLinear,b:interpolatorLinear,alpha:{use:interpolatorLinear,fixup:fixupAlpha}},gamut:!0,white:{r:1,g:1,b:1},black:{r:0,g:0,b:0}};var definition_default$23=definition$28;const linearize$2=(v$2=0)=>Math.abs(v$2)**(563/256)*Math.sign(v$2),convertA98ToXyz65=a98$1=>{let r$2=linearize$2(a98$1.r),g$2=linearize$2(a98$1.g),b$4=linearize$2(a98$1.b),res={mode:`xyz65`,x:.5766690429101305*r$2+.1855582379065463*g$2+.1882286462349947*b$4,y:.297344975250536*r$2+.6273635662554661*g$2+.0752914584939979*b$4,z:.0270313613864123*r$2+.0706888525358272*g$2+.9913375368376386*b$4};return a98$1.alpha!==void 0&&(res.alpha=a98$1.alpha),res};var convertA98ToXyz65_default=convertA98ToXyz65;const gamma$2=v$2=>Math.abs(v$2)**(256/563)*Math.sign(v$2),convertXyz65ToA98=({x:x$3,y:y$3,z:z$3,alpha:alpha$1})=>{x$3===void 0&&(x$3=0),y$3===void 0&&(y$3=0),z$3===void 0&&(z$3=0);let res={mode:`a98`,r:gamma$2(x$3*2.0415879038107465-y$3*.5650069742788597-.3447313507783297*z$3),g:gamma$2(x$3*-.9692436362808798+y$3*1.8759675015077206+.0415550574071756*z$3),b:gamma$2(x$3*.0134442806320312-y$3*.1183623922310184+1.0151749943912058*z$3)};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertXyz65ToA98_default=convertXyz65ToA98;const fn$4=(c$4=0)=>{let abs$2=Math.abs(c$4);return abs$2<=.04045?c$4/12.92:(Math.sign(c$4)||1)*((abs$2+.055)/1.055)**2.4},convertRgbToLrgb=({r:r$2,g:g$2,b:b$4,alpha:alpha$1})=>{let res={mode:`lrgb`,r:fn$4(r$2),g:fn$4(g$2),b:fn$4(b$4)};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertRgbToLrgb_default=convertRgbToLrgb;const convertRgbToXyz65=rgb$2=>{let{r:r$2,g:g$2,b:b$4,alpha:alpha$1}=convertRgbToLrgb_default(rgb$2),res={mode:`xyz65`,x:.4123907992659593*r$2+.357584339383878*g$2+.1804807884018343*b$4,y:.2126390058715102*r$2+.715168678767756*g$2+.0721923153607337*b$4,z:.0193308187155918*r$2+.119194779794626*g$2+.9505321522496607*b$4};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertRgbToXyz65_default=convertRgbToXyz65;const fn$3=(c$4=0)=>{let abs$2=Math.abs(c$4);return abs$2>.0031308?(Math.sign(c$4)||1)*(1.055*abs$2**(1/2.4)-.055):c$4*12.92},convertLrgbToRgb=({r:r$2,g:g$2,b:b$4,alpha:alpha$1},mode=`rgb`)=>{let res={mode,r:fn$3(r$2),g:fn$3(g$2),b:fn$3(b$4)};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertLrgbToRgb_default=convertLrgbToRgb;const convertXyz65ToRgb=({x:x$3,y:y$3,z:z$3,alpha:alpha$1})=>{x$3===void 0&&(x$3=0),y$3===void 0&&(y$3=0),z$3===void 0&&(z$3=0);let res=convertLrgbToRgb_default({r:x$3*3.2409699419045226-y$3*1.537383177570094-.4986107602930034*z$3,g:x$3*-.9692436362808796+y$3*1.8759675015077204+.0415550574071756*z$3,b:x$3*.0556300796969936-y$3*.2039769588889765+1.0569715142428784*z$3});return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertXyz65ToRgb_default=convertXyz65ToRgb;const definition$27={...definition_default$23,mode:`a98`,parse:[`a98-rgb`],serialize:`a98-rgb`,fromMode:{rgb:color$2=>convertXyz65ToA98_default(convertRgbToXyz65_default(color$2)),xyz65:convertXyz65ToA98_default},toMode:{rgb:color$2=>convertXyz65ToRgb_default(convertA98ToXyz65_default(color$2)),xyz65:convertA98ToXyz65_default}};var definition_default=definition$27;const normalizeHue=hue$2=>(hue$2%=360)<0?hue$2+360:hue$2;var normalizeHue_default=normalizeHue;const hue$1=(hues,fn$6)=>hues.map((hue$2,idx,arr)=>{if(hue$2===void 0)return hue$2;let normalized=normalizeHue_default(hue$2);return idx===0||hues[idx-1]===void 0?normalized:fn$6(normalized-normalizeHue_default(arr[idx-1]))}).reduce((acc,curr)=>!acc.length||curr===void 0||acc[acc.length-1]===void 0?(acc.push(curr),acc):(acc.push(curr+acc[acc.length-1]),acc),[]),fixupHueShorter=arr=>hue$1(arr,d$2=>Math.abs(d$2)<=180?d$2:d$2-360*Math.sign(d$2)),M=[-.14861,1.78277,-.29227,-.90649,1.97294,0],degToRad$1=Math.PI/180,radToDeg$1=180/Math.PI;let DE=M[3]*M[4],BE=M[1]*M[4],BCAD=M[1]*M[2]-M[0]*M[3];const convertRgbToCubehelix=({r:r$2,g:g$2,b:b$4,alpha:alpha$1})=>{r$2===void 0&&(r$2=0),g$2===void 0&&(g$2=0),b$4===void 0&&(b$4=0);let l$1=(BCAD*b$4+r$2*DE-g$2*BE)/(BCAD+DE-BE),x$3=b$4-l$1,y$3=(M[4]*(g$2-l$1)-M[2]*x$3)/M[3],res={mode:`cubehelix`,l:l$1,s:l$1===0||l$1===1?void 0:Math.sqrt(x$3*x$3+y$3*y$3)/(M[4]*l$1*(1-l$1))};return res.s&&(res.h=Math.atan2(y$3,x$3)*radToDeg$1-120),alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertRgbToCubehelix_default=convertRgbToCubehelix;const convertCubehelixToRgb=({h:h$3,s:s$1,l:l$1,alpha:alpha$1})=>{let res={mode:`rgb`};h$3=(h$3===void 0?0:h$3+120)*degToRad$1,l$1===void 0&&(l$1=0);let amp=s$1===void 0?0:s$1*l$1*(1-l$1),cosh=Math.cos(h$3),sinh=Math.sin(h$3);return res.r=l$1+amp*(M[0]*cosh+M[1]*sinh),res.g=l$1+amp*(M[2]*cosh+M[3]*sinh),res.b=l$1+amp*(M[4]*cosh+M[5]*sinh),alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertCubehelixToRgb_default=convertCubehelixToRgb;const differenceHueSaturation=(std,smp)=>{if(std.h===void 0||smp.h===void 0||!std.s||!smp.s)return 0;let std_h=normalizeHue_default(std.h),smp_h=normalizeHue_default(smp.h),dH=Math.sin((smp_h-std_h+360)/2*Math.PI/180);return 2*Math.sqrt(std.s*smp.s)*dH},differenceHueNaive=(std,smp)=>{if(std.h===void 0||smp.h===void 0)return 0;let std_h=normalizeHue_default(std.h),smp_h=normalizeHue_default(smp.h);return Math.abs(smp_h-std_h)>180?std_h-(smp_h-360*Math.sign(smp_h-std_h)):smp_h-std_h},differenceHueChroma=(std,smp)=>{if(std.h===void 0||smp.h===void 0||!std.c||!smp.c)return 0;let std_h=normalizeHue_default(std.h),smp_h=normalizeHue_default(smp.h),dH=Math.sin((smp_h-std_h+360)/2*Math.PI/180);return 2*Math.sqrt(std.c*smp.c)*dH},averageAngle=val=>{let sum=val.reduce((sum$1,val$1)=>{if(val$1!==void 0){let rad=val$1*Math.PI/180;sum$1.sin+=Math.sin(rad),sum$1.cos+=Math.cos(rad)}return sum$1},{sin:0,cos:0}),angle=Math.atan2(sum.sin,sum.cos)*180/Math.PI;return angle<0?360+angle:angle},definition$26={mode:`cubehelix`,channels:[`h`,`s`,`l`,`alpha`],parse:[`--cubehelix`],serialize:`--cubehelix`,ranges:{h:[0,360],s:[0,4.614],l:[0,1]},fromMode:{rgb:convertRgbToCubehelix_default},toMode:{rgb:convertCubehelixToRgb_default},interpolate:{h:{use:interpolatorLinear,fixup:fixupHueShorter},s:interpolatorLinear,l:interpolatorLinear,alpha:{use:interpolatorLinear,fixup:fixupAlpha}},difference:{h:differenceHueSaturation},average:{h:averageAngle}};var definition_default$1=definition$26;const convertLabToLch=({l:l$1,a:a$2,b:b$4,alpha:alpha$1},mode=`lch`)=>{a$2===void 0&&(a$2=0),b$4===void 0&&(b$4=0);let c$4=Math.sqrt(a$2*a$2+b$4*b$4),res={mode,l:l$1,c:c$4};return c$4&&(res.h=normalizeHue_default(Math.atan2(b$4,a$2)*180/Math.PI)),alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertLabToLch_default=convertLabToLch;const convertLchToLab=({l:l$1,c:c$4,h:h$3,alpha:alpha$1},mode=`lab`)=>{h$3===void 0&&(h$3=0);let res={mode,l:l$1,a:c$4?c$4*Math.cos(h$3/180*Math.PI):0,b:c$4?c$4*Math.sin(h$3/180*Math.PI):0};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertLchToLab_default=convertLchToLab;const k$2=29**3/3**3,e$1=6**3/29**3,D50={X:.3457/.3585,Y:1,Z:.2958/.3585},D65={X:.3127/.329,Y:1,Z:.3583/.329},k$3=29**3/3**3,e$2=6**3/29**3;let fn$2=v$2=>v$2**3>e$1?v$2**3:(116*v$2-16)/k$2;const convertLab65ToXyz65=({l:l$1,a:a$2,b:b$4,alpha:alpha$1})=>{l$1===void 0&&(l$1=0),a$2===void 0&&(a$2=0),b$4===void 0&&(b$4=0);let fy$1=(l$1+16)/116,fx=a$2/500+fy$1,fz=fy$1-b$4/200,res={mode:`xyz65`,x:fn$2(fx)*D65.X,y:fn$2(fy$1)*D65.Y,z:fn$2(fz)*D65.Z};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertLab65ToXyz65_default=convertLab65ToXyz65;const convertLab65ToRgb=lab$1=>convertXyz65ToRgb_default(convertLab65ToXyz65_default(lab$1));var convertLab65ToRgb_default=convertLab65ToRgb;const f$2=value$1=>value$1>e$1?Math.cbrt(value$1):(k$2*value$1+16)/116,convertXyz65ToLab65=({x:x$3,y:y$3,z:z$3,alpha:alpha$1})=>{x$3===void 0&&(x$3=0),y$3===void 0&&(y$3=0),z$3===void 0&&(z$3=0);let f0=f$2(x$3/D65.X),f1=f$2(y$3/D65.Y),f2=f$2(z$3/D65.Z),res={mode:`lab65`,l:116*f1-16,a:500*(f0-f1),b:200*(f1-f2)};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertXyz65ToLab65_default=convertXyz65ToLab65;const convertRgbToLab65=rgb$2=>{let res=convertXyz65ToLab65_default(convertRgbToXyz65_default(rgb$2));return rgb$2.r===rgb$2.b&&rgb$2.b===rgb$2.g&&(res.a=res.b=0),res};var convertRgbToLab65_default=convertRgbToLab65;const kE=1,kCH=1,θ=26/180*Math.PI,cosθ=Math.cos(θ),sinθ=Math.sin(θ),factor=100/Math.log(139/100),convertDlchToLab65=({l:l$1,c:c$4,h:h$3,alpha:alpha$1})=>{l$1===void 0&&(l$1=0),c$4===void 0&&(c$4=0),h$3===void 0&&(h$3=0);let res={mode:`lab65`,l:(Math.exp(l$1*kE/factor)-1)/.0039},G$2=(Math.exp(.0435*c$4*kCH*kE)-1)/.075,e$3=G$2*Math.cos(h$3/180*Math.PI-θ),f$3=G$2*Math.sin(h$3/180*Math.PI-θ);return res.a=e$3*cosθ-f$3/.83*sinθ,res.b=e$3*sinθ+f$3/.83*cosθ,alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertDlchToLab65_default=convertDlchToLab65;const convertLab65ToDlch=({l:l$1,a:a$2,b:b$4,alpha:alpha$1})=>{l$1===void 0&&(l$1=0),a$2===void 0&&(a$2=0),b$4===void 0&&(b$4=0);let e$3=a$2*cosθ+b$4*sinθ,f$3=.83*(b$4*cosθ-a$2*sinθ),G$2=Math.sqrt(e$3*e$3+f$3*f$3),res={mode:`dlch`,l:factor/kE*Math.log(1+.0039*l$1),c:Math.log(1+.075*G$2)/(.0435*kCH*kE)};return res.c&&(res.h=normalizeHue_default((Math.atan2(f$3,e$3)+θ)/Math.PI*180)),alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertLab65ToDlch_default=convertLab65ToDlch;const convertDlabToLab65=c$4=>convertDlchToLab65_default(convertLabToLch_default(c$4,`dlch`)),convertLab65ToDlab=c$4=>convertLchToLab_default(convertLab65ToDlch_default(c$4),`dlab`),definition$25={mode:`dlab`,parse:[`--din99o-lab`],serialize:`--din99o-lab`,toMode:{lab65:convertDlabToLab65,rgb:c$4=>convertLab65ToRgb_default(convertDlabToLab65(c$4))},fromMode:{lab65:convertLab65ToDlab,rgb:c$4=>convertLab65ToDlab(convertRgbToLab65_default(c$4))},channels:[`l`,`a`,`b`,`alpha`],ranges:{l:[0,100],a:[-40.09,45.501],b:[-40.469,44.344]},interpolate:{l:interpolatorLinear,a:interpolatorLinear,b:interpolatorLinear,alpha:{use:interpolatorLinear,fixup:fixupAlpha}}};var definition_default$2=definition$25;const definition$24={mode:`dlch`,parse:[`--din99o-lch`],serialize:`--din99o-lch`,toMode:{lab65:convertDlchToLab65_default,dlab:c$4=>convertLchToLab_default(c$4,`dlab`),rgb:c$4=>convertLab65ToRgb_default(convertDlchToLab65_default(c$4))},fromMode:{lab65:convertLab65ToDlch_default,dlab:c$4=>convertLabToLch_default(c$4,`dlch`),rgb:c$4=>convertLab65ToDlch_default(convertRgbToLab65_default(c$4))},channels:[`l`,`c`,`h`,`alpha`],ranges:{l:[0,100],c:[0,51.484],h:[0,360]},interpolate:{l:interpolatorLinear,c:interpolatorLinear,h:{use:interpolatorLinear,fixup:fixupHueShorter},alpha:{use:interpolatorLinear,fixup:fixupAlpha}},difference:{h:differenceHueChroma},average:{h:averageAngle}};var definition_default$3=definition$24;function convertHsiToRgb({h:h$3,s:s$1,i:i$1,alpha:alpha$1}){h$3=normalizeHue_default(h$3===void 0?0:h$3),s$1===void 0&&(s$1=0),i$1===void 0&&(i$1=0);let f$3=Math.abs(h$3/60%2-1),res;switch(Math.floor(h$3/60)){case 0:res={r:i$1*(1+s$1*(3/(2-f$3)-1)),g:i$1*(1+s$1*(3*(1-f$3)/(2-f$3)-1)),b:i$1*(1-s$1)};break;case 1:res={r:i$1*(1+s$1*(3*(1-f$3)/(2-f$3)-1)),g:i$1*(1+s$1*(3/(2-f$3)-1)),b:i$1*(1-s$1)};break;case 2:res={r:i$1*(1-s$1),g:i$1*(1+s$1*(3/(2-f$3)-1)),b:i$1*(1+s$1*(3*(1-f$3)/(2-f$3)-1))};break;case 3:res={r:i$1*(1-s$1),g:i$1*(1+s$1*(3*(1-f$3)/(2-f$3)-1)),b:i$1*(1+s$1*(3/(2-f$3)-1))};break;case 4:res={r:i$1*(1+s$1*(3*(1-f$3)/(2-f$3)-1)),g:i$1*(1-s$1),b:i$1*(1+s$1*(3/(2-f$3)-1))};break;case 5:res={r:i$1*(1+s$1*(3/(2-f$3)-1)),g:i$1*(1-s$1),b:i$1*(1+s$1*(3*(1-f$3)/(2-f$3)-1))};break;default:res={r:i$1*(1-s$1),g:i$1*(1-s$1),b:i$1*(1-s$1)}}return res.mode=`rgb`,alpha$1!==void 0&&(res.alpha=alpha$1),res}function convertRgbToHsi({r:r$2,g:g$2,b:b$4,alpha:alpha$1}){r$2===void 0&&(r$2=0),g$2===void 0&&(g$2=0),b$4===void 0&&(b$4=0);let M$1=Math.max(r$2,g$2,b$4),m$3=Math.min(r$2,g$2,b$4),res={mode:`hsi`,s:r$2+g$2+b$4===0?0:1-3*m$3/(r$2+g$2+b$4),i:(r$2+g$2+b$4)/3};return M$1-m$3!==0&&(res.h=(M$1===r$2?(g$2-b$4)/(M$1-m$3)+(g$2{switch(unit){case`deg`:return+val;case`rad`:return val/Math.PI*180;case`grad`:return val/10*9;case`turn`:return val*360}};var hue_default=hueToDeg;const hsl_old=RegExp(`^hsla?\\(\\s*${hue}${c$2}${per}${c$2}${per}\\s*(?:,\\s*${num_per}\\s*)?\\)$`),parseHslLegacy=color$2=>{let match=color$2.match(hsl_old);if(!match)return;let res={mode:`hsl`};return match[3]===void 0?match[1]!==void 0&&match[2]!==void 0&&(res.h=hue_default(match[1],match[2])):res.h=+match[3],match[4]!==void 0&&(res.s=Math.min(Math.max(0,match[4]/100),1)),match[5]!==void 0&&(res.l=Math.min(Math.max(0,match[5]/100),1)),match[6]===void 0?match[7]!==void 0&&(res.alpha=Math.max(0,Math.min(1,+match[7]))):res.alpha=Math.max(0,Math.min(1,match[6]/100)),res};var parseHslLegacy_default=parseHslLegacy;function parseHsl(color$2,parsed){if(!parsed||parsed[0]!==`hsl`&&parsed[0]!==`hsla`)return;let res={mode:`hsl`},[,h$3,s$1,l$1,alpha$1]=parsed;if(h$3.type!==Tok.None){if(h$3.type===Tok.Percentage)return;res.h=h$3.value}if(s$1.type!==Tok.None){if(s$1.type===Tok.Hue)return;res.s=s$1.value/100}if(l$1.type!==Tok.None){if(l$1.type===Tok.Hue)return;res.l=l$1.value/100}return alpha$1.type!==Tok.None&&(res.alpha=Math.min(1,Math.max(0,alpha$1.type===Tok.Number?alpha$1.value:alpha$1.value/100))),res}var parseHsl_default=parseHsl;const definition$22={mode:`hsl`,toMode:{rgb:convertHslToRgb},fromMode:{rgb:convertRgbToHsl},channels:[`h`,`s`,`l`,`alpha`],ranges:{h:[0,360]},gamut:`rgb`,parse:[parseHsl_default,parseHslLegacy_default],serialize:c$4=>`hsl(${c$4.h===void 0?`none`:c$4.h} ${c$4.s===void 0?`none`:c$4.s*100+`%`} ${c$4.l===void 0?`none`:c$4.l*100+`%`}${c$4.alpha<1?` / ${c$4.alpha}`:``})`,interpolate:{h:{use:interpolatorLinear,fixup:fixupHueShorter},s:interpolatorLinear,l:interpolatorLinear,alpha:{use:interpolatorLinear,fixup:fixupAlpha}},difference:{h:differenceHueSaturation},average:{h:averageAngle}};var definition_default$5=definition$22;function convertHsvToRgb({h:h$3,s:s$1,v:v$2,alpha:alpha$1}){h$3=normalizeHue_default(h$3===void 0?0:h$3),s$1===void 0&&(s$1=0),v$2===void 0&&(v$2=0);let f$3=Math.abs(h$3/60%2-1),res;switch(Math.floor(h$3/60)){case 0:res={r:v$2,g:v$2*(1-s$1*f$3),b:v$2*(1-s$1)};break;case 1:res={r:v$2*(1-s$1*f$3),g:v$2,b:v$2*(1-s$1)};break;case 2:res={r:v$2*(1-s$1),g:v$2,b:v$2*(1-s$1*f$3)};break;case 3:res={r:v$2*(1-s$1),g:v$2*(1-s$1*f$3),b:v$2};break;case 4:res={r:v$2*(1-s$1*f$3),g:v$2*(1-s$1),b:v$2};break;case 5:res={r:v$2,g:v$2*(1-s$1),b:v$2*(1-s$1*f$3)};break;default:res={r:v$2*(1-s$1),g:v$2*(1-s$1),b:v$2*(1-s$1)}}return res.mode=`rgb`,alpha$1!==void 0&&(res.alpha=alpha$1),res}function convertRgbToHsv({r:r$2,g:g$2,b:b$4,alpha:alpha$1}){r$2===void 0&&(r$2=0),g$2===void 0&&(g$2=0),b$4===void 0&&(b$4=0);let M$1=Math.max(r$2,g$2,b$4),m$3=Math.min(r$2,g$2,b$4),res={mode:`hsv`,s:M$1===0?0:1-m$3/M$1,v:M$1};return M$1-m$3!==0&&(res.h=(M$1===r$2?(g$2-b$4)/(M$1-m$3)+(g$21){let s$1=w$2+b$4;w$2/=s$1,b$4/=s$1}return convertHsvToRgb({h:h$3,s:b$4===1?1:1-w$2/(1-b$4),v:1-b$4,alpha:alpha$1})}function convertRgbToHwb(rgba$1){let hsv$1=convertRgbToHsv(rgba$1);if(hsv$1===void 0)return;let s$1=hsv$1.s===void 0?0:hsv$1.s,v$2=hsv$1.v===void 0?0:hsv$1.v,res={mode:`hwb`,w:(1-s$1)*v$2,b:1-v$2};return hsv$1.h!==void 0&&(res.h=hsv$1.h),hsv$1.alpha!==void 0&&(res.alpha=hsv$1.alpha),res}function ParseHwb(color$2,parsed){if(!parsed||parsed[0]!==`hwb`)return;let res={mode:`hwb`},[,h$3,w$2,b$4,alpha$1]=parsed;if(h$3.type!==Tok.None){if(h$3.type===Tok.Percentage)return;res.h=h$3.value}if(w$2.type!==Tok.None){if(w$2.type===Tok.Hue)return;res.w=w$2.value/100}if(b$4.type!==Tok.None){if(b$4.type===Tok.Hue)return;res.b=b$4.value/100}return alpha$1.type!==Tok.None&&(res.alpha=Math.min(1,Math.max(0,alpha$1.type===Tok.Number?alpha$1.value:alpha$1.value/100))),res}var parseHwb_default=ParseHwb;const definition$20={mode:`hwb`,toMode:{rgb:convertHwbToRgb},fromMode:{rgb:convertRgbToHwb},channels:[`h`,`w`,`b`,`alpha`],ranges:{h:[0,360]},gamut:`rgb`,parse:[parseHwb_default],serialize:c$4=>`hwb(${c$4.h===void 0?`none`:c$4.h} ${c$4.w===void 0?`none`:c$4.w*100+`%`} ${c$4.b===void 0?`none`:c$4.b*100+`%`}${c$4.alpha<1?` / ${c$4.alpha}`:``})`,interpolate:{h:{use:interpolatorLinear,fixup:fixupHueShorter},w:interpolatorLinear,b:interpolatorLinear,alpha:{use:interpolatorLinear,fixup:fixupAlpha}},difference:{h:differenceHueNaive},average:{h:averageAngle}};var definition_default$7=definition$20;const YW=203,M1=.1593017578125,M2=78.84375,C1=.8359375,C2=18.8515625,C3=18.6875;function transferPqDecode(v$2){if(v$2<0)return 0;let c$4=v$2**(1/M2);return 1e4*(Math.max(0,c$4-C1)/(C2-C3*c$4))**(1/M1)}function transferPqEncode(v$2){if(v$2<0)return 0;let c$4=(v$2/1e4)**M1;return((C1+C2*c$4)/(1+C3*c$4))**+M2}const toRel=c$4=>Math.max(c$4/YW,0),convertItpToXyz65=({i:i$1,t,p:p$5,alpha:alpha$1})=>{i$1===void 0&&(i$1=0),t===void 0&&(t=0),p$5===void 0&&(p$5=0);let l$1=transferPqDecode(i$1+.008609037037932761*t+.11102962500302593*p$5),m$3=transferPqDecode(i$1-.00860903703793275*t-.11102962500302599*p$5),s$1=transferPqDecode(i$1+.5600313357106791*t-.32062717498731885*p$5),res={mode:`xyz65`,x:toRel(2.070152218389422*l$1-1.3263473389671556*m$3+.2066510476294051*s$1),y:toRel(.3647385209748074*l$1+.680566024947227*m$3-.0453045459220346*s$1),z:toRel(-.049747207535812*l$1-.0492609666966138*m$3+1.1880659249923042*s$1)};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertItpToXyz65_default=convertItpToXyz65;const toAbs=(c$4=0)=>Math.max(c$4*YW,0),convertXyz65ToItp=({x:x$3,y:y$3,z:z$3,alpha:alpha$1})=>{let absX=toAbs(x$3),absY=toAbs(y$3),absZ=toAbs(z$3),l$1=transferPqEncode(.3592832590121217*absX+.6976051147779502*absY-.0358915932320289*absZ),m$3=transferPqEncode(-.1920808463704995*absX+1.1004767970374323*absY+.0753748658519118*absZ),s$1=transferPqEncode(.0070797844607477*absX+.0748396662186366*absY+.8433265453898765*absZ),i$1=.5*l$1+.5*m$3,t=1.61376953125*l$1-3.323486328125*m$3+1.709716796875*s$1,p$5=4.378173828125*l$1-4.24560546875*m$3-.132568359375*s$1,res={mode:`itp`,i:i$1,t,p:p$5};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertXyz65ToItp_default=convertXyz65ToItp;const definition$19={mode:`itp`,channels:[`i`,`t`,`p`,`alpha`],parse:[`--ictcp`],serialize:`--ictcp`,toMode:{xyz65:convertItpToXyz65_default,rgb:color$2=>convertXyz65ToRgb_default(convertItpToXyz65_default(color$2))},fromMode:{xyz65:convertXyz65ToItp_default,rgb:color$2=>convertXyz65ToItp_default(convertRgbToXyz65_default(color$2))},ranges:{i:[0,.581],t:[-.369,.272],p:[-.164,.331]},interpolate:{i:interpolatorLinear,t:interpolatorLinear,p:interpolatorLinear,alpha:{use:interpolatorLinear,fixup:fixupAlpha}}};var definition_default$8=definition$19;const p$3=134.03437499999998,d0$1=16295499532821565e-27,jabPqEncode=v$2=>{if(v$2<0)return 0;let vn$4=(v$2/1e4)**M1;return((C1+C2*vn$4)/(1+C3*vn$4))**+p$3},abs$1=(v$2=0)=>Math.max(v$2*203,0),convertXyz65ToJab=({x:x$3,y:y$3,z:z$3,alpha:alpha$1})=>{x$3=abs$1(x$3),y$3=abs$1(y$3),z$3=abs$1(z$3);let xp$1=1.15*x$3-.15*z$3,yp$1=.66*y$3+.34*x$3,l$1=jabPqEncode(.41478972*xp$1+.579999*yp$1+.014648*z$3),m$3=jabPqEncode(-.20151*xp$1+1.120649*yp$1+.0531008*z$3),s$1=jabPqEncode(-.0166008*xp$1+.2648*yp$1+.6684799*z$3),i$1=(l$1+m$3)/2,res={mode:`jab`,j:.44*i$1/(1-.56*i$1)-d0$1,a:3.524*l$1-4.066708*m$3+.542708*s$1,b:.199076*l$1+1.096799*m$3-1.295875*s$1};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertXyz65ToJab_default=convertXyz65ToJab;const p$2=134.03437499999998,d0=16295499532821565e-27,jabPqDecode=v$2=>{if(v$2<0)return 0;let vp$1=v$2**(1/p$2);return 1e4*((C1-vp$1)/(C3*vp$1-C2))**(1/M1)},rel=v$2=>v$2/203,convertJabToXyz65=({j:j$1,a:a$2,b:b$4,alpha:alpha$1})=>{j$1===void 0&&(j$1=0),a$2===void 0&&(a$2=0),b$4===void 0&&(b$4=0);let i$1=(j$1+d0)/(.44+.56*(j$1+d0)),l$1=jabPqDecode(i$1+.13860504*a$2+.058047316*b$4),m$3=jabPqDecode(i$1-.13860504*a$2-.058047316*b$4),s$1=jabPqDecode(i$1-.096019242*a$2-.8118919*b$4),res={mode:`xyz65`,x:rel(1.661373024652174*l$1-.914523081304348*m$3+.23136208173913045*s$1),y:rel(-.3250758611844533*l$1+1.571847026732543*m$3-.21825383453227928*s$1),z:rel(-.090982811*l$1-.31272829*m$3+1.5227666*s$1)};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertJabToXyz65_default=convertJabToXyz65;const convertRgbToJab=rgb$2=>{let res=convertXyz65ToJab_default(convertRgbToXyz65_default(rgb$2));return rgb$2.r===rgb$2.b&&rgb$2.b===rgb$2.g&&(res.a=res.b=0),res};var convertRgbToJab_default=convertRgbToJab;const convertJabToRgb=color$2=>convertXyz65ToRgb_default(convertJabToXyz65_default(color$2));var convertJabToRgb_default=convertJabToRgb;const definition$18={mode:`jab`,channels:[`j`,`a`,`b`,`alpha`],parse:[`--jzazbz`],serialize:`--jzazbz`,fromMode:{rgb:convertRgbToJab_default,xyz65:convertXyz65ToJab_default},toMode:{rgb:convertJabToRgb_default,xyz65:convertJabToXyz65_default},ranges:{j:[0,.222],a:[-.109,.129],b:[-.185,.134]},interpolate:{j:interpolatorLinear,a:interpolatorLinear,b:interpolatorLinear,alpha:{use:interpolatorLinear,fixup:fixupAlpha}}};var definition_default$9=definition$18;const convertJabToJch=({j:j$1,a:a$2,b:b$4,alpha:alpha$1})=>{a$2===void 0&&(a$2=0),b$4===void 0&&(b$4=0);let c$4=Math.sqrt(a$2*a$2+b$4*b$4),res={mode:`jch`,j:j$1,c:c$4};return c$4&&(res.h=normalizeHue_default(Math.atan2(b$4,a$2)*180/Math.PI)),alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertJabToJch_default=convertJabToJch;const convertJchToJab=({j:j$1,c:c$4,h:h$3,alpha:alpha$1})=>{h$3===void 0&&(h$3=0);let res={mode:`jab`,j:j$1,a:c$4?c$4*Math.cos(h$3/180*Math.PI):0,b:c$4?c$4*Math.sin(h$3/180*Math.PI):0};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertJchToJab_default=convertJchToJab;const definition$17={mode:`jch`,parse:[`--jzczhz`],serialize:`--jzczhz`,toMode:{jab:convertJchToJab_default,rgb:c$4=>convertJabToRgb_default(convertJchToJab_default(c$4))},fromMode:{rgb:c$4=>convertJabToJch_default(convertRgbToJab_default(c$4)),jab:convertJabToJch_default},channels:[`j`,`c`,`h`,`alpha`],ranges:{j:[0,.221],c:[0,.19],h:[0,360]},interpolate:{h:{use:interpolatorLinear,fixup:fixupHueShorter},c:interpolatorLinear,j:interpolatorLinear,alpha:{use:interpolatorLinear,fixup:fixupAlpha}},difference:{h:differenceHueChroma},average:{h:averageAngle}};var definition_default$10=definition$17;const k$1=29**3/3**3,e=6**3/29**3;let fn$1=v$2=>v$2**3>e?v$2**3:(116*v$2-16)/k$1;const convertLabToXyz50=({l:l$1,a:a$2,b:b$4,alpha:alpha$1})=>{l$1===void 0&&(l$1=0),a$2===void 0&&(a$2=0),b$4===void 0&&(b$4=0);let fy$1=(l$1+16)/116,fx=a$2/500+fy$1,fz=fy$1-b$4/200,res={mode:`xyz50`,x:fn$1(fx)*D50.X,y:fn$1(fy$1)*D50.Y,z:fn$1(fz)*D50.Z};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertLabToXyz50_default=convertLabToXyz50;const convertXyz50ToRgb=({x:x$3,y:y$3,z:z$3,alpha:alpha$1})=>{x$3===void 0&&(x$3=0),y$3===void 0&&(y$3=0),z$3===void 0&&(z$3=0);let res=convertLrgbToRgb_default({r:x$3*3.1341359569958707-y$3*1.6173863321612538-.4906619460083532*z$3,g:x$3*-.978795502912089+y$3*1.916254567259524+.03344273116131949*z$3,b:x$3*.07195537988411677-y$3*.2289768264158322+1.405386058324125*z$3});return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertXyz50ToRgb_default=convertXyz50ToRgb;const convertLabToRgb=lab$1=>convertXyz50ToRgb_default(convertLabToXyz50_default(lab$1));var convertLabToRgb_default=convertLabToRgb;const convertRgbToXyz50=rgb$2=>{let{r:r$2,g:g$2,b:b$4,alpha:alpha$1}=convertRgbToLrgb_default(rgb$2),res={mode:`xyz50`,x:.436065742824811*r$2+.3851514688337912*g$2+.14307845442264197*b$4,y:.22249319175623702*r$2+.7168870538238823*g$2+.06061979053616537*b$4,z:.013923904500943465*r$2+.09708128566574634*g$2+.7140993584005155*b$4};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertRgbToXyz50_default=convertRgbToXyz50;const f$1=value$1=>value$1>e?Math.cbrt(value$1):(k$1*value$1+16)/116,convertXyz50ToLab=({x:x$3,y:y$3,z:z$3,alpha:alpha$1})=>{x$3===void 0&&(x$3=0),y$3===void 0&&(y$3=0),z$3===void 0&&(z$3=0);let f0=f$1(x$3/D50.X),f1=f$1(y$3/D50.Y),f2=f$1(z$3/D50.Z),res={mode:`lab`,l:116*f1-16,a:500*(f0-f1),b:200*(f1-f2)};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertXyz50ToLab_default=convertXyz50ToLab;const convertRgbToLab=rgb$2=>{let res=convertXyz50ToLab_default(convertRgbToXyz50_default(rgb$2));return rgb$2.r===rgb$2.b&&rgb$2.b===rgb$2.g&&(res.a=res.b=0),res};var convertRgbToLab_default=convertRgbToLab;function parseLab(color$2,parsed){if(!parsed||parsed[0]!==`lab`)return;let res={mode:`lab`},[,l$1,a$2,b$4,alpha$1]=parsed;if(!(l$1.type===Tok.Hue||a$2.type===Tok.Hue||b$4.type===Tok.Hue))return l$1.type!==Tok.None&&(res.l=Math.min(Math.max(0,l$1.value),100)),a$2.type!==Tok.None&&(res.a=a$2.type===Tok.Number?a$2.value:a$2.value*125/100),b$4.type!==Tok.None&&(res.b=b$4.type===Tok.Number?b$4.value:b$4.value*125/100),alpha$1.type!==Tok.None&&(res.alpha=Math.min(1,Math.max(0,alpha$1.type===Tok.Number?alpha$1.value:alpha$1.value/100))),res}var parseLab_default=parseLab;const definition$16={mode:`lab`,toMode:{xyz50:convertLabToXyz50_default,rgb:convertLabToRgb_default},fromMode:{xyz50:convertXyz50ToLab_default,rgb:convertRgbToLab_default},channels:[`l`,`a`,`b`,`alpha`],ranges:{l:[0,100],a:[-125,125],b:[-125,125]},parse:[parseLab_default],serialize:c$4=>`lab(${c$4.l===void 0?`none`:c$4.l} ${c$4.a===void 0?`none`:c$4.a} ${c$4.b===void 0?`none`:c$4.b}${c$4.alpha<1?` / ${c$4.alpha}`:``})`,interpolate:{l:interpolatorLinear,a:interpolatorLinear,b:interpolatorLinear,alpha:{use:interpolatorLinear,fixup:fixupAlpha}}};var definition_default$11=definition$16;const definition$15={...definition_default$11,mode:`lab65`,parse:[`--lab-d65`],serialize:`--lab-d65`,toMode:{xyz65:convertLab65ToXyz65_default,rgb:convertLab65ToRgb_default},fromMode:{xyz65:convertXyz65ToLab65_default,rgb:convertRgbToLab65_default},ranges:{l:[0,100],a:[-125,125],b:[-125,125]}};var definition_default$12=definition$15;function parseLch(color$2,parsed){if(!parsed||parsed[0]!==`lch`)return;let res={mode:`lch`},[,l$1,c$4,h$3,alpha$1]=parsed;if(l$1.type!==Tok.None){if(l$1.type===Tok.Hue)return;res.l=Math.min(Math.max(0,l$1.value),100)}if(c$4.type!==Tok.None&&(res.c=Math.max(0,c$4.type===Tok.Number?c$4.value:c$4.value*150/100)),h$3.type!==Tok.None){if(h$3.type===Tok.Percentage)return;res.h=h$3.value}return alpha$1.type!==Tok.None&&(res.alpha=Math.min(1,Math.max(0,alpha$1.type===Tok.Number?alpha$1.value:alpha$1.value/100))),res}var parseLch_default=parseLch;const definition$14={mode:`lch`,toMode:{lab:convertLchToLab_default,rgb:c$4=>convertLabToRgb_default(convertLchToLab_default(c$4))},fromMode:{rgb:c$4=>convertLabToLch_default(convertRgbToLab_default(c$4)),lab:convertLabToLch_default},channels:[`l`,`c`,`h`,`alpha`],ranges:{l:[0,100],c:[0,150],h:[0,360]},parse:[parseLch_default],serialize:c$4=>`lch(${c$4.l===void 0?`none`:c$4.l} ${c$4.c===void 0?`none`:c$4.c} ${c$4.h===void 0?`none`:c$4.h}${c$4.alpha<1?` / ${c$4.alpha}`:``})`,interpolate:{h:{use:interpolatorLinear,fixup:fixupHueShorter},c:interpolatorLinear,l:interpolatorLinear,alpha:{use:interpolatorLinear,fixup:fixupAlpha}},difference:{h:differenceHueChroma},average:{h:averageAngle}};var definition_default$13=definition$14;const definition$13={...definition_default$13,mode:`lch65`,parse:[`--lch-d65`],serialize:`--lch-d65`,toMode:{lab65:c$4=>convertLchToLab_default(c$4,`lab65`),rgb:c$4=>convertLab65ToRgb_default(convertLchToLab_default(c$4,`lab65`))},fromMode:{rgb:c$4=>convertLabToLch_default(convertRgbToLab65_default(c$4),`lch65`),lab65:c$4=>convertLabToLch_default(c$4,`lch65`)},ranges:{l:[0,100],c:[0,150],h:[0,360]}};var definition_default$14=definition$13;const convertLuvToLchuv=({l:l$1,u:u$1,v:v$2,alpha:alpha$1})=>{u$1===void 0&&(u$1=0),v$2===void 0&&(v$2=0);let c$4=Math.sqrt(u$1*u$1+v$2*v$2),res={mode:`lchuv`,l:l$1,c:c$4};return c$4&&(res.h=normalizeHue_default(Math.atan2(v$2,u$1)*180/Math.PI)),alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertLuvToLchuv_default=convertLuvToLchuv;const convertLchuvToLuv=({l:l$1,c:c$4,h:h$3,alpha:alpha$1})=>{h$3===void 0&&(h$3=0);let res={mode:`luv`,l:l$1,u:c$4?c$4*Math.cos(h$3/180*Math.PI):0,v:c$4?c$4*Math.sin(h$3/180*Math.PI):0};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertLchuvToLuv_default=convertLchuvToLuv;const u_fn$1=(x$3,y$3,z$3)=>4*x$3/(x$3+15*y$3+3*z$3),v_fn$1=(x$3,y$3,z$3)=>9*y$3/(x$3+15*y$3+3*z$3),un$2=u_fn$1(D50.X,D50.Y,D50.Z),vn$2=v_fn$1(D50.X,D50.Y,D50.Z),l_fn=value$1=>value$1<=e?k$1*value$1:116*Math.cbrt(value$1)-16,convertXyz50ToLuv=({x:x$3,y:y$3,z:z$3,alpha:alpha$1})=>{x$3===void 0&&(x$3=0),y$3===void 0&&(y$3=0),z$3===void 0&&(z$3=0);let l$1=l_fn(y$3/D50.Y),u$1=u_fn$1(x$3,y$3,z$3),v$2=v_fn$1(x$3,y$3,z$3);!isFinite(u$1)||!isFinite(v$2)?l$1=u$1=v$2=0:(u$1=13*l$1*(u$1-un$2),v$2=13*l$1*(v$2-vn$2));let res={mode:`luv`,l:l$1,u:u$1,v:v$2};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertXyz50ToLuv_default=convertXyz50ToLuv;const u_fn=(x$3,y$3,z$3)=>4*x$3/(x$3+15*y$3+3*z$3),v_fn=(x$3,y$3,z$3)=>9*y$3/(x$3+15*y$3+3*z$3),un$1=u_fn(D50.X,D50.Y,D50.Z),vn$1=v_fn(D50.X,D50.Y,D50.Z),convertLuvToXyz50=({l:l$1,u:u$1,v:v$2,alpha:alpha$1})=>{if(l$1===void 0&&(l$1=0),l$1===0)return{mode:`xyz50`,x:0,y:0,z:0};u$1===void 0&&(u$1=0),v$2===void 0&&(v$2=0);let up$1=u$1/(13*l$1)+un$1,vp$1=v$2/(13*l$1)+vn$1,y$3=D50.Y*(l$1<=8?l$1/k$1:((l$1+16)/116)**3),x$3=y$3*(9*up$1)/(4*vp$1),z$3=y$3*(12-3*up$1-20*vp$1)/(4*vp$1),res={mode:`xyz50`,x:x$3,y:y$3,z:z$3};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertLuvToXyz50_default=convertLuvToXyz50;const convertRgbToLchuv=rgb$2=>convertLuvToLchuv_default(convertXyz50ToLuv_default(convertRgbToXyz50_default(rgb$2))),convertLchuvToRgb=lchuv$1=>convertXyz50ToRgb_default(convertLuvToXyz50_default(convertLchuvToLuv_default(lchuv$1))),definition$12={mode:`lchuv`,toMode:{luv:convertLchuvToLuv_default,rgb:convertLchuvToRgb},fromMode:{rgb:convertRgbToLchuv,luv:convertLuvToLchuv_default},channels:[`l`,`c`,`h`,`alpha`],parse:[`--lchuv`],serialize:`--lchuv`,ranges:{l:[0,100],c:[0,176.956],h:[0,360]},interpolate:{h:{use:interpolatorLinear,fixup:fixupHueShorter},c:interpolatorLinear,l:interpolatorLinear,alpha:{use:interpolatorLinear,fixup:fixupAlpha}},difference:{h:differenceHueChroma},average:{h:averageAngle}};var definition_default$15=definition$12;const definition$11={...definition_default$23,mode:`lrgb`,toMode:{rgb:convertLrgbToRgb_default},fromMode:{rgb:convertRgbToLrgb_default},parse:[`srgb-linear`],serialize:`srgb-linear`};var definition_default$16=definition$11;const definition$10={mode:`luv`,toMode:{xyz50:convertLuvToXyz50_default,rgb:luv$1=>convertXyz50ToRgb_default(convertLuvToXyz50_default(luv$1))},fromMode:{xyz50:convertXyz50ToLuv_default,rgb:rgb$2=>convertXyz50ToLuv_default(convertRgbToXyz50_default(rgb$2))},channels:[`l`,`u`,`v`,`alpha`],parse:[`--luv`],serialize:`--luv`,ranges:{l:[0,100],u:[-84.936,175.042],v:[-125.882,87.243]},interpolate:{l:interpolatorLinear,u:interpolatorLinear,v:interpolatorLinear,alpha:{use:interpolatorLinear,fixup:fixupAlpha}}};var definition_default$17=definition$10;const convertLrgbToOklab=({r:r$2,g:g$2,b:b$4,alpha:alpha$1})=>{r$2===void 0&&(r$2=0),g$2===void 0&&(g$2=0),b$4===void 0&&(b$4=0);let L$1=Math.cbrt(.412221469470763*r$2+.5363325372617348*g$2+.0514459932675022*b$4),M$1=Math.cbrt(.2119034958178252*r$2+.6806995506452344*g$2+.1073969535369406*b$4),S$2=Math.cbrt(.0883024591900564*r$2+.2817188391361215*g$2+.6299787016738222*b$4),res={mode:`oklab`,l:.210454268309314*L$1+.7936177747023054*M$1-.0040720430116193*S$2,a:1.9779985324311684*L$1-2.42859224204858*M$1+.450593709617411*S$2,b:.0259040424655478*L$1+.7827717124575296*M$1-.8086757549230774*S$2};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertLrgbToOklab_default=convertLrgbToOklab;const convertRgbToOklab=rgb$2=>{let res=convertLrgbToOklab_default(convertRgbToLrgb_default(rgb$2));return rgb$2.r===rgb$2.b&&rgb$2.b===rgb$2.g&&(res.a=res.b=0),res};var convertRgbToOklab_default=convertRgbToOklab;const convertOklabToLrgb=({l:l$1,a:a$2,b:b$4,alpha:alpha$1})=>{l$1===void 0&&(l$1=0),a$2===void 0&&(a$2=0),b$4===void 0&&(b$4=0);let L$1=(l$1+.3963377773761749*a$2+.2158037573099136*b$4)**3,M$1=(l$1-.1055613458156586*a$2-.0638541728258133*b$4)**3,S$2=(l$1-.0894841775298119*a$2-1.2914855480194092*b$4)**3,res={mode:`lrgb`,r:4.076741636075957*L$1-3.3077115392580616*M$1+.2309699031821044*S$2,g:-1.2684379732850317*L$1+2.6097573492876887*M$1-.3413193760026573*S$2,b:-.0041960761386756*L$1-.7034186179359362*M$1+1.7076146940746117*S$2};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertOklabToLrgb_default=convertOklabToLrgb;const convertOklabToRgb=c$4=>convertLrgbToRgb_default(convertOklabToLrgb_default(c$4));var convertOklabToRgb_default=convertOklabToRgb;function toe(x$3){let k_1=.206,k_2=.03,k_3=(1+k_1)/(1+k_2);return .5*(k_3*x$3-k_1+Math.sqrt((k_3*x$3-k_1)*(k_3*x$3-k_1)+4*k_2*k_3*x$3))}function toe_inv(x$3){let k_1=.206,k_2=.03,k_3=(1+k_1)/(1+k_2);return(x$3*x$3+k_1*x$3)/(k_3*(x$3+k_2))}function compute_max_saturation(a$2,b$4){let k0,k1,k2,k3,k4,wl,wm$1,ws$1;-1.88170328*a$2-.80936493*b$4>1?(k0=1.19086277,k1=1.76576728,k2=.59662641,k3=.75515197,k4=.56771245,wl=4.0767416621,wm$1=-3.3077115913,ws$1=.2309699292):1.81444104*a$2-1.19445276*b$4>1?(k0=.73956515,k1=-.45954404,k2=.08285427,k3=.1254107,k4=.14503204,wl=-1.2684380046,wm$1=2.6097574011,ws$1=-.3413193965):(k0=1.35733652,k1=-.00915799,k2=-1.1513021,k3=-.50559606,k4=.00692167,wl=-.0041960863,wm$1=-.7034186147,ws$1=1.707614701);let S$2=k0+k1*a$2+k2*b$4+k3*a$2*a$2+k4*a$2*b$4,k_l=.3963377774*a$2+.2158037573*b$4,k_m=-.1055613458*a$2-.0638541728*b$4,k_s=-.0894841775*a$2-1.291485548*b$4;{let l_=1+S$2*k_l,m_=1+S$2*k_m,s_=1+S$2*k_s,l$1=l_*l_*l_,m$3=m_*m_*m_,s$1=s_*s_*s_,l_dS=3*k_l*l_*l_,m_dS=3*k_m*m_*m_,s_dS=3*k_s*s_*s_,l_dS2=6*k_l*k_l*l_,m_dS2=6*k_m*k_m*m_,s_dS2=6*k_s*k_s*s_,f$3=wl*l$1+wm$1*m$3+ws$1*s$1,f1=wl*l_dS+wm$1*m_dS+ws$1*s_dS,f2=wl*l_dS2+wm$1*m_dS2+ws$1*s_dS2;S$2-=f$3*f1/(f1*f1-.5*f$3*f2)}return S$2}function find_cusp(a$2,b$4){let S_cusp=compute_max_saturation(a$2,b$4),rgb$2=convertOklabToLrgb_default({l:1,a:S_cusp*a$2,b:S_cusp*b$4}),L_cusp=Math.cbrt(1/Math.max(rgb$2.r,rgb$2.g,rgb$2.b)),C_cusp=L_cusp*S_cusp;return[L_cusp,C_cusp]}function find_gamut_intersection(a$2,b$4,L1,C1$1,L0,cusp=null){cusp||=find_cusp(a$2,b$4);let t;if((L1-L0)*cusp[1]-(cusp[0]-L0)*C1$1<=0)t=cusp[1]*L0/(C1$1*cusp[0]+cusp[1]*(L0-L1));else{t=cusp[1]*(L0-1)/(C1$1*(cusp[0]-1)+cusp[1]*(L0-L1));{let dL=L1-L0,dC=C1$1,k_l=.3963377774*a$2+.2158037573*b$4,k_m=-.1055613458*a$2-.0638541728*b$4,k_s=-.0894841775*a$2-1.291485548*b$4,l_dt=dL+dC*k_l,m_dt=dL+dC*k_m,s_dt=dL+dC*k_s;{let L$1=L0*(1-t)+t*L1,C$3=t*C1$1,l_=L$1+C$3*k_l,m_=L$1+C$3*k_m,s_=L$1+C$3*k_s,l$1=l_*l_*l_,m$3=m_*m_*m_,s$1=s_*s_*s_,ldt=3*l_dt*l_*l_,mdt=3*m_dt*m_*m_,sdt=3*s_dt*s_*s_,ldt2=6*l_dt*l_dt*l_,mdt2=6*m_dt*m_dt*m_,sdt2=6*s_dt*s_dt*s_,r$2=4.0767416621*l$1-3.3077115913*m$3+.2309699292*s$1-1,r1=4.0767416621*ldt-3.3077115913*mdt+.2309699292*sdt,r2=4.0767416621*ldt2-3.3077115913*mdt2+.2309699292*sdt2,u_r=r1/(r1*r1-.5*r$2*r2),t_r=-r$2*u_r,g$2=-1.2684380046*l$1+2.6097574011*m$3-.3413193965*s$1-1,g1=-1.2684380046*ldt+2.6097574011*mdt-.3413193965*sdt,g2=-1.2684380046*ldt2+2.6097574011*mdt2-.3413193965*sdt2,u_g=g1/(g1*g1-.5*g$2*g2),t_g=-g$2*u_g,b$5=-.0041960863*l$1-.7034186147*m$3+1.707614701*s$1-1,b1=-.0041960863*ldt-.7034186147*mdt+1.707614701*sdt,b2=-.0041960863*ldt2-.7034186147*mdt2+1.707614701*sdt2,u_b=b1/(b1*b1-.5*b$5*b2),t_b=-b$5*u_b;t_r=u_r>=0?t_r:1e6,t_g=u_g>=0?t_g:1e6,t_b=u_b>=0?t_b:1e6,t+=Math.min(t_r,Math.min(t_g,t_b))}}}return t}function get_ST_max(a_,b_,cusp=null){cusp||=find_cusp(a_,b_);let L$1=cusp[0],C$3=cusp[1];return[C$3/L$1,C$3/(1-L$1)]}function get_Cs(L$1,a_,b_){let cusp=find_cusp(a_,b_),C_max=find_gamut_intersection(a_,b_,L$1,1,L$1,cusp),ST_max=get_ST_max(a_,b_,cusp),S_mid=.11516993+1/(7.4477897+4.1590124*b_+a_*(-2.19557347+1.75198401*b_+a_*(-2.13704948-10.02301043*b_+a_*(-4.24894561+5.38770819*b_+4.69891013*a_)))),T_mid=.11239642+1/(1.6132032-.68124379*b_+a_*(.40370612+.90148123*b_+a_*(-.27087943+.6122399*b_+a_*(.00299215-.45399568*b_-.14661872*a_)))),k$4=C_max/Math.min(L$1*ST_max[0],(1-L$1)*ST_max[1]),C_a=L$1*S_mid,C_b=(1-L$1)*T_mid,C_mid=.9*k$4*Math.sqrt(Math.sqrt(1/(1/(C_a*C_a*C_a*C_a)+1/(C_b*C_b*C_b*C_b))));C_a=L$1*.4,C_b=(1-L$1)*.8;let C_0=Math.sqrt(1/(1/(C_a*C_a)+1/(C_b*C_b)));return[C_0,C_mid,C_max]}function convertOklabToOkhsl(lab$1){let l$1=lab$1.l===void 0?0:lab$1.l,a$2=lab$1.a===void 0?0:lab$1.a,b$4=lab$1.b===void 0?0:lab$1.b,ret={mode:`okhsl`,l:toe(l$1)};lab$1.alpha!==void 0&&(ret.alpha=lab$1.alpha);let c$4=Math.sqrt(a$2*a$2+b$4*b$4);if(!c$4)return ret.s=0,ret;let[C_0,C_mid,C_max]=get_Cs(l$1,a$2/c$4,b$4/c$4),s$1;if(c$4convertOklabToOkhsl(convertRgbToOklab_default(c$4))},toMode:{oklab:convertOkhslToOklab,rgb:c$4=>convertOklabToRgb_default(convertOkhslToOklab(c$4))}};var modeOkhsl_default=modeOkhsl;function convertOklabToOkhsv(lab$1){let l$1=lab$1.l===void 0?0:lab$1.l,a$2=lab$1.a===void 0?0:lab$1.a,b$4=lab$1.b===void 0?0:lab$1.b,c$4=Math.sqrt(a$2*a$2+b$4*b$4),a_=c$4?a$2/c$4:1,b_=c$4?b$4/c$4:1,[S_max,T$1]=get_ST_max(a_,b_),S_0=.5,k$4=1-S_0/S_max,t=T$1/(c$4+l$1*T$1),L_v=t*l$1,C_v=t*c$4,L_vt=toe_inv(L_v),C_vt=C_v*L_vt/L_v,rgb_scale=convertOklabToLrgb_default({l:L_vt,a:a_*C_vt,b:b_*C_vt}),scale_L=Math.cbrt(1/Math.max(rgb_scale.r,rgb_scale.g,rgb_scale.b,0));l$1/=scale_L,c$4=c$4/scale_L*toe(l$1)/l$1,l$1=toe(l$1);let ret={mode:`okhsv`,s:c$4?(S_0+T$1)*C_v/(T$1*S_0+T$1*k$4*C_v):0,v:l$1?l$1/L_v:0};return ret.s&&(ret.h=normalizeHue_default(Math.atan2(b$4,a$2)*180/Math.PI)),lab$1.alpha!==void 0&&(ret.alpha=lab$1.alpha),ret}function convertOkhsvToOklab(hsv$1){let ret={mode:`oklab`};hsv$1.alpha!==void 0&&(ret.alpha=hsv$1.alpha);let h$3=hsv$1.h===void 0?0:hsv$1.h,s$1=hsv$1.s===void 0?0:hsv$1.s,v$2=hsv$1.v===void 0?0:hsv$1.v,a_=Math.cos(h$3/180*Math.PI),b_=Math.sin(h$3/180*Math.PI),[S_max,T$1]=get_ST_max(a_,b_),S_0=.5,k$4=1-S_0/S_max,L_v=1-s$1*S_0/(S_0+T$1-T$1*k$4*s$1),C_v=s$1*T$1*S_0/(S_0+T$1-T$1*k$4*s$1),L_vt=toe_inv(L_v),C_vt=C_v*L_vt/L_v,rgb_scale=convertOklabToLrgb_default({l:L_vt,a:a_*C_vt,b:b_*C_vt}),scale_L=Math.cbrt(1/Math.max(rgb_scale.r,rgb_scale.g,rgb_scale.b,0)),L_new=toe_inv(v$2*L_v),C$3=C_v*L_new/L_v;return ret.l=L_new*scale_L,ret.a=C$3*a_*scale_L,ret.b=C$3*b_*scale_L,ret}const modeOkhsv={...definition_default$6,mode:`okhsv`,channels:[`h`,`s`,`v`,`alpha`],parse:[`--okhsv`],serialize:`--okhsv`,fromMode:{oklab:convertOklabToOkhsv,rgb:c$4=>convertOklabToOkhsv(convertRgbToOklab_default(c$4))},toMode:{oklab:convertOkhsvToOklab,rgb:c$4=>convertOklabToRgb_default(convertOkhsvToOklab(c$4))}};var modeOkhsv_default=modeOkhsv;function parseOklab(color$2,parsed){if(!parsed||parsed[0]!==`oklab`)return;let res={mode:`oklab`},[,l$1,a$2,b$4,alpha$1]=parsed;if(!(l$1.type===Tok.Hue||a$2.type===Tok.Hue||b$4.type===Tok.Hue))return l$1.type!==Tok.None&&(res.l=Math.min(Math.max(0,l$1.type===Tok.Number?l$1.value:l$1.value/100),1)),a$2.type!==Tok.None&&(res.a=a$2.type===Tok.Number?a$2.value:a$2.value*.4/100),b$4.type!==Tok.None&&(res.b=b$4.type===Tok.Number?b$4.value:b$4.value*.4/100),alpha$1.type!==Tok.None&&(res.alpha=Math.min(1,Math.max(0,alpha$1.type===Tok.Number?alpha$1.value:alpha$1.value/100))),res}var parseOklab_default=parseOklab;const definition$9={...definition_default$11,mode:`oklab`,toMode:{lrgb:convertOklabToLrgb_default,rgb:convertOklabToRgb_default},fromMode:{lrgb:convertLrgbToOklab_default,rgb:convertRgbToOklab_default},ranges:{l:[0,1],a:[-.4,.4],b:[-.4,.4]},parse:[parseOklab_default],serialize:c$4=>`oklab(${c$4.l===void 0?`none`:c$4.l} ${c$4.a===void 0?`none`:c$4.a} ${c$4.b===void 0?`none`:c$4.b}${c$4.alpha<1?` / ${c$4.alpha}`:``})`};var definition_default$18=definition$9;function parseOklch(color$2,parsed){if(!parsed||parsed[0]!==`oklch`)return;let res={mode:`oklch`},[,l$1,c$4,h$3,alpha$1]=parsed;if(l$1.type!==Tok.None){if(l$1.type===Tok.Hue)return;res.l=Math.min(Math.max(0,l$1.type===Tok.Number?l$1.value:l$1.value/100),1)}if(c$4.type!==Tok.None&&(res.c=Math.max(0,c$4.type===Tok.Number?c$4.value:c$4.value*.4/100)),h$3.type!==Tok.None){if(h$3.type===Tok.Percentage)return;res.h=h$3.value}return alpha$1.type!==Tok.None&&(res.alpha=Math.min(1,Math.max(0,alpha$1.type===Tok.Number?alpha$1.value:alpha$1.value/100))),res}var parseOklch_default=parseOklch;const definition$8={...definition_default$13,mode:`oklch`,toMode:{oklab:c$4=>convertLchToLab_default(c$4,`oklab`),rgb:c$4=>convertOklabToRgb_default(convertLchToLab_default(c$4,`oklab`))},fromMode:{rgb:c$4=>convertLabToLch_default(convertRgbToOklab_default(c$4),`oklch`),oklab:c$4=>convertLabToLch_default(c$4,`oklch`)},parse:[parseOklch_default],serialize:c$4=>`oklch(${c$4.l===void 0?`none`:c$4.l} ${c$4.c===void 0?`none`:c$4.c} ${c$4.h===void 0?`none`:c$4.h}${c$4.alpha<1?` / ${c$4.alpha}`:``})`,ranges:{l:[0,1],c:[0,.4],h:[0,360]}};var definition_default$19=definition$8;const convertP3ToXyz65=rgb$2=>{let{r:r$2,g:g$2,b:b$4,alpha:alpha$1}=convertRgbToLrgb_default(rgb$2),res={mode:`xyz65`,x:.486570948648216*r$2+.265667693169093*g$2+.1982172852343625*b$4,y:.2289745640697487*r$2+.6917385218365062*g$2+.079286914093745*b$4,z:0*r$2+.0451133818589026*g$2+1.043944368900976*b$4};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertP3ToXyz65_default=convertP3ToXyz65;const convertXyz65ToP3=({x:x$3,y:y$3,z:z$3,alpha:alpha$1})=>{x$3===void 0&&(x$3=0),y$3===void 0&&(y$3=0),z$3===void 0&&(z$3=0);let res=convertLrgbToRgb_default({r:x$3*2.4934969119414263-y$3*.9313836179191242-.402710784450717*z$3,g:x$3*-.8294889695615749+y$3*1.7626640603183465+.0236246858419436*z$3,b:x$3*.0358458302437845-y$3*.0761723892680418+.9568845240076871*z$3},`p3`);return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertXyz65ToP3_default=convertXyz65ToP3;const definition$7={...definition_default$23,mode:`p3`,parse:[`display-p3`],serialize:`display-p3`,fromMode:{rgb:color$2=>convertXyz65ToP3_default(convertRgbToXyz65_default(color$2)),xyz65:convertXyz65ToP3_default},toMode:{rgb:color$2=>convertXyz65ToRgb_default(convertP3ToXyz65_default(color$2)),xyz65:convertP3ToXyz65_default}};var definition_default$20=definition$7;const gamma$1=v$2=>{let abs$2=Math.abs(v$2);return abs$2>=1/512?Math.sign(v$2)*abs$2**(1/1.8):16*v$2},convertXyz50ToProphoto=({x:x$3,y:y$3,z:z$3,alpha:alpha$1})=>{x$3===void 0&&(x$3=0),y$3===void 0&&(y$3=0),z$3===void 0&&(z$3=0);let res={mode:`prophoto`,r:gamma$1(x$3*1.3457868816471585-y$3*.2555720873797946-.0511018649755453*z$3),g:gamma$1(x$3*-.5446307051249019+y$3*1.5082477428451466+.0205274474364214*z$3),b:gamma$1(x$3*0+y$3*0+1.2119675456389452*z$3)};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertXyz50ToProphoto_default=convertXyz50ToProphoto;const linearize$1=(v$2=0)=>{let abs$2=Math.abs(v$2);return abs$2>=16/512?Math.sign(v$2)*abs$2**1.8:v$2/16},convertProphotoToXyz50=prophoto$1=>{let r$2=linearize$1(prophoto$1.r),g$2=linearize$1(prophoto$1.g),b$4=linearize$1(prophoto$1.b),res={mode:`xyz50`,x:.7977666449006423*r$2+.1351812974005331*g$2+.0313477341283922*b$4,y:.2880748288194013*r$2+.7118352342418731*g$2+899369387256e-16*b$4,z:0*r$2+0*g$2+.8251046025104602*b$4};return prophoto$1.alpha!==void 0&&(res.alpha=prophoto$1.alpha),res};var convertProphotoToXyz50_default=convertProphotoToXyz50;const definition$6={...definition_default$23,mode:`prophoto`,parse:[`prophoto-rgb`],serialize:`prophoto-rgb`,fromMode:{xyz50:convertXyz50ToProphoto_default,rgb:color$2=>convertXyz50ToProphoto_default(convertRgbToXyz50_default(color$2))},toMode:{xyz50:convertProphotoToXyz50_default,rgb:color$2=>convertXyz50ToRgb_default(convertProphotoToXyz50_default(color$2))}};var definition_default$21=definition$6;const α$1=1.09929682680944,β$1=.018053968510807,gamma=v$2=>{let abs$2=Math.abs(v$2);return abs$2>β$1?(Math.sign(v$2)||1)*(α$1*abs$2**.45-(α$1-1)):4.5*v$2},convertXyz65ToRec2020=({x:x$3,y:y$3,z:z$3,alpha:alpha$1})=>{x$3===void 0&&(x$3=0),y$3===void 0&&(y$3=0),z$3===void 0&&(z$3=0);let res={mode:`rec2020`,r:gamma(x$3*1.7166511879712683-y$3*.3556707837763925-.2533662813736599*z$3),g:gamma(x$3*-.6666843518324893+y$3*1.6164812366349395+.0157685458139111*z$3),b:gamma(x$3*.0176398574453108-y$3*.0427706132578085+.9421031212354739*z$3)};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertXyz65ToRec2020_default=convertXyz65ToRec2020;const α=1.09929682680944,β=.018053968510807,linearize=(v$2=0)=>{let abs$2=Math.abs(v$2);return abs$2<β*4.5?v$2/4.5:(Math.sign(v$2)||1)*((abs$2+α-1)/α)**(1/.45)},convertRec2020ToXyz65=rec2020$1=>{let r$2=linearize(rec2020$1.r),g$2=linearize(rec2020$1.g),b$4=linearize(rec2020$1.b),res={mode:`xyz65`,x:.6369580483012911*r$2+.1446169035862083*g$2+.1688809751641721*b$4,y:.262700212011267*r$2+.6779980715188708*g$2+.059301716469862*b$4,z:0*r$2+.0280726930490874*g$2+1.0609850577107909*b$4};return rec2020$1.alpha!==void 0&&(res.alpha=rec2020$1.alpha),res};var convertRec2020ToXyz65_default=convertRec2020ToXyz65;const definition$5={...definition_default$23,mode:`rec2020`,fromMode:{xyz65:convertXyz65ToRec2020_default,rgb:color$2=>convertXyz65ToRec2020_default(convertRgbToXyz65_default(color$2))},toMode:{xyz65:convertRec2020ToXyz65_default,rgb:color$2=>convertXyz65ToRgb_default(convertRec2020ToXyz65_default(color$2))},parse:[`rec2020`],serialize:`rec2020`};var definition_default$22=definition$5;const bias=.0037930732552754493,bias_cbrt=Math.cbrt(bias),transfer$1=v$2=>Math.cbrt(v$2)-bias_cbrt,convertRgbToXyb=color$2=>{let{r:r$2,g:g$2,b:b$4,alpha:alpha$1}=convertRgbToLrgb_default(color$2),l$1=transfer$1(.3*r$2+.622*g$2+.078*b$4+bias),m$3=transfer$1(.23*r$2+.692*g$2+.078*b$4+bias),s$1=transfer$1(.2434226892454782*r$2+.2047674442449682*g$2+.5518098665095535*b$4+bias),res={mode:`xyb`,x:(l$1-m$3)/2,y:(l$1+m$3)/2,b:s$1-(l$1+m$3)/2};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertRgbToXyb_default=convertRgbToXyb;const transfer=v$2=>(v$2+bias_cbrt)**3,convertXybToRgb=({x:x$3,y:y$3,b:b$4,alpha:alpha$1})=>{x$3===void 0&&(x$3=0),y$3===void 0&&(y$3=0),b$4===void 0&&(b$4=0);let l$1=transfer(x$3+y$3)-bias,m$3=transfer(y$3-x$3)-bias,s$1=transfer(b$4+y$3)-bias,res=convertLrgbToRgb_default({r:11.031566904639861*l$1-9.866943908131562*m$3-.16462299650829934*s$1,g:-3.2541473810744237*l$1+4.418770377582723*m$3-.16462299650829934*s$1,b:-3.6588512867136815*l$1+2.7129230459360922*m$3+1.9459282407775895*s$1});return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertXybToRgb_default=convertXybToRgb;const definition$4={mode:`xyb`,channels:[`x`,`y`,`b`,`alpha`],parse:[`--xyb`],serialize:`--xyb`,toMode:{rgb:convertXybToRgb_default},fromMode:{rgb:convertRgbToXyb_default},ranges:{x:[-.0154,.0281],y:[0,.8453],b:[-.2778,.388]},interpolate:{x:interpolatorLinear,y:interpolatorLinear,b:interpolatorLinear,alpha:{use:interpolatorLinear,fixup:fixupAlpha}}};var definition_default$24=definition$4;const definition$3={mode:`xyz50`,parse:[`xyz-d50`],serialize:`xyz-d50`,toMode:{rgb:convertXyz50ToRgb_default,lab:convertXyz50ToLab_default},fromMode:{rgb:convertRgbToXyz50_default,lab:convertLabToXyz50_default},channels:[`x`,`y`,`z`,`alpha`],ranges:{x:[0,.964],y:[0,.999],z:[0,.825]},interpolate:{x:interpolatorLinear,y:interpolatorLinear,z:interpolatorLinear,alpha:{use:interpolatorLinear,fixup:fixupAlpha}}};var definition_default$25=definition$3;const convertXyz65ToXyz50=xyz65$1=>{let{x:x$3,y:y$3,z:z$3,alpha:alpha$1}=xyz65$1;x$3===void 0&&(x$3=0),y$3===void 0&&(y$3=0),z$3===void 0&&(z$3=0);let res={mode:`xyz50`,x:1.0479298208405488*x$3+.0229467933410191*y$3-.0501922295431356*z$3,y:.0296278156881593*x$3+.990434484573249*y$3-.0170738250293851*z$3,z:-.0092430581525912*x$3+.0150551448965779*y$3+.7518742899580008*z$3};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertXyz65ToXyz50_default=convertXyz65ToXyz50;const convertXyz50ToXyz65=xyz50$1=>{let{x:x$3,y:y$3,z:z$3,alpha:alpha$1}=xyz50$1;x$3===void 0&&(x$3=0),y$3===void 0&&(y$3=0),z$3===void 0&&(z$3=0);let res={mode:`xyz65`,x:.9554734527042182*x$3-.0230985368742614*y$3+.0632593086610217*z$3,y:-.0283697069632081*x$3+1.0099954580058226*y$3+.021041398966943*z$3,z:.0123140016883199*x$3-.0205076964334779*y$3+1.3303659366080753*z$3};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertXyz50ToXyz65_default=convertXyz50ToXyz65;const definition$2={mode:`xyz65`,toMode:{rgb:convertXyz65ToRgb_default,xyz50:convertXyz65ToXyz50_default},fromMode:{rgb:convertRgbToXyz65_default,xyz50:convertXyz50ToXyz65_default},ranges:{x:[0,.95],y:[0,1],z:[0,1.088]},channels:[`x`,`y`,`z`,`alpha`],parse:[`xyz`,`xyz-d65`],serialize:`xyz-d65`,interpolate:{x:interpolatorLinear,y:interpolatorLinear,z:interpolatorLinear,alpha:{use:interpolatorLinear,fixup:fixupAlpha}}};var definition_default$26=definition$2;const convertRgbToYiq=({r:r$2,g:g$2,b:b$4,alpha:alpha$1})=>{r$2===void 0&&(r$2=0),g$2===void 0&&(g$2=0),b$4===void 0&&(b$4=0);let res={mode:`yiq`,y:.29889531*r$2+.58662247*g$2+.11448223*b$4,i:.59597799*r$2-.2741761*g$2-.32180189*b$4,q:.21147017*r$2-.52261711*g$2+.31114694*b$4};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertRgbToYiq_default=convertRgbToYiq;const convertYiqToRgb=({y:y$3,i:i$1,q:q$2,alpha:alpha$1})=>{y$3===void 0&&(y$3=0),i$1===void 0&&(i$1=0),q$2===void 0&&(q$2=0);let res={mode:`rgb`,r:y$3+.95608445*i$1+.6208885*q$2,g:y$3-.27137664*i$1-.6486059*q$2,b:y$3-1.10561724*i$1+1.70250126*q$2};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertYiqToRgb_default=convertYiqToRgb;const definition$1={mode:`yiq`,toMode:{rgb:convertYiqToRgb_default},fromMode:{rgb:convertRgbToYiq_default},channels:[`y`,`i`,`q`,`alpha`],parse:[`--yiq`],serialize:`--yiq`,ranges:{i:[-.595,.595],q:[-.522,.522]},interpolate:{y:interpolatorLinear,i:interpolatorLinear,q:interpolatorLinear,alpha:{use:interpolatorLinear,fixup:fixupAlpha}}};var definition_default$27=definition$1;const r$1=(value$1,precision)=>Math.round(value$1*(precision=10**precision))/precision,round$2=(precision=4)=>value$1=>typeof value$1==`number`?r$1(value$1,precision):value$1;var round_default=round$2;let twoDecimals=round_default(2);const clamp$2=value$1=>Math.max(0,Math.min(1,value$1||0)),fixup=value$1=>Math.round(clamp$2(value$1)*255),rgb$1=converter_default(`rgb`),hsl$1=converter_default(`hsl`),serializeHex=color$2=>{if(color$2===void 0)return;let r$2=fixup(color$2.r),g$2=fixup(color$2.g),b$4=fixup(color$2.b);return`#`+(1<<24|r$2<<16|g$2<<8|b$4).toString(16).slice(1)},formatCss=c$4=>{let color$2=_prepare_default(c$4);if(!color$2)return;let def$1=getMode(color$2.mode);if(!def$1.serialize||typeof def$1.serialize==`string`){let res=`color(${def$1.serialize||`--${color$2.mode}`} `;return def$1.channels.forEach((ch$1,i$1)=>{ch$1!==`alpha`&&(res+=(i$1?` `:``)+(color$2[ch$1]===void 0?`none`:color$2[ch$1]))}),color$2.alpha!==void 0&&color$2.alpha<1&&(res+=` / ${color$2.alpha}`),res+`)`}if(typeof def$1.serialize==`function`)return def$1.serialize(color$2)},formatHex=c$4=>serializeHex(rgb$1(c$4)),a98=useMode(definition_default),cubehelix=useMode(definition_default$1),dlab=useMode(definition_default$2),dlch=useMode(definition_default$3),hsi=useMode(definition_default$4),hsl=useMode(definition_default$5),hsv=useMode(definition_default$6),hwb=useMode(definition_default$7),itp=useMode(definition_default$8),jab=useMode(definition_default$9),jch=useMode(definition_default$10),lab=useMode(definition_default$11),lab65=useMode(definition_default$12),lch=useMode(definition_default$13),lch65=useMode(definition_default$14),lchuv=useMode(definition_default$15),lrgb=useMode(definition_default$16),luv=useMode(definition_default$17),okhsl=useMode(modeOkhsl_default),okhsv=useMode(modeOkhsv_default),oklab=useMode(definition_default$18),oklch=useMode(definition_default$19),p3=useMode(definition_default$20),prophoto=useMode(definition_default$21),rec2020=useMode(definition_default$22),rgb=useMode(definition_default$23),xyb=useMode(definition_default$24),xyz50=useMode(definition_default$25),xyz65=useMode(definition_default$26),yiq=useMode(definition_default$27);function colorToChromaticColor(color$2){return{color:color$2,withAlpha:alpha$1=>{let rgba$1=oklch(color$2);if(!rgba$1)throw Error(`Invalid color provided for alpha adjustment`);return colorToChromaticColor(oklch({mode:`oklch`,l:rgba$1.l,c:rgba$1.c,h:rgba$1.h,alpha:alpha$1}))},toHex:()=>formatHex(color$2),toCSS:()=>formatCss(color$2)}}function chromaticPaletteFrom(baseHue=200,baseChroma){let chroma=baseChroma??.18+Math.cos(baseHue*Math.PI/180)*.04,shadeConfig={50:{lightness:.95,chromaMultiplier:.3,mixWithWhite:.7},100:{lightness:.95,chromaMultiplier:.5,mixWithWhite:.2},200:{lightness:.9,chromaMultiplier:.6},300:{lightness:.85,chromaMultiplier:.75},400:{lightness:.74,chromaMultiplier:.85},500:{lightness:.62,chromaMultiplier:1},600:{lightness:.54,chromaMultiplier:1.15},700:{lightness:.49,chromaMultiplier:1.1},800:{lightness:.42,chromaMultiplier:.85},900:{lightness:.37,chromaMultiplier:.7},950:{lightness:.29,chromaMultiplier:.5}},shadeBy=(shade,alpha$1,hueOffset=0)=>{let config=shadeConfig[shade],adjustedHue=(baseHue+hueOffset)%360,adjustedChroma=chroma*config.chromaMultiplier,baseColor=oklch({mode:`oklch`,l:config.lightness,c:adjustedChroma,h:adjustedHue,alpha:alpha$1??1});if(config.mixWithWhite){let white=oklch({mode:`oklch`,l:1,c:0,h:0,alpha:alpha$1??1});return colorToChromaticColor(mixColors(baseColor,white,config.mixWithWhite))}return colorToChromaticColor(baseColor)};return{baseHue,chroma,getAllShades:(alpha$1,hueOffset=0)=>{let shades={};for(let shadeKey of Object.keys(shadeConfig)){let shade=Number.parseInt(shadeKey);shades[shade]=shadeBy(shade,alpha$1,hueOffset)}return shades},shadeBy}}function mixColors(color1,color2,ratio=.5){let c1=oklch(color1),c2=oklch(color2);if(!c1||!c2)throw Error(`Invalid colors provided for mixing`);return oklch({mode:`oklch`,l:c1.l*(1-ratio)+c2.l*ratio,c:c1.c*(1-ratio)+c2.c*ratio,h:mixHues(c1.h??0,c2.h??0,ratio)})}function mixHues(h1,h2,ratio){let diff=h2-h1;return diff>180&&(diff-=360),diff<-180&&(diff+=360),(h1+diff*ratio+360)%360}let Emotion=function(Emotion$1){return Emotion$1.Idle=`<|EMOTE_NEUTRAL|>`,Emotion$1.Happy=`<|EMOTE_HAPPY|>`,Emotion$1.Sad=`<|EMOTE_SAD|>`,Emotion$1.Angry=`<|EMOTE_ANGRY|>`,Emotion$1.Think=`<|EMOTE_THINK|>`,Emotion$1.Surprise=`<|EMOTE_SURPRISE|>`,Emotion$1.Awkward=`<|EMOTE_AWKWARD|>`,Emotion$1.Question=`<|EMOTE_QUESTION|>`,Emotion$1}({});const EMOTION_VALUES=Object.values(Emotion),EmotionHappyMotionName=`Happy`,EmotionSadMotionName=`Sad`,EmotionAngryMotionName=`Angry`,EmotionAwkwardMotionName=`Awkward`,EmotionThinkMotionName=`Think`,EmotionSurpriseMotionName=`Surprise`,EmotionQuestionMotionName=`Question`,EmotionNeutralMotionName=`Idle`,EMOTION_EmotionMotionName_value={[Emotion.Happy]:EmotionHappyMotionName,[Emotion.Sad]:EmotionSadMotionName,[Emotion.Angry]:EmotionAngryMotionName,[Emotion.Think]:EmotionThinkMotionName,[Emotion.Surprise]:EmotionSurpriseMotionName,[Emotion.Awkward]:EmotionAwkwardMotionName,[Emotion.Question]:EmotionQuestionMotionName,[Emotion.Idle]:EmotionNeutralMotionName},EMOTION_VRMExpressionName_value={[Emotion.Happy]:`happy`,[Emotion.Sad]:`sad`,[Emotion.Angry]:`angry`,[Emotion.Think]:void 0,[Emotion.Surprise]:`surprised`,[Emotion.Awkward]:void 0,[Emotion.Question]:void 0,[Emotion.Idle]:void 0},chromaticHue=Symbol(`@proj-airi/chromatic-hue`);function message(prefix,suffix){return{role:`system`,content:[prefix,EMOTION_VALUES.map(emotion=>`- ${emotion}`).join(` @@ -3983,7 +3983,7 @@ function defineStore(id$1,setup,setupOptions){let options$1,isSetupStore=typeof `},1670:t=>{"use strict";t.exports=__WEBPACK_EXTERNAL_MODULE__1670__},7067:()=>{},1296:()=>{},1384:()=>{},3993:()=>{},908:()=>{},6953:()=>{},9925:()=>{},2806:()=>{},6449:()=>{},2850:()=>{},5381:()=>{},5686:(t,e$3,n$2)=>{"use strict";n$2.r(e$3),n$2.d(e$3,{flatbuffers:()=>r$2});var r$2={};r$2.Offset,r$2.Table,r$2.SIZEOF_SHORT=2,r$2.SIZEOF_INT=4,r$2.FILE_IDENTIFIER_LENGTH=4,r$2.SIZE_PREFIX_LENGTH=4,r$2.Encoding={UTF8_BYTES:1,UTF16_STRING:2},r$2.int32=new Int32Array(2),r$2.float32=new Float32Array(r$2.int32.buffer),r$2.float64=new Float64Array(r$2.int32.buffer),r$2.isLittleEndian=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1,r$2.Long=function(t$1,e$4){this.low=0|t$1,this.high=0|e$4},r$2.Long.create=function(t$1,e$4){return t$1==0&&e$4==0?r$2.Long.ZERO:new r$2.Long(t$1,e$4)},r$2.Long.prototype.toFloat64=function(){return(this.low>>>0)+4294967296*this.high},r$2.Long.prototype.equals=function(t$1){return this.low==t$1.low&&this.high==t$1.high},r$2.Long.ZERO=new r$2.Long(0,0),r$2.Builder=function(t$1){if(t$1)e$4=t$1;else var e$4=1024;this.bb=r$2.ByteBuffer.allocate(e$4),this.space=e$4,this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},r$2.Builder.prototype.clear=function(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},r$2.Builder.prototype.forceDefaults=function(t$1){this.force_defaults=t$1},r$2.Builder.prototype.dataBuffer=function(){return this.bb},r$2.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},r$2.Builder.prototype.prep=function(t$1,e$4){t$1>this.minalign&&(this.minalign=t$1);for(var n$3=1+~(this.bb.capacity()-this.space+e$4)&t$1-1;this.space=0&&this.vtable[e$4]==0;e$4--);for(var n$3=e$4+1;e$4>=0;e$4--)this.addInt16(this.vtable[e$4]==0?0:t$1-this.vtable[e$4]);this.addInt16(t$1-this.object_start);var i$1=(n$3+2)*r$2.SIZEOF_SHORT;this.addInt16(i$1);var o$1=0,a$2=this.space;t:for(e$4=0;e$4=0;a$2--)this.writeInt8(o$1.charCodeAt(a$2))}this.prep(this.minalign,r$2.SIZEOF_INT+i$1),this.addOffset(t$1),i$1&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)},r$2.Builder.prototype.finishSizePrefixed=function(t$1,e$4){this.finish(t$1,e$4,!0)},r$2.Builder.prototype.requiredField=function(t$1,e$4){var n$3=this.bb.capacity()-t$1,r$3=n$3-this.bb.readInt32(n$3);if(this.bb.readInt16(r$3+e$4)==0)throw Error(`FlatBuffers: field `+e$4+` must be set`)},r$2.Builder.prototype.startVector=function(t$1,e$4,n$3){this.notNested(),this.vector_num_elems=e$4,this.prep(r$2.SIZEOF_INT,t$1*e$4),this.prep(n$3,t$1*e$4)},r$2.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},r$2.Builder.prototype.createString=function(t$1){if(t$1 instanceof Uint8Array)var e$4=t$1;else{e$4=[];for(var n$3=0;n$3=56320?i$1:(i$1<<10)+t$1.charCodeAt(n$3++)+-56613888)<128?e$4.push(r$3):(r$3<2048?e$4.push(r$3>>6&31|192):(r$3<65536?e$4.push(r$3>>12&15|224):e$4.push(r$3>>18&7|240,r$3>>12&63|128),e$4.push(r$3>>6&63|128)),e$4.push(63&r$3|128))}}this.addInt8(0),this.startVector(1,e$4.length,1),this.bb.setPosition(this.space-=e$4.length),n$3=0;for(var o$1=this.space,a$2=this.bb.bytes();n$3>24},r$2.ByteBuffer.prototype.readUint8=function(t$1){return this.bytes_[t$1]},r$2.ByteBuffer.prototype.readInt16=function(t$1){return this.readUint16(t$1)<<16>>16},r$2.ByteBuffer.prototype.readUint16=function(t$1){return this.bytes_[t$1]|this.bytes_[t$1+1]<<8},r$2.ByteBuffer.prototype.readInt32=function(t$1){return this.bytes_[t$1]|this.bytes_[t$1+1]<<8|this.bytes_[t$1+2]<<16|this.bytes_[t$1+3]<<24},r$2.ByteBuffer.prototype.readUint32=function(t$1){return this.readInt32(t$1)>>>0},r$2.ByteBuffer.prototype.readInt64=function(t$1){return new r$2.Long(this.readInt32(t$1),this.readInt32(t$1+4))},r$2.ByteBuffer.prototype.readUint64=function(t$1){return new r$2.Long(this.readUint32(t$1),this.readUint32(t$1+4))},r$2.ByteBuffer.prototype.readFloat32=function(t$1){return r$2.int32[0]=this.readInt32(t$1),r$2.float32[0]},r$2.ByteBuffer.prototype.readFloat64=function(t$1){return r$2.int32[r$2.isLittleEndian?0:1]=this.readInt32(t$1),r$2.int32[r$2.isLittleEndian?1:0]=this.readInt32(t$1+4),r$2.float64[0]},r$2.ByteBuffer.prototype.writeInt8=function(t$1,e$4){this.bytes_[t$1]=e$4},r$2.ByteBuffer.prototype.writeUint8=function(t$1,e$4){this.bytes_[t$1]=e$4},r$2.ByteBuffer.prototype.writeInt16=function(t$1,e$4){this.bytes_[t$1]=e$4,this.bytes_[t$1+1]=e$4>>8},r$2.ByteBuffer.prototype.writeUint16=function(t$1,e$4){this.bytes_[t$1]=e$4,this.bytes_[t$1+1]=e$4>>8},r$2.ByteBuffer.prototype.writeInt32=function(t$1,e$4){this.bytes_[t$1]=e$4,this.bytes_[t$1+1]=e$4>>8,this.bytes_[t$1+2]=e$4>>16,this.bytes_[t$1+3]=e$4>>24},r$2.ByteBuffer.prototype.writeUint32=function(t$1,e$4){this.bytes_[t$1]=e$4,this.bytes_[t$1+1]=e$4>>8,this.bytes_[t$1+2]=e$4>>16,this.bytes_[t$1+3]=e$4>>24},r$2.ByteBuffer.prototype.writeInt64=function(t$1,e$4){this.writeInt32(t$1,e$4.low),this.writeInt32(t$1+4,e$4.high)},r$2.ByteBuffer.prototype.writeUint64=function(t$1,e$4){this.writeUint32(t$1,e$4.low),this.writeUint32(t$1+4,e$4.high)},r$2.ByteBuffer.prototype.writeFloat32=function(t$1,e$4){r$2.float32[0]=e$4,this.writeInt32(t$1,r$2.int32[0])},r$2.ByteBuffer.prototype.writeFloat64=function(t$1,e$4){r$2.float64[0]=e$4,this.writeInt32(t$1,r$2.int32[r$2.isLittleEndian?0:1]),this.writeInt32(t$1+4,r$2.int32[r$2.isLittleEndian?1:0])},r$2.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length>10),56320+(1023&a$2)))}return i$1},r$2.ByteBuffer.prototype.__indirect=function(t$1){return t$1+this.readInt32(t$1)},r$2.ByteBuffer.prototype.__vector=function(t$1){return t$1+this.readInt32(t$1)+r$2.SIZEOF_INT},r$2.ByteBuffer.prototype.__vector_len=function(t$1){return this.readInt32(t$1+this.readInt32(t$1))},r$2.ByteBuffer.prototype.__has_identifier=function(t$1){if(t$1.length!=r$2.FILE_IDENTIFIER_LENGTH)throw Error(`FlatBuffers: file identifier must be length `+r$2.FILE_IDENTIFIER_LENGTH);for(var e$4=0;e$4{var e$3=t&&t.__esModule?()=>t.default:()=>t;return __webpack_require__.d(e$3,{a:e$3}),e$3},__webpack_require__.d=(t,e$3)=>{for(var n$2 in e$3)__webpack_require__.o(e$3,n$2)&&!__webpack_require__.o(t,n$2)&&Object.defineProperty(t,n$2,{enumerable:!0,get:e$3[n$2]})},__webpack_require__.g=function(){if(typeof globalThis==`object`)return globalThis;try{return this||Function(`return this`)()}catch{if(typeof window==`object`)return window}}(),__webpack_require__.o=(t,e$3)=>Object.prototype.hasOwnProperty.call(t,e$3),__webpack_require__.r=t=>{typeof Symbol<`u`&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:`Module`}),Object.defineProperty(t,`__esModule`,{value:!0})};var __webpack_exports__=__webpack_require__(6018);return __webpack_exports__})())}),require_common=__commonJSMin(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0})}),require_legacy=__commonJSMin(exports=>{var _a$2;Object.defineProperty(exports,`__esModule`,{value:!0});let logging_1$3=require_logging();var SileroLegacy=class{constructor(ortInstance$2,_session,_h$1,_c$1,_sr){this.ortInstance=ortInstance$2,this._session=_session,this._h=_h$1,this._c=_c$1,this._sr=_sr,this.reset_state=()=>{let zeroes=Array(2*64).fill(0);this._h=new this.ortInstance.Tensor(`float32`,zeroes,[2,1,64]),this._c=new this.ortInstance.Tensor(`float32`,zeroes,[2,1,64])},this.process=async audioFrame=>{let t=new this.ortInstance.Tensor(`float32`,audioFrame,[1,audioFrame.length]),inputs={input:t,h:this._h,c:this._c,sr:this._sr},out=await this._session.run(inputs);this._h=out.hn,this._c=out.cn;let[isSpeech]=out.output?.data,notSpeech=1-isSpeech;return{notSpeech,isSpeech}}}};exports.SileroLegacy=SileroLegacy,_a$2=SileroLegacy,SileroLegacy.new=async(ortInstance$2,modelFetcher)=>{logging_1$3.log.debug(`initializing vad`);let modelArrayBuffer=await modelFetcher(),_session=await ortInstance$2.InferenceSession.create(modelArrayBuffer),_sr=new ortInstance$2.Tensor(`int64`,[16000n]),zeroes=Array(2*64).fill(0),_h$1=new ortInstance$2.Tensor(`float32`,zeroes,[2,1,64]),_c$1=new ortInstance$2.Tensor(`float32`,zeroes,[2,1,64]);logging_1$3.log.debug(`vad is initialized`);let model=new _a$2(ortInstance$2,_session,_h$1,_c$1,_sr);return model}}),require_v5=__commonJSMin(exports=>{var _a$1;Object.defineProperty(exports,`__esModule`,{value:!0});let logging_1$2=require_logging();function getNewState(ortInstance$2){let zeroes=Array(2*128).fill(0);return new ortInstance$2.Tensor(`float32`,zeroes,[2,1,128])}var SileroV5=class{constructor(_session,_state,_sr,ortInstance$2){this._session=_session,this._state=_state,this._sr=_sr,this.ortInstance=ortInstance$2,this.reset_state=()=>{this._state=getNewState(this.ortInstance)},this.process=async audioFrame=>{let t=new this.ortInstance.Tensor(`float32`,audioFrame,[1,audioFrame.length]),inputs={input:t,state:this._state,sr:this._sr},out=await this._session.run(inputs);this._state=out.stateN;let[isSpeech]=out.output?.data,notSpeech=1-isSpeech;return{notSpeech,isSpeech}}}};exports.SileroV5=SileroV5,_a$1=SileroV5,SileroV5.new=async(ortInstance$2,modelFetcher)=>{logging_1$2.log.debug(`Loading VAD...`);let modelArrayBuffer=await modelFetcher(),_session=await ortInstance$2.InferenceSession.create(modelArrayBuffer),_sr=new ortInstance$2.Tensor(`int64`,[16000n]),_state=getNewState(ortInstance$2);return logging_1$2.log.debug(`...finished loading VAD`),new _a$1(_session,_state,_sr,ortInstance$2)}}),require_models=__commonJSMin(exports=>{var __createBinding$2=exports&&exports.__createBinding||(Object.create?function(o$1,m$3,k$4,k2){k2===void 0&&(k2=k$4);var desc=Object.getOwnPropertyDescriptor(m$3,k$4);(!desc||(`get`in desc?!m$3.__esModule:desc.writable||desc.configurable))&&(desc={enumerable:!0,get:function(){return m$3[k$4]}}),Object.defineProperty(o$1,k2,desc)}:function(o$1,m$3,k$4,k2){k2===void 0&&(k2=k$4),o$1[k2]=m$3[k$4]}),__exportStar=exports&&exports.__exportStar||function(m$3,exports$1){for(var p$5 in m$3)p$5!==`default`&&!Object.prototype.hasOwnProperty.call(exports$1,p$5)&&__createBinding$2(exports$1,m$3,p$5)};Object.defineProperty(exports,`__esModule`,{value:!0}),exports.SileroV5=exports.SileroLegacy=void 0,__exportStar(require_common(),exports);var legacy_1=require_legacy();Object.defineProperty(exports,`SileroLegacy`,{enumerable:!0,get:function(){return legacy_1.SileroLegacy}});var v5_1=require_v5();Object.defineProperty(exports,`SileroV5`,{enumerable:!0,get:function(){return v5_1.SileroV5}})}),require_resampler=__commonJSMin(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0});let logging_1$1=require_logging();var Resampler=class{constructor(options$1){this.options=options$1,this.process=audioFrame=>{let outputFrames=[];for(let sample of audioFrame)for(this.inputBuffer.push(sample);this.hasEnoughDataForFrame();){let outputFrame=this.generateOutputFrame();outputFrames.push(outputFrame)}return outputFrames},options$1.nativeSampleRate<16e3&&logging_1$1.log.error(`nativeSampleRate is too low. Should have 16000 = targetSampleRate <= nativeSampleRate`),this.inputBuffer=[]}async*stream(audioInput){for(let sample of audioInput)for(this.inputBuffer.push(sample);this.hasEnoughDataForFrame();){let outputFrame=this.generateOutputFrame();yield outputFrame}}hasEnoughDataForFrame(){return this.inputBuffer.length*this.options.targetSampleRate/this.options.nativeSampleRate>=this.options.targetFrameSize}generateOutputFrame(){let outputFrame=new Float32Array(this.options.targetFrameSize),outputIndex=0,inputIndex=0;for(;outputIndex{var __createBinding$1=exports&&exports.__createBinding||(Object.create?function(o$1,m$3,k$4,k2){k2===void 0&&(k2=k$4);var desc=Object.getOwnPropertyDescriptor(m$3,k$4);(!desc||(`get`in desc?!m$3.__esModule:desc.writable||desc.configurable))&&(desc={enumerable:!0,get:function(){return m$3[k$4]}}),Object.defineProperty(o$1,k2,desc)}:function(o$1,m$3,k$4,k2){k2===void 0&&(k2=k$4),o$1[k2]=m$3[k$4]}),__setModuleDefault$1=exports&&exports.__setModuleDefault||(Object.create?function(o$1,v$2){Object.defineProperty(o$1,`default`,{enumerable:!0,value:v$2})}:function(o$1,v$2){o$1.default=v$2}),__importStar$1=exports&&exports.__importStar||function(mod){if(mod&&mod.__esModule)return mod;var result={};if(mod!=null)for(var k$4 in mod)k$4!==`default`&&Object.prototype.hasOwnProperty.call(mod,k$4)&&__createBinding$1(result,mod,k$4);return __setModuleDefault$1(result,mod),result};Object.defineProperty(exports,`__esModule`,{value:!0}),exports.NonRealTimeVAD=exports.defaultNonRealTimeVADOptions=void 0;let ortInstance$1=__importStar$1(require_ort_web_min()),asset_path_1$1=require_asset_path(),default_model_fetcher_1$2=require_default_model_fetcher(),frame_processor_1$2=require_frame_processor(),messages_1$2=require_messages(),models_1$1=require_models(),resampler_1$1=require_resampler();exports.defaultNonRealTimeVADOptions={...frame_processor_1$2.defaultLegacyFrameProcessorOptions,ortConfig:void 0,modelURL:asset_path_1$1.baseAssetPath+`silero_vad_legacy.onnx`,modelFetcher:default_model_fetcher_1$2.defaultModelFetcher};var NonRealTimeVAD=class{static async new(options$1={}){let fullOptions={...exports.defaultNonRealTimeVADOptions,...options$1};(0,frame_processor_1$2.validateOptions)(fullOptions),fullOptions.ortConfig!==void 0&&fullOptions.ortConfig(ortInstance$1);let modelFetcher=()=>fullOptions.modelFetcher(fullOptions.modelURL),model=await models_1$1.SileroLegacy.new(ortInstance$1,modelFetcher),frameProcessor=new frame_processor_1$2.FrameProcessor(model.process,model.reset_state,{frameSamples:fullOptions.frameSamples,positiveSpeechThreshold:fullOptions.positiveSpeechThreshold,negativeSpeechThreshold:fullOptions.negativeSpeechThreshold,redemptionFrames:fullOptions.redemptionFrames,preSpeechPadFrames:fullOptions.preSpeechPadFrames,minSpeechFrames:fullOptions.minSpeechFrames,submitUserSpeechOnPause:fullOptions.submitUserSpeechOnPause});frameProcessor.resume();let vad=new this(modelFetcher,ortInstance$1,fullOptions,frameProcessor);return vad}constructor(modelFetcher,ort,options$1,frameProcessor){this.modelFetcher=modelFetcher,this.ort=ort,this.options=options$1,this.frameProcessor=frameProcessor}async*run(inputAudio,sampleRate){let resamplerOptions={nativeSampleRate:sampleRate,targetSampleRate:16e3,targetFrameSize:this.options.frameSamples},resampler=new resampler_1$1.Resampler(resamplerOptions),start=0,end=0,frameIndex=0,messageContainer=[];for await(let frame$1 of resampler.stream(inputAudio)){await this.frameProcessor.process(frame$1,event=>{messageContainer.push(event)});for(let event of messageContainer)switch(event.msg){case messages_1$2.Message.SpeechStart:start=frameIndex*this.options.frameSamples/16;break;case messages_1$2.Message.SpeechEnd:end=(frameIndex+1)*this.options.frameSamples/16,yield{audio:event.audio,start,end};break;default:break}frameIndex++}let{msg,audio}=this.frameProcessor.endSegment(event=>{messageContainer.push(event)});for(let event of messageContainer)switch(event.msg){case messages_1$2.Message.SpeechEnd:yield{audio:event.audio,start,end:frameIndex*this.options.frameSamples/16}}}};exports.NonRealTimeVAD=NonRealTimeVAD}),require_utils=__commonJSMin(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0}),exports.audioFileToArray=exports.encodeWAV=exports.arrayBufferToBase64=exports.minFramesForTargetMS=void 0;function minFramesForTargetMS(targetDuration,frameSamples,sr$1=16e3){return Math.ceil(targetDuration*sr$1/1e3/frameSamples)}exports.minFramesForTargetMS=minFramesForTargetMS;function arrayBufferToBase64(buffer$1){let bytes=new Uint8Array(buffer$1),len=bytes.byteLength,binary=Array(len);for(var i$1=0;i$1{reader.addEventListener(`loadend`,ev$1=>{let audioData=reader.result;ctx.decodeAudioData(audioData,buffer$1=>{audioBuffer=buffer$1,ctx.startRendering().then(renderedBuffer=>{console.log(`Rendering completed successfully`),res()}).catch(err=>{console.error(`Rendering failed: ${err}`)})},e$3=>{console.log(`Error with decoding audio data: ${e$3}`)})}),reader.readAsArrayBuffer(audioFileData)}),audioBuffer===null)throw Error(`some shit`);let _audioBuffer=audioBuffer,out=new Float32Array(_audioBuffer.length);for(let i$1=0;i$1<_audioBuffer.length;i$1++)for(let j$1=0;j$1<_audioBuffer.numberOfChannels;j$1++)out[i$1]+=_audioBuffer.getChannelData(j$1)[i$1];return{audio:out,sampleRate:_audioBuffer.sampleRate}}exports.audioFileToArray=audioFileToArray}),require_real_time_vad=__commonJSMin(exports=>{var __createBinding=exports&&exports.__createBinding||(Object.create?function(o$1,m$3,k$4,k2){k2===void 0&&(k2=k$4);var desc=Object.getOwnPropertyDescriptor(m$3,k$4);(!desc||(`get`in desc?!m$3.__esModule:desc.writable||desc.configurable))&&(desc={enumerable:!0,get:function(){return m$3[k$4]}}),Object.defineProperty(o$1,k2,desc)}:function(o$1,m$3,k$4,k2){k2===void 0&&(k2=k$4),o$1[k2]=m$3[k$4]}),__setModuleDefault=exports&&exports.__setModuleDefault||(Object.create?function(o$1,v$2){Object.defineProperty(o$1,`default`,{enumerable:!0,value:v$2})}:function(o$1,v$2){o$1.default=v$2}),__importStar=exports&&exports.__importStar||function(mod){if(mod&&mod.__esModule)return mod;var result={};if(mod!=null)for(var k$4 in mod)k$4!==`default`&&Object.prototype.hasOwnProperty.call(mod,k$4)&&__createBinding(result,mod,k$4);return __setModuleDefault(result,mod),result};Object.defineProperty(exports,`__esModule`,{value:!0}),exports.AudioNodeVAD=exports.MicVAD=exports.getDefaultRealTimeVADOptions=exports.ort=exports.DEFAULT_MODEL=void 0;let ortInstance=__importStar(require_ort_web_min()),default_model_fetcher_1$1=require_default_model_fetcher(),frame_processor_1$1=require_frame_processor(),logging_1=require_logging(),messages_1$1=require_messages(),models_1=require_models(),resampler_1=require_resampler();exports.DEFAULT_MODEL=`legacy`,exports.ort=ortInstance;let workletFile=`vad.worklet.bundle.min.js`,sileroV5File=`silero_vad_v5.onnx`,sileroLegacyFile=`silero_vad_legacy.onnx`,getDefaultRealTimeVADOptions$1=model=>{let frameProcessorOptions=model===`v5`?frame_processor_1$1.defaultV5FrameProcessorOptions:frame_processor_1$1.defaultLegacyFrameProcessorOptions;return{...frameProcessorOptions,onFrameProcessed:(probabilities,frame$1)=>{},onVADMisfire:()=>{logging_1.log.debug(`VAD misfire`)},onSpeechStart:()=>{logging_1.log.debug(`Detected speech start`)},onSpeechEnd:()=>{logging_1.log.debug(`Detected speech end`)},onSpeechRealStart:()=>{logging_1.log.debug(`Detected real speech start`)},baseAssetPath:`https://cdn.jsdelivr.net/npm/@ricky0123/vad-web@latest/dist/`,onnxWASMBasePath:`https://cdn.jsdelivr.net/npm/onnxruntime-web@1.14.0/dist/`,stream:void 0,ortConfig:void 0,model,workletOptions:{}}};exports.getDefaultRealTimeVADOptions=getDefaultRealTimeVADOptions$1;var MicVAD$1=class MicVAD$1{static async new(options$1={}){let fullOptions={...(0,exports.getDefaultRealTimeVADOptions)(options$1.model??exports.DEFAULT_MODEL),...options$1};(0,frame_processor_1$1.validateOptions)(fullOptions);let stream;stream=fullOptions.stream===void 0?await navigator.mediaDevices.getUserMedia({audio:{...fullOptions.additionalAudioConstraints,channelCount:1,echoCancellation:!0,autoGainControl:!0,noiseSuppression:!0}}):fullOptions.stream;let audioContext=new AudioContext,sourceNode=new MediaStreamAudioSourceNode(audioContext,{mediaStream:stream}),audioNodeVAD=await AudioNodeVAD.new(audioContext,fullOptions);return audioNodeVAD.receive(sourceNode),new MicVAD$1(fullOptions,audioContext,stream,audioNodeVAD,sourceNode)}constructor(options$1,audioContext,stream,audioNodeVAD,sourceNode,listening=!1){this.options=options$1,this.audioContext=audioContext,this.stream=stream,this.audioNodeVAD=audioNodeVAD,this.sourceNode=sourceNode,this.listening=listening,this.pause=()=>{this.audioNodeVAD.pause(),this.listening=!1},this.start=()=>{this.audioNodeVAD.start(),this.listening=!0},this.destroy=()=>{this.listening&&this.pause(),this.options.stream===void 0&&this.stream.getTracks().forEach(track$1=>track$1.stop()),this.sourceNode.disconnect(),this.audioNodeVAD.destroy(),this.audioContext.close()},this.setOptions=options$2=>{this.audioNodeVAD.setFrameProcessorOptions(options$2)}}};exports.MicVAD=MicVAD$1;var AudioNodeVAD=class AudioNodeVAD{static async new(ctx,options$1={}){let fullOptions={...(0,exports.getDefaultRealTimeVADOptions)(options$1.model??exports.DEFAULT_MODEL),...options$1};(0,frame_processor_1$1.validateOptions)(fullOptions),exports.ort.env.wasm.wasmPaths=fullOptions.onnxWASMBasePath,fullOptions.ortConfig!==void 0&&fullOptions.ortConfig(exports.ort);let modelFile=fullOptions.model===`v5`?sileroV5File:sileroLegacyFile,modelURL=fullOptions.baseAssetPath+modelFile,modelFactory=fullOptions.model===`v5`?models_1.SileroV5.new:models_1.SileroLegacy.new,model;try{model=await modelFactory(exports.ort,()=>(0,default_model_fetcher_1$1.defaultModelFetcher)(modelURL))}catch(e$3){throw console.error(`Encountered an error while loading model file ${modelURL}`),e$3}let frameProcessor=new frame_processor_1$1.FrameProcessor(model.process,model.reset_state,{frameSamples:fullOptions.frameSamples,positiveSpeechThreshold:fullOptions.positiveSpeechThreshold,negativeSpeechThreshold:fullOptions.negativeSpeechThreshold,redemptionFrames:fullOptions.redemptionFrames,preSpeechPadFrames:fullOptions.preSpeechPadFrames,minSpeechFrames:fullOptions.minSpeechFrames,submitUserSpeechOnPause:fullOptions.submitUserSpeechOnPause}),audioNodeVAD=new AudioNodeVAD(ctx,fullOptions,frameProcessor);return await audioNodeVAD.setupAudioNode(),audioNodeVAD}constructor(ctx,options$1,frameProcessor){this.ctx=ctx,this.options=options$1,this.bufferIndex=0,this.pause=()=>{this.frameProcessor.pause(this.handleFrameProcessorEvent)},this.start=()=>{this.frameProcessor.resume()},this.receive=node$1=>{node$1.connect(this.audioNode)},this.processFrame=async frame$1=>{await this.frameProcessor.process(frame$1,this.handleFrameProcessorEvent)},this.handleFrameProcessorEvent=ev$1=>{switch(ev$1.msg){case messages_1$1.Message.FrameProcessed:this.options.onFrameProcessed(ev$1.probs,ev$1.frame);break;case messages_1$1.Message.SpeechStart:this.options.onSpeechStart();break;case messages_1$1.Message.SpeechRealStart:this.options.onSpeechRealStart();break;case messages_1$1.Message.VADMisfire:this.options.onVADMisfire();break;case messages_1$1.Message.SpeechEnd:this.options.onSpeechEnd(ev$1.audio);break}},this.destroy=()=>{this.audioNode instanceof AudioWorkletNode&&this.audioNode.port.postMessage({message:messages_1$1.Message.SpeechStop}),this.audioNode.disconnect(),this.gainNode?.disconnect()},this.setFrameProcessorOptions=options$2=>{this.frameProcessor.options={...this.frameProcessor.options,...options$2}},this.frameProcessor=frameProcessor}async setupAudioNode(){let hasAudioWorklet=`audioWorklet`in this.ctx&&typeof AudioWorkletNode==`function`;if(hasAudioWorklet)try{let workletURL=this.options.baseAssetPath+workletFile;await this.ctx.audioWorklet.addModule(workletURL);let workletOptions=this.options.workletOptions??{};workletOptions.processorOptions={...workletOptions.processorOptions??{},frameSamples:this.options.frameSamples},this.audioNode=new AudioWorkletNode(this.ctx,`vad-helper-worklet`,workletOptions),this.audioNode.port.onmessage=async ev$1=>{switch(ev$1.data?.message){case messages_1$1.Message.AudioFrame:let buffer$1=ev$1.data.data;buffer$1 instanceof ArrayBuffer||(buffer$1=new ArrayBuffer(ev$1.data.data.byteLength),new Uint8Array(buffer$1).set(new Uint8Array(ev$1.data.data)));let frame$1=new Float32Array(buffer$1);await this.processFrame(frame$1);break}};return}catch(e$3){console.log(`AudioWorklet setup failed, falling back to ScriptProcessor`,e$3)}this.resampler=new resampler_1.Resampler({nativeSampleRate:this.ctx.sampleRate,targetSampleRate:16e3,targetFrameSize:this.options.frameSamples??480});let bufferSize=4096;this.audioNode=this.ctx.createScriptProcessor(bufferSize,1,1),this.gainNode=this.ctx.createGain(),this.gainNode.gain.value=0;let processingAudio=!1;this.audioNode.onaudioprocess=async e$3=>{if(!processingAudio){processingAudio=!0;try{let input=e$3.inputBuffer.getChannelData(0),output=e$3.outputBuffer.getChannelData(0);if(output.fill(0),this.resampler){let frames=this.resampler.process(input);for(let frame$1 of frames)await this.processFrame(frame$1)}}catch(error){console.error(`Error processing audio:`,error)}finally{processingAudio=!1}}},this.audioNode.connect(this.gainNode),this.gainNode.connect(this.ctx.destination)}};exports.AudioNodeVAD=AudioNodeVAD}),require_dist=__commonJSMin(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0}),exports.getDefaultRealTimeVADOptions=exports.MicVAD=exports.DEFAULT_MODEL=exports.AudioNodeVAD=exports.utils=exports.NonRealTimeVAD=exports.Message=exports.FrameProcessor=exports.defaultModelFetcher=exports.baseAssetPath=void 0;var asset_path_1=require_asset_path();Object.defineProperty(exports,`baseAssetPath`,{enumerable:!0,get:function(){return asset_path_1.baseAssetPath}});var default_model_fetcher_1=require_default_model_fetcher();Object.defineProperty(exports,`defaultModelFetcher`,{enumerable:!0,get:function(){return default_model_fetcher_1.defaultModelFetcher}});var frame_processor_1=require_frame_processor();Object.defineProperty(exports,`FrameProcessor`,{enumerable:!0,get:function(){return frame_processor_1.FrameProcessor}});var messages_1=require_messages();Object.defineProperty(exports,`Message`,{enumerable:!0,get:function(){return messages_1.Message}});var non_real_time_vad_1=require_non_real_time_vad();Object.defineProperty(exports,`NonRealTimeVAD`,{enumerable:!0,get:function(){return non_real_time_vad_1.NonRealTimeVAD}});let utils_1=require_utils();exports.utils={audioFileToArray:utils_1.audioFileToArray,minFramesForTargetMS:utils_1.minFramesForTargetMS,arrayBufferToBase64:utils_1.arrayBufferToBase64,encodeWAV:utils_1.encodeWAV};var real_time_vad_1=require_real_time_vad();Object.defineProperty(exports,`AudioNodeVAD`,{enumerable:!0,get:function(){return real_time_vad_1.AudioNodeVAD}}),Object.defineProperty(exports,`DEFAULT_MODEL`,{enumerable:!0,get:function(){return real_time_vad_1.DEFAULT_MODEL}}),Object.defineProperty(exports,`MicVAD`,{enumerable:!0,get:function(){return real_time_vad_1.MicVAD}}),Object.defineProperty(exports,`getDefaultRealTimeVADOptions`,{enumerable:!0,get:function(){return real_time_vad_1.getDefaultRealTimeVADOptions}})}),import_dist=__toESM(require_dist());function useMicVAD(deviceId,options$1={}){let opts=merge$2({...(0,import_dist.getDefaultRealTimeVADOptions)(`v5`),preSpeechPadFrames:30,positiveSpeechThreshold:.5,negativeSpeechThreshold:.35,minSpeechFrames:30,auto:!0},options$1),micVad=ref(),microphoneAccess=usePermission(`microphone`);async function update(){if(micVad.value&&(micVad.value.destroy(),micVad.value=void 0,console.warn(`existing MicVAD destroyed`)),!microphoneAccess.value)return;let id$1=unref(deviceId);if(!id$1)return;let media=await navigator.mediaDevices.getUserMedia({audio:{deviceId:id$1}});micVad.value=await import_dist.MicVAD.new({...opts,stream:media}),opts.auto&&micVad.value.start()}return watch(microphoneAccess,update,{immediate:!0}),watch(toRef(deviceId),update,{immediate:!0}),tryOnMounted(update),onUnmounted(()=>{micVad.value&&(micVad.value.destroy(),micVad.value=void 0)}),{destroy:()=>{micVad.value&&(micVad.value.destroy(),micVad.value=void 0)},start:()=>{micVad.value&&micVad.value.start()}}}function useQueue(options$1){let queue$1=ref([]),isProcessing$1=ref(!1),internalEventHandler={add:[],pick:[],processing:[],error:[],processed:[],done:[]},internalHandlerEventHandler={};function on$2(eventName,handler){internalEventHandler[eventName].push(handler)}function emit$1(eventName,...params){let handlers$3=internalEventHandler[eventName];handlers$3.forEach(handler=>{handler(...params)})}function onHandlerEvent(eventName,handler){internalHandlerEventHandler[eventName]=internalHandlerEventHandler[eventName]||[],internalHandlerEventHandler[eventName].push(handler)}function emitHandlerEvent(eventName,...params){let handlers$3=internalHandlerEventHandler[eventName]||[];handlers$3.forEach(handler=>{handler(...params)})}async function add$1(payload){queue$1.value.push(payload),emit$1(`add`,payload)}function pick(){let payload=queue$1.value.shift();if(payload)return emit$1(`pick`,payload),payload}async function handleItem(){if(isProcessing$1.value)return;let payload=pick();if(payload){isProcessing$1.value=!0;for(let handler of options$1.handlers){emit$1(`processing`,payload,handler);try{let result=await handler({data:payload,itemsToBeProcessed:()=>queue$1.value.length,emit:emitHandlerEvent});emit$1(`processed`,payload,result,handler)}catch(err){emit$1(`error`,payload,err,handler);continue}}isProcessing$1.value=!1,emit$1(`done`,payload),queue$1.value.length>0&&handleItem()}}return on$2(`add`,handleItem),on$2(`done`,handleItem),{add:add$1,on:on$2,onHandlerEvent,queue:queue$1}}function throwIfAborted(signal,cleanup){if(signal?.aborted){cleanup?.();let e$3=Error(`Operation canceled`);throw e$3.name=signal?.reason,e$3}}function readGraphemeClusters(reader,options$1){let segmenter=new Intl.Segmenter(void 0,{granularity:`grapheme`}),decoder=new TextDecoder(`utf-8`,{fatal:!1}),signal=options$1?.signal;return async function*(){let decodedText=``;for(;;){throwIfAborted(signal,reader.close);let{done,value:value$1}=await new Promise((resolve$1,reject)=>{signal?.addEventListener(`abort`,()=>{reader.close?.();let e$3=Error(`Operation canceled`);e$3.name=signal.reason,reject(e$3)},{once:!0}),Promise.resolve(reader.read()).then(resolve$1).catch(reject)});decodedText+=decoder.decode(value$1,{stream:!0});let segments=segmenter.segment(decodedText);if(done){for(let seg of segments)throwIfAborted(signal,reader.close),yield seg.segment;return}let iter=segments[Symbol.iterator](),lastIndex=0,current=iter.next();for(;!current.done;){throwIfAborted(signal,reader.close);let next=iter.next();if(next.done)break;lastIndex=next.value.index,yield current.value.segment,current=next}done||(decodedText=decodedText.slice(lastIndex))}}()}const keptPunctuations=new Set(`??!!`),hardPunctuations=new Set(`.。??!!…⋯~~「」 \r`),softPunctuations=new Set(`,,、–—::;;《》`);async function*chunkTTSInput(input,options$1){let{boost=2,minimumWords=4,maximumWords=12}=options$1??{},iterator$1=readGraphemeClusters(typeof input==`string`?new ReadableStream({start(controller){controller.enqueue(new TextEncoder().encode(input)),controller.close()}}).getReader():input),segmenter=new Intl.Segmenter(void 0,{granularity:`word`}),yieldCount=0,buffer$1=``,chunk=``,chunkWordsCount=0,previousValue,current=await iterator$1.next();for(;!current.done;){let value$1=current.value;if(value$1.length>1){previousValue=value$1,current=await iterator$1.next();continue}let hard=hardPunctuations.has(value$1),soft=softPunctuations.has(value$1),kept=keptPunctuations.has(value$1);if(hard||soft){switch(value$1){case`.`:case`,`:if(previousValue!==void 0&&/\d/.test(previousValue)){let next=await iterator$1.next();if(!next.done&&next.value&&/\d/.test(next.value)){previousValue=next.value,current=next;continue}}}if(buffer$1.length===0){previousValue=value$1,current=await iterator$1.next();continue}let words=[...segmenter.segment(buffer$1)].filter(w$2=>w$2.isWordLike);if(chunkWordsCount>minimumWords&&chunkWordsCount+words.length>maximumWords){let text$5=kept?chunk.trim()+value$1:chunk.trim();yield{text:text$5,words:chunkWordsCount,reason:`limit`},yieldCount++,chunk=``,chunkWordsCount=0}if(chunk+=buffer$1+value$1,chunkWordsCount+=words.length,buffer$1=``,hard||chunkWordsCount>maximumWords||yieldCountmaximumWords?`limit`:`boost`},yieldCount++,chunk=``,chunkWordsCount=0}previousValue=value$1,current=await iterator$1.next();continue}buffer$1+=value$1,previousValue=value$1,current=await iterator$1.next()}if(chunk.length>0||buffer$1.length>0){let text$5=(chunk+buffer$1).trim();yield{text:text$5,words:chunkWordsCount+[...segmenter.segment(buffer$1)].filter(w$2=>w$2.isWordLike).length,reason:`flush`}}}function useEmotionsMessageQueue(emotionsQueue){function splitEmotion(content$2){for(let emotion of EMOTION_VALUES){if(!content$2.includes(emotion))continue;return{ok:!0,emotion}}return{ok:!1,emotion:``}}return useQueue({handlers:[async ctx=>{if(EMOTION_VALUES.includes(ctx.data)){ctx.emit(`emotion`,ctx.data),await emotionsQueue.add(ctx.data);return}{let{ok:ok$2,emotion}=splitEmotion(ctx.data);ok$2&&(ctx.emit(`emotion`,emotion),await emotionsQueue.add(emotion))}}]})}function useDelayMessageQueue(){function splitDelays(content$2){if(!/<\|DELAY:\d+\|>/i.test(content$2))return{ok:!1,delay:0};let delayExecArray=/<\|DELAY:(\d+)\|>/i.exec(content$2),delay=delayExecArray?.[1];if(!delay)return{ok:!1,delay:0};let delaySeconds=Number.parseFloat(delay);return delaySeconds<=0||Number.isNaN(delaySeconds)?{ok:!0,delay:0}:{ok:!0,delay:delaySeconds}}return useQueue({handlers:[async ctx=>{let{ok:ok$2,delay}=splitDelays(ctx.data);ok$2&&(ctx.emit(`delay`,delay),await sleep$1(delay*1e3))}]})}function useMessageContentQueue(ttsQueue){let processed=ref(``);return useQueue({handlers:[async ctx=>{if(ctx.data===llmInferenceEndToken){let content$2=processed.value.trim();content$2&&await ttsQueue.add(content$2),processed.value=``;return}for await(let chunk of chunkTTSInput(ctx.data))await ttsQueue.add(chunk.text)}]})} /*! -* @pixiv/three-vrm-animation v3.4.1 +* @pixiv/three-vrm-animation v3.4.2 * The implementation of VRM Animation * * Copyright (c) 2019-2025 pixiv Inc. @@ -3992,7 +3992,7 @@ function defineStore(id$1,setup,setupOptions){let options$1,isSetupStore=typeof */ var __async$1=(__this,__arguments,generator)=>new Promise((resolve$1,reject)=>{var fulfilled=value$1=>{try{step(generator.next(value$1))}catch(e$3){reject(e$3)}},rejected=value$1=>{try{step(generator.throw(value$1))}catch(e$3){reject(e$3)}},step=x$3=>x$3.done?resolve$1(x$3.value):Promise.resolve(x$3.value).then(fulfilled,rejected);step((generator=generator.apply(__this,__arguments)).next())}),__async2$1=(__this,__arguments,generator)=>new Promise((resolve$1,reject)=>{var fulfilled=value$1=>{try{step(generator.next(value$1))}catch(e$3){reject(e$3)}},rejected=value$1=>{try{step(generator.throw(value$1))}catch(e$3){reject(e$3)}},step=x$3=>x$3.done?resolve$1(x$3.value):Promise.resolve(x$3.value).then(fulfilled,rejected);step((generator=generator.apply(__this,__arguments)).next())}),VRMExpression$1=class extends Object3D{constructor(expressionName){super(),this.weight=0,this.isBinary=!1,this.overrideBlink=`none`,this.overrideLookAt=`none`,this.overrideMouth=`none`,this._binds=[],this.name=`VRMExpression_${expressionName}`,this.expressionName=expressionName,this.type=`VRMExpression`,this.visible=!1}get binds(){return this._binds}get overrideBlinkAmount(){return this.overrideBlink===`block`?0.5?1:0:this.weight}addBind(bind){this._binds.push(bind)}deleteBind(bind){let index$1=this._binds.indexOf(bind);index$1>=0&&this._binds.splice(index$1,1)}applyWeight(options$1){var _a$3;let actualWeight=this.outputWeight;actualWeight*=(_a$3=options$1?.multiplier)??1,this.isBinary&&actualWeight<1&&(actualWeight=0),this._binds.forEach(bind=>bind.applyWeight(actualWeight))}clearAppliedWeight(){this._binds.forEach(bind=>bind.clearAppliedWeight())}};function extractPrimitivesInternal$1(gltf,nodeIndex,node$1){var _a$3,_b;let json=gltf.parser.json,schemaNode=(_a$3=json.nodes)?.[nodeIndex];if(schemaNode==null)return console.warn(`extractPrimitivesInternal: Attempt to use nodes[${nodeIndex}] of glTF but the node doesn't exist`),null;let meshIndex=schemaNode.mesh;if(meshIndex==null)return null;let schemaMesh=(_b=json.meshes)?.[meshIndex];if(schemaMesh==null)return console.warn(`extractPrimitivesInternal: Attempt to use meshes[${meshIndex}] of glTF but the mesh doesn't exist`),null;let primitiveCount=schemaMesh.primitives.length,primitives=[];return node$1.traverse(object=>{primitives.length{presetNameSet.has(name$2)&&(result[name$2]=expression)}),result}get customExpressionMap(){let result={},presetNameSet=new Set(Object.values(VRMExpressionPresetName$1));return Object.entries(this._expressionMap).forEach(([name$2,expression])=>{presetNameSet.has(name$2)||(result[name$2]=expression)}),result}copy(source){let expressions=this._expressions.concat();return expressions.forEach(expression=>{this.unregisterExpression(expression)}),source._expressions.forEach(expression=>{this.registerExpression(expression)}),this.blinkExpressionNames=source.blinkExpressionNames.concat(),this.lookAtExpressionNames=source.lookAtExpressionNames.concat(),this.mouthExpressionNames=source.mouthExpressionNames.concat(),this}clone(){return new _VRMExpressionManager().copy(this)}getExpression(name$2){var _a$3;return(_a$3=this._expressionMap[name$2])??null}registerExpression(expression){this._expressions.push(expression),this._expressionMap[expression.expressionName]=expression}unregisterExpression(expression){let index$1=this._expressions.indexOf(expression);index$1===-1&&console.warn(`VRMExpressionManager: The specified expressions is not registered`),this._expressions.splice(index$1,1),delete this._expressionMap[expression.expressionName]}getValue(name$2){var _a$3;let expression=this.getExpression(name$2);return(_a$3=expression?.weight)??null}setValue(name$2,weight){let expression=this.getExpression(name$2);expression&&(expression.weight=saturate$1(weight))}resetValues(){this._expressions.forEach(expression=>{expression.weight=0})}getExpressionTrackName(name$2){let expression=this.getExpression(name$2);return expression?`${expression.name}.weight`:null}update(){let weightMultipliers=this._calculateWeightMultipliers();this._expressions.forEach(expression=>{expression.clearAppliedWeight()}),this._expressions.forEach(expression=>{let multiplier=1,name$2=expression.expressionName;this.blinkExpressionNames.indexOf(name$2)!==-1&&(multiplier*=weightMultipliers.blink),this.lookAtExpressionNames.indexOf(name$2)!==-1&&(multiplier*=weightMultipliers.lookAt),this.mouthExpressionNames.indexOf(name$2)!==-1&&(multiplier*=weightMultipliers.mouth),expression.applyWeight({multiplier})})}_calculateWeightMultipliers(){let blink=1,lookAt=1,mouth=1;return this._expressions.forEach(expression=>{blink-=expression.overrideBlinkAmount,lookAt-=expression.overrideLookAtAmount,mouth-=expression.overrideMouthAmount}),blink=Math.max(0,blink),lookAt=Math.max(0,lookAt),mouth=Math.max(0,mouth),{blink,lookAt,mouth}}},VRMExpressionMaterialColorType$1={Color:`color`,EmissionColor:`emissionColor`,ShadeColor:`shadeColor`,MatcapColor:`matcapColor`,RimColor:`rimColor`,OutlineColor:`outlineColor`},v0ExpressionMaterialColorMap$1={_Color:VRMExpressionMaterialColorType$1.Color,_EmissionColor:VRMExpressionMaterialColorType$1.EmissionColor,_ShadeColor:VRMExpressionMaterialColorType$1.ShadeColor,_RimColor:VRMExpressionMaterialColorType$1.RimColor,_OutlineColor:VRMExpressionMaterialColorType$1.OutlineColor},_color$1=new Color,_VRMExpressionMaterialColorBind$1=class _VRMExpressionMaterialColorBind2{constructor({material,type,targetValue,targetAlpha}){this.material=material,this.type=type,this.targetValue=targetValue,this.targetAlpha=targetAlpha??1;let color$2=this._initColorBindState(),alpha$1=this._initAlphaBindState();this._state={color:color$2,alpha:alpha$1}}applyWeight(weight){let{color:color$2,alpha:alpha$1}=this._state;if(color$2!=null){let{propertyName,deltaValue}=color$2,target$1=this.material[propertyName];target$1?.add(_color$1.copy(deltaValue).multiplyScalar(weight))}if(alpha$1!=null){let{propertyName,deltaValue}=alpha$1,target$1=this.material[propertyName];target$1!=null&&(this.material[propertyName]+=deltaValue*weight)}}clearAppliedWeight(){let{color:color$2,alpha:alpha$1}=this._state;if(color$2!=null){let{propertyName,initialValue}=color$2,target$1=this.material[propertyName];target$1?.copy(initialValue)}if(alpha$1!=null){let{propertyName,initialValue}=alpha$1,target$1=this.material[propertyName];target$1!=null&&(this.material[propertyName]=initialValue)}}_initColorBindState(){var _a$3,_b,_c$1;let{material,type,targetValue}=this,propertyNameMap=this._getPropertyNameMap(),propertyName=(_b=(_a$3=propertyNameMap?.[type])?.[0])??null;if(propertyName==null)return console.warn(`Tried to add a material color bind to the material ${(_c$1=material.name)??`(no name)`}, the type ${type} but the material or the type is not supported.`),null;let target$1=material[propertyName],initialValue=target$1.clone(),deltaValue=new Color(targetValue.r-initialValue.r,targetValue.g-initialValue.g,targetValue.b-initialValue.b);return{propertyName,initialValue,deltaValue}}_initAlphaBindState(){var _a$3,_b,_c$1;let{material,type,targetAlpha}=this,propertyNameMap=this._getPropertyNameMap(),propertyName=(_b=(_a$3=propertyNameMap?.[type])?.[1])??null;if(propertyName==null&&targetAlpha!==1)return console.warn(`Tried to add a material alpha bind to the material ${(_c$1=material.name)??`(no name)`}, the type ${type} but the material or the type does not support alpha.`),null;if(propertyName==null)return null;let initialValue=material[propertyName],deltaValue=targetAlpha-initialValue;return{propertyName,initialValue,deltaValue}}_getPropertyNameMap(){var _a$3,_b;return(_b=(_a$3=Object.entries(_VRMExpressionMaterialColorBind2._propertyNameMapMap).find(([distinguisher])=>this.material[distinguisher]===!0))?.[1])??null}};_VRMExpressionMaterialColorBind$1._propertyNameMapMap={isMeshStandardMaterial:{color:[`color`,`opacity`],emissionColor:[`emissive`,null]},isMeshBasicMaterial:{color:[`color`,`opacity`]},isMToonMaterial:{color:[`color`,`opacity`],emissionColor:[`emissive`,null],outlineColor:[`outlineColorFactor`,null],matcapColor:[`matcapFactor`,null],rimColor:[`parametricRimColorFactor`,null],shadeColor:[`shadeColorFactor`,null]}};var VRMExpressionMaterialColorBind$1=_VRMExpressionMaterialColorBind$1,VRMExpressionMorphTargetBind$1=class{constructor({primitives,index:index$1,weight}){this.primitives=primitives,this.index=index$1,this.weight=weight}applyWeight(weight){this.primitives.forEach(mesh=>{var _a$3;(_a$3=mesh.morphTargetInfluences)?.[this.index]!=null&&(mesh.morphTargetInfluences[this.index]+=this.weight*weight)})}clearAppliedWeight(){this.primitives.forEach(mesh=>{var _a$3;(_a$3=mesh.morphTargetInfluences)?.[this.index]!=null&&(mesh.morphTargetInfluences[this.index]=0)})}},_v2$1=new Vector2,_VRMExpressionTextureTransformBind$1=class _VRMExpressionTextureTransformBind2{constructor({material,scale:scale$1,offset:offset$2}){var _a$3,_b;this.material=material,this.scale=scale$1,this.offset=offset$2;let propertyNames=(_a$3=Object.entries(_VRMExpressionTextureTransformBind2._propertyNamesMap).find(([distinguisher])=>material[distinguisher]===!0))?.[1];propertyNames==null?(console.warn(`Tried to add a texture transform bind to the material ${(_b=material.name)??`(no name)`} but the material is not supported.`),this._properties=[]):(this._properties=[],propertyNames.forEach(propertyName=>{var _a2;let texture=(_a2=material[propertyName])?.clone();if(!texture)return null;material[propertyName]=texture;let initialOffset=texture.offset.clone(),initialScale=texture.repeat.clone(),deltaOffset=offset$2.clone().sub(initialOffset),deltaScale=scale$1.clone().sub(initialScale);this._properties.push({name:propertyName,initialOffset,deltaOffset,initialScale,deltaScale})}))}applyWeight(weight){this._properties.forEach(property=>{let target$1=this.material[property.name];target$1!==void 0&&(target$1.offset.add(_v2$1.copy(property.deltaOffset).multiplyScalar(weight)),target$1.repeat.add(_v2$1.copy(property.deltaScale).multiplyScalar(weight)))})}clearAppliedWeight(){this._properties.forEach(property=>{let target$1=this.material[property.name];target$1!==void 0&&(target$1.offset.copy(property.initialOffset),target$1.repeat.copy(property.initialScale))})}};_VRMExpressionTextureTransformBind$1._propertyNamesMap={isMeshStandardMaterial:[`map`,`emissiveMap`,`bumpMap`,`normalMap`,`displacementMap`,`roughnessMap`,`metalnessMap`,`alphaMap`],isMeshBasicMaterial:[`map`,`specularMap`,`alphaMap`],isMToonMaterial:[`map`,`normalMap`,`emissiveMap`,`shadeMultiplyTexture`,`rimMultiplyTexture`,`outlineWidthMultiplyTexture`,`uvAnimationMaskTexture`]};var VRMExpressionTextureTransformBind$1=_VRMExpressionTextureTransformBind$1,POSSIBLE_SPEC_VERSIONS$1=new Set([`1.0`,`1.0-beta`]),_VRMExpressionLoaderPlugin$1=class _VRMExpressionLoaderPlugin2{get name(){return`VRMExpressionLoaderPlugin`}constructor(parser){this.parser=parser}afterRoot(gltf){return __async2$1(this,null,function*(){gltf.userData.vrmExpressionManager=yield this._import(gltf)})}_import(gltf){return __async2$1(this,null,function*(){let v1Result=yield this._v1Import(gltf);if(v1Result)return v1Result;let v0Result=yield this._v0Import(gltf);return v0Result||null})}_v1Import(gltf){return __async2$1(this,null,function*(){var _a$3,_b;let json=this.parser.json,isVRMUsed=(_a$3=json.extensionsUsed)?.indexOf(`VRMC_vrm`)!==-1;if(!isVRMUsed)return null;let extension$1=(_b=json.extensions)?.VRMC_vrm;if(!extension$1)return null;let specVersion=extension$1.specVersion;if(!POSSIBLE_SPEC_VERSIONS$1.has(specVersion))return console.warn(`VRMExpressionLoaderPlugin: Unknown VRMC_vrm specVersion "${specVersion}"`),null;let schemaExpressions=extension$1.expressions;if(!schemaExpressions)return null;let presetNameSet=new Set(Object.values(VRMExpressionPresetName$1)),nameSchemaExpressionMap=new Map;schemaExpressions.preset!=null&&Object.entries(schemaExpressions.preset).forEach(([name$2,schemaExpression])=>{if(schemaExpression!=null){if(!presetNameSet.has(name$2)){console.warn(`VRMExpressionLoaderPlugin: Unknown preset name "${name$2}" detected. Ignoring the expression`);return}nameSchemaExpressionMap.set(name$2,schemaExpression)}}),schemaExpressions.custom!=null&&Object.entries(schemaExpressions.custom).forEach(([name$2,schemaExpression])=>{if(presetNameSet.has(name$2)){console.warn(`VRMExpressionLoaderPlugin: Custom expression cannot have preset name "${name$2}". Ignoring the expression`);return}nameSchemaExpressionMap.set(name$2,schemaExpression)});let manager=new VRMExpressionManager$1;return yield Promise.all(Array.from(nameSchemaExpressionMap.entries()).map(_0=>__async2$1(this,[_0],function*([name$2,schemaExpression]){var _a2,_b2,_c$1,_d$1,_e$2,_f$1,_g$1;let expression=new VRMExpression$1(name$2);if(gltf.scene.add(expression),expression.isBinary=(_a2=schemaExpression.isBinary)??!1,expression.overrideBlink=(_b2=schemaExpression.overrideBlink)??`none`,expression.overrideLookAt=(_c$1=schemaExpression.overrideLookAt)??`none`,expression.overrideMouth=(_d$1=schemaExpression.overrideMouth)??`none`,(_e$2=schemaExpression.morphTargetBinds)==null||_e$2.forEach(bind=>__async2$1(this,null,function*(){var _a3;if(bind.node===void 0||bind.index===void 0)return;let primitives=yield gltfExtractPrimitivesFromNode$1(gltf,bind.node),morphTargetIndex=bind.index;if(!primitives.every(primitive=>Array.isArray(primitive.morphTargetInfluences)&&morphTargetIndex{let material=object.material;material&&(Array.isArray(material)?gltfMaterials.push(...material):gltfMaterials.push(material))}),(_f$1=schemaExpression.materialColorBinds)==null||_f$1.forEach(bind=>__async2$1(this,null,function*(){let materials=gltfMaterials.filter(material=>{var _a3;let materialIndex=(_a3=this.parser.associations.get(material))?.materials;return bind.material===materialIndex});materials.forEach(material=>{expression.addBind(new VRMExpressionMaterialColorBind$1({material,type:bind.type,targetValue:new Color().fromArray(bind.targetValue),targetAlpha:bind.targetValue[3]}))})})),(_g$1=schemaExpression.textureTransformBinds)==null||_g$1.forEach(bind=>__async2$1(this,null,function*(){let materials=gltfMaterials.filter(material=>{var _a3;let materialIndex=(_a3=this.parser.associations.get(material))?.materials;return bind.material===materialIndex});materials.forEach(material=>{var _a3,_b3;expression.addBind(new VRMExpressionTextureTransformBind$1({material,offset:new Vector2().fromArray((_a3=bind.offset)??[0,0]),scale:new Vector2().fromArray((_b3=bind.scale)??[1,1])}))})}))}manager.registerExpression(expression)}))),manager})}_v0Import(gltf){return __async2$1(this,null,function*(){var _a$3;let json=this.parser.json,vrmExt=(_a$3=json.extensions)?.VRM;if(!vrmExt)return null;let schemaBlendShape=vrmExt.blendShapeMaster;if(!schemaBlendShape)return null;let manager=new VRMExpressionManager$1,schemaBlendShapeGroups=schemaBlendShape.blendShapeGroups;if(!schemaBlendShapeGroups)return manager;let blendShapeNameSet=new Set;return yield Promise.all(schemaBlendShapeGroups.map(schemaGroup=>__async2$1(this,null,function*(){var _a2;let v0PresetName=schemaGroup.presetName,v1PresetName=v0PresetName!=null&&_VRMExpressionLoaderPlugin2.v0v1PresetNameMap[v0PresetName]||null,name$2=v1PresetName??schemaGroup.name;if(name$2==null){console.warn(`VRMExpressionLoaderPlugin: One of custom expressions has no name. Ignoring the expression`);return}if(blendShapeNameSet.has(name$2)){console.warn(`VRMExpressionLoaderPlugin: An expression preset ${v0PresetName} has duplicated entries. Ignoring the expression`);return}blendShapeNameSet.add(name$2);let expression=new VRMExpression$1(name$2);gltf.scene.add(expression),expression.isBinary=(_a2=schemaGroup.isBinary)??!1,schemaGroup.binds&&schemaGroup.binds.forEach(bind=>__async2$1(this,null,function*(){var _a3;if(bind.mesh===void 0||bind.index===void 0)return;let nodesUsingMesh=[];(_a3=json.nodes)==null||_a3.forEach((node$1,i$1)=>{node$1.mesh===bind.mesh&&nodesUsingMesh.push(i$1)});let morphTargetIndex=bind.index;yield Promise.all(nodesUsingMesh.map(nodeIndex=>__async2$1(this,null,function*(){var _a4;let primitives=yield gltfExtractPrimitivesFromNode$1(gltf,nodeIndex);if(!primitives.every(primitive=>Array.isArray(primitive.morphTargetInfluences)&&morphTargetIndex{if(materialValue.materialName===void 0||materialValue.propertyName===void 0||materialValue.targetValue===void 0)return;let materials=[];gltf.scene.traverse(object=>{if(object.material){let material=object.material;Array.isArray(material)?materials.push(...material.filter(mtl=>(mtl.name===materialValue.materialName||mtl.name===materialValue.materialName+` (Outline)`)&&materials.indexOf(mtl)===-1)):material.name===materialValue.materialName&&materials.indexOf(material)===-1&&materials.push(material)}});let materialPropertyName=materialValue.propertyName;materials.forEach(material=>{if(materialPropertyName===`_MainTex_ST`){let scale$1=new Vector2(materialValue.targetValue[0],materialValue.targetValue[1]),offset$2=new Vector2(materialValue.targetValue[2],materialValue.targetValue[3]);offset$2.y=1-offset$2.y-scale$1.y,expression.addBind(new VRMExpressionTextureTransformBind$1({material,scale:scale$1,offset:offset$2}));return}let materialColorType=v0ExpressionMaterialColorMap$1[materialPropertyName];if(materialColorType){expression.addBind(new VRMExpressionMaterialColorBind$1({material,type:materialColorType,targetValue:new Color().fromArray(materialValue.targetValue),targetAlpha:materialValue.targetValue[3]}));return}console.warn(materialPropertyName+` is not supported`)})}),manager.registerExpression(expression)}))),manager})}};_VRMExpressionLoaderPlugin$1.v0v1PresetNameMap={a:`aa`,e:`ee`,i:`ih`,o:`oh`,u:`ou`,blink:`blink`,joy:`happy`,angry:`angry`,sorrow:`sad`,fun:`relaxed`,lookup:`lookUp`,lookdown:`lookDown`,lookleft:`lookLeft`,lookright:`lookRight`,blink_l:`blinkLeft`,blink_r:`blinkRight`,neutral:`neutral`};var _VRMFirstPerson$1=class _VRMFirstPerson2{constructor(humanoid,meshAnnotations){this._firstPersonOnlyLayer=_VRMFirstPerson2.DEFAULT_FIRSTPERSON_ONLY_LAYER,this._thirdPersonOnlyLayer=_VRMFirstPerson2.DEFAULT_THIRDPERSON_ONLY_LAYER,this._initializedLayers=!1,this.humanoid=humanoid,this.meshAnnotations=meshAnnotations}copy(source){if(this.humanoid!==source.humanoid)throw Error(`VRMFirstPerson: humanoid must be same in order to copy`);return this.meshAnnotations=source.meshAnnotations.map(annotation=>({meshes:annotation.meshes.concat(),type:annotation.type})),this}clone(){return new _VRMFirstPerson2(this.humanoid,this.meshAnnotations).copy(this)}get firstPersonOnlyLayer(){return this._firstPersonOnlyLayer}get thirdPersonOnlyLayer(){return this._thirdPersonOnlyLayer}setup({firstPersonOnlyLayer=_VRMFirstPerson2.DEFAULT_FIRSTPERSON_ONLY_LAYER,thirdPersonOnlyLayer=_VRMFirstPerson2.DEFAULT_THIRDPERSON_ONLY_LAYER}={}){this._initializedLayers||(this._firstPersonOnlyLayer=firstPersonOnlyLayer,this._thirdPersonOnlyLayer=thirdPersonOnlyLayer,this.meshAnnotations.forEach(item=>{item.meshes.forEach(mesh=>{item.type===`firstPersonOnly`?(mesh.layers.set(this._firstPersonOnlyLayer),mesh.traverse(child=>child.layers.set(this._firstPersonOnlyLayer))):item.type===`thirdPersonOnly`?(mesh.layers.set(this._thirdPersonOnlyLayer),mesh.traverse(child=>child.layers.set(this._thirdPersonOnlyLayer))):item.type===`auto`&&this._createHeadlessModel(mesh)})}),this._initializedLayers=!0)}_excludeTriangles(triangles,bws,skinIndex,exclude){let count$1=0;if(bws!=null&&bws.length>0)for(let i$1=0;i$10&&exclude.includes(skin0[0])||bw0[1]>0&&exclude.includes(skin0[1])||bw0[2]>0&&exclude.includes(skin0[2])||bw0[3]>0&&exclude.includes(skin0[3]))continue;let bw1=bws[b$4],skin1=skinIndex[b$4];if(bw1[0]>0&&exclude.includes(skin1[0])||bw1[1]>0&&exclude.includes(skin1[1])||bw1[2]>0&&exclude.includes(skin1[2])||bw1[3]>0&&exclude.includes(skin1[3]))continue;let bw2=bws[c$4],skin2=skinIndex[c$4];bw2[0]>0&&exclude.includes(skin2[0])||bw2[1]>0&&exclude.includes(skin2[1])||bw2[2]>0&&exclude.includes(skin2[2])||bw2[3]>0&&exclude.includes(skin2[3])||(triangles[count$1++]=a$2,triangles[count$1++]=b$4,triangles[count$1++]=c$4)}return count$1}_createErasedMesh(src,erasingBonesIndex){let dst=new SkinnedMesh(src.geometry.clone(),src.material);dst.name=`${src.name}(erase)`,dst.frustumCulled=src.frustumCulled,dst.layers.set(this._firstPersonOnlyLayer);let geometry=dst.geometry,skinIndexAttr=geometry.getAttribute(`skinIndex`),skinIndexAttrArray=skinIndexAttr instanceof GLBufferAttribute?[]:skinIndexAttr.array,skinIndex=[];for(let i$1=0;i$1{this._isEraseTarget(bone)&&eraseBoneIndexes.push(index$1)}),!eraseBoneIndexes.length){mesh.layers.enable(this._thirdPersonOnlyLayer),mesh.layers.enable(this._firstPersonOnlyLayer);return}mesh.layers.set(this._thirdPersonOnlyLayer);let newMesh=this._createErasedMesh(mesh,eraseBoneIndexes);parent.add(newMesh)}_createHeadlessModel(node$1){if(node$1.type===`Group`)if(node$1.layers.set(this._thirdPersonOnlyLayer),this._isEraseTarget(node$1))node$1.traverse(child=>child.layers.set(this._thirdPersonOnlyLayer));else{let parent=new Group;parent.name=`_headless_${node$1.name}`,parent.layers.set(this._firstPersonOnlyLayer),node$1.parent.add(parent),node$1.children.filter(child=>child.type===`SkinnedMesh`).forEach(child=>{let skinnedMesh=child;this._createHeadlessModelForSkinnedMesh(parent,skinnedMesh)})}else if(node$1.type===`SkinnedMesh`){let skinnedMesh=node$1;this._createHeadlessModelForSkinnedMesh(node$1.parent,skinnedMesh)}else this._isEraseTarget(node$1)&&(node$1.layers.set(this._thirdPersonOnlyLayer),node$1.traverse(child=>child.layers.set(this._thirdPersonOnlyLayer)))}_isEraseTarget(bone){return bone===this.humanoid.getRawBoneNode(`head`)?!0:bone.parent?this._isEraseTarget(bone.parent):!1}};_VRMFirstPerson$1.DEFAULT_FIRSTPERSON_ONLY_LAYER=9,_VRMFirstPerson$1.DEFAULT_THIRDPERSON_ONLY_LAYER=10;var _v3A$1=new Vector3,_v3B$1=new Vector3,_quatA$1=new Quaternion,VRMHumanBoneParentMap$1={hips:null,spine:`hips`,chest:`spine`,upperChest:`chest`,neck:`upperChest`,head:`neck`,leftEye:`head`,rightEye:`head`,jaw:`head`,leftUpperLeg:`hips`,leftLowerLeg:`leftUpperLeg`,leftFoot:`leftLowerLeg`,leftToes:`leftFoot`,rightUpperLeg:`hips`,rightLowerLeg:`rightUpperLeg`,rightFoot:`rightLowerLeg`,rightToes:`rightFoot`,leftShoulder:`upperChest`,leftUpperArm:`leftShoulder`,leftLowerArm:`leftUpperArm`,leftHand:`leftLowerArm`,rightShoulder:`upperChest`,rightUpperArm:`rightShoulder`,rightLowerArm:`rightUpperArm`,rightHand:`rightLowerArm`,leftThumbMetacarpal:`leftHand`,leftThumbProximal:`leftThumbMetacarpal`,leftThumbDistal:`leftThumbProximal`,leftIndexProximal:`leftHand`,leftIndexIntermediate:`leftIndexProximal`,leftIndexDistal:`leftIndexIntermediate`,leftMiddleProximal:`leftHand`,leftMiddleIntermediate:`leftMiddleProximal`,leftMiddleDistal:`leftMiddleIntermediate`,leftRingProximal:`leftHand`,leftRingIntermediate:`leftRingProximal`,leftRingDistal:`leftRingIntermediate`,leftLittleProximal:`leftHand`,leftLittleIntermediate:`leftLittleProximal`,leftLittleDistal:`leftLittleIntermediate`,rightThumbMetacarpal:`rightHand`,rightThumbProximal:`rightThumbMetacarpal`,rightThumbDistal:`rightThumbProximal`,rightIndexProximal:`rightHand`,rightIndexIntermediate:`rightIndexProximal`,rightIndexDistal:`rightIndexIntermediate`,rightMiddleProximal:`rightHand`,rightMiddleIntermediate:`rightMiddleProximal`,rightMiddleDistal:`rightMiddleIntermediate`,rightRingProximal:`rightHand`,rightRingIntermediate:`rightRingProximal`,rightRingDistal:`rightRingIntermediate`,rightLittleProximal:`rightHand`,rightLittleIntermediate:`rightLittleProximal`,rightLittleDistal:`rightLittleIntermediate`};function quatInvertCompat$1(target$1){return target$1.invert?target$1.invert():target$1.inverse(),target$1}var _v3A2$1=new Vector3,_quatA2$1=new Quaternion,_v3A3$1=new Vector3,_quatA3$1=new Quaternion,_boneWorldPos$1=new Vector3,_quatA4$1=new Quaternion,_quatB$1=new Quaternion,_v3A4$1=new Vector3,_v3B2$1=new Vector3,SQRT_2_OVER_2$1=Math.sqrt(2)/2,QUAT_XY_CW90$1=new Quaternion(0,0,-SQRT_2_OVER_2$1,SQRT_2_OVER_2$1),VEC3_POSITIVE_Y$1=new Vector3(0,1,0),_position$1=new Vector3,_scale$1=new Vector3;function getWorldQuaternionLite$1(object,out){return object.matrixWorld.decompose(_position$1,out,_scale$1),out}function calcAzimuthAltitude$1(vector){return[Math.atan2(-vector.z,vector.x),Math.atan2(vector.y,Math.sqrt(vector.x*vector.x+vector.z*vector.z))]}function sanitizeAngle$1(angle){let roundTurn=Math.round(angle/2/Math.PI);return angle-2*Math.PI*roundTurn}var VEC3_POSITIVE_Z$1=new Vector3(0,0,1),_v3A5$1=new Vector3,_v3B3$1=new Vector3,_v3C$1=new Vector3,_quatA5$1=new Quaternion,_quatB2$1=new Quaternion,_quatC$1=new Quaternion,_quatD$1=new Quaternion,_eulerA$1=new Euler,_VRMLookAt$1=class _VRMLookAt2{constructor(humanoid,applier){this.offsetFromHeadBone=new Vector3,this.autoUpdate=!0,this.faceFront=new Vector3(0,0,1),this.humanoid=humanoid,this.applier=applier,this._yaw=0,this._pitch=0,this._needsUpdate=!0,this._restHeadWorldQuaternion=this.getLookAtWorldQuaternion(new Quaternion)}get yaw(){return this._yaw}set yaw(value$1){this._yaw=value$1,this._needsUpdate=!0}get pitch(){return this._pitch}set pitch(value$1){this._pitch=value$1,this._needsUpdate=!0}get euler(){return console.warn(`VRMLookAt: euler is deprecated. use getEuler() instead.`),this.getEuler(new Euler)}getEuler(target$1){return target$1.set(MathUtils.DEG2RAD*this._pitch,MathUtils.DEG2RAD*this._yaw,0,`YXZ`)}copy(source){if(this.humanoid!==source.humanoid)throw Error(`VRMLookAt: humanoid must be same in order to copy`);return this.offsetFromHeadBone.copy(source.offsetFromHeadBone),this.applier=source.applier,this.autoUpdate=source.autoUpdate,this.target=source.target,this.faceFront.copy(source.faceFront),this}clone(){return new _VRMLookAt2(this.humanoid,this.applier).copy(this)}reset(){this._yaw=0,this._pitch=0,this._needsUpdate=!0}getLookAtWorldPosition(target$1){let head$1=this.humanoid.getRawBoneNode(`head`);return target$1.copy(this.offsetFromHeadBone).applyMatrix4(head$1.matrixWorld)}getLookAtWorldQuaternion(target$1){let head$1=this.humanoid.getRawBoneNode(`head`);return getWorldQuaternionLite$1(head$1,target$1)}getFaceFrontQuaternion(target$1){if(this.faceFront.distanceToSquared(VEC3_POSITIVE_Z$1)<.01)return target$1.copy(this._restHeadWorldQuaternion).invert();let[faceFrontAzimuth,faceFrontAltitude]=calcAzimuthAltitude$1(this.faceFront);return _eulerA$1.set(0,.5*Math.PI+faceFrontAzimuth,faceFrontAltitude,`YZX`),target$1.setFromEuler(_eulerA$1).premultiply(_quatD$1.copy(this._restHeadWorldQuaternion).invert())}getLookAtWorldDirection(target$1){return this.getLookAtWorldQuaternion(_quatB2$1),this.getFaceFrontQuaternion(_quatC$1),target$1.copy(VEC3_POSITIVE_Z$1).applyQuaternion(_quatB2$1).applyQuaternion(_quatC$1).applyEuler(this.getEuler(_eulerA$1))}lookAt(position$2){let headRotDiffInv=_quatA5$1.copy(this._restHeadWorldQuaternion).multiply(quatInvertCompat$1(this.getLookAtWorldQuaternion(_quatB2$1))),headPos=this.getLookAtWorldPosition(_v3B3$1),lookAtDir=_v3C$1.copy(position$2).sub(headPos).applyQuaternion(headRotDiffInv).normalize(),[azimuthFrom,altitudeFrom]=calcAzimuthAltitude$1(this.faceFront),[azimuthTo,altitudeTo]=calcAzimuthAltitude$1(lookAtDir),yaw=sanitizeAngle$1(azimuthTo-azimuthFrom),pitch=sanitizeAngle$1(altitudeFrom-altitudeTo);this._yaw=MathUtils.RAD2DEG*yaw,this._pitch=MathUtils.RAD2DEG*pitch,this._needsUpdate=!0}update(delta){this.target!=null&&this.autoUpdate&&this.lookAt(this.target.getWorldPosition(_v3A5$1)),this._needsUpdate&&(this._needsUpdate=!1,this.applier.applyYawPitch(this._yaw,this._pitch))}};_VRMLookAt$1.EULER_ORDER=`YXZ`;var VRMLookAt$1=_VRMLookAt$1,VEC3_POSITIVE_Z2$1=new Vector3(0,0,1),_quatA6$1=new Quaternion,_quatB3$1=new Quaternion,_eulerA2$1=new Euler(0,0,0,`YXZ`),VRMLookAtBoneApplier$1=class{constructor(humanoid,rangeMapHorizontalInner,rangeMapHorizontalOuter,rangeMapVerticalDown,rangeMapVerticalUp){this.humanoid=humanoid,this.rangeMapHorizontalInner=rangeMapHorizontalInner,this.rangeMapHorizontalOuter=rangeMapHorizontalOuter,this.rangeMapVerticalDown=rangeMapVerticalDown,this.rangeMapVerticalUp=rangeMapVerticalUp,this.faceFront=new Vector3(0,0,1),this._restQuatLeftEye=new Quaternion,this._restQuatRightEye=new Quaternion,this._restLeftEyeParentWorldQuat=new Quaternion,this._restRightEyeParentWorldQuat=new Quaternion;let leftEye=this.humanoid.getRawBoneNode(`leftEye`),rightEye=this.humanoid.getRawBoneNode(`rightEye`);leftEye&&(this._restQuatLeftEye.copy(leftEye.quaternion),getWorldQuaternionLite$1(leftEye.parent,this._restLeftEyeParentWorldQuat)),rightEye&&(this._restQuatRightEye.copy(rightEye.quaternion),getWorldQuaternionLite$1(rightEye.parent,this._restRightEyeParentWorldQuat))}applyYawPitch(yaw,pitch){let leftEye=this.humanoid.getRawBoneNode(`leftEye`),rightEye=this.humanoid.getRawBoneNode(`rightEye`),leftEyeNormalized=this.humanoid.getNormalizedBoneNode(`leftEye`),rightEyeNormalized=this.humanoid.getNormalizedBoneNode(`rightEye`);leftEye&&(pitch<0?_eulerA2$1.x=-MathUtils.DEG2RAD*this.rangeMapVerticalDown.map(-pitch):_eulerA2$1.x=MathUtils.DEG2RAD*this.rangeMapVerticalUp.map(pitch),yaw<0?_eulerA2$1.y=-MathUtils.DEG2RAD*this.rangeMapHorizontalInner.map(-yaw):_eulerA2$1.y=MathUtils.DEG2RAD*this.rangeMapHorizontalOuter.map(yaw),_quatA6$1.setFromEuler(_eulerA2$1),this._getWorldFaceFrontQuat(_quatB3$1),leftEyeNormalized.quaternion.copy(_quatB3$1).multiply(_quatA6$1).multiply(_quatB3$1.invert()),_quatA6$1.copy(this._restLeftEyeParentWorldQuat),leftEye.quaternion.copy(leftEyeNormalized.quaternion).multiply(_quatA6$1).premultiply(_quatA6$1.invert()).multiply(this._restQuatLeftEye)),rightEye&&(pitch<0?_eulerA2$1.x=-MathUtils.DEG2RAD*this.rangeMapVerticalDown.map(-pitch):_eulerA2$1.x=MathUtils.DEG2RAD*this.rangeMapVerticalUp.map(pitch),yaw<0?_eulerA2$1.y=-MathUtils.DEG2RAD*this.rangeMapHorizontalOuter.map(-yaw):_eulerA2$1.y=MathUtils.DEG2RAD*this.rangeMapHorizontalInner.map(yaw),_quatA6$1.setFromEuler(_eulerA2$1),this._getWorldFaceFrontQuat(_quatB3$1),rightEyeNormalized.quaternion.copy(_quatB3$1).multiply(_quatA6$1).multiply(_quatB3$1.invert()),_quatA6$1.copy(this._restRightEyeParentWorldQuat),rightEye.quaternion.copy(rightEyeNormalized.quaternion).multiply(_quatA6$1).premultiply(_quatA6$1.invert()).multiply(this._restQuatRightEye))}lookAt(euler){console.warn(`VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.`);let yaw=MathUtils.RAD2DEG*euler.y,pitch=MathUtils.RAD2DEG*euler.x;this.applyYawPitch(yaw,pitch)}_getWorldFaceFrontQuat(target$1){if(this.faceFront.distanceToSquared(VEC3_POSITIVE_Z2$1)<.01)return target$1.identity();let[faceFrontAzimuth,faceFrontAltitude]=calcAzimuthAltitude$1(this.faceFront);return _eulerA2$1.set(0,.5*Math.PI+faceFrontAzimuth,faceFrontAltitude,`YZX`),target$1.setFromEuler(_eulerA2$1)}};VRMLookAtBoneApplier$1.type=`bone`;var VRMLookAtExpressionApplier$1=class{constructor(expressions,rangeMapHorizontalInner,rangeMapHorizontalOuter,rangeMapVerticalDown,rangeMapVerticalUp){this.expressions=expressions,this.rangeMapHorizontalInner=rangeMapHorizontalInner,this.rangeMapHorizontalOuter=rangeMapHorizontalOuter,this.rangeMapVerticalDown=rangeMapVerticalDown,this.rangeMapVerticalUp=rangeMapVerticalUp}applyYawPitch(yaw,pitch){pitch<0?(this.expressions.setValue(`lookDown`,0),this.expressions.setValue(`lookUp`,this.rangeMapVerticalUp.map(-pitch))):(this.expressions.setValue(`lookUp`,0),this.expressions.setValue(`lookDown`,this.rangeMapVerticalDown.map(pitch))),yaw<0?(this.expressions.setValue(`lookLeft`,0),this.expressions.setValue(`lookRight`,this.rangeMapHorizontalOuter.map(-yaw))):(this.expressions.setValue(`lookRight`,0),this.expressions.setValue(`lookLeft`,this.rangeMapHorizontalOuter.map(yaw)))}lookAt(euler){console.warn(`VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.`);let yaw=MathUtils.RAD2DEG*euler.y,pitch=MathUtils.RAD2DEG*euler.x;this.applyYawPitch(yaw,pitch)}};VRMLookAtExpressionApplier$1.type=`expression`;var RAD2DEG$1=180/Math.PI,_eulerA3=new Euler,VRMLookAtQuaternionProxy=class extends Object3D{constructor(lookAt){super(),this.vrmLookAt=lookAt,this.type=`VRMLookAtQuaternionProxy`;let prevRotationOnChangeCallback=this.rotation._onChangeCallback;this.rotation._onChange(()=>{prevRotationOnChangeCallback(),this._applyToLookAt()});let prevQuaternionOnChangeCallback=this.quaternion._onChangeCallback;this.quaternion._onChange(()=>{prevQuaternionOnChangeCallback(),this._applyToLookAt()})}_applyToLookAt(){_eulerA3.setFromQuaternion(this.quaternion,VRMLookAt$1.EULER_ORDER),this.vrmLookAt.yaw=RAD2DEG$1*_eulerA3.y,this.vrmLookAt.pitch=RAD2DEG$1*_eulerA3.x}};function createVRMAnimationHumanoidTracks(vrmAnimation,humanoid,metaVersion){var _a$3,_b;let translation=new Map,rotation=new Map;for(let[name$2,origTrack]of vrmAnimation.humanoidTracks.rotation.entries()){let nodeName=(_a$3=humanoid.getNormalizedBoneNode(name$2))?.name;if(nodeName!=null){let track$1=new QuaternionKeyframeTrack(`${nodeName}.quaternion`,origTrack.times,origTrack.values.map((v$2,i$1)=>metaVersion===`0`&&i$1%2==0?-v$2:v$2));rotation.set(name$2,track$1)}}for(let[name$2,origTrack]of vrmAnimation.humanoidTracks.translation.entries()){let nodeName=(_b=humanoid.getNormalizedBoneNode(name$2))?.name;if(nodeName!=null){let animationY=vrmAnimation.restHipsPosition.y,humanoidY=humanoid.normalizedRestPose.hips.position[1],scale$1=humanoidY/animationY,track$1=origTrack.clone();track$1.values=track$1.values.map((v$2,i$1)=>(metaVersion===`0`&&i$1%3!=1?-v$2:v$2)*scale$1),track$1.name=`${nodeName}.position`,translation.set(name$2,track$1)}}return{translation,rotation}}function createVRMAnimationExpressionTracks(vrmAnimation,expressionManager){let preset=new Map,custom=new Map;for(let[name$2,origTrack]of vrmAnimation.expressionTracks.preset.entries()){let trackName=expressionManager.getExpressionTrackName(name$2);if(trackName!=null){let track$1=origTrack.clone();track$1.name=trackName,preset.set(name$2,track$1)}}for(let[name$2,origTrack]of vrmAnimation.expressionTracks.custom.entries()){let trackName=expressionManager.getExpressionTrackName(name$2);if(trackName!=null){let track$1=origTrack.clone();track$1.name=trackName,custom.set(name$2,track$1)}}return{preset,custom}}function createVRMAnimationLookAtTrack(vrmAnimation,trackName){if(vrmAnimation.lookAtTrack==null)return null;let track$1=vrmAnimation.lookAtTrack.clone();return track$1.name=trackName,track$1}function createVRMAnimationClip(vrmAnimation,vrm){let tracks=[],humanoidTracks=createVRMAnimationHumanoidTracks(vrmAnimation,vrm.humanoid,vrm.meta.metaVersion);if(tracks.push(...humanoidTracks.translation.values()),tracks.push(...humanoidTracks.rotation.values()),vrm.expressionManager!=null){let expressionTracks=createVRMAnimationExpressionTracks(vrmAnimation,vrm.expressionManager);tracks.push(...expressionTracks.preset.values()),tracks.push(...expressionTracks.custom.values())}if(vrm.lookAt!=null){let proxy=vrm.scene.children.find(obj=>obj instanceof VRMLookAtQuaternionProxy);proxy==null?(console.warn(`createVRMAnimationClip: VRMLookAtQuaternionProxy is not found. Creating a new one automatically. To suppress this warning, create a VRMLookAtQuaternionProxy manually`),proxy=new VRMLookAtQuaternionProxy(vrm.lookAt),proxy.name=`VRMLookAtQuaternionProxy`,vrm.scene.add(proxy)):proxy.name===``&&(console.warn(`createVRMAnimationClip: VRMLookAtQuaternionProxy is found but its name is not set. Setting the name automatically. To suppress this warning, set the name manually`),proxy.name=`VRMLookAtQuaternionProxy`);let track$1=createVRMAnimationLookAtTrack(vrmAnimation,`${proxy.name}.quaternion`);track$1!=null&&tracks.push(track$1)}return new AnimationClip(`Clip`,vrmAnimation.duration,tracks)}var VRMAnimation=class{constructor(){this.duration=0,this.restHipsPosition=new Vector3,this.humanoidTracks={translation:new Map,rotation:new Map},this.expressionTracks={preset:new Map,custom:new Map},this.lookAtTrack=null}};function arrayChunk(array,every){let N$2=array.length,ret=[],current=[],remaining=0;for(let i$1=0;i$1{let defAnimation=defGltf.animations[iAnimation],animation=this._parseAnimation(clip,defAnimation,nodeMap,worldMatrixMap);return animation.restHipsPosition=restHipsPosition,animation});gltf.userData.vrmAnimations=animations$1})}_createNodeMap(defExtension){var _a$3,_b,_c$1,_d$1,_e$2;let humanoidIndexToName=new Map,expressionsIndexToName=new Map,humanBones=(_a$3=defExtension.humanoid)?.humanBones;humanBones&&Object.entries(humanBones).forEach(([name$2,bone])=>{let node$1=bone?.node;node$1!=null&&humanoidIndexToName.set(node$1,name$2)});let preset=(_b=defExtension.expressions)?.preset;preset&&Object.entries(preset).forEach(([name$2,expression])=>{let node$1=expression?.node;node$1!=null&&expressionsIndexToName.set(node$1,name$2)});let custom=(_c$1=defExtension.expressions)?.custom;custom&&Object.entries(custom).forEach(([name$2,expression])=>{let{node:node$1}=expression;expressionsIndexToName.set(node$1,name$2)});let lookAtIndex=(_e$2=(_d$1=defExtension.lookAt)?.node)??null;return{humanoidIndexToName,expressionsIndexToName,lookAtIndex}}_createBoneWorldMatrixMap(gltf,defExtension){return __async$1(this,null,function*(){var _a$3,_b;gltf.scene.updateWorldMatrix(!1,!0);let threeNodes=yield gltf.parser.getDependencies(`node`),worldMatrixMap=new Map;if(defExtension.humanoid==null)return worldMatrixMap;for(let[boneName,humanBone]of Object.entries(defExtension.humanoid.humanBones)){let node$1=humanBone?.node;if(node$1!=null){let threeNode=threeNodes[node$1];worldMatrixMap.set(boneName,threeNode.matrixWorld),boneName===`hips`&&worldMatrixMap.set(`hipsParent`,(_b=(_a$3=threeNode.parent)?.matrixWorld)??MAT4_IDENTITY)}}return worldMatrixMap})}_parseAnimation(animationClip,defAnimation,nodeMap,worldMatrixMap){let tracks=animationClip.tracks,defChannels=defAnimation.channels,result=new VRMAnimation;return result.duration=animationClip.duration,defChannels.forEach((channel,iChannel)=>{let{node:node$1,path}=channel.target,origTrack=tracks[iChannel];if(node$1==null)return;let boneName=nodeMap.humanoidIndexToName.get(node$1);if(boneName!=null){let parentBoneName=VRMHumanBoneParentMap$1[boneName];for(;parentBoneName!=null&&worldMatrixMap.get(parentBoneName)==null;)parentBoneName=VRMHumanBoneParentMap$1[parentBoneName];if(parentBoneName??=`hipsParent`,path===`translation`)if(boneName!==`hips`)console.warn(`The loading animation contains a translation track for ${boneName}, which is not permitted in the VRMC_vrm_animation spec. ignoring the track`);else{let hipsParentWorldMatrix=worldMatrixMap.get(`hipsParent`),trackValues=arrayChunk(origTrack.values,3).flatMap(v$2=>_v3A6$1.fromArray(v$2).applyMatrix4(hipsParentWorldMatrix).toArray()),track$1=origTrack.clone();track$1.values=new Float32Array(trackValues),result.humanoidTracks.translation.set(boneName,track$1)}else if(path===`rotation`){let worldMatrix=worldMatrixMap.get(boneName),parentWorldMatrix=worldMatrixMap.get(parentBoneName);worldMatrix.decompose(_v3A6$1,_quatA7$1,_v3A6$1),_quatA7$1.invert(),parentWorldMatrix.decompose(_v3A6$1,_quatB4$1,_v3A6$1);let trackValues=arrayChunk(origTrack.values,4).flatMap(q$2=>_quatC2$1.fromArray(q$2).premultiply(_quatB4$1).multiply(_quatA7$1).toArray()),track$1=origTrack.clone();track$1.values=new Float32Array(trackValues),result.humanoidTracks.rotation.set(boneName,track$1)}else throw Error(`Invalid path "${path}"`);return}let expressionName=nodeMap.expressionsIndexToName.get(node$1);if(expressionName!=null){if(path===`translation`){let times=origTrack.times,values=new Float32Array(origTrack.values.length/3);for(let i$1=0;i$1new Promise((resolve$1,reject)=>{v */ const DEG2RAD=Math.PI/180,RAD2DEG=180/Math.PI;function lerp$1(x$3,y$3,t){return(1-t)*x$3+t*y$3}function randFloat(low,high){return low+Math.random()*(high-low)}const EYE_SACCADE_INT_STEP=400,EYE_SACCADE_INT_P=[[.075,800],[.11,0],[.125,0],[.14,0],[.125,0],[.05,0],[.04,0],[.03,0],[.02,0],[1,0]];for(let i$1=1;i$1`,`#include `))}}get color(){return this.uniforms.litFactor.value}set color(value$1){this.uniforms.litFactor.value=value$1}get map(){return this.uniforms.map.value}set map(value$1){this.uniforms.map.value=value$1}get normalMap(){return this.uniforms.normalMap.value}set normalMap(value$1){this.uniforms.normalMap.value=value$1}get normalScale(){return this.uniforms.normalScale.value}set normalScale(value$1){this.uniforms.normalScale.value=value$1}get emissive(){return this.uniforms.emissive.value}set emissive(value$1){this.uniforms.emissive.value=value$1}get emissiveIntensity(){return this.uniforms.emissiveIntensity.value}set emissiveIntensity(value$1){this.uniforms.emissiveIntensity.value=value$1}get emissiveMap(){return this.uniforms.emissiveMap.value}set emissiveMap(value$1){this.uniforms.emissiveMap.value=value$1}get shadeColorFactor(){return this.uniforms.shadeColorFactor.value}set shadeColorFactor(value$1){this.uniforms.shadeColorFactor.value=value$1}get shadeMultiplyTexture(){return this.uniforms.shadeMultiplyTexture.value}set shadeMultiplyTexture(value$1){this.uniforms.shadeMultiplyTexture.value=value$1}get shadingShiftFactor(){return this.uniforms.shadingShiftFactor.value}set shadingShiftFactor(value$1){this.uniforms.shadingShiftFactor.value=value$1}get shadingShiftTexture(){return this.uniforms.shadingShiftTexture.value}set shadingShiftTexture(value$1){this.uniforms.shadingShiftTexture.value=value$1}get shadingShiftTextureScale(){return this.uniforms.shadingShiftTextureScale.value}set shadingShiftTextureScale(value$1){this.uniforms.shadingShiftTextureScale.value=value$1}get shadingToonyFactor(){return this.uniforms.shadingToonyFactor.value}set shadingToonyFactor(value$1){this.uniforms.shadingToonyFactor.value=value$1}get giEqualizationFactor(){return this.uniforms.giEqualizationFactor.value}set giEqualizationFactor(value$1){this.uniforms.giEqualizationFactor.value=value$1}get matcapFactor(){return this.uniforms.matcapFactor.value}set matcapFactor(value$1){this.uniforms.matcapFactor.value=value$1}get matcapTexture(){return this.uniforms.matcapTexture.value}set matcapTexture(value$1){this.uniforms.matcapTexture.value=value$1}get parametricRimColorFactor(){return this.uniforms.parametricRimColorFactor.value}set parametricRimColorFactor(value$1){this.uniforms.parametricRimColorFactor.value=value$1}get rimMultiplyTexture(){return this.uniforms.rimMultiplyTexture.value}set rimMultiplyTexture(value$1){this.uniforms.rimMultiplyTexture.value=value$1}get rimLightingMixFactor(){return this.uniforms.rimLightingMixFactor.value}set rimLightingMixFactor(value$1){this.uniforms.rimLightingMixFactor.value=value$1}get parametricRimFresnelPowerFactor(){return this.uniforms.parametricRimFresnelPowerFactor.value}set parametricRimFresnelPowerFactor(value$1){this.uniforms.parametricRimFresnelPowerFactor.value=value$1}get parametricRimLiftFactor(){return this.uniforms.parametricRimLiftFactor.value}set parametricRimLiftFactor(value$1){this.uniforms.parametricRimLiftFactor.value=value$1}get outlineWidthMultiplyTexture(){return this.uniforms.outlineWidthMultiplyTexture.value}set outlineWidthMultiplyTexture(value$1){this.uniforms.outlineWidthMultiplyTexture.value=value$1}get outlineWidthFactor(){return this.uniforms.outlineWidthFactor.value}set outlineWidthFactor(value$1){this.uniforms.outlineWidthFactor.value=value$1}get outlineColorFactor(){return this.uniforms.outlineColorFactor.value}set outlineColorFactor(value$1){this.uniforms.outlineColorFactor.value=value$1}get outlineLightingMixFactor(){return this.uniforms.outlineLightingMixFactor.value}set outlineLightingMixFactor(value$1){this.uniforms.outlineLightingMixFactor.value=value$1}get uvAnimationMaskTexture(){return this.uniforms.uvAnimationMaskTexture.value}set uvAnimationMaskTexture(value$1){this.uniforms.uvAnimationMaskTexture.value=value$1}get uvAnimationScrollXOffset(){return this.uniforms.uvAnimationScrollXOffset.value}set uvAnimationScrollXOffset(value$1){this.uniforms.uvAnimationScrollXOffset.value=value$1}get uvAnimationScrollYOffset(){return this.uniforms.uvAnimationScrollYOffset.value}set uvAnimationScrollYOffset(value$1){this.uniforms.uvAnimationScrollYOffset.value=value$1}get uvAnimationRotationPhase(){return this.uniforms.uvAnimationRotationPhase.value}set uvAnimationRotationPhase(value$1){this.uniforms.uvAnimationRotationPhase.value=value$1}get ignoreVertexColor(){return this._ignoreVertexColor}set ignoreVertexColor(value$1){this._ignoreVertexColor=value$1,this.needsUpdate=!0}get v0CompatShade(){return this._v0CompatShade}set v0CompatShade(v$2){this._v0CompatShade=v$2,this.needsUpdate=!0}get debugMode(){return this._debugMode}set debugMode(m$3){this._debugMode=m$3,this.needsUpdate=!0}get outlineWidthMode(){return this._outlineWidthMode}set outlineWidthMode(m$3){this._outlineWidthMode=m$3,this.needsUpdate=!0}get isOutline(){return this._isOutline}set isOutline(b$4){this._isOutline=b$4,this.needsUpdate=!0}get isMToonMaterial(){return!0}update(delta){this._uploadUniformsWorkaround(),this._updateUVAnimation(delta)}copy(source){return super.copy(source),this.map=source.map,this.normalMap=source.normalMap,this.emissiveMap=source.emissiveMap,this.shadeMultiplyTexture=source.shadeMultiplyTexture,this.shadingShiftTexture=source.shadingShiftTexture,this.matcapTexture=source.matcapTexture,this.rimMultiplyTexture=source.rimMultiplyTexture,this.outlineWidthMultiplyTexture=source.outlineWidthMultiplyTexture,this.uvAnimationMaskTexture=source.uvAnimationMaskTexture,this.normalMapType=source.normalMapType,this.uvAnimationScrollXSpeedFactor=source.uvAnimationScrollXSpeedFactor,this.uvAnimationScrollYSpeedFactor=source.uvAnimationScrollYSpeedFactor,this.uvAnimationRotationSpeedFactor=source.uvAnimationRotationSpeedFactor,this.ignoreVertexColor=source.ignoreVertexColor,this.v0CompatShade=source.v0CompatShade,this.debugMode=source.debugMode,this.outlineWidthMode=source.outlineWidthMode,this.isOutline=source.isOutline,this.needsUpdate=!0,this}_updateUVAnimation(delta){this.uniforms.uvAnimationScrollXOffset.value+=delta*this.uvAnimationScrollXSpeedFactor,this.uniforms.uvAnimationScrollYOffset.value+=delta*this.uvAnimationScrollYSpeedFactor,this.uniforms.uvAnimationRotationPhase.value+=delta*this.uvAnimationRotationSpeedFactor,this.uniforms.alphaTest.value=this.alphaTest,this.uniformsNeedUpdate=!0}_uploadUniformsWorkaround(){this.uniforms.opacity.value=this.opacity,this._updateTextureMatrix(this.uniforms.map,this.uniforms.mapUvTransform),this._updateTextureMatrix(this.uniforms.normalMap,this.uniforms.normalMapUvTransform),this._updateTextureMatrix(this.uniforms.emissiveMap,this.uniforms.emissiveMapUvTransform),this._updateTextureMatrix(this.uniforms.shadeMultiplyTexture,this.uniforms.shadeMultiplyTextureUvTransform),this._updateTextureMatrix(this.uniforms.shadingShiftTexture,this.uniforms.shadingShiftTextureUvTransform),this._updateTextureMatrix(this.uniforms.matcapTexture,this.uniforms.matcapTextureUvTransform),this._updateTextureMatrix(this.uniforms.rimMultiplyTexture,this.uniforms.rimMultiplyTextureUvTransform),this._updateTextureMatrix(this.uniforms.outlineWidthMultiplyTexture,this.uniforms.outlineWidthMultiplyTextureUvTransform),this._updateTextureMatrix(this.uniforms.uvAnimationMaskTexture,this.uniforms.uvAnimationMaskTextureUvTransform),this.uniformsNeedUpdate=!0}_generateDefines(){let threeRevision=parseInt(REVISION,10),useUvInVert=this.outlineWidthMultiplyTexture!==null,useUvInFrag=this.map!==null||this.normalMap!==null||this.emissiveMap!==null||this.shadeMultiplyTexture!==null||this.shadingShiftTexture!==null||this.rimMultiplyTexture!==null||this.uvAnimationMaskTexture!==null;return{THREE_VRM_THREE_REVISION:threeRevision,OUTLINE:this._isOutline,MTOON_USE_UV:useUvInVert||useUvInFrag,MTOON_UVS_VERTEX_ONLY:useUvInVert&&!useUvInFrag,V0_COMPAT_SHADE:this._v0CompatShade,USE_SHADEMULTIPLYTEXTURE:this.shadeMultiplyTexture!==null,USE_SHADINGSHIFTTEXTURE:this.shadingShiftTexture!==null,USE_MATCAPTEXTURE:this.matcapTexture!==null,USE_RIMMULTIPLYTEXTURE:this.rimMultiplyTexture!==null,USE_OUTLINEWIDTHMULTIPLYTEXTURE:this._isOutline&&this.outlineWidthMultiplyTexture!==null,USE_UVANIMATIONMASKTEXTURE:this.uvAnimationMaskTexture!==null,IGNORE_VERTEX_COLOR:this._ignoreVertexColor===!0,DEBUG_NORMAL:this._debugMode===`normal`,DEBUG_LITSHADERATE:this._debugMode===`litShadeRate`,DEBUG_UV:this._debugMode===`uv`,OUTLINE_WIDTH_SCREEN:this._isOutline&&this._outlineWidthMode===MToonMaterialOutlineWidthMode.ScreenCoordinates}}_updateTextureMatrix(src,dst){src.value&&(src.value.matrixAutoUpdate&&src.value.updateMatrix(),dst.value.copy(src.value.matrix))}},POSSIBLE_SPEC_VERSIONS6=new Set([`1.0`,`1.0-beta`]),_MToonMaterialLoaderPlugin=class _MToonMaterialLoaderPlugin2{get name(){return _MToonMaterialLoaderPlugin2.EXTENSION_NAME}constructor(parser,options$1={}){var _a$3,_b,_c$1,_d$1;this.parser=parser,this.materialType=(_a$3=options$1.materialType)??MToonMaterial,this.renderOrderOffset=(_b=options$1.renderOrderOffset)??0,this.v0CompatShade=(_c$1=options$1.v0CompatShade)??!1,this.debugMode=(_d$1=options$1.debugMode)??`none`,this._mToonMaterialSet=new Set}beforeRoot(){return __async3(this,null,function*(){this._removeUnlitExtensionIfMToonExists()})}afterRoot(gltf){return __async3(this,null,function*(){gltf.userData.vrmMToonMaterials=Array.from(this._mToonMaterialSet)})}getMaterialType(materialIndex){let v1Extension=this._getMToonExtension(materialIndex);return v1Extension?this.materialType:null}extendMaterialParams(materialIndex,materialParams){let extension$1=this._getMToonExtension(materialIndex);return extension$1?this._extendMaterialParams(extension$1,materialParams):null}loadMesh(meshIndex){return __async3(this,null,function*(){var _a$3;let parser=this.parser,json=parser.json,meshDef=(_a$3=json.meshes)?.[meshIndex];if(meshDef==null)throw Error(`MToonMaterialLoaderPlugin: Attempt to use meshes[${meshIndex}] of glTF but the mesh doesn't exist`);let primitivesDef=meshDef.primitives,meshOrGroup=yield parser.loadMesh(meshIndex);if(primitivesDef.length===1){let mesh=meshOrGroup,materialIndex=primitivesDef[0].material;materialIndex!=null&&this._setupPrimitive(mesh,materialIndex)}else{let group=meshOrGroup;for(let i$1=0;i$1{var _a$3;let extension$1=this._getMToonExtension(iMaterial);extension$1&&(_a$3=materialDef.extensions)?.KHR_materials_unlit&&delete materialDef.extensions.KHR_materials_unlit})}_getMToonExtension(materialIndex){var _a$3,_b;let parser=this.parser,json=parser.json,materialDef=(_a$3=json.materials)?.[materialIndex];if(materialDef==null){console.warn(`MToonMaterialLoaderPlugin: Attempt to use materials[${materialIndex}] of glTF but the material doesn't exist`);return}let extension$1=(_b=materialDef.extensions)?.[_MToonMaterialLoaderPlugin2.EXTENSION_NAME];if(extension$1==null)return;let specVersion=extension$1.specVersion;if(!POSSIBLE_SPEC_VERSIONS6.has(specVersion)){console.warn(`MToonMaterialLoaderPlugin: Unknown ${_MToonMaterialLoaderPlugin2.EXTENSION_NAME} specVersion "${specVersion}"`);return}return extension$1}_extendMaterialParams(extension$1,materialParams){return __async3(this,null,function*(){var _a$3;delete materialParams.metalness,delete materialParams.roughness;let assignHelper=new GLTFMToonMaterialParamsAssignHelper(this.parser,materialParams);assignHelper.assignPrimitive(`transparentWithZWrite`,extension$1.transparentWithZWrite),assignHelper.assignColor(`shadeColorFactor`,extension$1.shadeColorFactor),assignHelper.assignTexture(`shadeMultiplyTexture`,extension$1.shadeMultiplyTexture,!0),assignHelper.assignPrimitive(`shadingShiftFactor`,extension$1.shadingShiftFactor),assignHelper.assignTexture(`shadingShiftTexture`,extension$1.shadingShiftTexture,!0),assignHelper.assignPrimitive(`shadingShiftTextureScale`,(_a$3=extension$1.shadingShiftTexture)?.scale),assignHelper.assignPrimitive(`shadingToonyFactor`,extension$1.shadingToonyFactor),assignHelper.assignPrimitive(`giEqualizationFactor`,extension$1.giEqualizationFactor),assignHelper.assignColor(`matcapFactor`,extension$1.matcapFactor),assignHelper.assignTexture(`matcapTexture`,extension$1.matcapTexture,!0),assignHelper.assignColor(`parametricRimColorFactor`,extension$1.parametricRimColorFactor),assignHelper.assignTexture(`rimMultiplyTexture`,extension$1.rimMultiplyTexture,!0),assignHelper.assignPrimitive(`rimLightingMixFactor`,extension$1.rimLightingMixFactor),assignHelper.assignPrimitive(`parametricRimFresnelPowerFactor`,extension$1.parametricRimFresnelPowerFactor),assignHelper.assignPrimitive(`parametricRimLiftFactor`,extension$1.parametricRimLiftFactor),assignHelper.assignPrimitive(`outlineWidthMode`,extension$1.outlineWidthMode),assignHelper.assignPrimitive(`outlineWidthFactor`,extension$1.outlineWidthFactor),assignHelper.assignTexture(`outlineWidthMultiplyTexture`,extension$1.outlineWidthMultiplyTexture,!1),assignHelper.assignColor(`outlineColorFactor`,extension$1.outlineColorFactor),assignHelper.assignPrimitive(`outlineLightingMixFactor`,extension$1.outlineLightingMixFactor),assignHelper.assignTexture(`uvAnimationMaskTexture`,extension$1.uvAnimationMaskTexture,!1),assignHelper.assignPrimitive(`uvAnimationScrollXSpeedFactor`,extension$1.uvAnimationScrollXSpeedFactor),assignHelper.assignPrimitive(`uvAnimationScrollYSpeedFactor`,extension$1.uvAnimationScrollYSpeedFactor),assignHelper.assignPrimitive(`uvAnimationRotationSpeedFactor`,extension$1.uvAnimationRotationSpeedFactor),assignHelper.assignPrimitive(`v0CompatShade`,this.v0CompatShade),assignHelper.assignPrimitive(`debugMode`,this.debugMode),yield assignHelper.pending})}_setupPrimitive(mesh,materialIndex){let extension$1=this._getMToonExtension(materialIndex);if(extension$1){let renderOrder=this._parseRenderOrder(extension$1);mesh.renderOrder=renderOrder+this.renderOrderOffset,this._generateOutline(mesh),this._addToMaterialSet(mesh);return}}_shouldGenerateOutline(surfaceMaterial){return typeof surfaceMaterial.outlineWidthMode==`string`&&surfaceMaterial.outlineWidthMode!==`none`&&typeof surfaceMaterial.outlineWidthFactor==`number`&&surfaceMaterial.outlineWidthFactor>0}_generateOutline(mesh){let surfaceMaterial=mesh.material;if(!(surfaceMaterial instanceof Material)||!this._shouldGenerateOutline(surfaceMaterial))return;mesh.material=[surfaceMaterial];let outlineMaterial=surfaceMaterial.clone();outlineMaterial.name+=` (Outline)`,outlineMaterial.isOutline=!0,outlineMaterial.side=BackSide,mesh.material.push(outlineMaterial);let geometry=mesh.geometry,primitiveVertices=geometry.index?geometry.index.count:geometry.attributes.position.count/3;geometry.addGroup(0,primitiveVertices,0),geometry.addGroup(0,primitiveVertices,1)}_addToMaterialSet(mesh){let materialOrMaterials=mesh.material,materialSet=new Set;Array.isArray(materialOrMaterials)?materialOrMaterials.forEach(material=>materialSet.add(material)):materialSet.add(materialOrMaterials);for(let material of materialSet)this._mToonMaterialSet.add(material)}_parseRenderOrder(extension$1){var _a$3;let enabledZWrite=extension$1.transparentWithZWrite;return(enabledZWrite?0:19)+((_a$3=extension$1.renderQueueOffsetNumber)??0)}};_MToonMaterialLoaderPlugin.EXTENSION_NAME=`VRMC_materials_mtoon`;var MToonMaterialLoaderPlugin=_MToonMaterialLoaderPlugin,__async4=(__this,__arguments,generator)=>new Promise((resolve$1,reject)=>{var fulfilled=value$1=>{try{step(generator.next(value$1))}catch(e$3){reject(e$3)}},rejected=value$1=>{try{step(generator.throw(value$1))}catch(e$3){reject(e$3)}},step=x$3=>x$3.done?resolve$1(x$3.value):Promise.resolve(x$3.value).then(fulfilled,rejected);step((generator=generator.apply(__this,__arguments)).next())}),_VRMMaterialsHDREmissiveMultiplierLoaderPlugin=class _VRMMaterialsHDREmissiveMultiplierLoaderPlugin2{get name(){return _VRMMaterialsHDREmissiveMultiplierLoaderPlugin2.EXTENSION_NAME}constructor(parser){this.parser=parser}extendMaterialParams(materialIndex,materialParams){return __async4(this,null,function*(){let extension$1=this._getHDREmissiveMultiplierExtension(materialIndex);if(extension$1==null)return;console.warn("VRMMaterialsHDREmissiveMultiplierLoaderPlugin: `VRMC_materials_hdr_emissiveMultiplier` is archived. Use `KHR_materials_emissive_strength` instead.");let emissiveMultiplier=extension$1.emissiveMultiplier;materialParams.emissiveIntensity=emissiveMultiplier})}_getHDREmissiveMultiplierExtension(materialIndex){var _a$3,_b;let parser=this.parser,json=parser.json,materialDef=(_a$3=json.materials)?.[materialIndex];if(materialDef==null){console.warn(`VRMMaterialsHDREmissiveMultiplierLoaderPlugin: Attempt to use materials[${materialIndex}] of glTF but the material doesn't exist`);return}let extension$1=(_b=materialDef.extensions)?.[_VRMMaterialsHDREmissiveMultiplierLoaderPlugin2.EXTENSION_NAME];if(extension$1!=null)return extension$1}};_VRMMaterialsHDREmissiveMultiplierLoaderPlugin.EXTENSION_NAME=`VRMC_materials_hdr_emissiveMultiplier`;var VRMMaterialsHDREmissiveMultiplierLoaderPlugin=_VRMMaterialsHDREmissiveMultiplierLoaderPlugin,__defProp2=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols2=Object.getOwnPropertySymbols,__hasOwnProp2=Object.prototype.hasOwnProperty,__propIsEnum2=Object.prototype.propertyIsEnumerable,__defNormalProp2=(obj,key$2,value$1)=>key$2 in obj?__defProp2(obj,key$2,{enumerable:!0,configurable:!0,writable:!0,value:value$1}):obj[key$2]=value$1,__spreadValues2=(a$2,b$4)=>{for(var prop in b$4||={})__hasOwnProp2.call(b$4,prop)&&__defNormalProp2(a$2,prop,b$4[prop]);if(__getOwnPropSymbols2)for(var prop of __getOwnPropSymbols2(b$4))__propIsEnum2.call(b$4,prop)&&__defNormalProp2(a$2,prop,b$4[prop]);return a$2},__spreadProps=(a$2,b$4)=>__defProps(a$2,__getOwnPropDescs(b$4)),__async5=(__this,__arguments,generator)=>new Promise((resolve$1,reject)=>{var fulfilled=value$1=>{try{step(generator.next(value$1))}catch(e$3){reject(e$3)}},rejected=value$1=>{try{step(generator.throw(value$1))}catch(e$3){reject(e$3)}},step=x$3=>x$3.done?resolve$1(x$3.value):Promise.resolve(x$3.value).then(fulfilled,rejected);step((generator=generator.apply(__this,__arguments)).next())});function gammaEOTF(e$3){return e$3**2.2}var VRMMaterialsV0CompatPlugin=class{get name(){return`VRMMaterialsV0CompatPlugin`}constructor(parser){var _a$3;this.parser=parser,this._renderQueueMapTransparent=new Map,this._renderQueueMapTransparentZWrite=new Map;let json=this.parser.json;json.extensionsUsed=(_a$3=json.extensionsUsed)??[],json.extensionsUsed.indexOf(`KHR_texture_transform`)===-1&&json.extensionsUsed.push(`KHR_texture_transform`)}beforeRoot(){return __async5(this,null,function*(){var _a$3;let json=this.parser.json,v0VRMExtension=(_a$3=json.extensions)?.VRM,v0MaterialProperties=v0VRMExtension?.materialProperties;v0MaterialProperties&&(this._populateRenderQueueMap(v0MaterialProperties),v0MaterialProperties.forEach((materialProperties,materialIndex)=>{var _a2,_b;let materialDef=(_a2=json.materials)?.[materialIndex];if(materialDef==null){console.warn(`VRMMaterialsV0CompatPlugin: Attempt to use materials[${materialIndex}] of glTF but the material doesn't exist`);return}if(materialProperties.shader===`VRM/MToon`){let material=this._parseV0MToonProperties(materialProperties,materialDef);json.materials[materialIndex]=material}else if((_b=materialProperties.shader)?.startsWith(`VRM/Unlit`)){let material=this._parseV0UnlitProperties(materialProperties,materialDef);json.materials[materialIndex]=material}else materialProperties.shader===`VRM_USE_GLTFSHADER`||console.warn(`VRMMaterialsV0CompatPlugin: Unknown shader: ${materialProperties.shader}`)}))})}_parseV0MToonProperties(materialProperties,schemaMaterial){var _a$3,_b,_c$1,_d$1,_e$2,_f$1,_g$1,_h$1,_i$2,_j,_k,_l,_m$1,_n$2,_o$1,_p$1,_q,_r$1,_s$1,_t$4,_u,_v,_w,_x$1,_y$2,_z$1,_A,_B,_C,_D,_E,_F,_G,_H,_I,_J,_K,_L,_M,_N,_O,_P,_Q,_R,_S,_T,_U,_V,_W,_X,_Y,_Z,__,_$,_aa;let isTransparent=(_b=(_a$3=materialProperties.keywordMap)?._ALPHABLEND_ON)??!1,enabledZWrite=(_c$1=materialProperties.floatProperties)?._ZWrite===1,transparentWithZWrite=enabledZWrite&&isTransparent,renderQueueOffsetNumber=this._v0ParseRenderQueue(materialProperties),isCutoff=(_e$2=(_d$1=materialProperties.keywordMap)?._ALPHATEST_ON)??!1,alphaMode=isTransparent?`BLEND`:isCutoff?`MASK`:`OPAQUE`,alphaCutoff=isCutoff?(_g$1=(_f$1=materialProperties.floatProperties)?._Cutoff)??.5:void 0,cullMode=(_i$2=(_h$1=materialProperties.floatProperties)?._CullMode)??2,doubleSided=cullMode===0,textureTransformExt=this._portTextureTransform(materialProperties),baseColorFactor=((_k=(_j=materialProperties.vectorProperties)?._Color)??[1,1,1,1]).map((v$2,i$1)=>i$1===3?v$2:gammaEOTF(v$2)),baseColorTextureIndex=(_l=materialProperties.textureProperties)?._MainTex,baseColorTexture=baseColorTextureIndex==null?void 0:{index:baseColorTextureIndex,extensions:__spreadValues2({},textureTransformExt)},normalTextureScale=(_n$2=(_m$1=materialProperties.floatProperties)?._BumpScale)??1,normalTextureIndex=(_o$1=materialProperties.textureProperties)?._BumpMap,normalTexture=normalTextureIndex==null?void 0:{index:normalTextureIndex,scale:normalTextureScale,extensions:__spreadValues2({},textureTransformExt)},emissiveFactor=((_q=(_p$1=materialProperties.vectorProperties)?._EmissionColor)??[0,0,0,1]).map(gammaEOTF),emissiveTextureIndex=(_r$1=materialProperties.textureProperties)?._EmissionMap,emissiveTexture=emissiveTextureIndex==null?void 0:{index:emissiveTextureIndex,extensions:__spreadValues2({},textureTransformExt)},shadeColorFactor=((_t$4=(_s$1=materialProperties.vectorProperties)?._ShadeColor)??[.97,.81,.86,1]).map(gammaEOTF),shadeMultiplyTextureIndex=(_u=materialProperties.textureProperties)?._ShadeTexture,shadeMultiplyTexture=shadeMultiplyTextureIndex==null?void 0:{index:shadeMultiplyTextureIndex,extensions:__spreadValues2({},textureTransformExt)},shadingShiftFactor=(_w=(_v=materialProperties.floatProperties)?._ShadeShift)??0,shadingToonyFactor=(_y$2=(_x$1=materialProperties.floatProperties)?._ShadeToony)??.9;shadingToonyFactor=MathUtils.lerp(shadingToonyFactor,1,.5+.5*shadingShiftFactor),shadingShiftFactor=-shadingShiftFactor-(1-shadingToonyFactor);let giIntensityFactor=(_A=(_z$1=materialProperties.floatProperties)?._IndirectLightIntensity)??.1,giEqualizationFactor=giIntensityFactor?1-giIntensityFactor:void 0,matcapTextureIndex=(_B=materialProperties.textureProperties)?._SphereAdd,matcapFactor=matcapTextureIndex==null?void 0:[1,1,1],matcapTexture=matcapTextureIndex==null?void 0:{index:matcapTextureIndex},rimLightingMixFactor=(_D=(_C=materialProperties.floatProperties)?._RimLightingMix)??0,rimMultiplyTextureIndex=(_E=materialProperties.textureProperties)?._RimTexture,rimMultiplyTexture=rimMultiplyTextureIndex==null?void 0:{index:rimMultiplyTextureIndex,extensions:__spreadValues2({},textureTransformExt)},parametricRimColorFactor=((_G=(_F=materialProperties.vectorProperties)?._RimColor)??[0,0,0,1]).map(gammaEOTF),parametricRimFresnelPowerFactor=(_I=(_H=materialProperties.floatProperties)?._RimFresnelPower)??1,parametricRimLiftFactor=(_K=(_J=materialProperties.floatProperties)?._RimLift)??0,outlineWidthMode=[`none`,`worldCoordinates`,`screenCoordinates`][(_M=(_L=materialProperties.floatProperties)?._OutlineWidthMode)??0],outlineWidthFactor=(_O=(_N=materialProperties.floatProperties)?._OutlineWidth)??0;outlineWidthFactor=.01*outlineWidthFactor;let outlineWidthMultiplyTextureIndex=(_P=materialProperties.textureProperties)?._OutlineWidthTexture,outlineWidthMultiplyTexture=outlineWidthMultiplyTextureIndex==null?void 0:{index:outlineWidthMultiplyTextureIndex,extensions:__spreadValues2({},textureTransformExt)},outlineColorFactor=((_R=(_Q=materialProperties.vectorProperties)?._OutlineColor)??[0,0,0]).map(gammaEOTF),outlineColorMode=(_T=(_S=materialProperties.floatProperties)?._OutlineColorMode)??0,outlineLightingMixFactor=outlineColorMode===1?(_V=(_U=materialProperties.floatProperties)?._OutlineLightingMix)??1:0,uvAnimationMaskTextureIndex=(_W=materialProperties.textureProperties)?._UvAnimMaskTexture,uvAnimationMaskTexture=uvAnimationMaskTextureIndex==null?void 0:{index:uvAnimationMaskTextureIndex,extensions:__spreadValues2({},textureTransformExt)},uvAnimationScrollXSpeedFactor=(_Y=(_X=materialProperties.floatProperties)?._UvAnimScrollX)??0,uvAnimationScrollYSpeedFactor=(__=(_Z=materialProperties.floatProperties)?._UvAnimScrollY)??0;uvAnimationScrollYSpeedFactor!=null&&(uvAnimationScrollYSpeedFactor=-uvAnimationScrollYSpeedFactor);let uvAnimationRotationSpeedFactor=(_aa=(_$=materialProperties.floatProperties)?._UvAnimRotation)??0,mtoonExtension={specVersion:`1.0`,transparentWithZWrite,renderQueueOffsetNumber,shadeColorFactor,shadeMultiplyTexture,shadingShiftFactor,shadingToonyFactor,giEqualizationFactor,matcapFactor,matcapTexture,rimLightingMixFactor,rimMultiplyTexture,parametricRimColorFactor,parametricRimFresnelPowerFactor,parametricRimLiftFactor,outlineWidthMode,outlineWidthFactor,outlineWidthMultiplyTexture,outlineColorFactor,outlineLightingMixFactor,uvAnimationMaskTexture,uvAnimationScrollXSpeedFactor,uvAnimationScrollYSpeedFactor,uvAnimationRotationSpeedFactor};return __spreadProps(__spreadValues2({},schemaMaterial),{pbrMetallicRoughness:{baseColorFactor,baseColorTexture},normalTexture,emissiveTexture,emissiveFactor,alphaMode,alphaCutoff,doubleSided,extensions:{VRMC_materials_mtoon:mtoonExtension}})}_parseV0UnlitProperties(materialProperties,schemaMaterial){var _a$3,_b,_c$1,_d$1,_e$2;let isTransparentZWrite=materialProperties.shader===`VRM/UnlitTransparentZWrite`,isTransparent=materialProperties.shader===`VRM/UnlitTransparent`||isTransparentZWrite,renderQueueOffsetNumber=this._v0ParseRenderQueue(materialProperties),isCutoff=materialProperties.shader===`VRM/UnlitCutout`,alphaMode=isTransparent?`BLEND`:isCutoff?`MASK`:`OPAQUE`,alphaCutoff=isCutoff?(_b=(_a$3=materialProperties.floatProperties)?._Cutoff)??.5:void 0,textureTransformExt=this._portTextureTransform(materialProperties),baseColorFactor=((_d$1=(_c$1=materialProperties.vectorProperties)?._Color)??[1,1,1,1]).map(gammaEOTF),baseColorTextureIndex=(_e$2=materialProperties.textureProperties)?._MainTex,baseColorTexture=baseColorTextureIndex==null?void 0:{index:baseColorTextureIndex,extensions:__spreadValues2({},textureTransformExt)},mtoonExtension={specVersion:`1.0`,transparentWithZWrite:isTransparentZWrite,renderQueueOffsetNumber,shadeColorFactor:baseColorFactor,shadeMultiplyTexture:baseColorTexture};return __spreadProps(__spreadValues2({},schemaMaterial),{pbrMetallicRoughness:{baseColorFactor,baseColorTexture},alphaMode,alphaCutoff,extensions:{VRMC_materials_mtoon:mtoonExtension}})}_portTextureTransform(materialProperties){var _a$3,_b,_c$1,_d$1,_e$2;let textureTransform=(_a$3=materialProperties.vectorProperties)?._MainTex;if(textureTransform==null)return{};let offset$2=[(_b=textureTransform?.[0])??0,(_c$1=textureTransform?.[1])??0],scale$1=[(_d$1=textureTransform?.[2])??1,(_e$2=textureTransform?.[3])??1];return offset$2[1]=1-scale$1[1]-offset$2[1],{KHR_texture_transform:{offset:offset$2,scale:scale$1}}}_v0ParseRenderQueue(materialProperties){var _a$3,_b;let isTransparentZWrite=materialProperties.shader===`VRM/UnlitTransparentZWrite`,isTransparent=(_a$3=materialProperties.keywordMap)?._ALPHABLEND_ON!=null||materialProperties.shader===`VRM/UnlitTransparent`||isTransparentZWrite,enabledZWrite=(_b=materialProperties.floatProperties)?._ZWrite===1||isTransparentZWrite,offset$2=0;if(isTransparent){let v0Queue=materialProperties.renderQueue;v0Queue!=null&&(offset$2=enabledZWrite?this._renderQueueMapTransparentZWrite.get(v0Queue):this._renderQueueMapTransparent.get(v0Queue))}return offset$2}_populateRenderQueueMap(materialPropertiesList){let renderQueuesTransparent=new Set,renderQueuesTransparentZWrite=new Set;materialPropertiesList.forEach(materialProperties=>{var _a$3,_b;let isTransparentZWrite=materialProperties.shader===`VRM/UnlitTransparentZWrite`,isTransparent=(_a$3=materialProperties.keywordMap)?._ALPHABLEND_ON!=null||materialProperties.shader===`VRM/UnlitTransparent`||isTransparentZWrite,enabledZWrite=(_b=materialProperties.floatProperties)?._ZWrite===1||isTransparentZWrite;if(isTransparent){let v0Queue=materialProperties.renderQueue;v0Queue!=null&&(enabledZWrite?renderQueuesTransparentZWrite.add(v0Queue):renderQueuesTransparent.add(v0Queue))}}),renderQueuesTransparent.size>10&&console.warn(`VRMMaterialsV0CompatPlugin: This VRM uses ${renderQueuesTransparent.size} render queues for Transparent materials while VRM 1.0 only supports up to 10 render queues. The model might not be rendered correctly.`),renderQueuesTransparentZWrite.size>10&&console.warn(`VRMMaterialsV0CompatPlugin: This VRM uses ${renderQueuesTransparentZWrite.size} render queues for TransparentZWrite materials while VRM 1.0 only supports up to 10 render queues. The model might not be rendered correctly.`),Array.from(renderQueuesTransparent).sort().forEach((queue$1,i$1)=>{let newQueueOffset=Math.min(Math.max(i$1-renderQueuesTransparent.size+1,-9),0);this._renderQueueMapTransparent.set(queue$1,newQueueOffset)}),Array.from(renderQueuesTransparentZWrite).sort().forEach((queue$1,i$1)=>{let newQueueOffset=Math.min(Math.max(i$1,0),9);this._renderQueueMapTransparentZWrite.set(queue$1,newQueueOffset)})}},__async6=(__this,__arguments,generator)=>new Promise((resolve$1,reject)=>{var fulfilled=value$1=>{try{step(generator.next(value$1))}catch(e$3){reject(e$3)}},rejected=value$1=>{try{step(generator.throw(value$1))}catch(e$3){reject(e$3)}},step=x$3=>x$3.done?resolve$1(x$3.value):Promise.resolve(x$3.value).then(fulfilled,rejected);step((generator=generator.apply(__this,__arguments)).next())}),_v3A6=new Vector3,VRMNodeConstraintHelper=class extends Group{constructor(constraint){super(),this._attrPosition=new BufferAttribute(new Float32Array([0,0,0,0,0,0]),3),this._attrPosition.setUsage(DynamicDrawUsage);let geometry=new BufferGeometry;geometry.setAttribute(`position`,this._attrPosition);let material=new LineBasicMaterial({color:16711935,depthTest:!1,depthWrite:!1});this._line=new Line(geometry,material),this.add(this._line),this.constraint=constraint}updateMatrixWorld(force){_v3A6.setFromMatrixPosition(this.constraint.destination.matrixWorld),this._attrPosition.setXYZ(0,_v3A6.x,_v3A6.y,_v3A6.z),this.constraint.source&&_v3A6.setFromMatrixPosition(this.constraint.source.matrixWorld),this._attrPosition.setXYZ(1,_v3A6.x,_v3A6.y,_v3A6.z),this._attrPosition.needsUpdate=!0,super.updateMatrixWorld(force)}};function decomposePosition(matrix,target$1){return target$1.set(matrix.elements[12],matrix.elements[13],matrix.elements[14])}var _v3A22=new Vector3,_v3B4=new Vector3;function decomposeRotation(matrix,target$1){return matrix.decompose(_v3A22,target$1,_v3B4),target$1}function quatInvertCompat2(target$1){return target$1.invert?target$1.invert():target$1.inverse(),target$1}var VRMNodeConstraint=class{constructor(destination,source){this.destination=destination,this.source=source,this.weight=1}},_v3A32=new Vector3,_v3B22=new Vector3,_v3C2=new Vector3,_quatA7=new Quaternion,_quatB4=new Quaternion,_quatC2=new Quaternion,VRMAimConstraint=class extends VRMNodeConstraint{get aimAxis(){return this._aimAxis}set aimAxis(aimAxis){this._aimAxis=aimAxis,this._v3AimAxis.set(aimAxis===`PositiveX`?1:aimAxis===`NegativeX`?-1:0,aimAxis===`PositiveY`?1:aimAxis===`NegativeY`?-1:0,aimAxis===`PositiveZ`?1:aimAxis===`NegativeZ`?-1:0)}get dependencies(){let set=new Set([this.source]);return this.destination.parent&&set.add(this.destination.parent),set}constructor(destination,source){super(destination,source),this._aimAxis=`PositiveX`,this._v3AimAxis=new Vector3(1,0,0),this._dstRestQuat=new Quaternion}setInitState(){this._dstRestQuat.copy(this.destination.quaternion)}update(){this.destination.updateWorldMatrix(!0,!1),this.source.updateWorldMatrix(!0,!1);let dstParentWorldQuat=_quatA7.identity(),invDstParentWorldQuat=_quatB4.identity();this.destination.parent&&(decomposeRotation(this.destination.parent.matrixWorld,dstParentWorldQuat),quatInvertCompat2(invDstParentWorldQuat.copy(dstParentWorldQuat)));let a0=_v3A32.copy(this._v3AimAxis).applyQuaternion(this._dstRestQuat).applyQuaternion(dstParentWorldQuat),a1=decomposePosition(this.source.matrixWorld,_v3B22).sub(decomposePosition(this.destination.matrixWorld,_v3C2)).normalize(),targetQuat=_quatC2.setFromUnitVectors(a0,a1).premultiply(invDstParentWorldQuat).multiply(dstParentWorldQuat).multiply(this._dstRestQuat);this.destination.quaternion.copy(this._dstRestQuat).slerp(targetQuat,this.weight)}};function traverseAncestorsFromRoot(object,callback){let ancestors=[object],head$1=object.parent;for(;head$1!==null;)ancestors.unshift(head$1),head$1=head$1.parent;ancestors.forEach(ancestor=>{callback(ancestor)})}var VRMNodeConstraintManager=class{constructor(){this._constraints=new Set,this._objectConstraintsMap=new Map}get constraints(){return this._constraints}addConstraint(constraint){this._constraints.add(constraint);let objectSet=this._objectConstraintsMap.get(constraint.destination);objectSet??(objectSet=new Set,this._objectConstraintsMap.set(constraint.destination,objectSet)),objectSet.add(constraint)}deleteConstraint(constraint){this._constraints.delete(constraint);let objectSet=this._objectConstraintsMap.get(constraint.destination);objectSet.delete(constraint)}setInitState(){let constraintsTried=new Set,constraintsDone=new Set;for(let constraint of this._constraints)this._processConstraint(constraint,constraintsTried,constraintsDone,constraint2=>constraint2.setInitState())}update(){let constraintsTried=new Set,constraintsDone=new Set;for(let constraint of this._constraints)this._processConstraint(constraint,constraintsTried,constraintsDone,constraint2=>constraint2.update())}_processConstraint(constraint,constraintsTried,constraintsDone,callback){if(constraintsDone.has(constraint))return;if(constraintsTried.has(constraint))throw Error(`VRMNodeConstraintManager: Circular dependency detected while updating constraints`);constraintsTried.add(constraint);let depObjects=constraint.dependencies;for(let depObject of depObjects)traverseAncestorsFromRoot(depObject,depObjectAncestor=>{let objectSet=this._objectConstraintsMap.get(depObjectAncestor);if(objectSet)for(let depConstraint of objectSet)this._processConstraint(depConstraint,constraintsTried,constraintsDone,callback)});callback(constraint),constraintsDone.add(constraint)}},_quatA22=new Quaternion,_quatB22=new Quaternion,VRMRotationConstraint=class extends VRMNodeConstraint{get dependencies(){return new Set([this.source])}constructor(destination,source){super(destination,source),this._dstRestQuat=new Quaternion,this._invSrcRestQuat=new Quaternion}setInitState(){this._dstRestQuat.copy(this.destination.quaternion),quatInvertCompat2(this._invSrcRestQuat.copy(this.source.quaternion))}update(){let srcDeltaQuat=_quatA22.copy(this._invSrcRestQuat).multiply(this.source.quaternion),targetQuat=_quatB22.copy(this._dstRestQuat).multiply(srcDeltaQuat);this.destination.quaternion.copy(this._dstRestQuat).slerp(targetQuat,this.weight)}},_v3A42=new Vector3,_quatA32=new Quaternion,_quatB32=new Quaternion,VRMRollConstraint=class extends VRMNodeConstraint{get rollAxis(){return this._rollAxis}set rollAxis(rollAxis){this._rollAxis=rollAxis,this._v3RollAxis.set(rollAxis===`X`?1:0,rollAxis===`Y`?1:0,rollAxis===`Z`?1:0)}get dependencies(){return new Set([this.source])}constructor(destination,source){super(destination,source),this._rollAxis=`X`,this._v3RollAxis=new Vector3(1,0,0),this._dstRestQuat=new Quaternion,this._invDstRestQuat=new Quaternion,this._invSrcRestQuatMulDstRestQuat=new Quaternion}setInitState(){this._dstRestQuat.copy(this.destination.quaternion),quatInvertCompat2(this._invDstRestQuat.copy(this._dstRestQuat)),quatInvertCompat2(this._invSrcRestQuatMulDstRestQuat.copy(this.source.quaternion)).multiply(this._dstRestQuat)}update(){let quatDelta=_quatA32.copy(this._invDstRestQuat).multiply(this.source.quaternion).multiply(this._invSrcRestQuatMulDstRestQuat),n1=_v3A42.copy(this._v3RollAxis).applyQuaternion(quatDelta),quatFromTo=_quatB32.setFromUnitVectors(n1,this._v3RollAxis),targetQuat=quatFromTo.premultiply(this._dstRestQuat).multiply(quatDelta);this.destination.quaternion.copy(this._dstRestQuat).slerp(targetQuat,this.weight)}},POSSIBLE_SPEC_VERSIONS7=new Set([`1.0`,`1.0-beta`]),_VRMNodeConstraintLoaderPlugin=class _VRMNodeConstraintLoaderPlugin2{get name(){return _VRMNodeConstraintLoaderPlugin2.EXTENSION_NAME}constructor(parser,options$1){this.parser=parser,this.helperRoot=options$1?.helperRoot}afterRoot(gltf){return __async6(this,null,function*(){gltf.userData.vrmNodeConstraintManager=yield this._import(gltf)})}_import(gltf){return __async6(this,null,function*(){var _a$3;let json=this.parser.json,isConstraintsUsed=(_a$3=json.extensionsUsed)?.indexOf(_VRMNodeConstraintLoaderPlugin2.EXTENSION_NAME)!==-1;if(!isConstraintsUsed)return null;let manager=new VRMNodeConstraintManager,threeNodes=yield this.parser.getDependencies(`node`);return threeNodes.forEach((node$1,nodeIndex)=>{var _a2;let schemaNode=json.nodes[nodeIndex],extension$1=(_a2=schemaNode?.extensions)?.[_VRMNodeConstraintLoaderPlugin2.EXTENSION_NAME];if(extension$1==null)return;let specVersion=extension$1.specVersion;if(!POSSIBLE_SPEC_VERSIONS7.has(specVersion)){console.warn(`VRMNodeConstraintLoaderPlugin: Unknown ${_VRMNodeConstraintLoaderPlugin2.EXTENSION_NAME} specVersion "${specVersion}"`);return}let constraintDef=extension$1.constraint;if(constraintDef.roll!=null){let constraint=this._importRollConstraint(node$1,threeNodes,constraintDef.roll);manager.addConstraint(constraint)}else if(constraintDef.aim!=null){let constraint=this._importAimConstraint(node$1,threeNodes,constraintDef.aim);manager.addConstraint(constraint)}else if(constraintDef.rotation!=null){let constraint=this._importRotationConstraint(node$1,threeNodes,constraintDef.rotation);manager.addConstraint(constraint)}}),gltf.scene.updateMatrixWorld(),manager.setInitState(),manager})}_importRollConstraint(destination,nodes,rollConstraintDef){let{source:sourceIndex,rollAxis,weight}=rollConstraintDef,source=nodes[sourceIndex],constraint=new VRMRollConstraint(destination,source);if(rollAxis!=null&&(constraint.rollAxis=rollAxis),weight!=null&&(constraint.weight=weight),this.helperRoot){let helper=new VRMNodeConstraintHelper(constraint);this.helperRoot.add(helper)}return constraint}_importAimConstraint(destination,nodes,aimConstraintDef){let{source:sourceIndex,aimAxis,weight}=aimConstraintDef,source=nodes[sourceIndex],constraint=new VRMAimConstraint(destination,source);if(aimAxis!=null&&(constraint.aimAxis=aimAxis),weight!=null&&(constraint.weight=weight),this.helperRoot){let helper=new VRMNodeConstraintHelper(constraint);this.helperRoot.add(helper)}return constraint}_importRotationConstraint(destination,nodes,rotationConstraintDef){let{source:sourceIndex,weight}=rotationConstraintDef,source=nodes[sourceIndex],constraint=new VRMRotationConstraint(destination,source);if(weight!=null&&(constraint.weight=weight),this.helperRoot){let helper=new VRMNodeConstraintHelper(constraint);this.helperRoot.add(helper)}return constraint}};_VRMNodeConstraintLoaderPlugin.EXTENSION_NAME=`VRMC_node_constraint`;var VRMNodeConstraintLoaderPlugin=_VRMNodeConstraintLoaderPlugin,__async7=(__this,__arguments,generator)=>new Promise((resolve$1,reject)=>{var fulfilled=value$1=>{try{step(generator.next(value$1))}catch(e$3){reject(e$3)}},rejected=value$1=>{try{step(generator.throw(value$1))}catch(e$3){reject(e$3)}},step=x$3=>x$3.done?resolve$1(x$3.value):Promise.resolve(x$3.value).then(fulfilled,rejected);step((generator=generator.apply(__this,__arguments)).next())}),VRMSpringBoneColliderShape=class{},_v3A7=new Vector3,_v3B5=new Vector3,VRMSpringBoneColliderShapeCapsule=class extends VRMSpringBoneColliderShape{get type(){return`capsule`}constructor(params){var _a$3,_b,_c$1,_d$1;super(),this.offset=(_a$3=params?.offset)??new Vector3(0,0,0),this.tail=(_b=params?.tail)??new Vector3(0,0,0),this.radius=(_c$1=params?.radius)??0,this.inside=(_d$1=params?.inside)??!1}calculateCollision(colliderMatrix,objectPosition,objectRadius,target$1){_v3A7.setFromMatrixPosition(colliderMatrix),_v3B5.subVectors(this.tail,this.offset).applyMatrix4(colliderMatrix),_v3B5.sub(_v3A7);let lengthSqCapsule=_v3B5.lengthSq();target$1.copy(objectPosition).sub(_v3A7);let dot=_v3B5.dot(target$1);dot<=0||(lengthSqCapsule<=dot||_v3B5.multiplyScalar(dot/lengthSqCapsule),target$1.sub(_v3B5));let length=target$1.length(),distance=this.inside?this.radius-objectRadius-length:length-objectRadius-this.radius;return distance<0&&(target$1.multiplyScalar(1/length),this.inside&&target$1.negate()),distance}},_v3A23=new Vector3,_mat3A=new Matrix3,VRMSpringBoneColliderShapePlane=class extends VRMSpringBoneColliderShape{get type(){return`plane`}constructor(params){var _a$3,_b;super(),this.offset=(_a$3=params?.offset)??new Vector3(0,0,0),this.normal=(_b=params?.normal)??new Vector3(0,0,1)}calculateCollision(colliderMatrix,objectPosition,objectRadius,target$1){target$1.setFromMatrixPosition(colliderMatrix),target$1.negate().add(objectPosition),_mat3A.getNormalMatrix(colliderMatrix),_v3A23.copy(this.normal).applyNormalMatrix(_mat3A).normalize();let distance=target$1.dot(_v3A23)-objectRadius;return target$1.copy(_v3A23),distance}},_v3A33=new Vector3,VRMSpringBoneColliderShapeSphere=class extends VRMSpringBoneColliderShape{get type(){return`sphere`}constructor(params){var _a$3,_b,_c$1;super(),this.offset=(_a$3=params?.offset)??new Vector3(0,0,0),this.radius=(_b=params?.radius)??0,this.inside=(_c$1=params?.inside)??!1}calculateCollision(colliderMatrix,objectPosition,objectRadius,target$1){target$1.subVectors(objectPosition,_v3A33.setFromMatrixPosition(colliderMatrix));let length=target$1.length(),distance=this.inside?this.radius-objectRadius-length:length-objectRadius-this.radius;return distance<0&&(target$1.multiplyScalar(1/length),this.inside&&target$1.negate()),distance}},_v3A43=new Vector3,ColliderShapeCapsuleBufferGeometry=class extends BufferGeometry{constructor(shape){super(),this.worldScale=1,this._currentRadius=0,this._currentOffset=new Vector3,this._currentTail=new Vector3,this._shape=shape,this._attrPos=new BufferAttribute(new Float32Array(396),3),this.setAttribute(`position`,this._attrPos),this._attrIndex=new BufferAttribute(new Uint16Array(264),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let shouldUpdateGeometry=!1,radius=this._shape.radius/this.worldScale;this._currentRadius!==radius&&(this._currentRadius=radius,shouldUpdateGeometry=!0),this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),shouldUpdateGeometry=!0);let tail=_v3A43.copy(this._shape.tail).divideScalar(this.worldScale);this._currentTail.distanceToSquared(tail)>1e-10&&(this._currentTail.copy(tail),shouldUpdateGeometry=!0),shouldUpdateGeometry&&this._buildPosition()}_buildPosition(){_v3A43.copy(this._currentTail).sub(this._currentOffset);let l$1=_v3A43.length()/this._currentRadius;for(let i$1=0;i$1<=16;i$1++){let t=i$1/16*Math.PI;this._attrPos.setXYZ(i$1,-Math.sin(t),-Math.cos(t),0),this._attrPos.setXYZ(17+i$1,l$1+Math.sin(t),Math.cos(t),0),this._attrPos.setXYZ(34+i$1,-Math.sin(t),0,-Math.cos(t)),this._attrPos.setXYZ(51+i$1,l$1+Math.sin(t),0,Math.cos(t))}for(let i$1=0;i$1<32;i$1++){let t=i$1/16*Math.PI;this._attrPos.setXYZ(68+i$1,0,Math.sin(t),Math.cos(t)),this._attrPos.setXYZ(100+i$1,l$1,Math.sin(t),Math.cos(t))}let theta=Math.atan2(_v3A43.y,Math.sqrt(_v3A43.x*_v3A43.x+_v3A43.z*_v3A43.z)),phi=-Math.atan2(_v3A43.z,_v3A43.x);this.rotateZ(theta),this.rotateY(phi),this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let i$1=0;i$1<34;i$1++){let i1=(i$1+1)%34;this._attrIndex.setXY(i$1*2,i$1,i1),this._attrIndex.setXY(68+i$1*2,34+i$1,34+i1)}for(let i$1=0;i$1<32;i$1++){let i1=(i$1+1)%32;this._attrIndex.setXY(136+i$1*2,68+i$1,68+i1),this._attrIndex.setXY(200+i$1*2,100+i$1,100+i1)}this._attrIndex.needsUpdate=!0}},ColliderShapePlaneBufferGeometry=class extends BufferGeometry{constructor(shape){super(),this.worldScale=1,this._currentOffset=new Vector3,this._currentNormal=new Vector3,this._shape=shape,this._attrPos=new BufferAttribute(new Float32Array(6*3),3),this.setAttribute(`position`,this._attrPos),this._attrIndex=new BufferAttribute(new Uint16Array(10),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let shouldUpdateGeometry=!1;this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),shouldUpdateGeometry=!0),this._currentNormal.equals(this._shape.normal)||(this._currentNormal.copy(this._shape.normal),shouldUpdateGeometry=!0),shouldUpdateGeometry&&this._buildPosition()}_buildPosition(){this._attrPos.setXYZ(0,-.5,-.5,0),this._attrPos.setXYZ(1,.5,-.5,0),this._attrPos.setXYZ(2,.5,.5,0),this._attrPos.setXYZ(3,-.5,.5,0),this._attrPos.setXYZ(4,0,0,0),this._attrPos.setXYZ(5,0,0,.25),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this.lookAt(this._currentNormal),this._attrPos.needsUpdate=!0}_buildIndex(){this._attrIndex.setXY(0,0,1),this._attrIndex.setXY(2,1,2),this._attrIndex.setXY(4,2,3),this._attrIndex.setXY(6,3,0),this._attrIndex.setXY(8,4,5),this._attrIndex.needsUpdate=!0}},ColliderShapeSphereBufferGeometry=class extends BufferGeometry{constructor(shape){super(),this.worldScale=1,this._currentRadius=0,this._currentOffset=new Vector3,this._shape=shape,this._attrPos=new BufferAttribute(new Float32Array(32*3*3),3),this.setAttribute(`position`,this._attrPos),this._attrIndex=new BufferAttribute(new Uint16Array(64*3),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let shouldUpdateGeometry=!1,radius=this._shape.radius/this.worldScale;this._currentRadius!==radius&&(this._currentRadius=radius,shouldUpdateGeometry=!0),this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),shouldUpdateGeometry=!0),shouldUpdateGeometry&&this._buildPosition()}_buildPosition(){for(let i$1=0;i$1<32;i$1++){let t=i$1/16*Math.PI;this._attrPos.setXYZ(i$1,Math.cos(t),Math.sin(t),0),this._attrPos.setXYZ(32+i$1,0,Math.cos(t),Math.sin(t)),this._attrPos.setXYZ(64+i$1,Math.sin(t),0,Math.cos(t))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let i$1=0;i$1<32;i$1++){let i1=(i$1+1)%32;this._attrIndex.setXY(i$1*2,i$1,i1),this._attrIndex.setXY(64+i$1*2,32+i$1,32+i1),this._attrIndex.setXY(128+i$1*2,64+i$1,64+i1)}this._attrIndex.needsUpdate=!0}},_v3A52=new Vector3,VRMSpringBoneColliderHelper=class extends Group{constructor(collider){if(super(),this.matrixAutoUpdate=!1,this.collider=collider,this.collider.shape instanceof VRMSpringBoneColliderShapeSphere)this._geometry=new ColliderShapeSphereBufferGeometry(this.collider.shape);else if(this.collider.shape instanceof VRMSpringBoneColliderShapeCapsule)this._geometry=new ColliderShapeCapsuleBufferGeometry(this.collider.shape);else if(this.collider.shape instanceof VRMSpringBoneColliderShapePlane)this._geometry=new ColliderShapePlaneBufferGeometry(this.collider.shape);else throw Error(`VRMSpringBoneColliderHelper: Unknown collider shape type detected`);let material=new LineBasicMaterial({color:16711935,depthTest:!1,depthWrite:!1});this._line=new LineSegments(this._geometry,material),this.add(this._line)}dispose(){this._geometry.dispose()}updateMatrixWorld(force){this.collider.updateWorldMatrix(!0,!1),this.matrix.copy(this.collider.matrixWorld);let matrixWorldElements=this.matrix.elements;this._geometry.worldScale=_v3A52.set(matrixWorldElements[0],matrixWorldElements[1],matrixWorldElements[2]).length(),this._geometry.update(),super.updateMatrixWorld(force)}},SpringBoneBufferGeometry=class extends BufferGeometry{constructor(springBone){super(),this.worldScale=1,this._currentRadius=0,this._currentTail=new Vector3,this._springBone=springBone,this._attrPos=new BufferAttribute(new Float32Array(294),3),this.setAttribute(`position`,this._attrPos),this._attrIndex=new BufferAttribute(new Uint16Array(194),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let shouldUpdateGeometry=!1,radius=this._springBone.settings.hitRadius/this.worldScale;this._currentRadius!==radius&&(this._currentRadius=radius,shouldUpdateGeometry=!0),this._currentTail.equals(this._springBone.initialLocalChildPosition)||(this._currentTail.copy(this._springBone.initialLocalChildPosition),shouldUpdateGeometry=!0),shouldUpdateGeometry&&this._buildPosition()}_buildPosition(){for(let i$1=0;i$1<32;i$1++){let t=i$1/16*Math.PI;this._attrPos.setXYZ(i$1,Math.cos(t),Math.sin(t),0),this._attrPos.setXYZ(32+i$1,0,Math.cos(t),Math.sin(t)),this._attrPos.setXYZ(64+i$1,Math.sin(t),0,Math.cos(t))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.setXYZ(96,0,0,0),this._attrPos.setXYZ(97,this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let i$1=0;i$1<32;i$1++){let i1=(i$1+1)%32;this._attrIndex.setXY(i$1*2,i$1,i1),this._attrIndex.setXY(64+i$1*2,32+i$1,32+i1),this._attrIndex.setXY(128+i$1*2,64+i$1,64+i1)}this._attrIndex.setXY(192,96,97),this._attrIndex.needsUpdate=!0}},_v3A62=new Vector3,VRMSpringBoneJointHelper=class extends Group{constructor(springBone){super(),this.matrixAutoUpdate=!1,this.springBone=springBone,this._geometry=new SpringBoneBufferGeometry(this.springBone);let material=new LineBasicMaterial({color:16776960,depthTest:!1,depthWrite:!1});this._line=new LineSegments(this._geometry,material),this.add(this._line)}dispose(){this._geometry.dispose()}updateMatrixWorld(force){this.springBone.bone.updateWorldMatrix(!0,!1),this.matrix.copy(this.springBone.bone.matrixWorld);let matrixWorldElements=this.matrix.elements;this._geometry.worldScale=_v3A62.set(matrixWorldElements[0],matrixWorldElements[1],matrixWorldElements[2]).length(),this._geometry.update(),super.updateMatrixWorld(force)}},VRMSpringBoneCollider=class extends Object3D{constructor(shape){super(),this.colliderMatrix=new Matrix4,this.shape=shape}updateWorldMatrix(updateParents,updateChildren){super.updateWorldMatrix(updateParents,updateChildren),updateColliderMatrix(this.colliderMatrix,this.matrixWorld,this.shape.offset)}};function updateColliderMatrix(colliderMatrix,matrixWorld,offset$2){let me$2=matrixWorld.elements;colliderMatrix.copy(matrixWorld),offset$2&&(colliderMatrix.elements[12]=me$2[0]*offset$2.x+me$2[4]*offset$2.y+me$2[8]*offset$2.z+me$2[12],colliderMatrix.elements[13]=me$2[1]*offset$2.x+me$2[5]*offset$2.y+me$2[9]*offset$2.z+me$2[13],colliderMatrix.elements[14]=me$2[2]*offset$2.x+me$2[6]*offset$2.y+me$2[10]*offset$2.z+me$2[14])}var _matA=new Matrix4;function mat4InvertCompat(target$1){return target$1.invert?target$1.invert():target$1.getInverse(_matA.copy(target$1)),target$1}var Matrix4InverseCache=class{constructor(matrix){this._inverseCache=new Matrix4,this._shouldUpdateInverse=!0,this.matrix=matrix;let handler={set:(obj,prop,newVal)=>(this._shouldUpdateInverse=!0,obj[prop]=newVal,!0)};this._originalElements=matrix.elements,matrix.elements=new Proxy(matrix.elements,handler)}get inverse(){return this._shouldUpdateInverse&&(mat4InvertCompat(this._inverseCache.copy(this.matrix)),this._shouldUpdateInverse=!1),this._inverseCache}revert(){this.matrix.elements=this._originalElements}},IDENTITY_MATRIX4=new Matrix4,_v3A72=new Vector3,_v3B23=new Vector3,_worldSpacePosition=new Vector3,_nextTail=new Vector3,_matA2=new Matrix4,VRMSpringBoneJoint=class{constructor(bone,child,settings={},colliderGroups=[]){this._currentTail=new Vector3,this._prevTail=new Vector3,this._boneAxis=new Vector3,this._worldSpaceBoneLength=0,this._center=null,this._initialLocalMatrix=new Matrix4,this._initialLocalRotation=new Quaternion,this._initialLocalChildPosition=new Vector3;var _a$3,_b,_c$1,_d$1,_e$2,_f$1;this.bone=bone,this.bone.matrixAutoUpdate=!1,this.child=child,this.settings={hitRadius:(_a$3=settings.hitRadius)??0,stiffness:(_b=settings.stiffness)??1,gravityPower:(_c$1=settings.gravityPower)??0,gravityDir:(_e$2=(_d$1=settings.gravityDir)?.clone())??new Vector3(0,-1,0),dragForce:(_f$1=settings.dragForce)??.4},this.colliderGroups=colliderGroups}get dependencies(){let set=new Set,parent=this.bone.parent;parent&&set.add(parent);for(let cg$1=0;cg$1{callback(ancestor)})}function traverseChildrenUntilConditionMet(object,callback){object.children.forEach(child=>{let result=callback(child);result||traverseChildrenUntilConditionMet(child,callback)})}function lowestCommonAncestor(objects){var _a$3;let sharedAncestors=new Map;for(let object of objects){let current=object;do{let newValue=((_a$3=sharedAncestors.get(current))??0)+1;if(newValue===objects.size)return current;sharedAncestors.set(current,newValue),current=current.parent}while(current!==null)}return null}var VRMSpringBoneManager=class{constructor(){this._joints=new Set,this._sortedJoints=[],this._hasWarnedCircularDependency=!1,this._ancestors=[],this._objectSpringBonesMap=new Map,this._isSortedJointsDirty=!1,this._relevantChildrenUpdated=this._relevantChildrenUpdated.bind(this)}get joints(){return this._joints}get springBones(){return console.warn(`VRMSpringBoneManager: springBones is deprecated. use joints instead.`),this._joints}get colliderGroups(){let set=new Set;return this._joints.forEach(springBone=>{springBone.colliderGroups.forEach(colliderGroup=>{set.add(colliderGroup)})}),Array.from(set)}get colliders(){let set=new Set;return this.colliderGroups.forEach(colliderGroup=>{colliderGroup.colliders.forEach(collider=>{set.add(collider)})}),Array.from(set)}addJoint(joint){this._joints.add(joint);let objectSet=this._objectSpringBonesMap.get(joint.bone);objectSet??(objectSet=new Set,this._objectSpringBonesMap.set(joint.bone,objectSet)),objectSet.add(joint),this._isSortedJointsDirty=!0}addSpringBone(joint){console.warn(`VRMSpringBoneManager: addSpringBone() is deprecated. use addJoint() instead.`),this.addJoint(joint)}deleteJoint(joint){this._joints.delete(joint);let objectSet=this._objectSpringBonesMap.get(joint.bone);objectSet.delete(joint),this._isSortedJointsDirty=!0}deleteSpringBone(joint){console.warn(`VRMSpringBoneManager: deleteSpringBone() is deprecated. use deleteJoint() instead.`),this.deleteJoint(joint)}setInitState(){this._sortJoints();for(let i$1=0;i$1{var _a$3,_b;return((_b=(_a$3=this._objectSpringBonesMap.get(object))?.size)??0)>0?!0:(this._ancestors.push(object),!1)})),this._isSortedJointsDirty=!1}_insertJointSort(springBone,springBonesTried,springBonesDone,springBoneOrder,ancestors){if(springBonesDone.has(springBone))return;if(springBonesTried.has(springBone)){this._hasWarnedCircularDependency||(console.warn(`VRMSpringBoneManager: Circular dependency detected`),this._hasWarnedCircularDependency=!0);return}springBonesTried.add(springBone);let depObjects=springBone.dependencies;for(let depObject of depObjects){let encounteredSpringBone=!1,ancestor=null;traverseAncestorsFromRoot2(depObject,depObjectAncestor=>{let objectSet=this._objectSpringBonesMap.get(depObjectAncestor);if(objectSet)for(let depSpringBone of objectSet)encounteredSpringBone=!0,this._insertJointSort(depSpringBone,springBonesTried,springBonesDone,springBoneOrder,ancestors);else encounteredSpringBone||(ancestor=depObjectAncestor)}),ancestor&&ancestors.add(ancestor)}springBoneOrder.push(springBone),springBonesDone.add(springBone)}_relevantChildrenUpdated(object){var _a$3,_b;return((_b=(_a$3=this._objectSpringBonesMap.get(object))?.size)??0)>0?!0:(object.updateWorldMatrix(!1,!1),!1)}},EXTENSION_NAME_EXTENDED_COLLIDER=`VRMC_springBone_extended_collider`,POSSIBLE_SPEC_VERSIONS8=new Set([`1.0`,`1.0-beta`]),POSSIBLE_SPEC_VERSIONS_EXTENDED_COLLIDERS=new Set([`1.0`]),_VRMSpringBoneLoaderPlugin=class _VRMSpringBoneLoaderPlugin2{get name(){return _VRMSpringBoneLoaderPlugin2.EXTENSION_NAME}constructor(parser,options$1){var _a$3;this.parser=parser,this.jointHelperRoot=options$1?.jointHelperRoot,this.colliderHelperRoot=options$1?.colliderHelperRoot,this.useExtendedColliders=(_a$3=options$1?.useExtendedColliders)??!0}afterRoot(gltf){return __async7(this,null,function*(){gltf.userData.vrmSpringBoneManager=yield this._import(gltf)})}_import(gltf){return __async7(this,null,function*(){let v1Result=yield this._v1Import(gltf);if(v1Result!=null)return v1Result;let v0Result=yield this._v0Import(gltf);return v0Result??null})}_v1Import(gltf){return __async7(this,null,function*(){var _a$3,_b,_c$1,_d$1,_e$2;let json=gltf.parser.json,isSpringBoneUsed=(_a$3=json.extensionsUsed)?.indexOf(_VRMSpringBoneLoaderPlugin2.EXTENSION_NAME)!==-1;if(!isSpringBoneUsed)return null;let manager=new VRMSpringBoneManager,threeNodes=yield gltf.parser.getDependencies(`node`),extension$1=(_b=json.extensions)?.[_VRMSpringBoneLoaderPlugin2.EXTENSION_NAME];if(!extension$1)return null;let specVersion=extension$1.specVersion;if(!POSSIBLE_SPEC_VERSIONS8.has(specVersion))return console.warn(`VRMSpringBoneLoaderPlugin: Unknown ${_VRMSpringBoneLoaderPlugin2.EXTENSION_NAME} specVersion "${specVersion}"`),null;let colliders=(_c$1=extension$1.colliders)?.map((schemaCollider,iCollider)=>{var _a2,_b2,_c2,_d2,_e2,_f$1,_g$1,_h$1,_i$2,_j,_k,_l,_m$1,_n$2,_o$1;let node$1=threeNodes[schemaCollider.node];if(node$1==null)return console.warn(`VRMSpringBoneLoaderPlugin: The collider #${iCollider} attempted to use the node #${schemaCollider.node} but not found`),null;let schemaShape=schemaCollider.shape,schemaExCollider=(_a2=schemaCollider.extensions)?.[EXTENSION_NAME_EXTENDED_COLLIDER];if(this.useExtendedColliders&&schemaExCollider!=null){let specVersionExCollider=schemaExCollider.specVersion;if(!POSSIBLE_SPEC_VERSIONS_EXTENDED_COLLIDERS.has(specVersionExCollider))console.warn(`VRMSpringBoneLoaderPlugin: Unknown ${EXTENSION_NAME_EXTENDED_COLLIDER} specVersion "${specVersionExCollider}". Fallbacking to the ${_VRMSpringBoneLoaderPlugin2.EXTENSION_NAME} definition`);else{let schemaExShape=schemaExCollider.shape;if(schemaExShape.sphere)return this._importSphereCollider(node$1,{offset:new Vector3().fromArray((_b2=schemaExShape.sphere.offset)??[0,0,0]),radius:(_c2=schemaExShape.sphere.radius)??0,inside:(_d2=schemaExShape.sphere.inside)??!1});if(schemaExShape.capsule)return this._importCapsuleCollider(node$1,{offset:new Vector3().fromArray((_e2=schemaExShape.capsule.offset)??[0,0,0]),radius:(_f$1=schemaExShape.capsule.radius)??0,tail:new Vector3().fromArray((_g$1=schemaExShape.capsule.tail)??[0,0,0]),inside:(_h$1=schemaExShape.capsule.inside)??!1});if(schemaExShape.plane)return this._importPlaneCollider(node$1,{offset:new Vector3().fromArray((_i$2=schemaExShape.plane.offset)??[0,0,0]),normal:new Vector3().fromArray((_j=schemaExShape.plane.normal)??[0,0,1])})}}if(schemaShape.sphere)return this._importSphereCollider(node$1,{offset:new Vector3().fromArray((_k=schemaShape.sphere.offset)??[0,0,0]),radius:(_l=schemaShape.sphere.radius)??0,inside:!1});if(schemaShape.capsule)return this._importCapsuleCollider(node$1,{offset:new Vector3().fromArray((_m$1=schemaShape.capsule.offset)??[0,0,0]),radius:(_n$2=schemaShape.capsule.radius)??0,tail:new Vector3().fromArray((_o$1=schemaShape.capsule.tail)??[0,0,0]),inside:!1});throw Error(`VRMSpringBoneLoaderPlugin: The collider #${iCollider} has no valid shape`)}),colliderGroups=(_d$1=extension$1.colliderGroups)?.map((schemaColliderGroup,iColliderGroup)=>{var _a2;let cols=((_a2=schemaColliderGroup.colliders)??[]).flatMap(iCollider=>{let col=colliders?.[iCollider];return col??(console.warn(`VRMSpringBoneLoaderPlugin: The colliderGroup #${iColliderGroup} attempted to use a collider #${iCollider} but not found`),[])});return{colliders:cols,name:schemaColliderGroup.name}});return(_e$2=extension$1.springs)==null||_e$2.forEach((schemaSpring,iSpring)=>{var _a2;let schemaJoints=schemaSpring.joints,colliderGroupsForSpring=(_a2=schemaSpring.colliderGroups)?.map(iColliderGroup=>{let group=colliderGroups?.[iColliderGroup];if(group==null)throw Error(`VRMSpringBoneLoaderPlugin: The spring #${iSpring} attempted to use a colliderGroup ${iColliderGroup} but not found`);return group}),center=schemaSpring.center==null?void 0:threeNodes[schemaSpring.center],prevSchemaJoint;schemaJoints.forEach(schemaJoint=>{if(prevSchemaJoint){let nodeIndex=prevSchemaJoint.node,node$1=threeNodes[nodeIndex],childIndex=schemaJoint.node,child=threeNodes[childIndex],setting={hitRadius:prevSchemaJoint.hitRadius,dragForce:prevSchemaJoint.dragForce,gravityPower:prevSchemaJoint.gravityPower,stiffness:prevSchemaJoint.stiffness,gravityDir:prevSchemaJoint.gravityDir==null?void 0:new Vector3().fromArray(prevSchemaJoint.gravityDir)},joint=this._importJoint(node$1,child,setting,colliderGroupsForSpring);center&&(joint.center=center),manager.addJoint(joint)}prevSchemaJoint=schemaJoint})}),manager.setInitState(),manager})}_v0Import(gltf){return __async7(this,null,function*(){var _a$3,_b,_c$1;let json=gltf.parser.json,isVRMUsed=(_a$3=json.extensionsUsed)?.indexOf(`VRM`)!==-1;if(!isVRMUsed)return null;let extension$1=(_b=json.extensions)?.VRM,schemaSecondaryAnimation=extension$1?.secondaryAnimation;if(!schemaSecondaryAnimation)return null;let schemaBoneGroups=schemaSecondaryAnimation?.boneGroups;if(!schemaBoneGroups)return null;let manager=new VRMSpringBoneManager,threeNodes=yield gltf.parser.getDependencies(`node`),colliderGroups=(_c$1=schemaSecondaryAnimation.colliderGroups)?.map(schemaColliderGroup=>{var _a2;let node$1=threeNodes[schemaColliderGroup.node],colliders=((_a2=schemaColliderGroup.colliders)??[]).map((schemaCollider,iCollider)=>{var _a3,_b2,_c2;let offset$2=new Vector3(0,0,0);return schemaCollider.offset&&offset$2.set((_a3=schemaCollider.offset.x)??0,(_b2=schemaCollider.offset.y)??0,schemaCollider.offset.z?-schemaCollider.offset.z:0),this._importSphereCollider(node$1,{offset:offset$2,radius:(_c2=schemaCollider.radius)??0,inside:!1})});return{colliders}});return schemaBoneGroups?.forEach((schemaBoneGroup,iBoneGroup)=>{let rootIndices=schemaBoneGroup.bones;rootIndices&&rootIndices.forEach(rootIndex=>{var _a2,_b2,_c2,_d$1;let root$3=threeNodes[rootIndex],gravityDir=new Vector3;schemaBoneGroup.gravityDir?gravityDir.set((_a2=schemaBoneGroup.gravityDir.x)??0,(_b2=schemaBoneGroup.gravityDir.y)??0,(_c2=schemaBoneGroup.gravityDir.z)??0):gravityDir.set(0,-1,0);let center=schemaBoneGroup.center==null?void 0:threeNodes[schemaBoneGroup.center],setting={hitRadius:schemaBoneGroup.hitRadius,dragForce:schemaBoneGroup.dragForce,gravityPower:schemaBoneGroup.gravityPower,stiffness:schemaBoneGroup.stiffiness,gravityDir},colliderGroupsForSpring=(_d$1=schemaBoneGroup.colliderGroups)?.map(iColliderGroup=>{let group=colliderGroups?.[iColliderGroup];if(group==null)throw Error(`VRMSpringBoneLoaderPlugin: The spring #${iBoneGroup} attempted to use a colliderGroup ${iColliderGroup} but not found`);return group});root$3.traverse(node$1=>{var _a3;let child=(_a3=node$1.children[0])??null,joint=this._importJoint(node$1,child,setting,colliderGroupsForSpring);center&&(joint.center=center),manager.addJoint(joint)})})}),gltf.scene.updateMatrixWorld(),manager.setInitState(),manager})}_importJoint(node$1,child,setting,colliderGroupsForSpring){let springBone=new VRMSpringBoneJoint(node$1,child,setting,colliderGroupsForSpring);if(this.jointHelperRoot){let helper=new VRMSpringBoneJointHelper(springBone);this.jointHelperRoot.add(helper),helper.renderOrder=this.jointHelperRoot.renderOrder}return springBone}_importSphereCollider(destination,params){let shape=new VRMSpringBoneColliderShapeSphere(params),collider=new VRMSpringBoneCollider(shape);if(destination.add(collider),this.colliderHelperRoot){let helper=new VRMSpringBoneColliderHelper(collider);this.colliderHelperRoot.add(helper),helper.renderOrder=this.colliderHelperRoot.renderOrder}return collider}_importCapsuleCollider(destination,params){let shape=new VRMSpringBoneColliderShapeCapsule(params),collider=new VRMSpringBoneCollider(shape);if(destination.add(collider),this.colliderHelperRoot){let helper=new VRMSpringBoneColliderHelper(collider);this.colliderHelperRoot.add(helper),helper.renderOrder=this.colliderHelperRoot.renderOrder}return collider}_importPlaneCollider(destination,params){let shape=new VRMSpringBoneColliderShapePlane(params),collider=new VRMSpringBoneCollider(shape);if(destination.add(collider),this.colliderHelperRoot){let helper=new VRMSpringBoneColliderHelper(collider);this.colliderHelperRoot.add(helper),helper.renderOrder=this.colliderHelperRoot.renderOrder}return collider}};_VRMSpringBoneLoaderPlugin.EXTENSION_NAME=`VRMC_springBone`;var VRMSpringBoneLoaderPlugin=_VRMSpringBoneLoaderPlugin,VRMLoaderPlugin=class{get name(){return`VRMLoaderPlugin`}constructor(parser,options$1){var _a$3,_b,_c$1,_d$1,_e$2,_f$1,_g$1,_h$1,_i$2,_j;this.parser=parser;let helperRoot=options$1?.helperRoot,autoUpdateHumanBones=options$1?.autoUpdateHumanBones;this.expressionPlugin=(_a$3=options$1?.expressionPlugin)??new VRMExpressionLoaderPlugin(parser),this.firstPersonPlugin=(_b=options$1?.firstPersonPlugin)??new VRMFirstPersonLoaderPlugin(parser),this.humanoidPlugin=(_c$1=options$1?.humanoidPlugin)??new VRMHumanoidLoaderPlugin(parser,{helperRoot,autoUpdateHumanBones}),this.lookAtPlugin=(_d$1=options$1?.lookAtPlugin)??new VRMLookAtLoaderPlugin(parser,{helperRoot}),this.metaPlugin=(_e$2=options$1?.metaPlugin)??new VRMMetaLoaderPlugin(parser),this.mtoonMaterialPlugin=(_f$1=options$1?.mtoonMaterialPlugin)??new MToonMaterialLoaderPlugin(parser),this.materialsHDREmissiveMultiplierPlugin=(_g$1=options$1?.materialsHDREmissiveMultiplierPlugin)??new VRMMaterialsHDREmissiveMultiplierLoaderPlugin(parser),this.materialsV0CompatPlugin=(_h$1=options$1?.materialsV0CompatPlugin)??new VRMMaterialsV0CompatPlugin(parser),this.springBonePlugin=(_i$2=options$1?.springBonePlugin)??new VRMSpringBoneLoaderPlugin(parser,{colliderHelperRoot:helperRoot,jointHelperRoot:helperRoot}),this.nodeConstraintPlugin=(_j=options$1?.nodeConstraintPlugin)??new VRMNodeConstraintLoaderPlugin(parser,{helperRoot})}beforeRoot(){return __async(this,null,function*(){yield this.materialsV0CompatPlugin.beforeRoot(),yield this.mtoonMaterialPlugin.beforeRoot()})}loadMesh(meshIndex){return __async(this,null,function*(){return yield this.mtoonMaterialPlugin.loadMesh(meshIndex)})}getMaterialType(materialIndex){let mtoonType=this.mtoonMaterialPlugin.getMaterialType(materialIndex);return mtoonType??null}extendMaterialParams(materialIndex,materialParams){return __async(this,null,function*(){yield this.materialsHDREmissiveMultiplierPlugin.extendMaterialParams(materialIndex,materialParams),yield this.mtoonMaterialPlugin.extendMaterialParams(materialIndex,materialParams)})}afterRoot(gltf){return __async(this,null,function*(){yield this.metaPlugin.afterRoot(gltf),yield this.humanoidPlugin.afterRoot(gltf),yield this.expressionPlugin.afterRoot(gltf),yield this.lookAtPlugin.afterRoot(gltf),yield this.firstPersonPlugin.afterRoot(gltf),yield this.springBonePlugin.afterRoot(gltf),yield this.nodeConstraintPlugin.afterRoot(gltf),yield this.mtoonMaterialPlugin.afterRoot(gltf);let meta=gltf.userData.vrmMeta,humanoid=gltf.userData.vrmHumanoid;if(meta&&humanoid){let vrm=new VRM({scene:gltf.scene,expressionManager:gltf.userData.vrmExpressionManager,firstPerson:gltf.userData.vrmFirstPerson,humanoid,lookAt:gltf.userData.vrmLookAt,meta,materials:gltf.userData.vrmMToonMaterials,springBoneManager:gltf.userData.vrmSpringBoneManager,nodeConstraintManager:gltf.userData.vrmNodeConstraintManager});gltf.userData.vrm=vrm}})}};function collectMeshes(scene){let meshes=new Set;return scene.traverse(obj=>{if(!obj.isMesh)return;let mesh=obj;meshes.add(mesh)}),meshes}function combineMorph(positionAttributes,binds,morphTargetsRelative){if(binds.size===1){let bind=binds.values().next().value;if(bind.weight===1)return positionAttributes[bind.index]}let newArray=new Float32Array(positionAttributes[0].count*3),weightSum=0;if(morphTargetsRelative)weightSum=1;else for(let bind of binds)weightSum+=bind.weight;for(let bind of binds){let src=positionAttributes[bind.index],weight=bind.weight/weightSum;for(let i$1=0;i$1boneDispatcher.getOrCreate(bone)).join(`,`),key$2=`${skinIndexKey};${skeletonKey};${bonesKey}`,newSkinIndexAttr=cache$1.get(key$2);newSkinIndexAttr??(newSkinIndexAttr=skinIndexAttr.clone(),remapSkinIndexAttribute(newSkinIndexAttr,bones,newBones),cache$1.set(key$2,newSkinIndexAttr)),mesh.geometry.setAttribute(`skinIndex`,newSkinIndexAttr)}for(let mesh of meshes)mesh.bind(newSkeleton,new Matrix4)}}function collectSkinnedMeshes(scene){let skinnedMeshes=new Set;return scene.traverse(obj=>{if(!obj.isSkinnedMesh)return;let skinnedMesh=obj;skinnedMeshes.add(skinnedMesh)}),skinnedMeshes}function listUsedIndices(skinIndexAttr,skinWeightAttr){let usedIndices=new Set;for(let i$1=0;i$1tolerance)return!1}return!0}var ObjectIndexDispatcher=class{constructor(){this._objectIndexMap=new Map,this._index=0}get(obj){return this._objectIndexMap.get(obj)}getOrCreate(obj){let index$1=this._objectIndexMap.get(obj);return index$1??(index$1=this._index,this._objectIndexMap.set(obj,index$1),this._index++),index$1}};function shallowCloneBufferGeometry(geometry){var _a$3,_b,_c$1,_d$1;let clone$2=new BufferGeometry;clone$2.name=geometry.name,clone$2.setIndex(geometry.index);for(let[name$2,attribute]of Object.entries(geometry.attributes))clone$2.setAttribute(name$2,attribute);for(let[key$2,morphAttributes]of Object.entries(geometry.morphAttributes)){let attributeName=key$2;clone$2.morphAttributes[attributeName]=morphAttributes.concat()}clone$2.morphTargetsRelative=geometry.morphTargetsRelative,clone$2.groups=[];for(let group of geometry.groups)clone$2.addGroup(group.start,group.count,group.materialIndex);return clone$2.boundingSphere=(_b=(_a$3=geometry.boundingSphere)?.clone())??null,clone$2.boundingBox=(_d$1=(_c$1=geometry.boundingBox)?.clone())??null,clone$2.drawRange.start=geometry.drawRange.start,clone$2.drawRange.count=geometry.drawRange.count,clone$2.userData=geometry.userData,clone$2}function disposeMaterial(material){if(Object.values(material).forEach(value$1=>{if(value$1?.isTexture){let texture=value$1;texture.dispose()}}),material.isShaderMaterial){let uniforms=material.uniforms;uniforms&&Object.values(uniforms).forEach(uniform=>{let value$1=uniform.value;if(value$1?.isTexture){let texture=value$1;texture.dispose()}})}material.dispose()}function dispose(object3D){let geometry=object3D.geometry;geometry&&geometry.dispose();let skeleton=object3D.skeleton;skeleton&&skeleton.dispose();let material=object3D.material;material&&(Array.isArray(material)?material.forEach(material2=>disposeMaterial(material2)):material&&disposeMaterial(material))}function deepDispose(object3D){object3D.traverse(dispose)}function removeUnnecessaryJoints(root$3,options$1){var _a$3,_b;console.warn(`VRMUtils.removeUnnecessaryJoints: removeUnnecessaryJoints is deprecated. Use combineSkeletons instead. combineSkeletons contributes more to the performance improvement. This function will be removed in the next major version.`);let experimentalSameBoneCounts=(_a$3=options$1?.experimentalSameBoneCounts)??!1,skinnedMeshes=[];root$3.traverse(obj=>{obj.type===`SkinnedMesh`&&skinnedMeshes.push(obj)});let attributeToBoneIndexMapMap=new Map,maxBones=0;for(let mesh of skinnedMeshes){let geometry=mesh.geometry,attribute=geometry.getAttribute(`skinIndex`);if(attributeToBoneIndexMapMap.has(attribute))continue;let oldToNew=new Map,newToOld=new Map;for(let i$1=0;i$1{var _a$3,_b,_c$1,_d$1;if(!obj.isMesh)return;let mesh=obj,geometry=mesh.geometry,originalIndex=geometry.index;if(originalIndex==null)return;let newGeometryAlreadyExisted=geometryMap.get(geometry);if(newGeometryAlreadyExisted!=null){mesh.geometry=newGeometryAlreadyExisted;return}let vertexCount=Object.values(geometry.attributes)[0].count,vertexInUse=Array(vertexCount),verticesUsed=0,originalIndexArray=originalIndex.array;for(let i$1=0;i$1{newGeometry.addGroup(group.start,group.count,group.materialIndex)}),newGeometry.boundingBox=(_b=(_a$3=geometry.boundingBox)?.clone())??null,newGeometry.boundingSphere=(_d$1=(_c$1=geometry.boundingSphere)?.clone())??null,newGeometry.setDrawRange(geometry.drawRange.start,geometry.drawRange.count),newGeometry.userData=geometry.userData,geometryMap.set(geometry,newGeometry);{let originalIndexArray2=originalIndex.array,newIndexArray=new originalIndexArray2.constructor(originalIndexArray2.length);for(let i$1=0;i$1{let originalAttribute=geometry.attributes[attributeName];if(originalAttribute.isInterleavedBufferAttribute)throw Error(`removeUnnecessaryVertices: InterleavedBufferAttribute is not supported`);let originalAttributeArray=originalAttribute.array,{itemSize,normalized}=originalAttribute,newAttributeArray=new originalAttributeArray.constructor(newIndexOriginalIndexMap.length*itemSize);newIndexOriginalIndexMap.forEach((originalIndex2,i$1)=>{for(let j$1=0;j$1{for(let j$1=0;j$1v$2===0),newGeometry.morphAttributes[attributeName][iMorph]=new BufferAttribute(newAttributeArray,itemSize,normalized)}}isNullMorph&&(newGeometry.morphAttributes={}),mesh.geometry=newGeometry}),Array.from(geometryMap.keys()).forEach(originalGeometry=>{originalGeometry.dispose()})}function rotateVRM0(vrm){var _a$3;(_a$3=vrm.meta)?.metaVersion===`0`&&(vrm.scene.rotation.y=Math.PI)}var VRMUtils=class{constructor(){}};VRMUtils.combineMorphs=combineMorphs,VRMUtils.combineSkeletons=combineSkeletons,VRMUtils.deepDispose=deepDispose,VRMUtils.removeUnnecessaryJoints=removeUnnecessaryJoints,VRMUtils.removeUnnecessaryVertices=removeUnnecessaryVertices,VRMUtils.rotateVRM0=rotateVRM0; /*! -* @pixiv/three-vrm-core v3.4.1 +* @pixiv/three-vrm-core v3.4.2 * The implementation of core features of VRM, for @pixiv/three-vrm * * Copyright (c) 2019-2025 pixiv Inc. @@ -4940,7 +4940,7 @@ void main() { * https://github.com/pixiv/three-vrm/blob/release/LICENSE */ /*! -* @pixiv/three-vrm-materials-mtoon v3.4.1 +* @pixiv/three-vrm-materials-mtoon v3.4.2 * MToon (toon material) module for @pixiv/three-vrm * * Copyright (c) 2019-2025 pixiv Inc. @@ -4948,7 +4948,7 @@ void main() { * https://github.com/pixiv/three-vrm/blob/release/LICENSE */ /*! -* @pixiv/three-vrm-materials-hdr-emissive-multiplier v3.4.1 +* @pixiv/three-vrm-materials-hdr-emissive-multiplier v3.4.2 * Support VRMC_hdr_emissiveMultiplier for @pixiv/three-vrm * * Copyright (c) 2019-2025 pixiv Inc. @@ -4956,7 +4956,7 @@ void main() { * https://github.com/pixiv/three-vrm/blob/release/LICENSE */ /*! -* @pixiv/three-vrm-materials-v0compat v3.4.1 +* @pixiv/three-vrm-materials-v0compat v3.4.2 * VRM0.0 materials compatibility layer plugin for @pixiv/three-vrm * * Copyright (c) 2019-2025 pixiv Inc. @@ -4964,7 +4964,7 @@ void main() { * https://github.com/pixiv/three-vrm/blob/release/LICENSE */ /*! -* @pixiv/three-vrm-node-constraint v3.4.1 +* @pixiv/three-vrm-node-constraint v3.4.2 * Node constraint module for @pixiv/three-vrm * * Copyright (c) 2019-2025 pixiv Inc. @@ -4972,17 +4972,23 @@ void main() { * https://github.com/pixiv/three-vrm/blob/release/LICENSE */ /*! -* @pixiv/three-vrm-springbone v3.4.1 +* @pixiv/three-vrm-springbone v3.4.2 * Spring bone module for @pixiv/three-vrm * * Copyright (c) 2019-2025 pixiv Inc. * @pixiv/three-vrm-springbone is distributed under MIT License * https://github.com/pixiv/three-vrm/blob/release/LICENSE */ -function toTrianglesDrawMode(geometry,drawMode){if(drawMode===TrianglesDrawMode)return console.warn(`THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles.`),geometry;if(drawMode===TriangleFanDrawMode||drawMode===TriangleStripDrawMode){let index$1=geometry.getIndex();if(index$1===null){let indices=[],position$2=geometry.getAttribute(`position`);if(position$2!==void 0){for(let i$1=0;i$1=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$1=0;i$1=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=this;return new Promise(function(resolve$1,reject){scope.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){objects[key$2]=object},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$3=new Matrix4,p$5=new Vector3,q$2=new Quaternion,s$1=new Vector3(1,1,1),instancedMesh=new InstancedMesh(mesh.geometry,mesh.material,count$1);for(let i$1=0;i$10||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$2,mappings);for(let[i$1,child]of original.children.entries())updateMappings(child,clone$2.children[i$1])};return updateMappings(object,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$1=0;i$1=2&&bufferAttribute.setY(index$1,sparseValues[i$1*itemSize+1]),itemSize>=3&&bufferAttribute.setZ(index$1,sparseValues[i$1*itemSize+2]),itemSize>=4&&bufferAttribute.setW(index$1,sparseValues[i$1*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$1=mapDef.extensions===void 0?void 0:mapDef.extensions[EXTENSIONS.KHR_TEXTURE_TRANSFORM];if(transform$1){let gltfReference=parser.associations.get(texture);texture=parser.extensions[EXTENSIONS.KHR_TEXTURE_TRANSFORM].extendTexture(texture,transform$1),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=metallicRoughness.baseColorFactor;materialParams.color.setRGB(array[0],array[1],array[2],LinearSRGBColorSpace),materialParams.opacity=array[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$1=0,il$1=primitives.length;i$10&&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$1=0,il$1=meshes.length;i$11?new Group:objects.length===1?objects[0]:new Object3D,node$1!==objects[0])for(let i$1=0,il$1=objects.length;i$11){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$1=0,il$1=nodeIds.length;i$1{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){object.morphTargetInfluences&&targetNames.push(object.name?object.name:object.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$1=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,timeSinceLastSaccade=0;function updateFixationTarget(){fixationTarget?fixationTarget.set(randFloat(-.25,.25),randFloat(-.2,.15),-.65):fixationTarget=new Vector3(randFloat(-.25,.25),randFloat(-.2,.15),-.65)}function update(vrm,delta){!vrm?.expressionManager||!vrm.lookAt||(timeSinceLastSaccade>=nextSaccadeAfter?(updateFixationTarget(),timeSinceLastSaccade=0,nextSaccadeAfter=randomSaccadeInterval()/1e3):fixationTarget||updateFixationTarget(),vrm.lookAt.target||(vrm.lookAt.target=new Object3D),vrm.lookAt.target.position.lerp(fixationTarget,randFloat(.2,.5)),vrm.lookAt?.update(delta),timeSinceLastSaccade+=delta)}return{update}}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=>{object.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.negate(),modelCenter.y-=modelSize.y/5,options$1?.positionOffset?_vrmGroup.position.set(modelCenter.x+options$1.positionOffset[0],modelCenter.y+options$1.positionOffset[1],modelCenter.z+options$1.positionOffset[2]):_vrmGroup.position.set(modelCenter.x,modelCenter.y,modelCenter.z);let fov$1=40,radians=fov$1/2*Math.PI/180,initialCameraPosition=new Vector3(modelSize.x/16,modelSize.y/6,-(modelSize.y/3)/Math.tan(radians));return{_vrm,_vrmGroup,modelCenter,modelSize,initialCameraPosition}}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)=>start+(end-start)*t,easeInOutCubic=t=>t<.5?4*t*t*t:1-(-2*t+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$1)=>{clearResetTimeout(),setEmotion(emotionName),resetTimeout.value=setTimeout(()=>{setEmotion(`neutral`),resetTimeout.value=void 0},ms$1)},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$2({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$3=>{switch(e$3.status){case`loading`:status.value=`loading`,loadingMessage.value=e$3.data,opts.onLoading?.(e$3.data);break;case`initiate`:loadingProgress.value.push(e$3),opts.onInitiate?.(e$3);break;case`progress`:loadingProgress.value=loadingProgress.value.map(item=>item.file===e$3.file?{...item,...e$3}:item),opts.onProgress?.(e$3);break;case`done`:loadingProgress.value=loadingProgress.value.filter(item=>item.file!==e$3.file),opts.onDone?.(e$3);break;case`ready`:status.value=`ready`,opts.onReady?.();break;case`start`:transcribing.value=!0,opts.onStart?.();break;case`update`:tps.value=e$3.tps,opts.onUpdate?.(e$3.tps);break;case`complete`:transcribing.value=!1,result.value=e$3.output[0]||``,console.debug(`Whisper result:`,result.value),opts.onComplete?.(e$3.output[0]);break}}),onUnmounted(()=>{terminate()}),{transcribe:message$1=>whisperPost(message$1),status,loadingMessage,loadingProgress,transcribing,tps,result,load:()=>whisperPost({type:`load`}),terminate}}var XSAIError$3=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$1=>`_${s$1.toLowerCase()}`),objCamelToSnake$1=obj=>Object.fromEntries(Object.entries(obj).map(([k$4,v$2])=>[strCamelToSnake$2(k$4),v$2])),clean$2=obj=>Object.fromEntries(Object.entries(obj).filter(([,v$2])=>v$2!==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$3(`Remote sent ${res.status} response: ${await res.text()}`,res);if(!res.body)throw new XSAIError$3(`Response body is empty from remote server`,res);if(!(res.body instanceof ReadableStream))throw new XSAIError$3(`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);var XSAIError$1=class extends Error{response;constructor(message$1,response){super(message$1),this.name=`XSAIError`,this.response=response}};const 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,parsedArgs,result,toolName}},strCamelToSnake$1=str=>str.replace(/[A-Z]/g,s$1=>`_${s$1.toLowerCase()}`),objCamelToSnake$2=obj=>Object.fromEntries(Object.entries(obj).map(([k$4,v$2])=>[strCamelToSnake$1(k$4),v$2]));var XSAIError$2=class extends Error{response;constructor(message$1,response){super(message$1),this.name=`XSAIError`,this.response=response}};const CHUNK_HEADER_PREFIX=`data:`,parseChunk=text$5=>{if(!text$5||!text$5.startsWith(CHUNK_HEADER_PREFIX))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]},streamText=async options$1=>{let chunkCtrl,stepCtrl,textCtrl,chunkStream=new ReadableStream({start:controller=>chunkCtrl=controller}),stepStream=new ReadableStream({start:controller=>stepCtrl=controller}),textStream=new ReadableStream({start:controller=>textCtrl=controller}),maxSteps=options$1.maxSteps??1,decoder=new TextDecoder,steps$2=[],stepOne=async options2=>{let step={choices:[],finishReason:`error`,messages:structuredClone(options2.messages),stepType:`initial`,toolCalls:[],toolResults:[]},choiceState={},buffer$1=``,finishReason,usage,shouldOutputText=!0,endToolCallByIndex=(state,idx)=>{state.endedToolCallIndex.has(idx)||(state.endedToolCallIndex.add(idx),state.currentToolIndex=null)};if(await chat({...options2,maxSteps:void 0,stream:!0,streamOptions:options2.streamOptions==null?void 0:objCamelToSnake$2(options2.streamOptions)}).then(async res=>res.body.pipeThrough(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)}}})).pipeTo(new WritableStream({abort:reason=>{chunkCtrl.error(reason),stepCtrl.error(reason),textCtrl.error(reason)},close:()=>{options2.onEvent?.({finishReason,type:`finish`,usage})},write:async chunk=>{if(options2.onChunk?.(chunk),chunkCtrl.enqueue(chunk),usage=chunk.usage,chunk.choices==null||chunk.choices.length===0)return;let choice=chunk.choices[0];choice.delta.tool_calls&&(shouldOutputText=!1);let{delta,finish_reason,index:index$1,...rest}=choice,choiceSnapshot=step.choices[index$1]??={finishReason:finish_reason,index:index$1,message:{role:`assistant`}};if(finish_reason!==void 0){if(finishReason=finish_reason,step.finishReason=finish_reason,choiceSnapshot.finishReason=finish_reason,finish_reason===`length`)throw new XSAIError$2(`length exceeded`);if(finish_reason===`content_filter`)throw new XSAIError$2(`content filter`)}Object.assign(choiceSnapshot,rest);let{content:content$2,refusal,tool_calls,...rests}=delta,message$1=choiceSnapshot.message;Object.assign(message$1,rests),refusal!==void 0&&(message$1.refusal=(message$1.refusal||``)+(refusal||``),options2.onEvent?.({refusal:message$1.refusal,type:`refusal`})),content$2!==void 0&&(message$1.content=(message$1.content||``)+(content$2||``),shouldOutputText&&textCtrl?.enqueue(content$2),options2.onEvent?.({text:content$2,type:`text-delta`}));for(let tool_call of tool_calls||[]){options2.onEvent?.({toolCall:tool_call,type:`tool-call-delta`});let{function:fn$6,id:id$1,index:index2,type}=tool_call;message$1.toolCalls??={};let toolCall=message$1.toolCalls[index2]??={function:{arguments:``,name:fn$6.name,parsedArguments:{}},id:id$1,index:index2,type};toolCall.function.arguments+=fn$6.arguments}let state=choiceState[index$1]??={calledToolCallIndex:new Set,currentToolIndex:null,endedToolCallIndex:new Set,index:index$1,toolCallErrors:{},toolCallResults:{}};finish_reason&&state.currentToolIndex!==null&&endToolCallByIndex(state,state.currentToolIndex);for(let toolCall of delta.tool_calls||[])state.currentToolIndex!==toolCall.index&&state.currentToolIndex!==null&&endToolCallByIndex(state,state.currentToolIndex),state.calledToolCallIndex.add(toolCall.index),state.currentToolIndex=toolCall.index}}))),step.messages.push({content:step.choices[0]?.message.content??``,refusal:step.choices[0]?.message.refusal,role:`assistant`,tool_calls:Object.values(step.choices[0]?.message.toolCalls??{}).map(toolCall=>({function:{arguments:toolCall.function.arguments,name:toolCall.function.name},id:toolCall.id,index:toolCall.index,type:toolCall.type}))}),await Promise.allSettled(step.choices.map(async choice=>{let state=choiceState[choice.index];return Promise.allSettled([...state.endedToolCallIndex].map(async idx=>{let toolCall=choice.message.toolCalls[idx];if(step.toolCalls.push({args:toolCall.function.arguments,toolCallId:toolCall.id,toolCallType:`function`,toolName:toolCall.function.name}),!state.toolCallResults[toolCall.id]){options2.onEvent?.({toolCall,type:`tool-call`});try{let{completionToolResult,message:message$1,parsedArgs,result}=await executeTool({abortSignal:options2.abortSignal,messages:options2.messages,toolCall,tools:options2.tools});toolCall.function.parsedArguments=parsedArgs,state.toolCallResults[toolCall.id]=result,step.messages.push(message$1),step.toolResults.push(completionToolResult),options2.onEvent?.({id:toolCall.id,result,type:`tool-call-result`})}catch(error){state.toolCallErrors[idx]=error}}}))})),step.stepType=determineStepType({finishReason:step.finishReason,maxSteps,stepsLength:steps$2.length,toolCallsLength:step.toolCalls.length}),steps$2.push(step),stepCtrl.enqueue(step),options2.onStepFinish?.(step),!shouldOutputText)return async()=>stepOne({...options2,messages:step.messages})},invokeFunctionCalls=async()=>{let ret=await stepOne(options$1);for(;typeof ret==`function`&&steps$2.length{chunkCtrl.error(error),stepCtrl.error(error),textCtrl.error(error)}),Promise.resolve({chunkStream,stepStream,textStream})},strictJsonSchema=schema=>({...schema,additionalProperties:!1}),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-DWDEUAMn.js`),[]).then(async({getToJsonSchemaFn:getToJsonSchemaFn2})=>getToJsonSchemaFn2());case`effect`:return __vitePreload(()=>import(`./effect-DBSVVF8G-PVyVIIwu.js`),[]).then(async({getToJsonSchemaFn:getToJsonSchemaFn2})=>getToJsonSchemaFn2());case`sury`:return __vitePreload(()=>import(`./sury-GtnkadyM-Dv3wvZV6.js`),[]).then(async({getToJsonSchemaFn:getToJsonSchemaFn2})=>getToJsonSchemaFn2());case`valibot`:return __vitePreload(()=>import(`./valibot-CbgwcZn_-CLR2GVm1.js`),[]).then(async({getToJsonSchemaFn:getToJsonSchemaFn2})=>getToJsonSchemaFn2());case`zod`:return __vitePreload(()=>import(`./zod-CD8IEU5z-78-ilYcF.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`}};var util;(function(util$1){util$1.assertEqual=_$2=>{};function assertIs(_arg){}util$1.assertIs=assertIs;function assertNever(_x$1){throw Error()}util$1.assertNever=assertNever,util$1.arrayToEnum=items=>{let obj={};for(let item of items)obj[item]=item;return obj},util$1.getValidEnumValues=obj=>{let validKeys=util$1.objectKeys(obj).filter(k$4=>typeof obj[obj[k$4]]!=`number`),filtered={};for(let k$4 of validKeys)filtered[k$4]=obj[k$4];return util$1.objectValues(filtered)},util$1.objectValues=obj=>util$1.objectKeys(obj).map(function(e$3){return obj[e$3]}),util$1.objectKeys=typeof Object.keys==`function`?obj=>Object.keys(obj):object=>{let keys$3=[];for(let key$2 in object)Object.prototype.hasOwnProperty.call(object,key$2)&&keys$3.push(key$2);return keys$3},util$1.find=(arr,checker)=>{for(let item of arr)if(checker(item))return item},util$1.isInteger=typeof Number.isInteger==`function`?val=>Number.isInteger(val):val=>typeof val==`number`&&Number.isFinite(val)&&Math.floor(val)===val;function joinValues(array,separator=` | `){return array.map(val=>typeof val==`string`?`'${val}'`:val).join(separator)}util$1.joinValues=joinValues,util$1.jsonStringifyReplacer=(_$2,value$1)=>typeof value$1==`bigint`?value$1.toString():value$1})(util||={});var objectUtil;(function(objectUtil$1){objectUtil$1.mergeShapes=(first,second)=>({...first,...second})})(objectUtil||={});const ZodParsedType=util.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),getParsedType=data$12=>{let t=typeof data$12;switch(t){case`undefined`:return ZodParsedType.undefined;case`string`:return ZodParsedType.string;case`number`:return Number.isNaN(data$12)?ZodParsedType.nan:ZodParsedType.number;case`boolean`:return ZodParsedType.boolean;case`function`:return ZodParsedType.function;case`bigint`:return ZodParsedType.bigint;case`symbol`:return ZodParsedType.symbol;case`object`:return Array.isArray(data$12)?ZodParsedType.array:data$12===null?ZodParsedType.null:data$12.then&&typeof data$12.then==`function`&&data$12.catch&&typeof data$12.catch==`function`?ZodParsedType.promise:typeof Map<`u`&&data$12 instanceof Map?ZodParsedType.map:typeof Set<`u`&&data$12 instanceof Set?ZodParsedType.set:typeof Date<`u`&&data$12 instanceof Date?ZodParsedType.date:ZodParsedType.object;default:return ZodParsedType.unknown}},ZodIssueCode=util.arrayToEnum([`invalid_type`,`invalid_literal`,`custom`,`invalid_union`,`invalid_union_discriminator`,`invalid_enum_value`,`unrecognized_keys`,`invalid_arguments`,`invalid_return_type`,`invalid_date`,`invalid_string`,`too_small`,`too_big`,`invalid_intersection_types`,`not_multiple_of`,`not_finite`]);var ZodError=class ZodError extends Error{get errors(){return this.issues}constructor(issues){super(),this.issues=[],this.addIssue=sub=>{this.issues=[...this.issues,sub]},this.addIssues=(subs=[])=>{this.issues=[...this.issues,...subs]};let actualProto=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,actualProto):this.__proto__=actualProto,this.name=`ZodError`,this.issues=issues}format(_mapper){let mapper=_mapper||function(issue){return issue.message},fieldErrors={_errors:[]},processError=error=>{for(let issue of error.issues)if(issue.code===`invalid_union`)issue.unionErrors.map(processError);else if(issue.code===`invalid_return_type`)processError(issue.returnTypeError);else if(issue.code===`invalid_arguments`)processError(issue.argumentsError);else if(issue.path.length===0)fieldErrors._errors.push(mapper(issue));else{let curr=fieldErrors,i$1=0;for(;i$1issue.message){let fieldErrors={},formErrors=[];for(let sub of this.issues)if(sub.path.length>0){let firstEl=sub.path[0];fieldErrors[firstEl]=fieldErrors[firstEl]||[],fieldErrors[firstEl].push(mapper(sub))}else formErrors.push(mapper(sub));return{formErrors,fieldErrors}}get formErrors(){return this.flatten()}};ZodError.create=issues=>{let error=new ZodError(issues);return error};const errorMap=(issue,_ctx)=>{let message$1;switch(issue.code){case ZodIssueCode.invalid_type:message$1=issue.received===ZodParsedType.undefined?`Required`:`Expected ${issue.expected}, received ${issue.received}`;break;case ZodIssueCode.invalid_literal:message$1=`Invalid literal value, expected ${JSON.stringify(issue.expected,util.jsonStringifyReplacer)}`;break;case ZodIssueCode.unrecognized_keys:message$1=`Unrecognized key(s) in object: ${util.joinValues(issue.keys,`, `)}`;break;case ZodIssueCode.invalid_union:message$1=`Invalid input`;break;case ZodIssueCode.invalid_union_discriminator:message$1=`Invalid discriminator value. Expected ${util.joinValues(issue.options)}`;break;case ZodIssueCode.invalid_enum_value:message$1=`Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`;break;case ZodIssueCode.invalid_arguments:message$1=`Invalid function arguments`;break;case ZodIssueCode.invalid_return_type:message$1=`Invalid function return type`;break;case ZodIssueCode.invalid_date:message$1=`Invalid date`;break;case ZodIssueCode.invalid_string:typeof issue.validation==`object`?`includes`in issue.validation?(message$1=`Invalid input: must include "${issue.validation.includes}"`,typeof issue.validation.position==`number`&&(message$1=`${message$1} at one or more positions greater than or equal to ${issue.validation.position}`)):`startsWith`in issue.validation?message$1=`Invalid input: must start with "${issue.validation.startsWith}"`:`endsWith`in issue.validation?message$1=`Invalid input: must end with "${issue.validation.endsWith}"`:util.assertNever(issue.validation):message$1=issue.validation===`regex`?`Invalid`:`Invalid ${issue.validation}`;break;case ZodIssueCode.too_small:message$1=issue.type===`array`?`Array must contain ${issue.exact?`exactly`:issue.inclusive?`at least`:`more than`} ${issue.minimum} element(s)`:issue.type===`string`?`String must contain ${issue.exact?`exactly`:issue.inclusive?`at least`:`over`} ${issue.minimum} character(s)`:issue.type===`number`||issue.type===`bigint`?`Number must be ${issue.exact?`exactly equal to `:issue.inclusive?`greater than or equal to `:`greater than `}${issue.minimum}`:issue.type===`date`?`Date must be ${issue.exact?`exactly equal to `:issue.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(issue.minimum))}`:`Invalid input`;break;case ZodIssueCode.too_big:message$1=issue.type===`array`?`Array must contain ${issue.exact?`exactly`:issue.inclusive?`at most`:`less than`} ${issue.maximum} element(s)`:issue.type===`string`?`String must contain ${issue.exact?`exactly`:issue.inclusive?`at most`:`under`} ${issue.maximum} character(s)`:issue.type===`number`?`Number must be ${issue.exact?`exactly`:issue.inclusive?`less than or equal to`:`less than`} ${issue.maximum}`:issue.type===`bigint`?`BigInt must be ${issue.exact?`exactly`:issue.inclusive?`less than or equal to`:`less than`} ${issue.maximum}`:issue.type===`date`?`Date must be ${issue.exact?`exactly`:issue.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(issue.maximum))}`:`Invalid input`;break;case ZodIssueCode.custom:message$1=`Invalid input`;break;case ZodIssueCode.invalid_intersection_types:message$1=`Intersection results could not be merged`;break;case ZodIssueCode.not_multiple_of:message$1=`Number must be a multiple of ${issue.multipleOf}`;break;case ZodIssueCode.not_finite:message$1=`Number must be finite`;break;default:message$1=_ctx.defaultError,util.assertNever(issue)}return{message:message$1}};var en_default$1=errorMap;let overrideErrorMap=en_default$1;function getErrorMap(){return overrideErrorMap}const makeIssue=params=>{let{data:data$12,path,errorMaps,issueData}=params,fullPath=[...path,...issueData.path||[]],fullIssue={...issueData,path:fullPath};if(issueData.message!==void 0)return{...issueData,path:fullPath,message:issueData.message};let errorMessage=``,maps=errorMaps.filter(m$3=>!!m$3).slice().reverse();for(let map of maps)errorMessage=map(fullIssue,{data:data$12,defaultError:errorMessage}).message;return{...issueData,path:fullPath,message:errorMessage}};function addIssueToContext(ctx,issueData){let overrideMap=getErrorMap(),issue=makeIssue({issueData,data:ctx.data,path:ctx.path,errorMaps:[ctx.common.contextualErrorMap,ctx.schemaErrorMap,overrideMap,overrideMap===en_default$1?void 0:en_default$1].filter(x$3=>!!x$3)});ctx.common.issues.push(issue)}var ParseStatus=class ParseStatus{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(status,results){let arrayValue=[];for(let s$1 of results){if(s$1.status===`aborted`)return INVALID;s$1.status===`dirty`&&status.dirty(),arrayValue.push(s$1.value)}return{status:status.value,value:arrayValue}}static async mergeObjectAsync(status,pairs){let syncPairs=[];for(let pair of pairs){let key$2=await pair.key,value$1=await pair.value;syncPairs.push({key:key$2,value:value$1})}return ParseStatus.mergeObjectSync(status,syncPairs)}static mergeObjectSync(status,pairs){let finalObject={};for(let pair of pairs){let{key:key$2,value:value$1}=pair;if(key$2.status===`aborted`||value$1.status===`aborted`)return INVALID;key$2.status===`dirty`&&status.dirty(),value$1.status===`dirty`&&status.dirty(),key$2.value!==`__proto__`&&(value$1.value!==void 0||pair.alwaysSet)&&(finalObject[key$2.value]=value$1.value)}return{status:status.value,value:finalObject}}};const INVALID=Object.freeze({status:`aborted`}),DIRTY=value$1=>({status:`dirty`,value:value$1}),OK=value$1=>({status:`valid`,value:value$1}),isAborted=x$3=>x$3.status===`aborted`,isDirty=x$3=>x$3.status===`dirty`,isValid=x$3=>x$3.status===`valid`,isAsync=x$3=>typeof Promise<`u`&&x$3 instanceof Promise;var errorUtil;(function(errorUtil$1){errorUtil$1.errToObj=message$1=>typeof message$1==`string`?{message:message$1}:message$1||{},errorUtil$1.toString=message$1=>typeof message$1==`string`?message$1:message$1?.message})(errorUtil||={});var ParseInputLazyPath=class{constructor(parent,value$1,path,key$2){this._cachedPath=[],this.parent=parent,this.data=value$1,this._path=path,this._key=key$2}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};const handleResult=(ctx,result)=>{if(isValid(result))return{success:!0,data:result.value};if(!ctx.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){if(this._error)return this._error;let error=new ZodError(ctx.common.issues);return this._error=error,this._error}}};function processCreateParams(params){if(!params)return{};let{errorMap:errorMap$1,invalid_type_error,required_error,description}=params;if(errorMap$1&&(invalid_type_error||required_error))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(errorMap$1)return{errorMap:errorMap$1,description};let customMap=(iss,ctx)=>{let{message:message$1}=params;return iss.code===`invalid_enum_value`?{message:message$1??ctx.defaultError}:ctx.data===void 0?{message:message$1??required_error??ctx.defaultError}:iss.code===`invalid_type`?{message:message$1??invalid_type_error??ctx.defaultError}:{message:ctx.defaultError}};return{errorMap:customMap,description}}var ZodType=class{get description(){return this._def.description}_getType(input){return getParsedType(input.data)}_getOrReturnCtx(input,ctx){return ctx||{common:input.parent.common,data:input.data,parsedType:getParsedType(input.data),schemaErrorMap:this._def.errorMap,path:input.path,parent:input.parent}}_processInputParams(input){return{status:new ParseStatus,ctx:{common:input.parent.common,data:input.data,parsedType:getParsedType(input.data),schemaErrorMap:this._def.errorMap,path:input.path,parent:input.parent}}}_parseSync(input){let result=this._parse(input);if(isAsync(result))throw Error(`Synchronous parse encountered promise.`);return result}_parseAsync(input){let result=this._parse(input);return Promise.resolve(result)}parse(data$12,params){let result=this.safeParse(data$12,params);if(result.success)return result.data;throw result.error}safeParse(data$12,params){let ctx={common:{issues:[],async:params?.async??!1,contextualErrorMap:params?.errorMap},path:params?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:data$12,parsedType:getParsedType(data$12)},result=this._parseSync({data:data$12,path:ctx.path,parent:ctx});return handleResult(ctx,result)}"~validate"(data$12){let ctx={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:data$12,parsedType:getParsedType(data$12)};if(!this[`~standard`].async)try{let result=this._parseSync({data:data$12,path:[],parent:ctx});return isValid(result)?{value:result.value}:{issues:ctx.common.issues}}catch(err){err?.message?.toLowerCase()?.includes(`encountered`)&&(this[`~standard`].async=!0),ctx.common={issues:[],async:!0}}return this._parseAsync({data:data$12,path:[],parent:ctx}).then(result=>isValid(result)?{value:result.value}:{issues:ctx.common.issues})}async parseAsync(data$12,params){let result=await this.safeParseAsync(data$12,params);if(result.success)return result.data;throw result.error}async safeParseAsync(data$12,params){let ctx={common:{issues:[],contextualErrorMap:params?.errorMap,async:!0},path:params?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:data$12,parsedType:getParsedType(data$12)},maybeAsyncResult=this._parse({data:data$12,path:ctx.path,parent:ctx}),result=await(isAsync(maybeAsyncResult)?maybeAsyncResult:Promise.resolve(maybeAsyncResult));return handleResult(ctx,result)}refine(check$1,message$1){let getIssueProperties=val=>typeof message$1==`string`||message$1===void 0?{message:message$1}:typeof message$1==`function`?message$1(val):message$1;return this._refinement((val,ctx)=>{let result=check$1(val),setError=()=>ctx.addIssue({code:ZodIssueCode.custom,...getIssueProperties(val)});return typeof Promise<`u`&&result instanceof Promise?result.then(data$12=>data$12?!0:(setError(),!1)):result?!0:(setError(),!1)})}refinement(check$1,refinementData){return this._refinement((val,ctx)=>check$1(val)?!0:(ctx.addIssue(typeof refinementData==`function`?refinementData(val,ctx):refinementData),!1))}_refinement(refinement){return new ZodEffects({schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:`refinement`,refinement}})}superRefine(refinement){return this._refinement(refinement)}constructor(def$1){this.spa=this.safeParseAsync,this._def=def$1,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this[`~standard`]={version:1,vendor:`zod`,validate:data$12=>this[`~validate`](data$12)}}optional(){return ZodOptional.create(this,this._def)}nullable(){return ZodNullable.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ZodArray.create(this)}promise(){return ZodPromise.create(this,this._def)}or(option$1){return ZodUnion.create([this,option$1],this._def)}and(incoming){return ZodIntersection.create(this,incoming,this._def)}transform(transform$1){return new ZodEffects({...processCreateParams(this._def),schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:`transform`,transform:transform$1}})}default(def$1){let defaultValueFunc=typeof def$1==`function`?def$1:()=>def$1;return new ZodDefault({...processCreateParams(this._def),innerType:this,defaultValue:defaultValueFunc,typeName:ZodFirstPartyTypeKind.ZodDefault})}brand(){return new ZodBranded({typeName:ZodFirstPartyTypeKind.ZodBranded,type:this,...processCreateParams(this._def)})}catch(def$1){let catchValueFunc=typeof def$1==`function`?def$1:()=>def$1;return new ZodCatch({...processCreateParams(this._def),innerType:this,catchValue:catchValueFunc,typeName:ZodFirstPartyTypeKind.ZodCatch})}describe(description){let This=this.constructor;return new This({...this._def,description})}pipe(target$1){return ZodPipeline.create(this,target$1)}readonly(){return ZodReadonly.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};const cuidRegex=/^c[^\s-]{8,}$/i,cuid2Regex=/^[0-9a-z]+$/,ulidRegex=/^[0-9A-HJKMNP-TV-Z]{26}$/i,uuidRegex=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,nanoidRegex=/^[a-z0-9_-]{21}$/i,jwtRegex=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,durationRegex=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,emailRegex=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_emojiRegex=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;let emojiRegex;const ipv4Regex=/^(?:(?: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])$/,ipv4CidrRegex=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,ipv6Regex=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ipv6CidrRegex=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64Regex=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64urlRegex=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,dateRegexSource=`((\\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])))`,dateRegex=RegExp(`^${dateRegexSource}$`);function timeRegexSource(args){let secondsRegexSource=`[0-5]\\d`;args.precision?secondsRegexSource=`${secondsRegexSource}\\.\\d{${args.precision}}`:args.precision??(secondsRegexSource=`${secondsRegexSource}(\\.\\d+)?`);let secondsQuantifier=args.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`}function timeRegex(args){return RegExp(`^${timeRegexSource(args)}$`)}function datetimeRegex(args){let regex=`${dateRegexSource}T${timeRegexSource(args)}`,opts=[];return opts.push(args.local?`Z?`:`Z`),args.offset&&opts.push(`([+-]\\d{2}:?\\d{2})`),regex=`${regex}(${opts.join(`|`)})`,RegExp(`^${regex}$`)}function isValidIP(ip$1,version$1){return!!((version$1===`v4`||!version$1)&&ipv4Regex.test(ip$1)||(version$1===`v6`||!version$1)&&ipv6Regex.test(ip$1))}function isValidJWT(jwt,alg){if(!jwtRegex.test(jwt))return!1;try{let[header]=jwt.split(`.`);if(!header)return!1;let base64=header.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(header.length+(4-header.length%4)%4,`=`),decoded=JSON.parse(atob(base64));return!(typeof decoded!=`object`||!decoded||`typ`in decoded&&decoded?.typ!==`JWT`||!decoded.alg||alg&&decoded.alg!==alg)}catch{return!1}}function isValidCidr(ip$1,version$1){return!!((version$1===`v4`||!version$1)&&ipv4CidrRegex.test(ip$1)||(version$1===`v6`||!version$1)&&ipv6CidrRegex.test(ip$1))}var ZodString=class ZodString extends ZodType{_parse(input){this._def.coerce&&(input.data=String(input.data));let parsedType=this._getType(input);if(parsedType!==ZodParsedType.string){let ctx$1=this._getOrReturnCtx(input);return addIssueToContext(ctx$1,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.string,received:ctx$1.parsedType}),INVALID}let status=new ParseStatus,ctx;for(let check$1 of this._def.checks)if(check$1.kind===`min`)input.data.lengthcheck$1.value&&(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.too_big,maximum:check$1.value,type:`string`,inclusive:!0,exact:!1,message:check$1.message}),status.dirty());else if(check$1.kind===`length`){let tooBig=input.data.length>check$1.value,tooSmall=input.data.lengthregex.test(data$12),{validation,code:ZodIssueCode.invalid_string,...errorUtil.errToObj(message$1)})}_addCheck(check$1){return new ZodString({...this._def,checks:[...this._def.checks,check$1]})}email(message$1){return this._addCheck({kind:`email`,...errorUtil.errToObj(message$1)})}url(message$1){return this._addCheck({kind:`url`,...errorUtil.errToObj(message$1)})}emoji(message$1){return this._addCheck({kind:`emoji`,...errorUtil.errToObj(message$1)})}uuid(message$1){return this._addCheck({kind:`uuid`,...errorUtil.errToObj(message$1)})}nanoid(message$1){return this._addCheck({kind:`nanoid`,...errorUtil.errToObj(message$1)})}cuid(message$1){return this._addCheck({kind:`cuid`,...errorUtil.errToObj(message$1)})}cuid2(message$1){return this._addCheck({kind:`cuid2`,...errorUtil.errToObj(message$1)})}ulid(message$1){return this._addCheck({kind:`ulid`,...errorUtil.errToObj(message$1)})}base64(message$1){return this._addCheck({kind:`base64`,...errorUtil.errToObj(message$1)})}base64url(message$1){return this._addCheck({kind:`base64url`,...errorUtil.errToObj(message$1)})}jwt(options$1){return this._addCheck({kind:`jwt`,...errorUtil.errToObj(options$1)})}ip(options$1){return this._addCheck({kind:`ip`,...errorUtil.errToObj(options$1)})}cidr(options$1){return this._addCheck({kind:`cidr`,...errorUtil.errToObj(options$1)})}datetime(options$1){return typeof options$1==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:options$1}):this._addCheck({kind:`datetime`,precision:options$1?.precision===void 0?null:options$1?.precision,offset:options$1?.offset??!1,local:options$1?.local??!1,...errorUtil.errToObj(options$1?.message)})}date(message$1){return this._addCheck({kind:`date`,message:message$1})}time(options$1){return typeof options$1==`string`?this._addCheck({kind:`time`,precision:null,message:options$1}):this._addCheck({kind:`time`,precision:options$1?.precision===void 0?null:options$1?.precision,...errorUtil.errToObj(options$1?.message)})}duration(message$1){return this._addCheck({kind:`duration`,...errorUtil.errToObj(message$1)})}regex(regex,message$1){return this._addCheck({kind:`regex`,regex,...errorUtil.errToObj(message$1)})}includes(value$1,options$1){return this._addCheck({kind:`includes`,value:value$1,position:options$1?.position,...errorUtil.errToObj(options$1?.message)})}startsWith(value$1,message$1){return this._addCheck({kind:`startsWith`,value:value$1,...errorUtil.errToObj(message$1)})}endsWith(value$1,message$1){return this._addCheck({kind:`endsWith`,value:value$1,...errorUtil.errToObj(message$1)})}min(minLength,message$1){return this._addCheck({kind:`min`,value:minLength,...errorUtil.errToObj(message$1)})}max(maxLength,message$1){return this._addCheck({kind:`max`,value:maxLength,...errorUtil.errToObj(message$1)})}length(len,message$1){return this._addCheck({kind:`length`,value:len,...errorUtil.errToObj(message$1)})}nonempty(message$1){return this.min(1,errorUtil.errToObj(message$1))}trim(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:`toUpperCase`}]})}get isDatetime(){return!!this._def.checks.find(ch$1=>ch$1.kind===`datetime`)}get isDate(){return!!this._def.checks.find(ch$1=>ch$1.kind===`date`)}get isTime(){return!!this._def.checks.find(ch$1=>ch$1.kind===`time`)}get isDuration(){return!!this._def.checks.find(ch$1=>ch$1.kind===`duration`)}get isEmail(){return!!this._def.checks.find(ch$1=>ch$1.kind===`email`)}get isURL(){return!!this._def.checks.find(ch$1=>ch$1.kind===`url`)}get isEmoji(){return!!this._def.checks.find(ch$1=>ch$1.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(ch$1=>ch$1.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(ch$1=>ch$1.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(ch$1=>ch$1.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(ch$1=>ch$1.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(ch$1=>ch$1.kind===`ulid`)}get isIP(){return!!this._def.checks.find(ch$1=>ch$1.kind===`ip`)}get isCIDR(){return!!this._def.checks.find(ch$1=>ch$1.kind===`cidr`)}get isBase64(){return!!this._def.checks.find(ch$1=>ch$1.kind===`base64`)}get isBase64url(){return!!this._def.checks.find(ch$1=>ch$1.kind===`base64url`)}get minLength(){let min$1=null;for(let ch$1 of this._def.checks)ch$1.kind===`min`&&(min$1===null||ch$1.value>min$1)&&(min$1=ch$1.value);return min$1}get maxLength(){let max$1=null;for(let ch$1 of this._def.checks)ch$1.kind===`max`&&(max$1===null||ch$1.valuenew ZodString({checks:[],typeName:ZodFirstPartyTypeKind.ZodString,coerce:params?.coerce??!1,...processCreateParams(params)});function floatSafeRemainder(val,step){let valDecCount=(val.toString().split(`.`)[1]||``).length,stepDecCount=(step.toString().split(`.`)[1]||``).length,decCount=valDecCount>stepDecCount?valDecCount:stepDecCount,valInt=Number.parseInt(val.toFixed(decCount).replace(`.`,``)),stepInt=Number.parseInt(step.toFixed(decCount).replace(`.`,``));return valInt%stepInt/10**decCount}var ZodNumber=class ZodNumber extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(input){this._def.coerce&&(input.data=Number(input.data));let parsedType=this._getType(input);if(parsedType!==ZodParsedType.number){let ctx$1=this._getOrReturnCtx(input);return addIssueToContext(ctx$1,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.number,received:ctx$1.parsedType}),INVALID}let ctx,status=new ParseStatus;for(let check$1 of this._def.checks)if(check$1.kind===`int`)util.isInteger(input.data)||(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:`integer`,received:`float`,message:check$1.message}),status.dirty());else if(check$1.kind===`min`){let tooSmall=check$1.inclusive?input.datacheck$1.value:input.data>=check$1.value;tooBig&&(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.too_big,maximum:check$1.value,type:`number`,inclusive:check$1.inclusive,exact:!1,message:check$1.message}),status.dirty())}else check$1.kind===`multipleOf`?floatSafeRemainder(input.data,check$1.value)!==0&&(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.not_multiple_of,multipleOf:check$1.value,message:check$1.message}),status.dirty()):check$1.kind===`finite`?Number.isFinite(input.data)||(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.not_finite,message:check$1.message}),status.dirty()):util.assertNever(check$1);return{status:status.value,value:input.data}}gte(value$1,message$1){return this.setLimit(`min`,value$1,!0,errorUtil.toString(message$1))}gt(value$1,message$1){return this.setLimit(`min`,value$1,!1,errorUtil.toString(message$1))}lte(value$1,message$1){return this.setLimit(`max`,value$1,!0,errorUtil.toString(message$1))}lt(value$1,message$1){return this.setLimit(`max`,value$1,!1,errorUtil.toString(message$1))}setLimit(kind,value$1,inclusive,message$1){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind,value:value$1,inclusive,message:errorUtil.toString(message$1)}]})}_addCheck(check$1){return new ZodNumber({...this._def,checks:[...this._def.checks,check$1]})}int(message$1){return this._addCheck({kind:`int`,message:errorUtil.toString(message$1)})}positive(message$1){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:errorUtil.toString(message$1)})}negative(message$1){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:errorUtil.toString(message$1)})}nonpositive(message$1){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:errorUtil.toString(message$1)})}nonnegative(message$1){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:errorUtil.toString(message$1)})}multipleOf(value$1,message$1){return this._addCheck({kind:`multipleOf`,value:value$1,message:errorUtil.toString(message$1)})}finite(message$1){return this._addCheck({kind:`finite`,message:errorUtil.toString(message$1)})}safe(message$1){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:errorUtil.toString(message$1)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:errorUtil.toString(message$1)})}get minValue(){let min$1=null;for(let ch$1 of this._def.checks)ch$1.kind===`min`&&(min$1===null||ch$1.value>min$1)&&(min$1=ch$1.value);return min$1}get maxValue(){let max$1=null;for(let ch$1 of this._def.checks)ch$1.kind===`max`&&(max$1===null||ch$1.valuech$1.kind===`int`||ch$1.kind===`multipleOf`&&util.isInteger(ch$1.value))}get isFinite(){let max$1=null,min$1=null;for(let ch$1 of this._def.checks)if(ch$1.kind===`finite`||ch$1.kind===`int`||ch$1.kind===`multipleOf`)return!0;else ch$1.kind===`min`?(min$1===null||ch$1.value>min$1)&&(min$1=ch$1.value):ch$1.kind===`max`&&(max$1===null||ch$1.valuenew ZodNumber({checks:[],typeName:ZodFirstPartyTypeKind.ZodNumber,coerce:params?.coerce||!1,...processCreateParams(params)});var ZodBigInt=class ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(input){if(this._def.coerce)try{input.data=BigInt(input.data)}catch{return this._getInvalidInput(input)}let parsedType=this._getType(input);if(parsedType!==ZodParsedType.bigint)return this._getInvalidInput(input);let ctx,status=new ParseStatus;for(let check$1 of this._def.checks)if(check$1.kind===`min`){let tooSmall=check$1.inclusive?input.datacheck$1.value:input.data>=check$1.value;tooBig&&(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.too_big,type:`bigint`,maximum:check$1.value,inclusive:check$1.inclusive,message:check$1.message}),status.dirty())}else check$1.kind===`multipleOf`?input.data%check$1.value!==BigInt(0)&&(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.not_multiple_of,multipleOf:check$1.value,message:check$1.message}),status.dirty()):util.assertNever(check$1);return{status:status.value,value:input.data}}_getInvalidInput(input){let ctx=this._getOrReturnCtx(input);return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.bigint,received:ctx.parsedType}),INVALID}gte(value$1,message$1){return this.setLimit(`min`,value$1,!0,errorUtil.toString(message$1))}gt(value$1,message$1){return this.setLimit(`min`,value$1,!1,errorUtil.toString(message$1))}lte(value$1,message$1){return this.setLimit(`max`,value$1,!0,errorUtil.toString(message$1))}lt(value$1,message$1){return this.setLimit(`max`,value$1,!1,errorUtil.toString(message$1))}setLimit(kind,value$1,inclusive,message$1){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind,value:value$1,inclusive,message:errorUtil.toString(message$1)}]})}_addCheck(check$1){return new ZodBigInt({...this._def,checks:[...this._def.checks,check$1]})}positive(message$1){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:errorUtil.toString(message$1)})}negative(message$1){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:errorUtil.toString(message$1)})}nonpositive(message$1){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:errorUtil.toString(message$1)})}nonnegative(message$1){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:errorUtil.toString(message$1)})}multipleOf(value$1,message$1){return this._addCheck({kind:`multipleOf`,value:value$1,message:errorUtil.toString(message$1)})}get minValue(){let min$1=null;for(let ch$1 of this._def.checks)ch$1.kind===`min`&&(min$1===null||ch$1.value>min$1)&&(min$1=ch$1.value);return min$1}get maxValue(){let max$1=null;for(let ch$1 of this._def.checks)ch$1.kind===`max`&&(max$1===null||ch$1.valuenew ZodBigInt({checks:[],typeName:ZodFirstPartyTypeKind.ZodBigInt,coerce:params?.coerce??!1,...processCreateParams(params)});var ZodBoolean=class extends ZodType{_parse(input){this._def.coerce&&(input.data=!!input.data);let parsedType=this._getType(input);if(parsedType!==ZodParsedType.boolean){let ctx=this._getOrReturnCtx(input);return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.boolean,received:ctx.parsedType}),INVALID}return OK(input.data)}};ZodBoolean.create=params=>new ZodBoolean({typeName:ZodFirstPartyTypeKind.ZodBoolean,coerce:params?.coerce||!1,...processCreateParams(params)});var ZodDate=class ZodDate extends ZodType{_parse(input){this._def.coerce&&(input.data=new Date(input.data));let parsedType=this._getType(input);if(parsedType!==ZodParsedType.date){let ctx$1=this._getOrReturnCtx(input);return addIssueToContext(ctx$1,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.date,received:ctx$1.parsedType}),INVALID}if(Number.isNaN(input.data.getTime())){let ctx$1=this._getOrReturnCtx(input);return addIssueToContext(ctx$1,{code:ZodIssueCode.invalid_date}),INVALID}let status=new ParseStatus,ctx;for(let check$1 of this._def.checks)check$1.kind===`min`?input.data.getTime()check$1.value&&(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.too_big,message:check$1.message,inclusive:!0,exact:!1,maximum:check$1.value,type:`date`}),status.dirty()):util.assertNever(check$1);return{status:status.value,value:new Date(input.data.getTime())}}_addCheck(check$1){return new ZodDate({...this._def,checks:[...this._def.checks,check$1]})}min(minDate,message$1){return this._addCheck({kind:`min`,value:minDate.getTime(),message:errorUtil.toString(message$1)})}max(maxDate,message$1){return this._addCheck({kind:`max`,value:maxDate.getTime(),message:errorUtil.toString(message$1)})}get minDate(){let min$1=null;for(let ch$1 of this._def.checks)ch$1.kind===`min`&&(min$1===null||ch$1.value>min$1)&&(min$1=ch$1.value);return min$1==null?null:new Date(min$1)}get maxDate(){let max$1=null;for(let ch$1 of this._def.checks)ch$1.kind===`max`&&(max$1===null||ch$1.valuenew ZodDate({checks:[],coerce:params?.coerce||!1,typeName:ZodFirstPartyTypeKind.ZodDate,...processCreateParams(params)});var ZodSymbol=class extends ZodType{_parse(input){let parsedType=this._getType(input);if(parsedType!==ZodParsedType.symbol){let ctx=this._getOrReturnCtx(input);return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.symbol,received:ctx.parsedType}),INVALID}return OK(input.data)}};ZodSymbol.create=params=>new ZodSymbol({typeName:ZodFirstPartyTypeKind.ZodSymbol,...processCreateParams(params)});var ZodUndefined=class extends ZodType{_parse(input){let parsedType=this._getType(input);if(parsedType!==ZodParsedType.undefined){let ctx=this._getOrReturnCtx(input);return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.undefined,received:ctx.parsedType}),INVALID}return OK(input.data)}};ZodUndefined.create=params=>new ZodUndefined({typeName:ZodFirstPartyTypeKind.ZodUndefined,...processCreateParams(params)});var ZodNull=class extends ZodType{_parse(input){let parsedType=this._getType(input);if(parsedType!==ZodParsedType.null){let ctx=this._getOrReturnCtx(input);return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.null,received:ctx.parsedType}),INVALID}return OK(input.data)}};ZodNull.create=params=>new ZodNull({typeName:ZodFirstPartyTypeKind.ZodNull,...processCreateParams(params)});var ZodAny=class extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(input){return OK(input.data)}};ZodAny.create=params=>new ZodAny({typeName:ZodFirstPartyTypeKind.ZodAny,...processCreateParams(params)});var ZodUnknown=class extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(input){return OK(input.data)}};ZodUnknown.create=params=>new ZodUnknown({typeName:ZodFirstPartyTypeKind.ZodUnknown,...processCreateParams(params)});var ZodNever=class extends ZodType{_parse(input){let ctx=this._getOrReturnCtx(input);return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.never,received:ctx.parsedType}),INVALID}};ZodNever.create=params=>new ZodNever({typeName:ZodFirstPartyTypeKind.ZodNever,...processCreateParams(params)});var ZodVoid=class extends ZodType{_parse(input){let parsedType=this._getType(input);if(parsedType!==ZodParsedType.undefined){let ctx=this._getOrReturnCtx(input);return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.void,received:ctx.parsedType}),INVALID}return OK(input.data)}};ZodVoid.create=params=>new ZodVoid({typeName:ZodFirstPartyTypeKind.ZodVoid,...processCreateParams(params)});var ZodArray=class ZodArray extends ZodType{_parse(input){let{ctx,status}=this._processInputParams(input),def$1=this._def;if(ctx.parsedType!==ZodParsedType.array)return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:ctx.parsedType}),INVALID;if(def$1.exactLength!==null){let tooBig=ctx.data.length>def$1.exactLength.value,tooSmall=ctx.data.lengthdef$1.maxLength.value&&(addIssueToContext(ctx,{code:ZodIssueCode.too_big,maximum:def$1.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:def$1.maxLength.message}),status.dirty()),ctx.common.async)return Promise.all([...ctx.data].map((item,i$1)=>def$1.type._parseAsync(new ParseInputLazyPath(ctx,item,ctx.path,i$1)))).then(result$1=>ParseStatus.mergeArray(status,result$1));let result=[...ctx.data].map((item,i$1)=>def$1.type._parseSync(new ParseInputLazyPath(ctx,item,ctx.path,i$1)));return ParseStatus.mergeArray(status,result)}get element(){return this._def.type}min(minLength,message$1){return new ZodArray({...this._def,minLength:{value:minLength,message:errorUtil.toString(message$1)}})}max(maxLength,message$1){return new ZodArray({...this._def,maxLength:{value:maxLength,message:errorUtil.toString(message$1)}})}length(len,message$1){return new ZodArray({...this._def,exactLength:{value:len,message:errorUtil.toString(message$1)}})}nonempty(message$1){return this.min(1,message$1)}};ZodArray.create=(schema,params)=>new ZodArray({type:schema,minLength:null,maxLength:null,exactLength:null,typeName:ZodFirstPartyTypeKind.ZodArray,...processCreateParams(params)});function deepPartialify(schema){if(schema instanceof ZodObject){let newShape={};for(let key$2 in schema.shape){let fieldSchema=schema.shape[key$2];newShape[key$2]=ZodOptional.create(deepPartialify(fieldSchema))}return new ZodObject({...schema._def,shape:()=>newShape})}else if(schema instanceof ZodArray)return new ZodArray({...schema._def,type:deepPartialify(schema.element)});else if(schema instanceof ZodOptional)return ZodOptional.create(deepPartialify(schema.unwrap()));else if(schema instanceof ZodNullable)return ZodNullable.create(deepPartialify(schema.unwrap()));else if(schema instanceof ZodTuple)return ZodTuple.create(schema.items.map(item=>deepPartialify(item)));else return schema}var ZodObject=class ZodObject extends ZodType{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let shape=this._def.shape(),keys$3=util.objectKeys(shape);return this._cached={shape,keys:keys$3},this._cached}_parse(input){let parsedType=this._getType(input);if(parsedType!==ZodParsedType.object){let ctx$1=this._getOrReturnCtx(input);return addIssueToContext(ctx$1,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:ctx$1.parsedType}),INVALID}let{status,ctx}=this._processInputParams(input),{shape,keys:shapeKeys}=this._getCached(),extraKeys=[];if(!(this._def.catchall instanceof ZodNever&&this._def.unknownKeys===`strip`))for(let key$2 in ctx.data)shapeKeys.includes(key$2)||extraKeys.push(key$2);let pairs=[];for(let key$2 of shapeKeys){let keyValidator=shape[key$2],value$1=ctx.data[key$2];pairs.push({key:{status:`valid`,value:key$2},value:keyValidator._parse(new ParseInputLazyPath(ctx,value$1,ctx.path,key$2)),alwaysSet:key$2 in ctx.data})}if(this._def.catchall instanceof ZodNever){let unknownKeys=this._def.unknownKeys;if(unknownKeys===`passthrough`)for(let key$2 of extraKeys)pairs.push({key:{status:`valid`,value:key$2},value:{status:`valid`,value:ctx.data[key$2]}});else if(unknownKeys===`strict`)extraKeys.length>0&&(addIssueToContext(ctx,{code:ZodIssueCode.unrecognized_keys,keys:extraKeys}),status.dirty());else if(unknownKeys!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let catchall=this._def.catchall;for(let key$2 of extraKeys){let value$1=ctx.data[key$2];pairs.push({key:{status:`valid`,value:key$2},value:catchall._parse(new ParseInputLazyPath(ctx,value$1,ctx.path,key$2)),alwaysSet:key$2 in ctx.data})}}return ctx.common.async?Promise.resolve().then(async()=>{let syncPairs=[];for(let pair of pairs){let key$2=await pair.key,value$1=await pair.value;syncPairs.push({key:key$2,value:value$1,alwaysSet:pair.alwaysSet})}return syncPairs}).then(syncPairs=>ParseStatus.mergeObjectSync(status,syncPairs)):ParseStatus.mergeObjectSync(status,pairs)}get shape(){return this._def.shape()}strict(message$1){return errorUtil.errToObj,new ZodObject({...this._def,unknownKeys:`strict`,...message$1===void 0?{}:{errorMap:(issue,ctx)=>{let defaultError=this._def.errorMap?.(issue,ctx).message??ctx.defaultError;return issue.code===`unrecognized_keys`?{message:errorUtil.errToObj(message$1).message??defaultError}:{message:defaultError}}}})}strip(){return new ZodObject({...this._def,unknownKeys:`strip`})}passthrough(){return new ZodObject({...this._def,unknownKeys:`passthrough`})}extend(augmentation){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),...augmentation})})}merge(merging){let merged=new ZodObject({unknownKeys:merging._def.unknownKeys,catchall:merging._def.catchall,shape:()=>({...this._def.shape(),...merging._def.shape()}),typeName:ZodFirstPartyTypeKind.ZodObject});return merged}setKey(key$2,schema){return this.augment({[key$2]:schema})}catchall(index$1){return new ZodObject({...this._def,catchall:index$1})}pick(mask){let shape={};for(let key$2 of util.objectKeys(mask))mask[key$2]&&this.shape[key$2]&&(shape[key$2]=this.shape[key$2]);return new ZodObject({...this._def,shape:()=>shape})}omit(mask){let shape={};for(let key$2 of util.objectKeys(this.shape))mask[key$2]||(shape[key$2]=this.shape[key$2]);return new ZodObject({...this._def,shape:()=>shape})}deepPartial(){return deepPartialify(this)}partial(mask){let newShape={};for(let key$2 of util.objectKeys(this.shape)){let fieldSchema=this.shape[key$2];mask&&!mask[key$2]?newShape[key$2]=fieldSchema:newShape[key$2]=fieldSchema.optional()}return new ZodObject({...this._def,shape:()=>newShape})}required(mask){let newShape={};for(let key$2 of util.objectKeys(this.shape))if(mask&&!mask[key$2])newShape[key$2]=this.shape[key$2];else{let fieldSchema=this.shape[key$2],newField=fieldSchema;for(;newField instanceof ZodOptional;)newField=newField._def.innerType;newShape[key$2]=newField}return new ZodObject({...this._def,shape:()=>newShape})}keyof(){return createZodEnum(util.objectKeys(this.shape))}};ZodObject.create=(shape,params)=>new ZodObject({shape:()=>shape,unknownKeys:`strip`,catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(params)}),ZodObject.strictCreate=(shape,params)=>new ZodObject({shape:()=>shape,unknownKeys:`strict`,catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(params)}),ZodObject.lazycreate=(shape,params)=>new ZodObject({shape,unknownKeys:`strip`,catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(params)});var ZodUnion=class extends ZodType{_parse(input){let{ctx}=this._processInputParams(input),options$1=this._def.options;function handleResults(results){for(let result of results)if(result.result.status===`valid`)return result.result;for(let result of results)if(result.result.status===`dirty`)return ctx.common.issues.push(...result.ctx.common.issues),result.result;let unionErrors=results.map(result=>new ZodError(result.ctx.common.issues));return addIssueToContext(ctx,{code:ZodIssueCode.invalid_union,unionErrors}),INVALID}if(ctx.common.async)return Promise.all(options$1.map(async option$1=>{let childCtx={...ctx,common:{...ctx.common,issues:[]},parent:null};return{result:await option$1._parseAsync({data:ctx.data,path:ctx.path,parent:childCtx}),ctx:childCtx}})).then(handleResults);{let dirty,issues=[];for(let option$1 of options$1){let childCtx={...ctx,common:{...ctx.common,issues:[]},parent:null},result=option$1._parseSync({data:ctx.data,path:ctx.path,parent:childCtx});if(result.status===`valid`)return result;result.status===`dirty`&&!dirty&&(dirty={result,ctx:childCtx}),childCtx.common.issues.length&&issues.push(childCtx.common.issues)}if(dirty)return ctx.common.issues.push(...dirty.ctx.common.issues),dirty.result;let unionErrors=issues.map(issues$1=>new ZodError(issues$1));return addIssueToContext(ctx,{code:ZodIssueCode.invalid_union,unionErrors}),INVALID}}get options(){return this._def.options}};ZodUnion.create=(types$1,params)=>new ZodUnion({options:types$1,typeName:ZodFirstPartyTypeKind.ZodUnion,...processCreateParams(params)});const getDiscriminator=type=>type instanceof ZodLazy?getDiscriminator(type.schema):type instanceof ZodEffects?getDiscriminator(type.innerType()):type instanceof ZodLiteral?[type.value]:type instanceof ZodEnum?type.options:type instanceof ZodNativeEnum?util.objectValues(type.enum):type instanceof ZodDefault?getDiscriminator(type._def.innerType):type instanceof ZodUndefined?[void 0]:type instanceof ZodNull?[null]:type instanceof ZodOptional?[void 0,...getDiscriminator(type.unwrap())]:type instanceof ZodNullable?[null,...getDiscriminator(type.unwrap())]:type instanceof ZodBranded||type instanceof ZodReadonly?getDiscriminator(type.unwrap()):type instanceof ZodCatch?getDiscriminator(type._def.innerType):[];var ZodDiscriminatedUnion=class ZodDiscriminatedUnion extends ZodType{_parse(input){let{ctx}=this._processInputParams(input);if(ctx.parsedType!==ZodParsedType.object)return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:ctx.parsedType}),INVALID;let discriminator=this.discriminator,discriminatorValue=ctx.data[discriminator],option$1=this.optionsMap.get(discriminatorValue);return option$1?ctx.common.async?option$1._parseAsync({data:ctx.data,path:ctx.path,parent:ctx}):option$1._parseSync({data:ctx.data,path:ctx.path,parent:ctx}):(addIssueToContext(ctx,{code:ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[discriminator]}),INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(discriminator,options$1,params){let optionsMap=new Map;for(let type of options$1){let discriminatorValues=getDiscriminator(type.shape[discriminator]);if(!discriminatorValues.length)throw Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`);for(let value$1 of discriminatorValues){if(optionsMap.has(value$1))throw Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value$1)}`);optionsMap.set(value$1,type)}}return new ZodDiscriminatedUnion({typeName:ZodFirstPartyTypeKind.ZodDiscriminatedUnion,discriminator,options:options$1,optionsMap,...processCreateParams(params)})}};function mergeValues(a$2,b$4){let aType=getParsedType(a$2),bType=getParsedType(b$4);if(a$2===b$4)return{valid:!0,data:a$2};if(aType===ZodParsedType.object&&bType===ZodParsedType.object){let bKeys=util.objectKeys(b$4),sharedKeys=util.objectKeys(a$2).filter(key$2=>bKeys.indexOf(key$2)!==-1),newObj={...a$2,...b$4};for(let key$2 of sharedKeys){let sharedValue=mergeValues(a$2[key$2],b$4[key$2]);if(!sharedValue.valid)return{valid:!1};newObj[key$2]=sharedValue.data}return{valid:!0,data:newObj}}else if(aType===ZodParsedType.array&&bType===ZodParsedType.array){if(a$2.length!==b$4.length)return{valid:!1};let newArray=[];for(let index$1=0;index$1{if(isAborted(parsedLeft)||isAborted(parsedRight))return INVALID;let merged=mergeValues(parsedLeft.value,parsedRight.value);return merged.valid?((isDirty(parsedLeft)||isDirty(parsedRight))&&status.dirty(),{status:status.value,value:merged.data}):(addIssueToContext(ctx,{code:ZodIssueCode.invalid_intersection_types}),INVALID)};return ctx.common.async?Promise.all([this._def.left._parseAsync({data:ctx.data,path:ctx.path,parent:ctx}),this._def.right._parseAsync({data:ctx.data,path:ctx.path,parent:ctx})]).then(([left,right])=>handleParsed(left,right)):handleParsed(this._def.left._parseSync({data:ctx.data,path:ctx.path,parent:ctx}),this._def.right._parseSync({data:ctx.data,path:ctx.path,parent:ctx}))}};ZodIntersection.create=(left,right,params)=>new ZodIntersection({left,right,typeName:ZodFirstPartyTypeKind.ZodIntersection,...processCreateParams(params)});var ZodTuple=class ZodTuple extends ZodType{_parse(input){let{status,ctx}=this._processInputParams(input);if(ctx.parsedType!==ZodParsedType.array)return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:ctx.parsedType}),INVALID;if(ctx.data.lengththis._def.items.length&&(addIssueToContext(ctx,{code:ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),status.dirty());let items=[...ctx.data].map((item,itemIndex)=>{let schema=this._def.items[itemIndex]||this._def.rest;return schema?schema._parse(new ParseInputLazyPath(ctx,item,ctx.path,itemIndex)):null}).filter(x$3=>!!x$3);return ctx.common.async?Promise.all(items).then(results=>ParseStatus.mergeArray(status,results)):ParseStatus.mergeArray(status,items)}get items(){return this._def.items}rest(rest){return new ZodTuple({...this._def,rest})}};ZodTuple.create=(schemas,params)=>{if(!Array.isArray(schemas))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new ZodTuple({items:schemas,typeName:ZodFirstPartyTypeKind.ZodTuple,rest:null,...processCreateParams(params)})};var ZodRecord=class ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(input){let{status,ctx}=this._processInputParams(input);if(ctx.parsedType!==ZodParsedType.object)return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:ctx.parsedType}),INVALID;let pairs=[],keyType=this._def.keyType,valueType=this._def.valueType;for(let key$2 in ctx.data)pairs.push({key:keyType._parse(new ParseInputLazyPath(ctx,key$2,ctx.path,key$2)),value:valueType._parse(new ParseInputLazyPath(ctx,ctx.data[key$2],ctx.path,key$2)),alwaysSet:key$2 in ctx.data});return ctx.common.async?ParseStatus.mergeObjectAsync(status,pairs):ParseStatus.mergeObjectSync(status,pairs)}get element(){return this._def.valueType}static create(first,second,third){return second instanceof ZodType?new ZodRecord({keyType:first,valueType:second,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(third)}):new ZodRecord({keyType:ZodString.create(),valueType:first,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(second)})}},ZodMap=class extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(input){let{status,ctx}=this._processInputParams(input);if(ctx.parsedType!==ZodParsedType.map)return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.map,received:ctx.parsedType}),INVALID;let keyType=this._def.keyType,valueType=this._def.valueType,pairs=[...ctx.data.entries()].map(([key$2,value$1],index$1)=>({key:keyType._parse(new ParseInputLazyPath(ctx,key$2,ctx.path,[index$1,`key`])),value:valueType._parse(new ParseInputLazyPath(ctx,value$1,ctx.path,[index$1,`value`]))}));if(ctx.common.async){let finalMap=new Map;return Promise.resolve().then(async()=>{for(let pair of pairs){let key$2=await pair.key,value$1=await pair.value;if(key$2.status===`aborted`||value$1.status===`aborted`)return INVALID;(key$2.status===`dirty`||value$1.status===`dirty`)&&status.dirty(),finalMap.set(key$2.value,value$1.value)}return{status:status.value,value:finalMap}})}else{let finalMap=new Map;for(let pair of pairs){let key$2=pair.key,value$1=pair.value;if(key$2.status===`aborted`||value$1.status===`aborted`)return INVALID;(key$2.status===`dirty`||value$1.status===`dirty`)&&status.dirty(),finalMap.set(key$2.value,value$1.value)}return{status:status.value,value:finalMap}}}};ZodMap.create=(keyType,valueType,params)=>new ZodMap({valueType,keyType,typeName:ZodFirstPartyTypeKind.ZodMap,...processCreateParams(params)});var ZodSet=class ZodSet extends ZodType{_parse(input){let{status,ctx}=this._processInputParams(input);if(ctx.parsedType!==ZodParsedType.set)return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.set,received:ctx.parsedType}),INVALID;let def$1=this._def;def$1.minSize!==null&&ctx.data.sizedef$1.maxSize.value&&(addIssueToContext(ctx,{code:ZodIssueCode.too_big,maximum:def$1.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:def$1.maxSize.message}),status.dirty());let valueType=this._def.valueType;function finalizeSet(elements$1){let parsedSet=new Set;for(let element$3 of elements$1){if(element$3.status===`aborted`)return INVALID;element$3.status===`dirty`&&status.dirty(),parsedSet.add(element$3.value)}return{status:status.value,value:parsedSet}}let elements=[...ctx.data.values()].map((item,i$1)=>valueType._parse(new ParseInputLazyPath(ctx,item,ctx.path,i$1)));return ctx.common.async?Promise.all(elements).then(elements$1=>finalizeSet(elements$1)):finalizeSet(elements)}min(minSize,message$1){return new ZodSet({...this._def,minSize:{value:minSize,message:errorUtil.toString(message$1)}})}max(maxSize,message$1){return new ZodSet({...this._def,maxSize:{value:maxSize,message:errorUtil.toString(message$1)}})}size(size$2,message$1){return this.min(size$2,message$1).max(size$2,message$1)}nonempty(message$1){return this.min(1,message$1)}};ZodSet.create=(valueType,params)=>new ZodSet({valueType,minSize:null,maxSize:null,typeName:ZodFirstPartyTypeKind.ZodSet,...processCreateParams(params)});var ZodFunction=class ZodFunction extends ZodType{constructor(){super(...arguments),this.validate=this.implement}_parse(input){let{ctx}=this._processInputParams(input);if(ctx.parsedType!==ZodParsedType.function)return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.function,received:ctx.parsedType}),INVALID;function makeArgsIssue(args,error){return makeIssue({data:args,path:ctx.path,errorMaps:[ctx.common.contextualErrorMap,ctx.schemaErrorMap,getErrorMap(),en_default$1].filter(x$3=>!!x$3),issueData:{code:ZodIssueCode.invalid_arguments,argumentsError:error}})}function makeReturnsIssue(returns,error){return makeIssue({data:returns,path:ctx.path,errorMaps:[ctx.common.contextualErrorMap,ctx.schemaErrorMap,getErrorMap(),en_default$1].filter(x$3=>!!x$3),issueData:{code:ZodIssueCode.invalid_return_type,returnTypeError:error}})}let params={errorMap:ctx.common.contextualErrorMap},fn$6=ctx.data;if(this._def.returns instanceof ZodPromise){let me$2=this;return OK(async function(...args){let error=new ZodError([]),parsedArgs=await me$2._def.args.parseAsync(args,params).catch(e$3=>{throw error.addIssue(makeArgsIssue(args,e$3)),error}),result=await Reflect.apply(fn$6,this,parsedArgs),parsedReturns=await me$2._def.returns._def.type.parseAsync(result,params).catch(e$3=>{throw error.addIssue(makeReturnsIssue(result,e$3)),error});return parsedReturns})}else{let me$2=this;return OK(function(...args){let parsedArgs=me$2._def.args.safeParse(args,params);if(!parsedArgs.success)throw new ZodError([makeArgsIssue(args,parsedArgs.error)]);let result=Reflect.apply(fn$6,this,parsedArgs.data),parsedReturns=me$2._def.returns.safeParse(result,params);if(!parsedReturns.success)throw new ZodError([makeReturnsIssue(result,parsedReturns.error)]);return parsedReturns.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...items){return new ZodFunction({...this._def,args:ZodTuple.create(items).rest(ZodUnknown.create())})}returns(returnType){return new ZodFunction({...this._def,returns:returnType})}implement(func){let validatedFunc=this.parse(func);return validatedFunc}strictImplement(func){let validatedFunc=this.parse(func);return validatedFunc}static create(args,returns,params){return new ZodFunction({args:args||ZodTuple.create([]).rest(ZodUnknown.create()),returns:returns||ZodUnknown.create(),typeName:ZodFirstPartyTypeKind.ZodFunction,...processCreateParams(params)})}},ZodLazy=class extends ZodType{get schema(){return this._def.getter()}_parse(input){let{ctx}=this._processInputParams(input),lazySchema=this._def.getter();return lazySchema._parse({data:ctx.data,path:ctx.path,parent:ctx})}};ZodLazy.create=(getter,params)=>new ZodLazy({getter,typeName:ZodFirstPartyTypeKind.ZodLazy,...processCreateParams(params)});var ZodLiteral=class extends ZodType{_parse(input){if(input.data!==this._def.value){let ctx=this._getOrReturnCtx(input);return addIssueToContext(ctx,{received:ctx.data,code:ZodIssueCode.invalid_literal,expected:this._def.value}),INVALID}return{status:`valid`,value:input.data}}get value(){return this._def.value}};ZodLiteral.create=(value$1,params)=>new ZodLiteral({value:value$1,typeName:ZodFirstPartyTypeKind.ZodLiteral,...processCreateParams(params)});function createZodEnum(values,params){return new ZodEnum({values,typeName:ZodFirstPartyTypeKind.ZodEnum,...processCreateParams(params)})}var ZodEnum=class ZodEnum extends ZodType{_parse(input){if(typeof input.data!=`string`){let ctx=this._getOrReturnCtx(input),expectedValues=this._def.values;return addIssueToContext(ctx,{expected:util.joinValues(expectedValues),received:ctx.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(this._cache||=new Set(this._def.values),!this._cache.has(input.data)){let ctx=this._getOrReturnCtx(input),expectedValues=this._def.values;return addIssueToContext(ctx,{received:ctx.data,code:ZodIssueCode.invalid_enum_value,options:expectedValues}),INVALID}return OK(input.data)}get options(){return this._def.values}get enum(){let enumValues={};for(let val of this._def.values)enumValues[val]=val;return enumValues}get Values(){let enumValues={};for(let val of this._def.values)enumValues[val]=val;return enumValues}get Enum(){let enumValues={};for(let val of this._def.values)enumValues[val]=val;return enumValues}extract(values,newDef=this._def){return ZodEnum.create(values,{...this._def,...newDef})}exclude(values,newDef=this._def){return ZodEnum.create(this.options.filter(opt=>!values.includes(opt)),{...this._def,...newDef})}};ZodEnum.create=createZodEnum;var ZodNativeEnum=class extends ZodType{_parse(input){let nativeEnumValues=util.getValidEnumValues(this._def.values),ctx=this._getOrReturnCtx(input);if(ctx.parsedType!==ZodParsedType.string&&ctx.parsedType!==ZodParsedType.number){let expectedValues=util.objectValues(nativeEnumValues);return addIssueToContext(ctx,{expected:util.joinValues(expectedValues),received:ctx.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(this._cache||=new Set(util.getValidEnumValues(this._def.values)),!this._cache.has(input.data)){let expectedValues=util.objectValues(nativeEnumValues);return addIssueToContext(ctx,{received:ctx.data,code:ZodIssueCode.invalid_enum_value,options:expectedValues}),INVALID}return OK(input.data)}get enum(){return this._def.values}};ZodNativeEnum.create=(values,params)=>new ZodNativeEnum({values,typeName:ZodFirstPartyTypeKind.ZodNativeEnum,...processCreateParams(params)});var ZodPromise=class extends ZodType{unwrap(){return this._def.type}_parse(input){let{ctx}=this._processInputParams(input);if(ctx.parsedType!==ZodParsedType.promise&&ctx.common.async===!1)return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.promise,received:ctx.parsedType}),INVALID;let promisified=ctx.parsedType===ZodParsedType.promise?ctx.data:Promise.resolve(ctx.data);return OK(promisified.then(data$12=>this._def.type.parseAsync(data$12,{path:ctx.path,errorMap:ctx.common.contextualErrorMap})))}};ZodPromise.create=(schema,params)=>new ZodPromise({type:schema,typeName:ZodFirstPartyTypeKind.ZodPromise,...processCreateParams(params)});var ZodEffects=class extends ZodType{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ZodFirstPartyTypeKind.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(input){let{status,ctx}=this._processInputParams(input),effect$1=this._def.effect||null,checkCtx={addIssue:arg=>{addIssueToContext(ctx,arg),arg.fatal?status.abort():status.dirty()},get path(){return ctx.path}};if(checkCtx.addIssue=checkCtx.addIssue.bind(checkCtx),effect$1.type===`preprocess`){let processed=effect$1.transform(ctx.data,checkCtx);if(ctx.common.async)return Promise.resolve(processed).then(async processed$1=>{if(status.value===`aborted`)return INVALID;let result=await this._def.schema._parseAsync({data:processed$1,path:ctx.path,parent:ctx});return result.status===`aborted`?INVALID:result.status===`dirty`||status.value===`dirty`?DIRTY(result.value):result});{if(status.value===`aborted`)return INVALID;let result=this._def.schema._parseSync({data:processed,path:ctx.path,parent:ctx});return result.status===`aborted`?INVALID:result.status===`dirty`||status.value===`dirty`?DIRTY(result.value):result}}if(effect$1.type===`refinement`){let executeRefinement=acc=>{let result=effect$1.refinement(acc,checkCtx);if(ctx.common.async)return Promise.resolve(result);if(result instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return acc};if(ctx.common.async===!1){let inner=this._def.schema._parseSync({data:ctx.data,path:ctx.path,parent:ctx});return inner.status===`aborted`?INVALID:(inner.status===`dirty`&&status.dirty(),executeRefinement(inner.value),{status:status.value,value:inner.value})}else return this._def.schema._parseAsync({data:ctx.data,path:ctx.path,parent:ctx}).then(inner=>inner.status===`aborted`?INVALID:(inner.status===`dirty`&&status.dirty(),executeRefinement(inner.value).then(()=>({status:status.value,value:inner.value}))))}if(effect$1.type===`transform`)if(ctx.common.async===!1){let base=this._def.schema._parseSync({data:ctx.data,path:ctx.path,parent:ctx});if(!isValid(base))return INVALID;let result=effect$1.transform(base.value,checkCtx);if(result instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:status.value,value:result}}else return this._def.schema._parseAsync({data:ctx.data,path:ctx.path,parent:ctx}).then(base=>isValid(base)?Promise.resolve(effect$1.transform(base.value,checkCtx)).then(result=>({status:status.value,value:result})):INVALID);util.assertNever(effect$1)}};ZodEffects.create=(schema,effect$1,params)=>new ZodEffects({schema,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:effect$1,...processCreateParams(params)}),ZodEffects.createWithPreprocess=(preprocess$1,schema,params)=>new ZodEffects({schema,effect:{type:`preprocess`,transform:preprocess$1},typeName:ZodFirstPartyTypeKind.ZodEffects,...processCreateParams(params)});var ZodOptional=class extends ZodType{_parse(input){let parsedType=this._getType(input);return parsedType===ZodParsedType.undefined?OK(void 0):this._def.innerType._parse(input)}unwrap(){return this._def.innerType}};ZodOptional.create=(type,params)=>new ZodOptional({innerType:type,typeName:ZodFirstPartyTypeKind.ZodOptional,...processCreateParams(params)});var ZodNullable=class extends ZodType{_parse(input){let parsedType=this._getType(input);return parsedType===ZodParsedType.null?OK(null):this._def.innerType._parse(input)}unwrap(){return this._def.innerType}};ZodNullable.create=(type,params)=>new ZodNullable({innerType:type,typeName:ZodFirstPartyTypeKind.ZodNullable,...processCreateParams(params)});var ZodDefault=class extends ZodType{_parse(input){let{ctx}=this._processInputParams(input),data$12=ctx.data;return ctx.parsedType===ZodParsedType.undefined&&(data$12=this._def.defaultValue()),this._def.innerType._parse({data:data$12,path:ctx.path,parent:ctx})}removeDefault(){return this._def.innerType}};ZodDefault.create=(type,params)=>new ZodDefault({innerType:type,typeName:ZodFirstPartyTypeKind.ZodDefault,defaultValue:typeof params.default==`function`?params.default:()=>params.default,...processCreateParams(params)});var ZodCatch=class extends ZodType{_parse(input){let{ctx}=this._processInputParams(input),newCtx={...ctx,common:{...ctx.common,issues:[]}},result=this._def.innerType._parse({data:newCtx.data,path:newCtx.path,parent:{...newCtx}});return isAsync(result)?result.then(result$1=>({status:`valid`,value:result$1.status===`valid`?result$1.value:this._def.catchValue({get error(){return new ZodError(newCtx.common.issues)},input:newCtx.data})})):{status:`valid`,value:result.status===`valid`?result.value:this._def.catchValue({get error(){return new ZodError(newCtx.common.issues)},input:newCtx.data})}}removeCatch(){return this._def.innerType}};ZodCatch.create=(type,params)=>new ZodCatch({innerType:type,typeName:ZodFirstPartyTypeKind.ZodCatch,catchValue:typeof params.catch==`function`?params.catch:()=>params.catch,...processCreateParams(params)});var ZodNaN=class extends ZodType{_parse(input){let parsedType=this._getType(input);if(parsedType!==ZodParsedType.nan){let ctx=this._getOrReturnCtx(input);return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.nan,received:ctx.parsedType}),INVALID}return{status:`valid`,value:input.data}}};ZodNaN.create=params=>new ZodNaN({typeName:ZodFirstPartyTypeKind.ZodNaN,...processCreateParams(params)});const BRAND=Symbol(`zod_brand`);var ZodBranded=class extends ZodType{_parse(input){let{ctx}=this._processInputParams(input),data$12=ctx.data;return this._def.type._parse({data:data$12,path:ctx.path,parent:ctx})}unwrap(){return this._def.type}},ZodPipeline=class ZodPipeline extends ZodType{_parse(input){let{status,ctx}=this._processInputParams(input);if(ctx.common.async){let handleAsync=async()=>{let inResult=await this._def.in._parseAsync({data:ctx.data,path:ctx.path,parent:ctx});return inResult.status===`aborted`?INVALID:inResult.status===`dirty`?(status.dirty(),DIRTY(inResult.value)):this._def.out._parseAsync({data:inResult.value,path:ctx.path,parent:ctx})};return handleAsync()}else{let inResult=this._def.in._parseSync({data:ctx.data,path:ctx.path,parent:ctx});return inResult.status===`aborted`?INVALID:inResult.status===`dirty`?(status.dirty(),{status:`dirty`,value:inResult.value}):this._def.out._parseSync({data:inResult.value,path:ctx.path,parent:ctx})}}static create(a$2,b$4){return new ZodPipeline({in:a$2,out:b$4,typeName:ZodFirstPartyTypeKind.ZodPipeline})}},ZodReadonly=class extends ZodType{_parse(input){let result=this._def.innerType._parse(input),freeze=data$12=>(isValid(data$12)&&(data$12.value=Object.freeze(data$12.value)),data$12);return isAsync(result)?result.then(data$12=>freeze(data$12)):freeze(result)}unwrap(){return this._def.innerType}};ZodReadonly.create=(type,params)=>new ZodReadonly({innerType:type,typeName:ZodFirstPartyTypeKind.ZodReadonly,...processCreateParams(params)});const late={object:ZodObject.lazycreate};var ZodFirstPartyTypeKind;(function(ZodFirstPartyTypeKind$1){ZodFirstPartyTypeKind$1.ZodString=`ZodString`,ZodFirstPartyTypeKind$1.ZodNumber=`ZodNumber`,ZodFirstPartyTypeKind$1.ZodNaN=`ZodNaN`,ZodFirstPartyTypeKind$1.ZodBigInt=`ZodBigInt`,ZodFirstPartyTypeKind$1.ZodBoolean=`ZodBoolean`,ZodFirstPartyTypeKind$1.ZodDate=`ZodDate`,ZodFirstPartyTypeKind$1.ZodSymbol=`ZodSymbol`,ZodFirstPartyTypeKind$1.ZodUndefined=`ZodUndefined`,ZodFirstPartyTypeKind$1.ZodNull=`ZodNull`,ZodFirstPartyTypeKind$1.ZodAny=`ZodAny`,ZodFirstPartyTypeKind$1.ZodUnknown=`ZodUnknown`,ZodFirstPartyTypeKind$1.ZodNever=`ZodNever`,ZodFirstPartyTypeKind$1.ZodVoid=`ZodVoid`,ZodFirstPartyTypeKind$1.ZodArray=`ZodArray`,ZodFirstPartyTypeKind$1.ZodObject=`ZodObject`,ZodFirstPartyTypeKind$1.ZodUnion=`ZodUnion`,ZodFirstPartyTypeKind$1.ZodDiscriminatedUnion=`ZodDiscriminatedUnion`,ZodFirstPartyTypeKind$1.ZodIntersection=`ZodIntersection`,ZodFirstPartyTypeKind$1.ZodTuple=`ZodTuple`,ZodFirstPartyTypeKind$1.ZodRecord=`ZodRecord`,ZodFirstPartyTypeKind$1.ZodMap=`ZodMap`,ZodFirstPartyTypeKind$1.ZodSet=`ZodSet`,ZodFirstPartyTypeKind$1.ZodFunction=`ZodFunction`,ZodFirstPartyTypeKind$1.ZodLazy=`ZodLazy`,ZodFirstPartyTypeKind$1.ZodLiteral=`ZodLiteral`,ZodFirstPartyTypeKind$1.ZodEnum=`ZodEnum`,ZodFirstPartyTypeKind$1.ZodEffects=`ZodEffects`,ZodFirstPartyTypeKind$1.ZodNativeEnum=`ZodNativeEnum`,ZodFirstPartyTypeKind$1.ZodOptional=`ZodOptional`,ZodFirstPartyTypeKind$1.ZodNullable=`ZodNullable`,ZodFirstPartyTypeKind$1.ZodDefault=`ZodDefault`,ZodFirstPartyTypeKind$1.ZodCatch=`ZodCatch`,ZodFirstPartyTypeKind$1.ZodPromise=`ZodPromise`,ZodFirstPartyTypeKind$1.ZodBranded=`ZodBranded`,ZodFirstPartyTypeKind$1.ZodPipeline=`ZodPipeline`,ZodFirstPartyTypeKind$1.ZodReadonly=`ZodReadonly`})(ZodFirstPartyTypeKind||={});const stringType=ZodString.create,numberType=ZodNumber.create,nanType=ZodNaN.create,bigIntType=ZodBigInt.create,booleanType=ZodBoolean.create,dateType=ZodDate.create,symbolType=ZodSymbol.create,undefinedType=ZodUndefined.create,nullType=ZodNull.create,anyType=ZodAny.create,unknownType=ZodUnknown.create,neverType=ZodNever.create,voidType=ZodVoid.create,arrayType=ZodArray.create,objectType=ZodObject.create,strictObjectType=ZodObject.strictCreate,unionType=ZodUnion.create,discriminatedUnionType=ZodDiscriminatedUnion.create,intersectionType=ZodIntersection.create,tupleType=ZodTuple.create,recordType=ZodRecord.create,mapType=ZodMap.create,setType=ZodSet.create,functionType=ZodFunction.create,lazyType=ZodLazy.create,literalType=ZodLiteral.create,enumType=ZodEnum.create,nativeEnumType=ZodNativeEnum.create,promiseType=ZodPromise.create,effectsType=ZodEffects.create,optionalType=ZodOptional.create,nullableType=ZodNullable.create,preprocessType=ZodEffects.createWithPreprocess,pipelineType=ZodPipeline.create,tools$1=[tool({name:`debug_random_number`,description:`Generate a random number between 0 and 1`,execute:async()=>new Promise(resolve$1=>{setTimeout(()=>{resolve$1(Math.random().toString())},1e3)}),parameters:objectType({})})],debug=async()=>Promise.all(tools$1);function __classPrivateFieldGet(receiver,state,kind,f$3){if(kind===`a`&&!f$3)throw TypeError(`Private accessor was defined without a getter`);if(typeof state==`function`?receiver!==state||!f$3:!state.has(receiver))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return kind===`m`?f$3:kind===`a`?f$3.call(receiver):f$3?f$3.value:state.get(receiver)}function __classPrivateFieldSet(receiver,state,value$1,kind,f$3){if(kind===`m`)throw TypeError(`Private method is not writable`);if(kind===`a`&&!f$3)throw TypeError(`Private accessor was defined without a setter`);if(typeof state==`function`?receiver!==state||!f$3:!state.has(receiver))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return kind===`a`?f$3.call(receiver,value$1):f$3?f$3.value=value$1:state.set(receiver,value$1),value$1}var _Channel_onmessage,_Channel_nextMessageIndex,_Channel_pendingMessages,_Channel_messageEndIndex,_Resource_rid;const SERIALIZE_TO_IPC_FN=`__TAURI_TO_IPC_KEY__`;function transformCallback(callback,once=!1){return window.__TAURI_INTERNALS__.transformCallback(callback,once)}var Channel=class{constructor(onmessage){_Channel_onmessage.set(this,void 0),_Channel_nextMessageIndex.set(this,0),_Channel_pendingMessages.set(this,[]),_Channel_messageEndIndex.set(this,void 0),__classPrivateFieldSet(this,_Channel_onmessage,onmessage||(()=>{}),`f`),this.id=transformCallback(rawMessage=>{let index$1=rawMessage.index;if(`end`in rawMessage){index$1==__classPrivateFieldGet(this,_Channel_nextMessageIndex,`f`)?this.cleanupCallback():__classPrivateFieldSet(this,_Channel_messageEndIndex,index$1,`f`);return}let message$1=rawMessage.message;if(index$1==__classPrivateFieldGet(this,_Channel_nextMessageIndex,`f`)){for(__classPrivateFieldGet(this,_Channel_onmessage,`f`).call(this,message$1),__classPrivateFieldSet(this,_Channel_nextMessageIndex,__classPrivateFieldGet(this,_Channel_nextMessageIndex,`f`)+1,`f`);__classPrivateFieldGet(this,_Channel_nextMessageIndex,`f`)in __classPrivateFieldGet(this,_Channel_pendingMessages,`f`);){let message$2=__classPrivateFieldGet(this,_Channel_pendingMessages,`f`)[__classPrivateFieldGet(this,_Channel_nextMessageIndex,`f`)];__classPrivateFieldGet(this,_Channel_onmessage,`f`).call(this,message$2),delete __classPrivateFieldGet(this,_Channel_pendingMessages,`f`)[__classPrivateFieldGet(this,_Channel_nextMessageIndex,`f`)],__classPrivateFieldSet(this,_Channel_nextMessageIndex,__classPrivateFieldGet(this,_Channel_nextMessageIndex,`f`)+1,`f`)}__classPrivateFieldGet(this,_Channel_nextMessageIndex,`f`)===__classPrivateFieldGet(this,_Channel_messageEndIndex,`f`)&&this.cleanupCallback()}else __classPrivateFieldGet(this,_Channel_pendingMessages,`f`)[index$1]=message$1})}cleanupCallback(){window.__TAURI_INTERNALS__.unregisterCallback(this.id)}set onmessage(handler){__classPrivateFieldSet(this,_Channel_onmessage,handler,`f`)}get onmessage(){return __classPrivateFieldGet(this,_Channel_onmessage,`f`)}[(_Channel_onmessage=new WeakMap,_Channel_nextMessageIndex=new WeakMap,_Channel_pendingMessages=new WeakMap,_Channel_messageEndIndex=new WeakMap,SERIALIZE_TO_IPC_FN)](){return`__CHANNEL__:${this.id}`}toJSON(){return this[SERIALIZE_TO_IPC_FN]()}};async function invoke(cmd,args={},options$1){return window.__TAURI_INTERNALS__.invoke(cmd,args,options$1)}_Resource_rid=new WeakMap;async function connectServer(command,args){await invoke(`plugin:mcp|connect_server`,{command,args})}async function disconnectServer(){await invoke(`plugin:mcp|disconnect_server`)}async function listTools(){return await invoke(`plugin:mcp|list_tools`)}async function callTool(name$2,args){return await invoke(`plugin:mcp|call_tool`,{name:name$2,args})}const tools=[tool({name:`mcp_list_tools`,description:`List all tools available on the MCP server`,execute:async(_$2,__)=>await listTools(),parameters:objectType({})}),tool({name:`mcp_connect_server`,description:`Connect to the MCP server. If "success", the connection to the MCP server is successful. Otherwise, the connection fails.`,execute:async({command,args})=>(await connectServer(command,args),`success`),parameters:objectType({command:stringType().describe(`The command to connect to the MCP server`),args:arrayType(stringType()).describe(`The arguments to pass to the MCP server`)})}),tool({name:`mcp_disconnect_server`,description:`Disconnect from the MCP server. If "success", the disconnection from the MCP server is successful. Otherwise, the disconnection fails.`,execute:async()=>(await disconnectServer(),`success`),parameters:objectType({})}),tool({name:`mcp_call_tool`,description:`Call a tool on the MCP server. The result is a list of content and a boolean indicating whether the tool call is an error.`,execute:async({name:name$2,parameters})=>{let parametersObject=Object.fromEntries(parameters.map(({name:name$3,value:value$1})=>[name$3,value$1])),result=await callTool(name$2,parametersObject);return result},parameters:objectType({name:stringType().describe(`The name of the tool to call`),parameters:arrayType(objectType({name:stringType().describe(`The name of the parameter`),value:unionType([stringType(),numberType(),booleanType(),objectType({})]).describe(`The value of the parameter, it can be a string, a number, a boolean, or an object`)})).describe(`The parameters to pass to the tool`)})})],mcp=async()=>Promise.all(tools);function streamOptionsToolsCompatibilityOk(model,chatProvider,_$2,options$1,toolsCompatibility=new Map){return!!(options$1?.supportsTools||toolsCompatibility.get(`${chatProvider.chat(model).baseURL}-${model}`))}async function streamFrom(model,chatProvider,messages,options$1){let headers=options$1?.headers;return await streamText({...chatProvider.chat(model),maxSteps:10,messages:messages.map(msg=>({...msg,content:msg.role===`error`?`User encountered error: ${msg.content}`:msg.content,role:msg.role===`error`?`user`:msg.role})),headers,tools:streamOptionsToolsCompatibilityOk(model,chatProvider,messages,options$1)?[...await mcp(),...await debug()]:void 0,onEvent(event){event.type===`tool-call`?options$1?.onToolCall?.(event.toolCall):event.type===`tool-call-result`&&options$1?.onToolCallResult?.({id:event.id,result:event.result})}})}async function attemptForToolsCompatibilityDiscovery(model,chatProvider,_$2,options$1){async function attempt(enable){try{let res=await streamFrom(model,chatProvider,[{role:`user`,content:`Hello, world!`}],{...options$1,supportsTools:enable});for await(let _$3 of readableStreamToAsyncIterator(res.textStream,async v$2=>v$2));return!0}catch(err){if(err instanceof Error&&err.name===new XSAIError$1(``).name&&(String(err).includes(`does not support tools`)||String(err).includes(`No endpoints found that support tool use.`)))return!1;throw err}}function promiseAllWithInterval(promises,interval){return new Promise(resolve$1=>{let results=[],completed=0;promises.forEach((promiseFn,index$1)=>{setTimeout(()=>{promiseFn().then(result=>{results[index$1]={result}}).catch(err=>{results[index$1]={error:err}}).finally(()=>{completed++,completed===promises.length&&resolve$1(results)})},index$1*interval)})})}let attempts=[()=>attempt(!0),()=>attempt(!1)],attemptsResults=await promiseAllWithInterval(attempts,1e3);if(attemptsResults.some(res=>res.error)){let err=Error(`Error during tools compatibility discovery for model: ${model}. Errors: ${attemptsResults.map(res=>res.error).filter(Boolean).join(`, `)}`);throw err.cause=attemptsResults.map(res=>res.error).filter(Boolean),err}return attemptsResults[0].result===!0&&attemptsResults[1].result===!0}const useLLM=defineStore(`llm`,()=>{let toolsCompatibility=ref(new Map);async function discoverToolsCompatibility(model,chatProvider,_$2,options$1){if(toolsCompatibility.value.has(`${chatProvider.chat(model).baseURL}-${model}`))return;let res=await attemptForToolsCompatibilityDiscovery(model,chatProvider,_$2,{...options$1,toolsCompatibility:toolsCompatibility.value});toolsCompatibility.value.set(`${chatProvider.chat(model).baseURL}-${model}`,res)}function stream(model,chatProvider,messages,options$1){return streamFrom(model,chatProvider,messages,{...options$1,toolsCompatibility:toolsCompatibility.value})}async function models$1(apiUrl,apiKey){if(apiUrl===``)return[];try{return await listModels({baseURL:apiUrl.endsWith(`/`)?apiUrl:`${apiUrl}/`,apiKey})}catch(err){if(String(err).includes(`Failed to construct 'URL': Invalid URL`))return[];throw err}}return{models:models$1,stream,discoverToolsCompatibility}}),inBrowser=typeof window<`u`,makeSymbol=(name$2,shareable=!1)=>shareable?Symbol.for(name$2):Symbol(name$2),generateFormatCacheKey=(locale,key$2,source)=>friendlyJSONstringify({l:locale,k:key$2,s:source}),friendlyJSONstringify=json=>JSON.stringify(json).replace(/\u2028/g,`\\u2028`).replace(/\u2029/g,`\\u2029`).replace(/\u0027/g,`\\u0027`),isNumber=val=>typeof val==`number`&&isFinite(val),isDate=val=>toTypeString(val)===`[object Date]`,isRegExp=val=>toTypeString(val)===`[object RegExp]`,isEmptyObject=val=>isPlainObject(val)&&Object.keys(val).length===0,assign=Object.assign,_create=Object.create,create=(obj=null)=>_create(obj);let _globalThis;const getGlobalThis=()=>_globalThis||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:create();function escapeHtml(rawText){return rawText.replace(//g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}const hasOwnProperty=Object.prototype.hasOwnProperty;function hasOwn(obj,key$2){return hasOwnProperty.call(obj,key$2)}const isArray=Array.isArray,isFunction=val=>typeof val==`function`,isString=val=>typeof val==`string`,isBoolean=val=>typeof val==`boolean`,isObject=val=>typeof val==`object`&&!!val,isPromise=val=>isObject(val)&&isFunction(val.then)&&isFunction(val.catch),objectToString=Object.prototype.toString,toTypeString=value$1=>objectToString.call(value$1),isPlainObject=val=>toTypeString(val)===`[object Object]`,toDisplayString$1=val=>val==null?``:isArray(val)||isPlainObject(val)&&val.toString===objectToString?JSON.stringify(val,null,2):String(val);function join(items,separator=``){return items.reduce((str,item,index$1)=>index$1===0?str+item:str+separator+item,``)}function warn(msg,err){typeof console<`u`&&(console.warn(`[intlify] `+msg),err&&console.warn(err.stack))}const isNotObjectOrIsArray=val=>!isObject(val)||isArray(val);function deepCopy(src,des){if(isNotObjectOrIsArray(src)||isNotObjectOrIsArray(des))throw Error(`Invalid value`);let stack$1=[{src,des}];for(;stack$1.length;){let{src:src$1,des:des$1}=stack$1.pop();Object.keys(src$1).forEach(key$2=>{key$2!==`__proto__`&&(isObject(src$1[key$2])&&!isObject(des$1[key$2])&&(des$1[key$2]=Array.isArray(src$1[key$2])?[]:create()),isNotObjectOrIsArray(des$1[key$2])||isNotObjectOrIsArray(src$1[key$2])?des$1[key$2]=src$1[key$2]:stack$1.push({src:src$1[key$2],des:des$1[key$2]}))})}}function createPosition(line,column,offset$2){return{line,column,offset:offset$2}}function createLocation(start,end,source){let loc={start,end};return source!=null&&(loc.source=source),loc}const CompileErrorCodes={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16},COMPILE_ERROR_CODES_EXTEND_POINT=17,errorMessages$2={[CompileErrorCodes.EXPECTED_TOKEN]:`Expected token: '{0}'`,[CompileErrorCodes.INVALID_TOKEN_IN_PLACEHOLDER]:`Invalid token in placeholder: '{0}'`,[CompileErrorCodes.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER]:`Unterminated single quote in placeholder`,[CompileErrorCodes.UNKNOWN_ESCAPE_SEQUENCE]:`Unknown escape sequence: \\{0}`,[CompileErrorCodes.INVALID_UNICODE_ESCAPE_SEQUENCE]:`Invalid unicode escape sequence: {0}`,[CompileErrorCodes.UNBALANCED_CLOSING_BRACE]:`Unbalanced closing brace`,[CompileErrorCodes.UNTERMINATED_CLOSING_BRACE]:`Unterminated closing brace`,[CompileErrorCodes.EMPTY_PLACEHOLDER]:`Empty placeholder`,[CompileErrorCodes.NOT_ALLOW_NEST_PLACEHOLDER]:`Not allowed nest placeholder`,[CompileErrorCodes.INVALID_LINKED_FORMAT]:`Invalid linked format`,[CompileErrorCodes.MUST_HAVE_MESSAGES_IN_PLURAL]:`Plural must have messages`,[CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_MODIFIER]:`Unexpected empty linked modifier`,[CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_KEY]:`Unexpected empty linked key`,[CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS]:`Unexpected lexical analysis in token: '{0}'`,[CompileErrorCodes.UNHANDLED_CODEGEN_NODE_TYPE]:`unhandled codegen node type: '{0}'`,[CompileErrorCodes.UNHANDLED_MINIFIER_NODE_TYPE]:`unhandled mimifier node type: '{0}'`};function createCompileError(code$1,loc,options$1={}){let{domain,messages,args}=options$1,msg=code$1,error=SyntaxError(String(msg));return error.code=code$1,loc&&(error.location=loc),error.domain=domain,error}function defaultOnError(error){throw error}const CHAR_SP=` `,CHAR_CR=`\r`,CHAR_LF=` +function toTrianglesDrawMode(geometry,drawMode){if(drawMode===TrianglesDrawMode)return console.warn(`THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles.`),geometry;if(drawMode===TriangleFanDrawMode||drawMode===TriangleStripDrawMode){let index$1=geometry.getIndex();if(index$1===null){let indices=[],position$2=geometry.getAttribute(`position`);if(position$2!==void 0){for(let i$1=0;i$1=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$1=0;i$1=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=this;return new Promise(function(resolve$1,reject){scope.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){objects[key$2]=object},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$3=new Matrix4,p$5=new Vector3,q$2=new Quaternion,s$1=new Vector3(1,1,1),instancedMesh=new InstancedMesh(mesh.geometry,mesh.material,count$1);for(let i$1=0;i$10||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$2,mappings);for(let[i$1,child]of original.children.entries())updateMappings(child,clone$2.children[i$1])};return updateMappings(object,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$1=0;i$1=2&&bufferAttribute.setY(index$1,sparseValues[i$1*itemSize+1]),itemSize>=3&&bufferAttribute.setZ(index$1,sparseValues[i$1*itemSize+2]),itemSize>=4&&bufferAttribute.setW(index$1,sparseValues[i$1*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$1=mapDef.extensions===void 0?void 0:mapDef.extensions[EXTENSIONS.KHR_TEXTURE_TRANSFORM];if(transform$1){let gltfReference=parser.associations.get(texture);texture=parser.extensions[EXTENSIONS.KHR_TEXTURE_TRANSFORM].extendTexture(texture,transform$1),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=metallicRoughness.baseColorFactor;materialParams.color.setRGB(array[0],array[1],array[2],LinearSRGBColorSpace),materialParams.opacity=array[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$1=0,il$1=primitives.length;i$10&&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$1=0,il$1=meshes.length;i$11?new Group:objects.length===1?objects[0]:new Object3D,node$1!==objects[0])for(let i$1=0,il$1=objects.length;i$11){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$1=0,il$1=nodeIds.length;i$1{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){object.morphTargetInfluences&&targetNames.push(object.name?object.name:object.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$1=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,timeSinceLastSaccade=0;function updateFixationTarget(){fixationTarget?fixationTarget.set(randFloat(-.25,.25),randFloat(-.2,.15),-.65):fixationTarget=new Vector3(randFloat(-.25,.25),randFloat(-.2,.15),-.65)}function update(vrm,delta){!vrm?.expressionManager||!vrm.lookAt||(timeSinceLastSaccade>=nextSaccadeAfter?(updateFixationTarget(),timeSinceLastSaccade=0,nextSaccadeAfter=randomSaccadeInterval()/1e3):fixationTarget||updateFixationTarget(),vrm.lookAt.target||(vrm.lookAt.target=new Object3D),vrm.lookAt.target.position.lerp(fixationTarget,randFloat(.2,.5)),vrm.lookAt?.update(delta),timeSinceLastSaccade+=delta)}return{update}}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=>{object.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.negate(),modelCenter.y-=modelSize.y/5,options$1?.positionOffset?_vrmGroup.position.set(modelCenter.x+options$1.positionOffset[0],modelCenter.y+options$1.positionOffset[1],modelCenter.z+options$1.positionOffset[2]):_vrmGroup.position.set(modelCenter.x,modelCenter.y,modelCenter.z);let fov$1=40,radians=fov$1/2*Math.PI/180,initialCameraPosition=new Vector3(modelSize.x/16,modelSize.y/6,-(modelSize.y/3)/Math.tan(radians));return{_vrm,_vrmGroup,modelCenter,modelSize,initialCameraPosition}}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)=>start+(end-start)*t,easeInOutCubic=t=>t<.5?4*t*t*t:1-(-2*t+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$1)=>{clearResetTimeout(),setEmotion(emotionName),resetTimeout.value=setTimeout(()=>{setEmotion(`neutral`),resetTimeout.value=void 0},ms$1)},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$2({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$3=>{switch(e$3.status){case`loading`:status.value=`loading`,loadingMessage.value=e$3.data,opts.onLoading?.(e$3.data);break;case`initiate`:loadingProgress.value.push(e$3),opts.onInitiate?.(e$3);break;case`progress`:loadingProgress.value=loadingProgress.value.map(item=>item.file===e$3.file?{...item,...e$3}:item),opts.onProgress?.(e$3);break;case`done`:loadingProgress.value=loadingProgress.value.filter(item=>item.file!==e$3.file),opts.onDone?.(e$3);break;case`ready`:status.value=`ready`,opts.onReady?.();break;case`start`:transcribing.value=!0,opts.onStart?.();break;case`update`:tps.value=e$3.tps,opts.onUpdate?.(e$3.tps);break;case`complete`:transcribing.value=!1,result.value=e$3.output[0]||``,console.debug(`Whisper result:`,result.value),opts.onComplete?.(e$3.output[0]);break}}),onUnmounted(()=>{terminate()}),{transcribe:message$1=>whisperPost(message$1),status,loadingMessage,loadingProgress,transcribing,tps,result,load:()=>whisperPost({type:`load`}),terminate}}var XSAIError$2=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$1=>`_${s$1.toLowerCase()}`),objCamelToSnake$1=obj=>Object.fromEntries(Object.entries(obj).map(([k$4,v$2])=>[strCamelToSnake$2(k$4),v$2])),clean$2=obj=>Object.fromEntries(Object.entries(obj).filter(([,v$2])=>v$2!==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$2(`Remote sent ${res.status} response: ${await res.text()}`,res);if(!res.body)throw new XSAIError$2(`Response body is empty from remote server`,res);if(!(res.body instanceof ReadableStream))throw new XSAIError$2(`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);var XSAIError$1=class extends Error{response;constructor(message$1,response){super(message$1),this.name=`XSAIError`,this.response=response}};const 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$1=>`_${s$1.toLowerCase()}`),objCamelToSnake$2=obj=>Object.fromEntries(Object.entries(obj).map(([k$4,v$2])=>[strCamelToSnake$1(k$4),v$2])),trampoline=async fn$6=>{let result=await fn$6();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$1=>{usage=u$1},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}),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-BBIv_cP1.js`),[]).then(async({getToJsonSchemaFn:getToJsonSchemaFn2})=>getToJsonSchemaFn2());case`effect`:return __vitePreload(()=>import(`./effect-DBSVVF8G-D__cQ9PS.js`),[]).then(async({getToJsonSchemaFn:getToJsonSchemaFn2})=>getToJsonSchemaFn2());case`sury`:return __vitePreload(()=>import(`./sury-GtnkadyM-CUwsFFlt.js`),[]).then(async({getToJsonSchemaFn:getToJsonSchemaFn2})=>getToJsonSchemaFn2());case`valibot`:return __vitePreload(()=>import(`./valibot-CbgwcZn_-CzuPOF44.js`),[]).then(async({getToJsonSchemaFn:getToJsonSchemaFn2})=>getToJsonSchemaFn2());case`zod`:return __vitePreload(()=>import(`./zod-CD8IEU5z-dVvvg2wD.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`}};var util;(function(util$1){util$1.assertEqual=_$2=>{};function assertIs(_arg){}util$1.assertIs=assertIs;function assertNever(_x$1){throw Error()}util$1.assertNever=assertNever,util$1.arrayToEnum=items=>{let obj={};for(let item of items)obj[item]=item;return obj},util$1.getValidEnumValues=obj=>{let validKeys=util$1.objectKeys(obj).filter(k$4=>typeof obj[obj[k$4]]!=`number`),filtered={};for(let k$4 of validKeys)filtered[k$4]=obj[k$4];return util$1.objectValues(filtered)},util$1.objectValues=obj=>util$1.objectKeys(obj).map(function(e$3){return obj[e$3]}),util$1.objectKeys=typeof Object.keys==`function`?obj=>Object.keys(obj):object=>{let keys$3=[];for(let key$2 in object)Object.prototype.hasOwnProperty.call(object,key$2)&&keys$3.push(key$2);return keys$3},util$1.find=(arr,checker)=>{for(let item of arr)if(checker(item))return item},util$1.isInteger=typeof Number.isInteger==`function`?val=>Number.isInteger(val):val=>typeof val==`number`&&Number.isFinite(val)&&Math.floor(val)===val;function joinValues(array,separator=` | `){return array.map(val=>typeof val==`string`?`'${val}'`:val).join(separator)}util$1.joinValues=joinValues,util$1.jsonStringifyReplacer=(_$2,value$1)=>typeof value$1==`bigint`?value$1.toString():value$1})(util||={});var objectUtil;(function(objectUtil$1){objectUtil$1.mergeShapes=(first,second)=>({...first,...second})})(objectUtil||={});const ZodParsedType=util.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),getParsedType=data$12=>{let t=typeof data$12;switch(t){case`undefined`:return ZodParsedType.undefined;case`string`:return ZodParsedType.string;case`number`:return Number.isNaN(data$12)?ZodParsedType.nan:ZodParsedType.number;case`boolean`:return ZodParsedType.boolean;case`function`:return ZodParsedType.function;case`bigint`:return ZodParsedType.bigint;case`symbol`:return ZodParsedType.symbol;case`object`:return Array.isArray(data$12)?ZodParsedType.array:data$12===null?ZodParsedType.null:data$12.then&&typeof data$12.then==`function`&&data$12.catch&&typeof data$12.catch==`function`?ZodParsedType.promise:typeof Map<`u`&&data$12 instanceof Map?ZodParsedType.map:typeof Set<`u`&&data$12 instanceof Set?ZodParsedType.set:typeof Date<`u`&&data$12 instanceof Date?ZodParsedType.date:ZodParsedType.object;default:return ZodParsedType.unknown}},ZodIssueCode=util.arrayToEnum([`invalid_type`,`invalid_literal`,`custom`,`invalid_union`,`invalid_union_discriminator`,`invalid_enum_value`,`unrecognized_keys`,`invalid_arguments`,`invalid_return_type`,`invalid_date`,`invalid_string`,`too_small`,`too_big`,`invalid_intersection_types`,`not_multiple_of`,`not_finite`]);var ZodError=class ZodError extends Error{get errors(){return this.issues}constructor(issues){super(),this.issues=[],this.addIssue=sub=>{this.issues=[...this.issues,sub]},this.addIssues=(subs=[])=>{this.issues=[...this.issues,...subs]};let actualProto=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,actualProto):this.__proto__=actualProto,this.name=`ZodError`,this.issues=issues}format(_mapper){let mapper=_mapper||function(issue){return issue.message},fieldErrors={_errors:[]},processError=error=>{for(let issue of error.issues)if(issue.code===`invalid_union`)issue.unionErrors.map(processError);else if(issue.code===`invalid_return_type`)processError(issue.returnTypeError);else if(issue.code===`invalid_arguments`)processError(issue.argumentsError);else if(issue.path.length===0)fieldErrors._errors.push(mapper(issue));else{let curr=fieldErrors,i$1=0;for(;i$1issue.message){let fieldErrors={},formErrors=[];for(let sub of this.issues)if(sub.path.length>0){let firstEl=sub.path[0];fieldErrors[firstEl]=fieldErrors[firstEl]||[],fieldErrors[firstEl].push(mapper(sub))}else formErrors.push(mapper(sub));return{formErrors,fieldErrors}}get formErrors(){return this.flatten()}};ZodError.create=issues=>{let error=new ZodError(issues);return error};const errorMap=(issue,_ctx)=>{let message$1;switch(issue.code){case ZodIssueCode.invalid_type:message$1=issue.received===ZodParsedType.undefined?`Required`:`Expected ${issue.expected}, received ${issue.received}`;break;case ZodIssueCode.invalid_literal:message$1=`Invalid literal value, expected ${JSON.stringify(issue.expected,util.jsonStringifyReplacer)}`;break;case ZodIssueCode.unrecognized_keys:message$1=`Unrecognized key(s) in object: ${util.joinValues(issue.keys,`, `)}`;break;case ZodIssueCode.invalid_union:message$1=`Invalid input`;break;case ZodIssueCode.invalid_union_discriminator:message$1=`Invalid discriminator value. Expected ${util.joinValues(issue.options)}`;break;case ZodIssueCode.invalid_enum_value:message$1=`Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`;break;case ZodIssueCode.invalid_arguments:message$1=`Invalid function arguments`;break;case ZodIssueCode.invalid_return_type:message$1=`Invalid function return type`;break;case ZodIssueCode.invalid_date:message$1=`Invalid date`;break;case ZodIssueCode.invalid_string:typeof issue.validation==`object`?`includes`in issue.validation?(message$1=`Invalid input: must include "${issue.validation.includes}"`,typeof issue.validation.position==`number`&&(message$1=`${message$1} at one or more positions greater than or equal to ${issue.validation.position}`)):`startsWith`in issue.validation?message$1=`Invalid input: must start with "${issue.validation.startsWith}"`:`endsWith`in issue.validation?message$1=`Invalid input: must end with "${issue.validation.endsWith}"`:util.assertNever(issue.validation):message$1=issue.validation===`regex`?`Invalid`:`Invalid ${issue.validation}`;break;case ZodIssueCode.too_small:message$1=issue.type===`array`?`Array must contain ${issue.exact?`exactly`:issue.inclusive?`at least`:`more than`} ${issue.minimum} element(s)`:issue.type===`string`?`String must contain ${issue.exact?`exactly`:issue.inclusive?`at least`:`over`} ${issue.minimum} character(s)`:issue.type===`number`||issue.type===`bigint`?`Number must be ${issue.exact?`exactly equal to `:issue.inclusive?`greater than or equal to `:`greater than `}${issue.minimum}`:issue.type===`date`?`Date must be ${issue.exact?`exactly equal to `:issue.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(issue.minimum))}`:`Invalid input`;break;case ZodIssueCode.too_big:message$1=issue.type===`array`?`Array must contain ${issue.exact?`exactly`:issue.inclusive?`at most`:`less than`} ${issue.maximum} element(s)`:issue.type===`string`?`String must contain ${issue.exact?`exactly`:issue.inclusive?`at most`:`under`} ${issue.maximum} character(s)`:issue.type===`number`?`Number must be ${issue.exact?`exactly`:issue.inclusive?`less than or equal to`:`less than`} ${issue.maximum}`:issue.type===`bigint`?`BigInt must be ${issue.exact?`exactly`:issue.inclusive?`less than or equal to`:`less than`} ${issue.maximum}`:issue.type===`date`?`Date must be ${issue.exact?`exactly`:issue.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(issue.maximum))}`:`Invalid input`;break;case ZodIssueCode.custom:message$1=`Invalid input`;break;case ZodIssueCode.invalid_intersection_types:message$1=`Intersection results could not be merged`;break;case ZodIssueCode.not_multiple_of:message$1=`Number must be a multiple of ${issue.multipleOf}`;break;case ZodIssueCode.not_finite:message$1=`Number must be finite`;break;default:message$1=_ctx.defaultError,util.assertNever(issue)}return{message:message$1}};var en_default$1=errorMap;let overrideErrorMap=en_default$1;function getErrorMap(){return overrideErrorMap}const makeIssue=params=>{let{data:data$12,path,errorMaps,issueData}=params,fullPath=[...path,...issueData.path||[]],fullIssue={...issueData,path:fullPath};if(issueData.message!==void 0)return{...issueData,path:fullPath,message:issueData.message};let errorMessage=``,maps=errorMaps.filter(m$3=>!!m$3).slice().reverse();for(let map of maps)errorMessage=map(fullIssue,{data:data$12,defaultError:errorMessage}).message;return{...issueData,path:fullPath,message:errorMessage}};function addIssueToContext(ctx,issueData){let overrideMap=getErrorMap(),issue=makeIssue({issueData,data:ctx.data,path:ctx.path,errorMaps:[ctx.common.contextualErrorMap,ctx.schemaErrorMap,overrideMap,overrideMap===en_default$1?void 0:en_default$1].filter(x$3=>!!x$3)});ctx.common.issues.push(issue)}var ParseStatus=class ParseStatus{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(status,results){let arrayValue=[];for(let s$1 of results){if(s$1.status===`aborted`)return INVALID;s$1.status===`dirty`&&status.dirty(),arrayValue.push(s$1.value)}return{status:status.value,value:arrayValue}}static async mergeObjectAsync(status,pairs){let syncPairs=[];for(let pair of pairs){let key$2=await pair.key,value$1=await pair.value;syncPairs.push({key:key$2,value:value$1})}return ParseStatus.mergeObjectSync(status,syncPairs)}static mergeObjectSync(status,pairs){let finalObject={};for(let pair of pairs){let{key:key$2,value:value$1}=pair;if(key$2.status===`aborted`||value$1.status===`aborted`)return INVALID;key$2.status===`dirty`&&status.dirty(),value$1.status===`dirty`&&status.dirty(),key$2.value!==`__proto__`&&(value$1.value!==void 0||pair.alwaysSet)&&(finalObject[key$2.value]=value$1.value)}return{status:status.value,value:finalObject}}};const INVALID=Object.freeze({status:`aborted`}),DIRTY=value$1=>({status:`dirty`,value:value$1}),OK=value$1=>({status:`valid`,value:value$1}),isAborted=x$3=>x$3.status===`aborted`,isDirty=x$3=>x$3.status===`dirty`,isValid=x$3=>x$3.status===`valid`,isAsync=x$3=>typeof Promise<`u`&&x$3 instanceof Promise;var errorUtil;(function(errorUtil$1){errorUtil$1.errToObj=message$1=>typeof message$1==`string`?{message:message$1}:message$1||{},errorUtil$1.toString=message$1=>typeof message$1==`string`?message$1:message$1?.message})(errorUtil||={});var ParseInputLazyPath=class{constructor(parent,value$1,path,key$2){this._cachedPath=[],this.parent=parent,this.data=value$1,this._path=path,this._key=key$2}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};const handleResult=(ctx,result)=>{if(isValid(result))return{success:!0,data:result.value};if(!ctx.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){if(this._error)return this._error;let error=new ZodError(ctx.common.issues);return this._error=error,this._error}}};function processCreateParams(params){if(!params)return{};let{errorMap:errorMap$1,invalid_type_error,required_error,description}=params;if(errorMap$1&&(invalid_type_error||required_error))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(errorMap$1)return{errorMap:errorMap$1,description};let customMap=(iss,ctx)=>{let{message:message$1}=params;return iss.code===`invalid_enum_value`?{message:message$1??ctx.defaultError}:ctx.data===void 0?{message:message$1??required_error??ctx.defaultError}:iss.code===`invalid_type`?{message:message$1??invalid_type_error??ctx.defaultError}:{message:ctx.defaultError}};return{errorMap:customMap,description}}var ZodType=class{get description(){return this._def.description}_getType(input){return getParsedType(input.data)}_getOrReturnCtx(input,ctx){return ctx||{common:input.parent.common,data:input.data,parsedType:getParsedType(input.data),schemaErrorMap:this._def.errorMap,path:input.path,parent:input.parent}}_processInputParams(input){return{status:new ParseStatus,ctx:{common:input.parent.common,data:input.data,parsedType:getParsedType(input.data),schemaErrorMap:this._def.errorMap,path:input.path,parent:input.parent}}}_parseSync(input){let result=this._parse(input);if(isAsync(result))throw Error(`Synchronous parse encountered promise.`);return result}_parseAsync(input){let result=this._parse(input);return Promise.resolve(result)}parse(data$12,params){let result=this.safeParse(data$12,params);if(result.success)return result.data;throw result.error}safeParse(data$12,params){let ctx={common:{issues:[],async:params?.async??!1,contextualErrorMap:params?.errorMap},path:params?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:data$12,parsedType:getParsedType(data$12)},result=this._parseSync({data:data$12,path:ctx.path,parent:ctx});return handleResult(ctx,result)}"~validate"(data$12){let ctx={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:data$12,parsedType:getParsedType(data$12)};if(!this[`~standard`].async)try{let result=this._parseSync({data:data$12,path:[],parent:ctx});return isValid(result)?{value:result.value}:{issues:ctx.common.issues}}catch(err){err?.message?.toLowerCase()?.includes(`encountered`)&&(this[`~standard`].async=!0),ctx.common={issues:[],async:!0}}return this._parseAsync({data:data$12,path:[],parent:ctx}).then(result=>isValid(result)?{value:result.value}:{issues:ctx.common.issues})}async parseAsync(data$12,params){let result=await this.safeParseAsync(data$12,params);if(result.success)return result.data;throw result.error}async safeParseAsync(data$12,params){let ctx={common:{issues:[],contextualErrorMap:params?.errorMap,async:!0},path:params?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:data$12,parsedType:getParsedType(data$12)},maybeAsyncResult=this._parse({data:data$12,path:ctx.path,parent:ctx}),result=await(isAsync(maybeAsyncResult)?maybeAsyncResult:Promise.resolve(maybeAsyncResult));return handleResult(ctx,result)}refine(check$1,message$1){let getIssueProperties=val=>typeof message$1==`string`||message$1===void 0?{message:message$1}:typeof message$1==`function`?message$1(val):message$1;return this._refinement((val,ctx)=>{let result=check$1(val),setError=()=>ctx.addIssue({code:ZodIssueCode.custom,...getIssueProperties(val)});return typeof Promise<`u`&&result instanceof Promise?result.then(data$12=>data$12?!0:(setError(),!1)):result?!0:(setError(),!1)})}refinement(check$1,refinementData){return this._refinement((val,ctx)=>check$1(val)?!0:(ctx.addIssue(typeof refinementData==`function`?refinementData(val,ctx):refinementData),!1))}_refinement(refinement){return new ZodEffects({schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:`refinement`,refinement}})}superRefine(refinement){return this._refinement(refinement)}constructor(def$1){this.spa=this.safeParseAsync,this._def=def$1,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this[`~standard`]={version:1,vendor:`zod`,validate:data$12=>this[`~validate`](data$12)}}optional(){return ZodOptional.create(this,this._def)}nullable(){return ZodNullable.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ZodArray.create(this)}promise(){return ZodPromise.create(this,this._def)}or(option$1){return ZodUnion.create([this,option$1],this._def)}and(incoming){return ZodIntersection.create(this,incoming,this._def)}transform(transform$1){return new ZodEffects({...processCreateParams(this._def),schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:`transform`,transform:transform$1}})}default(def$1){let defaultValueFunc=typeof def$1==`function`?def$1:()=>def$1;return new ZodDefault({...processCreateParams(this._def),innerType:this,defaultValue:defaultValueFunc,typeName:ZodFirstPartyTypeKind.ZodDefault})}brand(){return new ZodBranded({typeName:ZodFirstPartyTypeKind.ZodBranded,type:this,...processCreateParams(this._def)})}catch(def$1){let catchValueFunc=typeof def$1==`function`?def$1:()=>def$1;return new ZodCatch({...processCreateParams(this._def),innerType:this,catchValue:catchValueFunc,typeName:ZodFirstPartyTypeKind.ZodCatch})}describe(description){let This=this.constructor;return new This({...this._def,description})}pipe(target$1){return ZodPipeline.create(this,target$1)}readonly(){return ZodReadonly.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};const cuidRegex=/^c[^\s-]{8,}$/i,cuid2Regex=/^[0-9a-z]+$/,ulidRegex=/^[0-9A-HJKMNP-TV-Z]{26}$/i,uuidRegex=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,nanoidRegex=/^[a-z0-9_-]{21}$/i,jwtRegex=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,durationRegex=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,emailRegex=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_emojiRegex=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;let emojiRegex;const ipv4Regex=/^(?:(?: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])$/,ipv4CidrRegex=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,ipv6Regex=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ipv6CidrRegex=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64Regex=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64urlRegex=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,dateRegexSource=`((\\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])))`,dateRegex=RegExp(`^${dateRegexSource}$`);function timeRegexSource(args){let secondsRegexSource=`[0-5]\\d`;args.precision?secondsRegexSource=`${secondsRegexSource}\\.\\d{${args.precision}}`:args.precision??(secondsRegexSource=`${secondsRegexSource}(\\.\\d+)?`);let secondsQuantifier=args.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`}function timeRegex(args){return RegExp(`^${timeRegexSource(args)}$`)}function datetimeRegex(args){let regex=`${dateRegexSource}T${timeRegexSource(args)}`,opts=[];return opts.push(args.local?`Z?`:`Z`),args.offset&&opts.push(`([+-]\\d{2}:?\\d{2})`),regex=`${regex}(${opts.join(`|`)})`,RegExp(`^${regex}$`)}function isValidIP(ip$1,version$1){return!!((version$1===`v4`||!version$1)&&ipv4Regex.test(ip$1)||(version$1===`v6`||!version$1)&&ipv6Regex.test(ip$1))}function isValidJWT(jwt,alg){if(!jwtRegex.test(jwt))return!1;try{let[header]=jwt.split(`.`);if(!header)return!1;let base64=header.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(header.length+(4-header.length%4)%4,`=`),decoded=JSON.parse(atob(base64));return!(typeof decoded!=`object`||!decoded||`typ`in decoded&&decoded?.typ!==`JWT`||!decoded.alg||alg&&decoded.alg!==alg)}catch{return!1}}function isValidCidr(ip$1,version$1){return!!((version$1===`v4`||!version$1)&&ipv4CidrRegex.test(ip$1)||(version$1===`v6`||!version$1)&&ipv6CidrRegex.test(ip$1))}var ZodString=class ZodString extends ZodType{_parse(input){this._def.coerce&&(input.data=String(input.data));let parsedType=this._getType(input);if(parsedType!==ZodParsedType.string){let ctx$1=this._getOrReturnCtx(input);return addIssueToContext(ctx$1,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.string,received:ctx$1.parsedType}),INVALID}let status=new ParseStatus,ctx;for(let check$1 of this._def.checks)if(check$1.kind===`min`)input.data.lengthcheck$1.value&&(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.too_big,maximum:check$1.value,type:`string`,inclusive:!0,exact:!1,message:check$1.message}),status.dirty());else if(check$1.kind===`length`){let tooBig=input.data.length>check$1.value,tooSmall=input.data.lengthregex.test(data$12),{validation,code:ZodIssueCode.invalid_string,...errorUtil.errToObj(message$1)})}_addCheck(check$1){return new ZodString({...this._def,checks:[...this._def.checks,check$1]})}email(message$1){return this._addCheck({kind:`email`,...errorUtil.errToObj(message$1)})}url(message$1){return this._addCheck({kind:`url`,...errorUtil.errToObj(message$1)})}emoji(message$1){return this._addCheck({kind:`emoji`,...errorUtil.errToObj(message$1)})}uuid(message$1){return this._addCheck({kind:`uuid`,...errorUtil.errToObj(message$1)})}nanoid(message$1){return this._addCheck({kind:`nanoid`,...errorUtil.errToObj(message$1)})}cuid(message$1){return this._addCheck({kind:`cuid`,...errorUtil.errToObj(message$1)})}cuid2(message$1){return this._addCheck({kind:`cuid2`,...errorUtil.errToObj(message$1)})}ulid(message$1){return this._addCheck({kind:`ulid`,...errorUtil.errToObj(message$1)})}base64(message$1){return this._addCheck({kind:`base64`,...errorUtil.errToObj(message$1)})}base64url(message$1){return this._addCheck({kind:`base64url`,...errorUtil.errToObj(message$1)})}jwt(options$1){return this._addCheck({kind:`jwt`,...errorUtil.errToObj(options$1)})}ip(options$1){return this._addCheck({kind:`ip`,...errorUtil.errToObj(options$1)})}cidr(options$1){return this._addCheck({kind:`cidr`,...errorUtil.errToObj(options$1)})}datetime(options$1){return typeof options$1==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:options$1}):this._addCheck({kind:`datetime`,precision:options$1?.precision===void 0?null:options$1?.precision,offset:options$1?.offset??!1,local:options$1?.local??!1,...errorUtil.errToObj(options$1?.message)})}date(message$1){return this._addCheck({kind:`date`,message:message$1})}time(options$1){return typeof options$1==`string`?this._addCheck({kind:`time`,precision:null,message:options$1}):this._addCheck({kind:`time`,precision:options$1?.precision===void 0?null:options$1?.precision,...errorUtil.errToObj(options$1?.message)})}duration(message$1){return this._addCheck({kind:`duration`,...errorUtil.errToObj(message$1)})}regex(regex,message$1){return this._addCheck({kind:`regex`,regex,...errorUtil.errToObj(message$1)})}includes(value$1,options$1){return this._addCheck({kind:`includes`,value:value$1,position:options$1?.position,...errorUtil.errToObj(options$1?.message)})}startsWith(value$1,message$1){return this._addCheck({kind:`startsWith`,value:value$1,...errorUtil.errToObj(message$1)})}endsWith(value$1,message$1){return this._addCheck({kind:`endsWith`,value:value$1,...errorUtil.errToObj(message$1)})}min(minLength,message$1){return this._addCheck({kind:`min`,value:minLength,...errorUtil.errToObj(message$1)})}max(maxLength,message$1){return this._addCheck({kind:`max`,value:maxLength,...errorUtil.errToObj(message$1)})}length(len,message$1){return this._addCheck({kind:`length`,value:len,...errorUtil.errToObj(message$1)})}nonempty(message$1){return this.min(1,errorUtil.errToObj(message$1))}trim(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:`toUpperCase`}]})}get isDatetime(){return!!this._def.checks.find(ch$1=>ch$1.kind===`datetime`)}get isDate(){return!!this._def.checks.find(ch$1=>ch$1.kind===`date`)}get isTime(){return!!this._def.checks.find(ch$1=>ch$1.kind===`time`)}get isDuration(){return!!this._def.checks.find(ch$1=>ch$1.kind===`duration`)}get isEmail(){return!!this._def.checks.find(ch$1=>ch$1.kind===`email`)}get isURL(){return!!this._def.checks.find(ch$1=>ch$1.kind===`url`)}get isEmoji(){return!!this._def.checks.find(ch$1=>ch$1.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(ch$1=>ch$1.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(ch$1=>ch$1.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(ch$1=>ch$1.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(ch$1=>ch$1.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(ch$1=>ch$1.kind===`ulid`)}get isIP(){return!!this._def.checks.find(ch$1=>ch$1.kind===`ip`)}get isCIDR(){return!!this._def.checks.find(ch$1=>ch$1.kind===`cidr`)}get isBase64(){return!!this._def.checks.find(ch$1=>ch$1.kind===`base64`)}get isBase64url(){return!!this._def.checks.find(ch$1=>ch$1.kind===`base64url`)}get minLength(){let min$1=null;for(let ch$1 of this._def.checks)ch$1.kind===`min`&&(min$1===null||ch$1.value>min$1)&&(min$1=ch$1.value);return min$1}get maxLength(){let max$1=null;for(let ch$1 of this._def.checks)ch$1.kind===`max`&&(max$1===null||ch$1.valuenew ZodString({checks:[],typeName:ZodFirstPartyTypeKind.ZodString,coerce:params?.coerce??!1,...processCreateParams(params)});function floatSafeRemainder(val,step){let valDecCount=(val.toString().split(`.`)[1]||``).length,stepDecCount=(step.toString().split(`.`)[1]||``).length,decCount=valDecCount>stepDecCount?valDecCount:stepDecCount,valInt=Number.parseInt(val.toFixed(decCount).replace(`.`,``)),stepInt=Number.parseInt(step.toFixed(decCount).replace(`.`,``));return valInt%stepInt/10**decCount}var ZodNumber=class ZodNumber extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(input){this._def.coerce&&(input.data=Number(input.data));let parsedType=this._getType(input);if(parsedType!==ZodParsedType.number){let ctx$1=this._getOrReturnCtx(input);return addIssueToContext(ctx$1,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.number,received:ctx$1.parsedType}),INVALID}let ctx,status=new ParseStatus;for(let check$1 of this._def.checks)if(check$1.kind===`int`)util.isInteger(input.data)||(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:`integer`,received:`float`,message:check$1.message}),status.dirty());else if(check$1.kind===`min`){let tooSmall=check$1.inclusive?input.datacheck$1.value:input.data>=check$1.value;tooBig&&(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.too_big,maximum:check$1.value,type:`number`,inclusive:check$1.inclusive,exact:!1,message:check$1.message}),status.dirty())}else check$1.kind===`multipleOf`?floatSafeRemainder(input.data,check$1.value)!==0&&(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.not_multiple_of,multipleOf:check$1.value,message:check$1.message}),status.dirty()):check$1.kind===`finite`?Number.isFinite(input.data)||(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.not_finite,message:check$1.message}),status.dirty()):util.assertNever(check$1);return{status:status.value,value:input.data}}gte(value$1,message$1){return this.setLimit(`min`,value$1,!0,errorUtil.toString(message$1))}gt(value$1,message$1){return this.setLimit(`min`,value$1,!1,errorUtil.toString(message$1))}lte(value$1,message$1){return this.setLimit(`max`,value$1,!0,errorUtil.toString(message$1))}lt(value$1,message$1){return this.setLimit(`max`,value$1,!1,errorUtil.toString(message$1))}setLimit(kind,value$1,inclusive,message$1){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind,value:value$1,inclusive,message:errorUtil.toString(message$1)}]})}_addCheck(check$1){return new ZodNumber({...this._def,checks:[...this._def.checks,check$1]})}int(message$1){return this._addCheck({kind:`int`,message:errorUtil.toString(message$1)})}positive(message$1){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:errorUtil.toString(message$1)})}negative(message$1){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:errorUtil.toString(message$1)})}nonpositive(message$1){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:errorUtil.toString(message$1)})}nonnegative(message$1){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:errorUtil.toString(message$1)})}multipleOf(value$1,message$1){return this._addCheck({kind:`multipleOf`,value:value$1,message:errorUtil.toString(message$1)})}finite(message$1){return this._addCheck({kind:`finite`,message:errorUtil.toString(message$1)})}safe(message$1){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:errorUtil.toString(message$1)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:errorUtil.toString(message$1)})}get minValue(){let min$1=null;for(let ch$1 of this._def.checks)ch$1.kind===`min`&&(min$1===null||ch$1.value>min$1)&&(min$1=ch$1.value);return min$1}get maxValue(){let max$1=null;for(let ch$1 of this._def.checks)ch$1.kind===`max`&&(max$1===null||ch$1.valuech$1.kind===`int`||ch$1.kind===`multipleOf`&&util.isInteger(ch$1.value))}get isFinite(){let max$1=null,min$1=null;for(let ch$1 of this._def.checks)if(ch$1.kind===`finite`||ch$1.kind===`int`||ch$1.kind===`multipleOf`)return!0;else ch$1.kind===`min`?(min$1===null||ch$1.value>min$1)&&(min$1=ch$1.value):ch$1.kind===`max`&&(max$1===null||ch$1.valuenew ZodNumber({checks:[],typeName:ZodFirstPartyTypeKind.ZodNumber,coerce:params?.coerce||!1,...processCreateParams(params)});var ZodBigInt=class ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(input){if(this._def.coerce)try{input.data=BigInt(input.data)}catch{return this._getInvalidInput(input)}let parsedType=this._getType(input);if(parsedType!==ZodParsedType.bigint)return this._getInvalidInput(input);let ctx,status=new ParseStatus;for(let check$1 of this._def.checks)if(check$1.kind===`min`){let tooSmall=check$1.inclusive?input.datacheck$1.value:input.data>=check$1.value;tooBig&&(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.too_big,type:`bigint`,maximum:check$1.value,inclusive:check$1.inclusive,message:check$1.message}),status.dirty())}else check$1.kind===`multipleOf`?input.data%check$1.value!==BigInt(0)&&(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.not_multiple_of,multipleOf:check$1.value,message:check$1.message}),status.dirty()):util.assertNever(check$1);return{status:status.value,value:input.data}}_getInvalidInput(input){let ctx=this._getOrReturnCtx(input);return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.bigint,received:ctx.parsedType}),INVALID}gte(value$1,message$1){return this.setLimit(`min`,value$1,!0,errorUtil.toString(message$1))}gt(value$1,message$1){return this.setLimit(`min`,value$1,!1,errorUtil.toString(message$1))}lte(value$1,message$1){return this.setLimit(`max`,value$1,!0,errorUtil.toString(message$1))}lt(value$1,message$1){return this.setLimit(`max`,value$1,!1,errorUtil.toString(message$1))}setLimit(kind,value$1,inclusive,message$1){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind,value:value$1,inclusive,message:errorUtil.toString(message$1)}]})}_addCheck(check$1){return new ZodBigInt({...this._def,checks:[...this._def.checks,check$1]})}positive(message$1){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:errorUtil.toString(message$1)})}negative(message$1){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:errorUtil.toString(message$1)})}nonpositive(message$1){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:errorUtil.toString(message$1)})}nonnegative(message$1){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:errorUtil.toString(message$1)})}multipleOf(value$1,message$1){return this._addCheck({kind:`multipleOf`,value:value$1,message:errorUtil.toString(message$1)})}get minValue(){let min$1=null;for(let ch$1 of this._def.checks)ch$1.kind===`min`&&(min$1===null||ch$1.value>min$1)&&(min$1=ch$1.value);return min$1}get maxValue(){let max$1=null;for(let ch$1 of this._def.checks)ch$1.kind===`max`&&(max$1===null||ch$1.valuenew ZodBigInt({checks:[],typeName:ZodFirstPartyTypeKind.ZodBigInt,coerce:params?.coerce??!1,...processCreateParams(params)});var ZodBoolean=class extends ZodType{_parse(input){this._def.coerce&&(input.data=!!input.data);let parsedType=this._getType(input);if(parsedType!==ZodParsedType.boolean){let ctx=this._getOrReturnCtx(input);return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.boolean,received:ctx.parsedType}),INVALID}return OK(input.data)}};ZodBoolean.create=params=>new ZodBoolean({typeName:ZodFirstPartyTypeKind.ZodBoolean,coerce:params?.coerce||!1,...processCreateParams(params)});var ZodDate=class ZodDate extends ZodType{_parse(input){this._def.coerce&&(input.data=new Date(input.data));let parsedType=this._getType(input);if(parsedType!==ZodParsedType.date){let ctx$1=this._getOrReturnCtx(input);return addIssueToContext(ctx$1,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.date,received:ctx$1.parsedType}),INVALID}if(Number.isNaN(input.data.getTime())){let ctx$1=this._getOrReturnCtx(input);return addIssueToContext(ctx$1,{code:ZodIssueCode.invalid_date}),INVALID}let status=new ParseStatus,ctx;for(let check$1 of this._def.checks)check$1.kind===`min`?input.data.getTime()check$1.value&&(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.too_big,message:check$1.message,inclusive:!0,exact:!1,maximum:check$1.value,type:`date`}),status.dirty()):util.assertNever(check$1);return{status:status.value,value:new Date(input.data.getTime())}}_addCheck(check$1){return new ZodDate({...this._def,checks:[...this._def.checks,check$1]})}min(minDate,message$1){return this._addCheck({kind:`min`,value:minDate.getTime(),message:errorUtil.toString(message$1)})}max(maxDate,message$1){return this._addCheck({kind:`max`,value:maxDate.getTime(),message:errorUtil.toString(message$1)})}get minDate(){let min$1=null;for(let ch$1 of this._def.checks)ch$1.kind===`min`&&(min$1===null||ch$1.value>min$1)&&(min$1=ch$1.value);return min$1==null?null:new Date(min$1)}get maxDate(){let max$1=null;for(let ch$1 of this._def.checks)ch$1.kind===`max`&&(max$1===null||ch$1.valuenew ZodDate({checks:[],coerce:params?.coerce||!1,typeName:ZodFirstPartyTypeKind.ZodDate,...processCreateParams(params)});var ZodSymbol=class extends ZodType{_parse(input){let parsedType=this._getType(input);if(parsedType!==ZodParsedType.symbol){let ctx=this._getOrReturnCtx(input);return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.symbol,received:ctx.parsedType}),INVALID}return OK(input.data)}};ZodSymbol.create=params=>new ZodSymbol({typeName:ZodFirstPartyTypeKind.ZodSymbol,...processCreateParams(params)});var ZodUndefined=class extends ZodType{_parse(input){let parsedType=this._getType(input);if(parsedType!==ZodParsedType.undefined){let ctx=this._getOrReturnCtx(input);return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.undefined,received:ctx.parsedType}),INVALID}return OK(input.data)}};ZodUndefined.create=params=>new ZodUndefined({typeName:ZodFirstPartyTypeKind.ZodUndefined,...processCreateParams(params)});var ZodNull=class extends ZodType{_parse(input){let parsedType=this._getType(input);if(parsedType!==ZodParsedType.null){let ctx=this._getOrReturnCtx(input);return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.null,received:ctx.parsedType}),INVALID}return OK(input.data)}};ZodNull.create=params=>new ZodNull({typeName:ZodFirstPartyTypeKind.ZodNull,...processCreateParams(params)});var ZodAny=class extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(input){return OK(input.data)}};ZodAny.create=params=>new ZodAny({typeName:ZodFirstPartyTypeKind.ZodAny,...processCreateParams(params)});var ZodUnknown=class extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(input){return OK(input.data)}};ZodUnknown.create=params=>new ZodUnknown({typeName:ZodFirstPartyTypeKind.ZodUnknown,...processCreateParams(params)});var ZodNever=class extends ZodType{_parse(input){let ctx=this._getOrReturnCtx(input);return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.never,received:ctx.parsedType}),INVALID}};ZodNever.create=params=>new ZodNever({typeName:ZodFirstPartyTypeKind.ZodNever,...processCreateParams(params)});var ZodVoid=class extends ZodType{_parse(input){let parsedType=this._getType(input);if(parsedType!==ZodParsedType.undefined){let ctx=this._getOrReturnCtx(input);return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.void,received:ctx.parsedType}),INVALID}return OK(input.data)}};ZodVoid.create=params=>new ZodVoid({typeName:ZodFirstPartyTypeKind.ZodVoid,...processCreateParams(params)});var ZodArray=class ZodArray extends ZodType{_parse(input){let{ctx,status}=this._processInputParams(input),def$1=this._def;if(ctx.parsedType!==ZodParsedType.array)return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:ctx.parsedType}),INVALID;if(def$1.exactLength!==null){let tooBig=ctx.data.length>def$1.exactLength.value,tooSmall=ctx.data.lengthdef$1.maxLength.value&&(addIssueToContext(ctx,{code:ZodIssueCode.too_big,maximum:def$1.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:def$1.maxLength.message}),status.dirty()),ctx.common.async)return Promise.all([...ctx.data].map((item,i$1)=>def$1.type._parseAsync(new ParseInputLazyPath(ctx,item,ctx.path,i$1)))).then(result$1=>ParseStatus.mergeArray(status,result$1));let result=[...ctx.data].map((item,i$1)=>def$1.type._parseSync(new ParseInputLazyPath(ctx,item,ctx.path,i$1)));return ParseStatus.mergeArray(status,result)}get element(){return this._def.type}min(minLength,message$1){return new ZodArray({...this._def,minLength:{value:minLength,message:errorUtil.toString(message$1)}})}max(maxLength,message$1){return new ZodArray({...this._def,maxLength:{value:maxLength,message:errorUtil.toString(message$1)}})}length(len,message$1){return new ZodArray({...this._def,exactLength:{value:len,message:errorUtil.toString(message$1)}})}nonempty(message$1){return this.min(1,message$1)}};ZodArray.create=(schema,params)=>new ZodArray({type:schema,minLength:null,maxLength:null,exactLength:null,typeName:ZodFirstPartyTypeKind.ZodArray,...processCreateParams(params)});function deepPartialify(schema){if(schema instanceof ZodObject){let newShape={};for(let key$2 in schema.shape){let fieldSchema=schema.shape[key$2];newShape[key$2]=ZodOptional.create(deepPartialify(fieldSchema))}return new ZodObject({...schema._def,shape:()=>newShape})}else if(schema instanceof ZodArray)return new ZodArray({...schema._def,type:deepPartialify(schema.element)});else if(schema instanceof ZodOptional)return ZodOptional.create(deepPartialify(schema.unwrap()));else if(schema instanceof ZodNullable)return ZodNullable.create(deepPartialify(schema.unwrap()));else if(schema instanceof ZodTuple)return ZodTuple.create(schema.items.map(item=>deepPartialify(item)));else return schema}var ZodObject=class ZodObject extends ZodType{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let shape=this._def.shape(),keys$3=util.objectKeys(shape);return this._cached={shape,keys:keys$3},this._cached}_parse(input){let parsedType=this._getType(input);if(parsedType!==ZodParsedType.object){let ctx$1=this._getOrReturnCtx(input);return addIssueToContext(ctx$1,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:ctx$1.parsedType}),INVALID}let{status,ctx}=this._processInputParams(input),{shape,keys:shapeKeys}=this._getCached(),extraKeys=[];if(!(this._def.catchall instanceof ZodNever&&this._def.unknownKeys===`strip`))for(let key$2 in ctx.data)shapeKeys.includes(key$2)||extraKeys.push(key$2);let pairs=[];for(let key$2 of shapeKeys){let keyValidator=shape[key$2],value$1=ctx.data[key$2];pairs.push({key:{status:`valid`,value:key$2},value:keyValidator._parse(new ParseInputLazyPath(ctx,value$1,ctx.path,key$2)),alwaysSet:key$2 in ctx.data})}if(this._def.catchall instanceof ZodNever){let unknownKeys=this._def.unknownKeys;if(unknownKeys===`passthrough`)for(let key$2 of extraKeys)pairs.push({key:{status:`valid`,value:key$2},value:{status:`valid`,value:ctx.data[key$2]}});else if(unknownKeys===`strict`)extraKeys.length>0&&(addIssueToContext(ctx,{code:ZodIssueCode.unrecognized_keys,keys:extraKeys}),status.dirty());else if(unknownKeys!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let catchall=this._def.catchall;for(let key$2 of extraKeys){let value$1=ctx.data[key$2];pairs.push({key:{status:`valid`,value:key$2},value:catchall._parse(new ParseInputLazyPath(ctx,value$1,ctx.path,key$2)),alwaysSet:key$2 in ctx.data})}}return ctx.common.async?Promise.resolve().then(async()=>{let syncPairs=[];for(let pair of pairs){let key$2=await pair.key,value$1=await pair.value;syncPairs.push({key:key$2,value:value$1,alwaysSet:pair.alwaysSet})}return syncPairs}).then(syncPairs=>ParseStatus.mergeObjectSync(status,syncPairs)):ParseStatus.mergeObjectSync(status,pairs)}get shape(){return this._def.shape()}strict(message$1){return errorUtil.errToObj,new ZodObject({...this._def,unknownKeys:`strict`,...message$1===void 0?{}:{errorMap:(issue,ctx)=>{let defaultError=this._def.errorMap?.(issue,ctx).message??ctx.defaultError;return issue.code===`unrecognized_keys`?{message:errorUtil.errToObj(message$1).message??defaultError}:{message:defaultError}}}})}strip(){return new ZodObject({...this._def,unknownKeys:`strip`})}passthrough(){return new ZodObject({...this._def,unknownKeys:`passthrough`})}extend(augmentation){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),...augmentation})})}merge(merging){let merged=new ZodObject({unknownKeys:merging._def.unknownKeys,catchall:merging._def.catchall,shape:()=>({...this._def.shape(),...merging._def.shape()}),typeName:ZodFirstPartyTypeKind.ZodObject});return merged}setKey(key$2,schema){return this.augment({[key$2]:schema})}catchall(index$1){return new ZodObject({...this._def,catchall:index$1})}pick(mask){let shape={};for(let key$2 of util.objectKeys(mask))mask[key$2]&&this.shape[key$2]&&(shape[key$2]=this.shape[key$2]);return new ZodObject({...this._def,shape:()=>shape})}omit(mask){let shape={};for(let key$2 of util.objectKeys(this.shape))mask[key$2]||(shape[key$2]=this.shape[key$2]);return new ZodObject({...this._def,shape:()=>shape})}deepPartial(){return deepPartialify(this)}partial(mask){let newShape={};for(let key$2 of util.objectKeys(this.shape)){let fieldSchema=this.shape[key$2];mask&&!mask[key$2]?newShape[key$2]=fieldSchema:newShape[key$2]=fieldSchema.optional()}return new ZodObject({...this._def,shape:()=>newShape})}required(mask){let newShape={};for(let key$2 of util.objectKeys(this.shape))if(mask&&!mask[key$2])newShape[key$2]=this.shape[key$2];else{let fieldSchema=this.shape[key$2],newField=fieldSchema;for(;newField instanceof ZodOptional;)newField=newField._def.innerType;newShape[key$2]=newField}return new ZodObject({...this._def,shape:()=>newShape})}keyof(){return createZodEnum(util.objectKeys(this.shape))}};ZodObject.create=(shape,params)=>new ZodObject({shape:()=>shape,unknownKeys:`strip`,catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(params)}),ZodObject.strictCreate=(shape,params)=>new ZodObject({shape:()=>shape,unknownKeys:`strict`,catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(params)}),ZodObject.lazycreate=(shape,params)=>new ZodObject({shape,unknownKeys:`strip`,catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(params)});var ZodUnion=class extends ZodType{_parse(input){let{ctx}=this._processInputParams(input),options$1=this._def.options;function handleResults(results){for(let result of results)if(result.result.status===`valid`)return result.result;for(let result of results)if(result.result.status===`dirty`)return ctx.common.issues.push(...result.ctx.common.issues),result.result;let unionErrors=results.map(result=>new ZodError(result.ctx.common.issues));return addIssueToContext(ctx,{code:ZodIssueCode.invalid_union,unionErrors}),INVALID}if(ctx.common.async)return Promise.all(options$1.map(async option$1=>{let childCtx={...ctx,common:{...ctx.common,issues:[]},parent:null};return{result:await option$1._parseAsync({data:ctx.data,path:ctx.path,parent:childCtx}),ctx:childCtx}})).then(handleResults);{let dirty,issues=[];for(let option$1 of options$1){let childCtx={...ctx,common:{...ctx.common,issues:[]},parent:null},result=option$1._parseSync({data:ctx.data,path:ctx.path,parent:childCtx});if(result.status===`valid`)return result;result.status===`dirty`&&!dirty&&(dirty={result,ctx:childCtx}),childCtx.common.issues.length&&issues.push(childCtx.common.issues)}if(dirty)return ctx.common.issues.push(...dirty.ctx.common.issues),dirty.result;let unionErrors=issues.map(issues$1=>new ZodError(issues$1));return addIssueToContext(ctx,{code:ZodIssueCode.invalid_union,unionErrors}),INVALID}}get options(){return this._def.options}};ZodUnion.create=(types$1,params)=>new ZodUnion({options:types$1,typeName:ZodFirstPartyTypeKind.ZodUnion,...processCreateParams(params)});const getDiscriminator=type=>type instanceof ZodLazy?getDiscriminator(type.schema):type instanceof ZodEffects?getDiscriminator(type.innerType()):type instanceof ZodLiteral?[type.value]:type instanceof ZodEnum?type.options:type instanceof ZodNativeEnum?util.objectValues(type.enum):type instanceof ZodDefault?getDiscriminator(type._def.innerType):type instanceof ZodUndefined?[void 0]:type instanceof ZodNull?[null]:type instanceof ZodOptional?[void 0,...getDiscriminator(type.unwrap())]:type instanceof ZodNullable?[null,...getDiscriminator(type.unwrap())]:type instanceof ZodBranded||type instanceof ZodReadonly?getDiscriminator(type.unwrap()):type instanceof ZodCatch?getDiscriminator(type._def.innerType):[];var ZodDiscriminatedUnion=class ZodDiscriminatedUnion extends ZodType{_parse(input){let{ctx}=this._processInputParams(input);if(ctx.parsedType!==ZodParsedType.object)return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:ctx.parsedType}),INVALID;let discriminator=this.discriminator,discriminatorValue=ctx.data[discriminator],option$1=this.optionsMap.get(discriminatorValue);return option$1?ctx.common.async?option$1._parseAsync({data:ctx.data,path:ctx.path,parent:ctx}):option$1._parseSync({data:ctx.data,path:ctx.path,parent:ctx}):(addIssueToContext(ctx,{code:ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[discriminator]}),INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(discriminator,options$1,params){let optionsMap=new Map;for(let type of options$1){let discriminatorValues=getDiscriminator(type.shape[discriminator]);if(!discriminatorValues.length)throw Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`);for(let value$1 of discriminatorValues){if(optionsMap.has(value$1))throw Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value$1)}`);optionsMap.set(value$1,type)}}return new ZodDiscriminatedUnion({typeName:ZodFirstPartyTypeKind.ZodDiscriminatedUnion,discriminator,options:options$1,optionsMap,...processCreateParams(params)})}};function mergeValues(a$2,b$4){let aType=getParsedType(a$2),bType=getParsedType(b$4);if(a$2===b$4)return{valid:!0,data:a$2};if(aType===ZodParsedType.object&&bType===ZodParsedType.object){let bKeys=util.objectKeys(b$4),sharedKeys=util.objectKeys(a$2).filter(key$2=>bKeys.indexOf(key$2)!==-1),newObj={...a$2,...b$4};for(let key$2 of sharedKeys){let sharedValue=mergeValues(a$2[key$2],b$4[key$2]);if(!sharedValue.valid)return{valid:!1};newObj[key$2]=sharedValue.data}return{valid:!0,data:newObj}}else if(aType===ZodParsedType.array&&bType===ZodParsedType.array){if(a$2.length!==b$4.length)return{valid:!1};let newArray=[];for(let index$1=0;index$1{if(isAborted(parsedLeft)||isAborted(parsedRight))return INVALID;let merged=mergeValues(parsedLeft.value,parsedRight.value);return merged.valid?((isDirty(parsedLeft)||isDirty(parsedRight))&&status.dirty(),{status:status.value,value:merged.data}):(addIssueToContext(ctx,{code:ZodIssueCode.invalid_intersection_types}),INVALID)};return ctx.common.async?Promise.all([this._def.left._parseAsync({data:ctx.data,path:ctx.path,parent:ctx}),this._def.right._parseAsync({data:ctx.data,path:ctx.path,parent:ctx})]).then(([left,right])=>handleParsed(left,right)):handleParsed(this._def.left._parseSync({data:ctx.data,path:ctx.path,parent:ctx}),this._def.right._parseSync({data:ctx.data,path:ctx.path,parent:ctx}))}};ZodIntersection.create=(left,right,params)=>new ZodIntersection({left,right,typeName:ZodFirstPartyTypeKind.ZodIntersection,...processCreateParams(params)});var ZodTuple=class ZodTuple extends ZodType{_parse(input){let{status,ctx}=this._processInputParams(input);if(ctx.parsedType!==ZodParsedType.array)return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:ctx.parsedType}),INVALID;if(ctx.data.lengththis._def.items.length&&(addIssueToContext(ctx,{code:ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),status.dirty());let items=[...ctx.data].map((item,itemIndex)=>{let schema=this._def.items[itemIndex]||this._def.rest;return schema?schema._parse(new ParseInputLazyPath(ctx,item,ctx.path,itemIndex)):null}).filter(x$3=>!!x$3);return ctx.common.async?Promise.all(items).then(results=>ParseStatus.mergeArray(status,results)):ParseStatus.mergeArray(status,items)}get items(){return this._def.items}rest(rest){return new ZodTuple({...this._def,rest})}};ZodTuple.create=(schemas,params)=>{if(!Array.isArray(schemas))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new ZodTuple({items:schemas,typeName:ZodFirstPartyTypeKind.ZodTuple,rest:null,...processCreateParams(params)})};var ZodRecord=class ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(input){let{status,ctx}=this._processInputParams(input);if(ctx.parsedType!==ZodParsedType.object)return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:ctx.parsedType}),INVALID;let pairs=[],keyType=this._def.keyType,valueType=this._def.valueType;for(let key$2 in ctx.data)pairs.push({key:keyType._parse(new ParseInputLazyPath(ctx,key$2,ctx.path,key$2)),value:valueType._parse(new ParseInputLazyPath(ctx,ctx.data[key$2],ctx.path,key$2)),alwaysSet:key$2 in ctx.data});return ctx.common.async?ParseStatus.mergeObjectAsync(status,pairs):ParseStatus.mergeObjectSync(status,pairs)}get element(){return this._def.valueType}static create(first,second,third){return second instanceof ZodType?new ZodRecord({keyType:first,valueType:second,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(third)}):new ZodRecord({keyType:ZodString.create(),valueType:first,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(second)})}},ZodMap=class extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(input){let{status,ctx}=this._processInputParams(input);if(ctx.parsedType!==ZodParsedType.map)return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.map,received:ctx.parsedType}),INVALID;let keyType=this._def.keyType,valueType=this._def.valueType,pairs=[...ctx.data.entries()].map(([key$2,value$1],index$1)=>({key:keyType._parse(new ParseInputLazyPath(ctx,key$2,ctx.path,[index$1,`key`])),value:valueType._parse(new ParseInputLazyPath(ctx,value$1,ctx.path,[index$1,`value`]))}));if(ctx.common.async){let finalMap=new Map;return Promise.resolve().then(async()=>{for(let pair of pairs){let key$2=await pair.key,value$1=await pair.value;if(key$2.status===`aborted`||value$1.status===`aborted`)return INVALID;(key$2.status===`dirty`||value$1.status===`dirty`)&&status.dirty(),finalMap.set(key$2.value,value$1.value)}return{status:status.value,value:finalMap}})}else{let finalMap=new Map;for(let pair of pairs){let key$2=pair.key,value$1=pair.value;if(key$2.status===`aborted`||value$1.status===`aborted`)return INVALID;(key$2.status===`dirty`||value$1.status===`dirty`)&&status.dirty(),finalMap.set(key$2.value,value$1.value)}return{status:status.value,value:finalMap}}}};ZodMap.create=(keyType,valueType,params)=>new ZodMap({valueType,keyType,typeName:ZodFirstPartyTypeKind.ZodMap,...processCreateParams(params)});var ZodSet=class ZodSet extends ZodType{_parse(input){let{status,ctx}=this._processInputParams(input);if(ctx.parsedType!==ZodParsedType.set)return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.set,received:ctx.parsedType}),INVALID;let def$1=this._def;def$1.minSize!==null&&ctx.data.sizedef$1.maxSize.value&&(addIssueToContext(ctx,{code:ZodIssueCode.too_big,maximum:def$1.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:def$1.maxSize.message}),status.dirty());let valueType=this._def.valueType;function finalizeSet(elements$1){let parsedSet=new Set;for(let element$3 of elements$1){if(element$3.status===`aborted`)return INVALID;element$3.status===`dirty`&&status.dirty(),parsedSet.add(element$3.value)}return{status:status.value,value:parsedSet}}let elements=[...ctx.data.values()].map((item,i$1)=>valueType._parse(new ParseInputLazyPath(ctx,item,ctx.path,i$1)));return ctx.common.async?Promise.all(elements).then(elements$1=>finalizeSet(elements$1)):finalizeSet(elements)}min(minSize,message$1){return new ZodSet({...this._def,minSize:{value:minSize,message:errorUtil.toString(message$1)}})}max(maxSize,message$1){return new ZodSet({...this._def,maxSize:{value:maxSize,message:errorUtil.toString(message$1)}})}size(size$2,message$1){return this.min(size$2,message$1).max(size$2,message$1)}nonempty(message$1){return this.min(1,message$1)}};ZodSet.create=(valueType,params)=>new ZodSet({valueType,minSize:null,maxSize:null,typeName:ZodFirstPartyTypeKind.ZodSet,...processCreateParams(params)});var ZodFunction=class ZodFunction extends ZodType{constructor(){super(...arguments),this.validate=this.implement}_parse(input){let{ctx}=this._processInputParams(input);if(ctx.parsedType!==ZodParsedType.function)return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.function,received:ctx.parsedType}),INVALID;function makeArgsIssue(args,error){return makeIssue({data:args,path:ctx.path,errorMaps:[ctx.common.contextualErrorMap,ctx.schemaErrorMap,getErrorMap(),en_default$1].filter(x$3=>!!x$3),issueData:{code:ZodIssueCode.invalid_arguments,argumentsError:error}})}function makeReturnsIssue(returns,error){return makeIssue({data:returns,path:ctx.path,errorMaps:[ctx.common.contextualErrorMap,ctx.schemaErrorMap,getErrorMap(),en_default$1].filter(x$3=>!!x$3),issueData:{code:ZodIssueCode.invalid_return_type,returnTypeError:error}})}let params={errorMap:ctx.common.contextualErrorMap},fn$6=ctx.data;if(this._def.returns instanceof ZodPromise){let me$2=this;return OK(async function(...args){let error=new ZodError([]),parsedArgs=await me$2._def.args.parseAsync(args,params).catch(e$3=>{throw error.addIssue(makeArgsIssue(args,e$3)),error}),result=await Reflect.apply(fn$6,this,parsedArgs),parsedReturns=await me$2._def.returns._def.type.parseAsync(result,params).catch(e$3=>{throw error.addIssue(makeReturnsIssue(result,e$3)),error});return parsedReturns})}else{let me$2=this;return OK(function(...args){let parsedArgs=me$2._def.args.safeParse(args,params);if(!parsedArgs.success)throw new ZodError([makeArgsIssue(args,parsedArgs.error)]);let result=Reflect.apply(fn$6,this,parsedArgs.data),parsedReturns=me$2._def.returns.safeParse(result,params);if(!parsedReturns.success)throw new ZodError([makeReturnsIssue(result,parsedReturns.error)]);return parsedReturns.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...items){return new ZodFunction({...this._def,args:ZodTuple.create(items).rest(ZodUnknown.create())})}returns(returnType){return new ZodFunction({...this._def,returns:returnType})}implement(func){let validatedFunc=this.parse(func);return validatedFunc}strictImplement(func){let validatedFunc=this.parse(func);return validatedFunc}static create(args,returns,params){return new ZodFunction({args:args||ZodTuple.create([]).rest(ZodUnknown.create()),returns:returns||ZodUnknown.create(),typeName:ZodFirstPartyTypeKind.ZodFunction,...processCreateParams(params)})}},ZodLazy=class extends ZodType{get schema(){return this._def.getter()}_parse(input){let{ctx}=this._processInputParams(input),lazySchema=this._def.getter();return lazySchema._parse({data:ctx.data,path:ctx.path,parent:ctx})}};ZodLazy.create=(getter,params)=>new ZodLazy({getter,typeName:ZodFirstPartyTypeKind.ZodLazy,...processCreateParams(params)});var ZodLiteral=class extends ZodType{_parse(input){if(input.data!==this._def.value){let ctx=this._getOrReturnCtx(input);return addIssueToContext(ctx,{received:ctx.data,code:ZodIssueCode.invalid_literal,expected:this._def.value}),INVALID}return{status:`valid`,value:input.data}}get value(){return this._def.value}};ZodLiteral.create=(value$1,params)=>new ZodLiteral({value:value$1,typeName:ZodFirstPartyTypeKind.ZodLiteral,...processCreateParams(params)});function createZodEnum(values,params){return new ZodEnum({values,typeName:ZodFirstPartyTypeKind.ZodEnum,...processCreateParams(params)})}var ZodEnum=class ZodEnum extends ZodType{_parse(input){if(typeof input.data!=`string`){let ctx=this._getOrReturnCtx(input),expectedValues=this._def.values;return addIssueToContext(ctx,{expected:util.joinValues(expectedValues),received:ctx.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(this._cache||=new Set(this._def.values),!this._cache.has(input.data)){let ctx=this._getOrReturnCtx(input),expectedValues=this._def.values;return addIssueToContext(ctx,{received:ctx.data,code:ZodIssueCode.invalid_enum_value,options:expectedValues}),INVALID}return OK(input.data)}get options(){return this._def.values}get enum(){let enumValues={};for(let val of this._def.values)enumValues[val]=val;return enumValues}get Values(){let enumValues={};for(let val of this._def.values)enumValues[val]=val;return enumValues}get Enum(){let enumValues={};for(let val of this._def.values)enumValues[val]=val;return enumValues}extract(values,newDef=this._def){return ZodEnum.create(values,{...this._def,...newDef})}exclude(values,newDef=this._def){return ZodEnum.create(this.options.filter(opt=>!values.includes(opt)),{...this._def,...newDef})}};ZodEnum.create=createZodEnum;var ZodNativeEnum=class extends ZodType{_parse(input){let nativeEnumValues=util.getValidEnumValues(this._def.values),ctx=this._getOrReturnCtx(input);if(ctx.parsedType!==ZodParsedType.string&&ctx.parsedType!==ZodParsedType.number){let expectedValues=util.objectValues(nativeEnumValues);return addIssueToContext(ctx,{expected:util.joinValues(expectedValues),received:ctx.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(this._cache||=new Set(util.getValidEnumValues(this._def.values)),!this._cache.has(input.data)){let expectedValues=util.objectValues(nativeEnumValues);return addIssueToContext(ctx,{received:ctx.data,code:ZodIssueCode.invalid_enum_value,options:expectedValues}),INVALID}return OK(input.data)}get enum(){return this._def.values}};ZodNativeEnum.create=(values,params)=>new ZodNativeEnum({values,typeName:ZodFirstPartyTypeKind.ZodNativeEnum,...processCreateParams(params)});var ZodPromise=class extends ZodType{unwrap(){return this._def.type}_parse(input){let{ctx}=this._processInputParams(input);if(ctx.parsedType!==ZodParsedType.promise&&ctx.common.async===!1)return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.promise,received:ctx.parsedType}),INVALID;let promisified=ctx.parsedType===ZodParsedType.promise?ctx.data:Promise.resolve(ctx.data);return OK(promisified.then(data$12=>this._def.type.parseAsync(data$12,{path:ctx.path,errorMap:ctx.common.contextualErrorMap})))}};ZodPromise.create=(schema,params)=>new ZodPromise({type:schema,typeName:ZodFirstPartyTypeKind.ZodPromise,...processCreateParams(params)});var ZodEffects=class extends ZodType{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ZodFirstPartyTypeKind.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(input){let{status,ctx}=this._processInputParams(input),effect$1=this._def.effect||null,checkCtx={addIssue:arg=>{addIssueToContext(ctx,arg),arg.fatal?status.abort():status.dirty()},get path(){return ctx.path}};if(checkCtx.addIssue=checkCtx.addIssue.bind(checkCtx),effect$1.type===`preprocess`){let processed=effect$1.transform(ctx.data,checkCtx);if(ctx.common.async)return Promise.resolve(processed).then(async processed$1=>{if(status.value===`aborted`)return INVALID;let result=await this._def.schema._parseAsync({data:processed$1,path:ctx.path,parent:ctx});return result.status===`aborted`?INVALID:result.status===`dirty`||status.value===`dirty`?DIRTY(result.value):result});{if(status.value===`aborted`)return INVALID;let result=this._def.schema._parseSync({data:processed,path:ctx.path,parent:ctx});return result.status===`aborted`?INVALID:result.status===`dirty`||status.value===`dirty`?DIRTY(result.value):result}}if(effect$1.type===`refinement`){let executeRefinement=acc=>{let result=effect$1.refinement(acc,checkCtx);if(ctx.common.async)return Promise.resolve(result);if(result instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return acc};if(ctx.common.async===!1){let inner=this._def.schema._parseSync({data:ctx.data,path:ctx.path,parent:ctx});return inner.status===`aborted`?INVALID:(inner.status===`dirty`&&status.dirty(),executeRefinement(inner.value),{status:status.value,value:inner.value})}else return this._def.schema._parseAsync({data:ctx.data,path:ctx.path,parent:ctx}).then(inner=>inner.status===`aborted`?INVALID:(inner.status===`dirty`&&status.dirty(),executeRefinement(inner.value).then(()=>({status:status.value,value:inner.value}))))}if(effect$1.type===`transform`)if(ctx.common.async===!1){let base=this._def.schema._parseSync({data:ctx.data,path:ctx.path,parent:ctx});if(!isValid(base))return INVALID;let result=effect$1.transform(base.value,checkCtx);if(result instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:status.value,value:result}}else return this._def.schema._parseAsync({data:ctx.data,path:ctx.path,parent:ctx}).then(base=>isValid(base)?Promise.resolve(effect$1.transform(base.value,checkCtx)).then(result=>({status:status.value,value:result})):INVALID);util.assertNever(effect$1)}};ZodEffects.create=(schema,effect$1,params)=>new ZodEffects({schema,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:effect$1,...processCreateParams(params)}),ZodEffects.createWithPreprocess=(preprocess$1,schema,params)=>new ZodEffects({schema,effect:{type:`preprocess`,transform:preprocess$1},typeName:ZodFirstPartyTypeKind.ZodEffects,...processCreateParams(params)});var ZodOptional=class extends ZodType{_parse(input){let parsedType=this._getType(input);return parsedType===ZodParsedType.undefined?OK(void 0):this._def.innerType._parse(input)}unwrap(){return this._def.innerType}};ZodOptional.create=(type,params)=>new ZodOptional({innerType:type,typeName:ZodFirstPartyTypeKind.ZodOptional,...processCreateParams(params)});var ZodNullable=class extends ZodType{_parse(input){let parsedType=this._getType(input);return parsedType===ZodParsedType.null?OK(null):this._def.innerType._parse(input)}unwrap(){return this._def.innerType}};ZodNullable.create=(type,params)=>new ZodNullable({innerType:type,typeName:ZodFirstPartyTypeKind.ZodNullable,...processCreateParams(params)});var ZodDefault=class extends ZodType{_parse(input){let{ctx}=this._processInputParams(input),data$12=ctx.data;return ctx.parsedType===ZodParsedType.undefined&&(data$12=this._def.defaultValue()),this._def.innerType._parse({data:data$12,path:ctx.path,parent:ctx})}removeDefault(){return this._def.innerType}};ZodDefault.create=(type,params)=>new ZodDefault({innerType:type,typeName:ZodFirstPartyTypeKind.ZodDefault,defaultValue:typeof params.default==`function`?params.default:()=>params.default,...processCreateParams(params)});var ZodCatch=class extends ZodType{_parse(input){let{ctx}=this._processInputParams(input),newCtx={...ctx,common:{...ctx.common,issues:[]}},result=this._def.innerType._parse({data:newCtx.data,path:newCtx.path,parent:{...newCtx}});return isAsync(result)?result.then(result$1=>({status:`valid`,value:result$1.status===`valid`?result$1.value:this._def.catchValue({get error(){return new ZodError(newCtx.common.issues)},input:newCtx.data})})):{status:`valid`,value:result.status===`valid`?result.value:this._def.catchValue({get error(){return new ZodError(newCtx.common.issues)},input:newCtx.data})}}removeCatch(){return this._def.innerType}};ZodCatch.create=(type,params)=>new ZodCatch({innerType:type,typeName:ZodFirstPartyTypeKind.ZodCatch,catchValue:typeof params.catch==`function`?params.catch:()=>params.catch,...processCreateParams(params)});var ZodNaN=class extends ZodType{_parse(input){let parsedType=this._getType(input);if(parsedType!==ZodParsedType.nan){let ctx=this._getOrReturnCtx(input);return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.nan,received:ctx.parsedType}),INVALID}return{status:`valid`,value:input.data}}};ZodNaN.create=params=>new ZodNaN({typeName:ZodFirstPartyTypeKind.ZodNaN,...processCreateParams(params)});const BRAND=Symbol(`zod_brand`);var ZodBranded=class extends ZodType{_parse(input){let{ctx}=this._processInputParams(input),data$12=ctx.data;return this._def.type._parse({data:data$12,path:ctx.path,parent:ctx})}unwrap(){return this._def.type}},ZodPipeline=class ZodPipeline extends ZodType{_parse(input){let{status,ctx}=this._processInputParams(input);if(ctx.common.async){let handleAsync=async()=>{let inResult=await this._def.in._parseAsync({data:ctx.data,path:ctx.path,parent:ctx});return inResult.status===`aborted`?INVALID:inResult.status===`dirty`?(status.dirty(),DIRTY(inResult.value)):this._def.out._parseAsync({data:inResult.value,path:ctx.path,parent:ctx})};return handleAsync()}else{let inResult=this._def.in._parseSync({data:ctx.data,path:ctx.path,parent:ctx});return inResult.status===`aborted`?INVALID:inResult.status===`dirty`?(status.dirty(),{status:`dirty`,value:inResult.value}):this._def.out._parseSync({data:inResult.value,path:ctx.path,parent:ctx})}}static create(a$2,b$4){return new ZodPipeline({in:a$2,out:b$4,typeName:ZodFirstPartyTypeKind.ZodPipeline})}},ZodReadonly=class extends ZodType{_parse(input){let result=this._def.innerType._parse(input),freeze=data$12=>(isValid(data$12)&&(data$12.value=Object.freeze(data$12.value)),data$12);return isAsync(result)?result.then(data$12=>freeze(data$12)):freeze(result)}unwrap(){return this._def.innerType}};ZodReadonly.create=(type,params)=>new ZodReadonly({innerType:type,typeName:ZodFirstPartyTypeKind.ZodReadonly,...processCreateParams(params)});const late={object:ZodObject.lazycreate};var ZodFirstPartyTypeKind;(function(ZodFirstPartyTypeKind$1){ZodFirstPartyTypeKind$1.ZodString=`ZodString`,ZodFirstPartyTypeKind$1.ZodNumber=`ZodNumber`,ZodFirstPartyTypeKind$1.ZodNaN=`ZodNaN`,ZodFirstPartyTypeKind$1.ZodBigInt=`ZodBigInt`,ZodFirstPartyTypeKind$1.ZodBoolean=`ZodBoolean`,ZodFirstPartyTypeKind$1.ZodDate=`ZodDate`,ZodFirstPartyTypeKind$1.ZodSymbol=`ZodSymbol`,ZodFirstPartyTypeKind$1.ZodUndefined=`ZodUndefined`,ZodFirstPartyTypeKind$1.ZodNull=`ZodNull`,ZodFirstPartyTypeKind$1.ZodAny=`ZodAny`,ZodFirstPartyTypeKind$1.ZodUnknown=`ZodUnknown`,ZodFirstPartyTypeKind$1.ZodNever=`ZodNever`,ZodFirstPartyTypeKind$1.ZodVoid=`ZodVoid`,ZodFirstPartyTypeKind$1.ZodArray=`ZodArray`,ZodFirstPartyTypeKind$1.ZodObject=`ZodObject`,ZodFirstPartyTypeKind$1.ZodUnion=`ZodUnion`,ZodFirstPartyTypeKind$1.ZodDiscriminatedUnion=`ZodDiscriminatedUnion`,ZodFirstPartyTypeKind$1.ZodIntersection=`ZodIntersection`,ZodFirstPartyTypeKind$1.ZodTuple=`ZodTuple`,ZodFirstPartyTypeKind$1.ZodRecord=`ZodRecord`,ZodFirstPartyTypeKind$1.ZodMap=`ZodMap`,ZodFirstPartyTypeKind$1.ZodSet=`ZodSet`,ZodFirstPartyTypeKind$1.ZodFunction=`ZodFunction`,ZodFirstPartyTypeKind$1.ZodLazy=`ZodLazy`,ZodFirstPartyTypeKind$1.ZodLiteral=`ZodLiteral`,ZodFirstPartyTypeKind$1.ZodEnum=`ZodEnum`,ZodFirstPartyTypeKind$1.ZodEffects=`ZodEffects`,ZodFirstPartyTypeKind$1.ZodNativeEnum=`ZodNativeEnum`,ZodFirstPartyTypeKind$1.ZodOptional=`ZodOptional`,ZodFirstPartyTypeKind$1.ZodNullable=`ZodNullable`,ZodFirstPartyTypeKind$1.ZodDefault=`ZodDefault`,ZodFirstPartyTypeKind$1.ZodCatch=`ZodCatch`,ZodFirstPartyTypeKind$1.ZodPromise=`ZodPromise`,ZodFirstPartyTypeKind$1.ZodBranded=`ZodBranded`,ZodFirstPartyTypeKind$1.ZodPipeline=`ZodPipeline`,ZodFirstPartyTypeKind$1.ZodReadonly=`ZodReadonly`})(ZodFirstPartyTypeKind||={});const stringType=ZodString.create,numberType=ZodNumber.create,nanType=ZodNaN.create,bigIntType=ZodBigInt.create,booleanType=ZodBoolean.create,dateType=ZodDate.create,symbolType=ZodSymbol.create,undefinedType=ZodUndefined.create,nullType=ZodNull.create,anyType=ZodAny.create,unknownType=ZodUnknown.create,neverType=ZodNever.create,voidType=ZodVoid.create,arrayType=ZodArray.create,objectType=ZodObject.create,strictObjectType=ZodObject.strictCreate,unionType=ZodUnion.create,discriminatedUnionType=ZodDiscriminatedUnion.create,intersectionType=ZodIntersection.create,tupleType=ZodTuple.create,recordType=ZodRecord.create,mapType=ZodMap.create,setType=ZodSet.create,functionType=ZodFunction.create,lazyType=ZodLazy.create,literalType=ZodLiteral.create,enumType=ZodEnum.create,nativeEnumType=ZodNativeEnum.create,promiseType=ZodPromise.create,effectsType=ZodEffects.create,optionalType=ZodOptional.create,nullableType=ZodNullable.create,preprocessType=ZodEffects.createWithPreprocess,pipelineType=ZodPipeline.create,tools$1=[tool({name:`debug_random_number`,description:`Generate a random number between 0 and 1`,execute:async()=>new Promise(resolve$1=>{setTimeout(()=>{resolve$1(Math.random().toString())},1e3)}),parameters:objectType({})})],debug=async()=>Promise.all(tools$1);function __classPrivateFieldGet(receiver,state,kind,f$3){if(kind===`a`&&!f$3)throw TypeError(`Private accessor was defined without a getter`);if(typeof state==`function`?receiver!==state||!f$3:!state.has(receiver))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return kind===`m`?f$3:kind===`a`?f$3.call(receiver):f$3?f$3.value:state.get(receiver)}function __classPrivateFieldSet(receiver,state,value$1,kind,f$3){if(kind===`m`)throw TypeError(`Private method is not writable`);if(kind===`a`&&!f$3)throw TypeError(`Private accessor was defined without a setter`);if(typeof state==`function`?receiver!==state||!f$3:!state.has(receiver))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return kind===`a`?f$3.call(receiver,value$1):f$3?f$3.value=value$1:state.set(receiver,value$1),value$1}var _Channel_onmessage,_Channel_nextMessageIndex,_Channel_pendingMessages,_Channel_messageEndIndex,_Resource_rid;const SERIALIZE_TO_IPC_FN=`__TAURI_TO_IPC_KEY__`;function transformCallback(callback,once=!1){return window.__TAURI_INTERNALS__.transformCallback(callback,once)}var Channel=class{constructor(onmessage){_Channel_onmessage.set(this,void 0),_Channel_nextMessageIndex.set(this,0),_Channel_pendingMessages.set(this,[]),_Channel_messageEndIndex.set(this,void 0),__classPrivateFieldSet(this,_Channel_onmessage,onmessage||(()=>{}),`f`),this.id=transformCallback(rawMessage=>{let index$1=rawMessage.index;if(`end`in rawMessage){index$1==__classPrivateFieldGet(this,_Channel_nextMessageIndex,`f`)?this.cleanupCallback():__classPrivateFieldSet(this,_Channel_messageEndIndex,index$1,`f`);return}let message$1=rawMessage.message;if(index$1==__classPrivateFieldGet(this,_Channel_nextMessageIndex,`f`)){for(__classPrivateFieldGet(this,_Channel_onmessage,`f`).call(this,message$1),__classPrivateFieldSet(this,_Channel_nextMessageIndex,__classPrivateFieldGet(this,_Channel_nextMessageIndex,`f`)+1,`f`);__classPrivateFieldGet(this,_Channel_nextMessageIndex,`f`)in __classPrivateFieldGet(this,_Channel_pendingMessages,`f`);){let message$2=__classPrivateFieldGet(this,_Channel_pendingMessages,`f`)[__classPrivateFieldGet(this,_Channel_nextMessageIndex,`f`)];__classPrivateFieldGet(this,_Channel_onmessage,`f`).call(this,message$2),delete __classPrivateFieldGet(this,_Channel_pendingMessages,`f`)[__classPrivateFieldGet(this,_Channel_nextMessageIndex,`f`)],__classPrivateFieldSet(this,_Channel_nextMessageIndex,__classPrivateFieldGet(this,_Channel_nextMessageIndex,`f`)+1,`f`)}__classPrivateFieldGet(this,_Channel_nextMessageIndex,`f`)===__classPrivateFieldGet(this,_Channel_messageEndIndex,`f`)&&this.cleanupCallback()}else __classPrivateFieldGet(this,_Channel_pendingMessages,`f`)[index$1]=message$1})}cleanupCallback(){window.__TAURI_INTERNALS__.unregisterCallback(this.id)}set onmessage(handler){__classPrivateFieldSet(this,_Channel_onmessage,handler,`f`)}get onmessage(){return __classPrivateFieldGet(this,_Channel_onmessage,`f`)}[(_Channel_onmessage=new WeakMap,_Channel_nextMessageIndex=new WeakMap,_Channel_pendingMessages=new WeakMap,_Channel_messageEndIndex=new WeakMap,SERIALIZE_TO_IPC_FN)](){return`__CHANNEL__:${this.id}`}toJSON(){return this[SERIALIZE_TO_IPC_FN]()}};async function invoke(cmd,args={},options$1){return window.__TAURI_INTERNALS__.invoke(cmd,args,options$1)}_Resource_rid=new WeakMap;async function connectServer(command,args){await invoke(`plugin:mcp|connect_server`,{command,args})}async function disconnectServer(){await invoke(`plugin:mcp|disconnect_server`)}async function listTools(){return await invoke(`plugin:mcp|list_tools`)}async function callTool(name$2,args){return await invoke(`plugin:mcp|call_tool`,{name:name$2,args})}const tools=[tool({name:`mcp_list_tools`,description:`List all tools available on the MCP server`,execute:async(_$2,__)=>await listTools(),parameters:objectType({})}),tool({name:`mcp_connect_server`,description:`Connect to the MCP server. If "success", the connection to the MCP server is successful. Otherwise, the connection fails.`,execute:async({command,args})=>(await connectServer(command,args),`success`),parameters:objectType({command:stringType().describe(`The command to connect to the MCP server`),args:arrayType(stringType()).describe(`The arguments to pass to the MCP server`)})}),tool({name:`mcp_disconnect_server`,description:`Disconnect from the MCP server. If "success", the disconnection from the MCP server is successful. Otherwise, the disconnection fails.`,execute:async()=>(await disconnectServer(),`success`),parameters:objectType({})}),tool({name:`mcp_call_tool`,description:`Call a tool on the MCP server. The result is a list of content and a boolean indicating whether the tool call is an error.`,execute:async({name:name$2,parameters})=>{let parametersObject=Object.fromEntries(parameters.map(({name:name$3,value:value$1})=>[name$3,value$1])),result=await callTool(name$2,parametersObject);return result},parameters:objectType({name:stringType().describe(`The name of the tool to call`),parameters:arrayType(objectType({name:stringType().describe(`The name of the parameter`),value:unionType([stringType(),numberType(),booleanType(),objectType({})]).describe(`The value of the parameter, it can be a string, a number, a boolean, or an object`)})).describe(`The parameters to pass to the tool`)})})],mcp=async()=>Promise.all(tools);function streamOptionsToolsCompatibilityOk(model,chatProvider,_$2,options$1,toolsCompatibility=new Map){return!!(options$1?.supportsTools||toolsCompatibility.get(`${chatProvider.chat(model).baseURL}-${model}`))}async function streamFrom(model,chatProvider,messages,options$1){let headers=options$1?.headers;return await streamText({...chatProvider.chat(model),maxSteps:10,messages:messages.map(msg=>({...msg,content:msg.role===`error`?`User encountered error: ${msg.content}`:msg.content,role:msg.role===`error`?`user`:msg.role})),headers,tools:streamOptionsToolsCompatibilityOk(model,chatProvider,messages,options$1)?[...await mcp(),...await debug()]:void 0,onEvent(event){event.type===`tool-call`?options$1?.onToolCall?.(event):event.type===`tool-result`&&options$1?.onToolCallResult?.({id:event.toolCallId,result:event.result})}})}async function attemptForToolsCompatibilityDiscovery(model,chatProvider,_$2,options$1){async function attempt(enable){try{let res=await streamFrom(model,chatProvider,[{role:`user`,content:`Hello, world!`}],{...options$1,supportsTools:enable});for await(let _$3 of readableStreamToAsyncIterator(res.textStream,async v$2=>v$2));return!0}catch(err){if(err instanceof Error&&err.name===new XSAIError$1(``).name&&(String(err).includes(`does not support tools`)||String(err).includes(`No endpoints found that support tool use.`)))return!1;throw err}}function promiseAllWithInterval(promises,interval){return new Promise(resolve$1=>{let results=[],completed=0;promises.forEach((promiseFn,index$1)=>{setTimeout(()=>{promiseFn().then(result=>{results[index$1]={result}}).catch(err=>{results[index$1]={error:err}}).finally(()=>{completed++,completed===promises.length&&resolve$1(results)})},index$1*interval)})})}let attempts=[()=>attempt(!0),()=>attempt(!1)],attemptsResults=await promiseAllWithInterval(attempts,1e3);if(attemptsResults.some(res=>res.error)){let err=Error(`Error during tools compatibility discovery for model: ${model}. Errors: ${attemptsResults.map(res=>res.error).filter(Boolean).join(`, `)}`);throw err.cause=attemptsResults.map(res=>res.error).filter(Boolean),err}return attemptsResults[0].result===!0&&attemptsResults[1].result===!0}const useLLM=defineStore(`llm`,()=>{let toolsCompatibility=ref(new Map);async function discoverToolsCompatibility(model,chatProvider,_$2,options$1){if(toolsCompatibility.value.has(`${chatProvider.chat(model).baseURL}-${model}`))return;let res=await attemptForToolsCompatibilityDiscovery(model,chatProvider,_$2,{...options$1,toolsCompatibility:toolsCompatibility.value});toolsCompatibility.value.set(`${chatProvider.chat(model).baseURL}-${model}`,res)}function stream(model,chatProvider,messages,options$1){return streamFrom(model,chatProvider,messages,{...options$1,toolsCompatibility:toolsCompatibility.value})}async function models$1(apiUrl,apiKey){if(apiUrl===``)return[];try{return await listModels({baseURL:apiUrl.endsWith(`/`)?apiUrl:`${apiUrl}/`,apiKey})}catch(err){if(String(err).includes(`Failed to construct 'URL': Invalid URL`))return[];throw err}}return{models:models$1,stream,discoverToolsCompatibility}}); +/*! +* shared v11.1.10 +* (c) 2025 kazuya kawaguchi +* Released under the MIT License. +*/ +function warn(msg,err){typeof console<`u`&&(console.warn(`[intlify] `+msg),err&&console.warn(err.stack))}const inBrowser=typeof window<`u`,makeSymbol=(name$2,shareable=!1)=>shareable?Symbol.for(name$2):Symbol(name$2),generateFormatCacheKey=(locale,key$2,source)=>friendlyJSONstringify({l:locale,k:key$2,s:source}),friendlyJSONstringify=json=>JSON.stringify(json).replace(/\u2028/g,`\\u2028`).replace(/\u2029/g,`\\u2029`).replace(/\u0027/g,`\\u0027`),isNumber=val=>typeof val==`number`&&isFinite(val),isDate=val=>toTypeString(val)===`[object Date]`,isRegExp=val=>toTypeString(val)===`[object RegExp]`,isEmptyObject=val=>isPlainObject(val)&&Object.keys(val).length===0,assign=Object.assign,_create=Object.create,create=(obj=null)=>_create(obj);let _globalThis;const getGlobalThis=()=>_globalThis||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:create();function escapeHtml(rawText){return rawText.replace(/&/g,`&`).replace(//g,`>`).replace(/"/g,`"`).replace(/'/g,`'`).replace(/\//g,`/`).replace(/=/g,`=`)}function escapeAttributeValue(value$1){return value$1.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,`&`).replace(/"/g,`"`).replace(/'/g,`'`).replace(//g,`>`)}function sanitizeTranslatedHtml(html$5){html$5=html$5.replace(/(\w+)\s*=\s*"([^"]*)"/g,(_$2,attrName,attrValue)=>`${attrName}="${escapeAttributeValue(attrValue)}"`),html$5=html$5.replace(/(\w+)\s*=\s*'([^']*)'/g,(_$2,attrName,attrValue)=>`${attrName}='${escapeAttributeValue(attrValue)}'`);let eventHandlerPattern=/\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi;eventHandlerPattern.test(html$5)&&(html$5=html$5.replace(/(\s+)(on)(\w+\s*=)/gi,`$1on$3`));let javascriptUrlPattern=[/(\s+(?:href|src|action|formaction)\s*=\s*["']?)\s*javascript:/gi,/(style\s*=\s*["'][^"']*url\s*\(\s*)javascript:/gi];return javascriptUrlPattern.forEach(pattern=>{html$5=html$5.replace(pattern,`$1javascript:`)}),html$5}const hasOwnProperty=Object.prototype.hasOwnProperty;function hasOwn(obj,key$2){return hasOwnProperty.call(obj,key$2)}const isArray=Array.isArray,isFunction=val=>typeof val==`function`,isString=val=>typeof val==`string`,isBoolean=val=>typeof val==`boolean`,isObject=val=>typeof val==`object`&&!!val,isPromise=val=>isObject(val)&&isFunction(val.then)&&isFunction(val.catch),objectToString=Object.prototype.toString,toTypeString=value$1=>objectToString.call(value$1),isPlainObject=val=>toTypeString(val)===`[object Object]`,toDisplayString$1=val=>val==null?``:isArray(val)||isPlainObject(val)&&val.toString===objectToString?JSON.stringify(val,null,2):String(val);function join(items,separator=``){return items.reduce((str,item,index$1)=>index$1===0?str+item:str+separator+item,``)}const isNotObjectOrIsArray=val=>!isObject(val)||isArray(val);function deepCopy(src,des){if(isNotObjectOrIsArray(src)||isNotObjectOrIsArray(des))throw Error(`Invalid value`);let stack$1=[{src,des}];for(;stack$1.length;){let{src:src$1,des:des$1}=stack$1.pop();Object.keys(src$1).forEach(key$2=>{key$2!==`__proto__`&&(isObject(src$1[key$2])&&!isObject(des$1[key$2])&&(des$1[key$2]=Array.isArray(src$1[key$2])?[]:create()),isNotObjectOrIsArray(des$1[key$2])||isNotObjectOrIsArray(src$1[key$2])?des$1[key$2]=src$1[key$2]:stack$1.push({src:src$1[key$2],des:des$1[key$2]}))})}}function createPosition(line,column,offset$2){return{line,column,offset:offset$2}}function createLocation(start,end,source){let loc={start,end};return source!=null&&(loc.source=source),loc}const CompileErrorCodes={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16},COMPILE_ERROR_CODES_EXTEND_POINT=17,errorMessages$2={[CompileErrorCodes.EXPECTED_TOKEN]:`Expected token: '{0}'`,[CompileErrorCodes.INVALID_TOKEN_IN_PLACEHOLDER]:`Invalid token in placeholder: '{0}'`,[CompileErrorCodes.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER]:`Unterminated single quote in placeholder`,[CompileErrorCodes.UNKNOWN_ESCAPE_SEQUENCE]:`Unknown escape sequence: \\{0}`,[CompileErrorCodes.INVALID_UNICODE_ESCAPE_SEQUENCE]:`Invalid unicode escape sequence: {0}`,[CompileErrorCodes.UNBALANCED_CLOSING_BRACE]:`Unbalanced closing brace`,[CompileErrorCodes.UNTERMINATED_CLOSING_BRACE]:`Unterminated closing brace`,[CompileErrorCodes.EMPTY_PLACEHOLDER]:`Empty placeholder`,[CompileErrorCodes.NOT_ALLOW_NEST_PLACEHOLDER]:`Not allowed nest placeholder`,[CompileErrorCodes.INVALID_LINKED_FORMAT]:`Invalid linked format`,[CompileErrorCodes.MUST_HAVE_MESSAGES_IN_PLURAL]:`Plural must have messages`,[CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_MODIFIER]:`Unexpected empty linked modifier`,[CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_KEY]:`Unexpected empty linked key`,[CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS]:`Unexpected lexical analysis in token: '{0}'`,[CompileErrorCodes.UNHANDLED_CODEGEN_NODE_TYPE]:`unhandled codegen node type: '{0}'`,[CompileErrorCodes.UNHANDLED_MINIFIER_NODE_TYPE]:`unhandled mimifier node type: '{0}'`};function createCompileError(code$1,loc,options$1={}){let{domain,messages,args}=options$1,msg=code$1,error=SyntaxError(String(msg));return error.code=code$1,loc&&(error.location=loc),error.domain=domain,error}function defaultOnError(error){throw error}const CHAR_SP=` `,CHAR_CR=`\r`,CHAR_LF=` `,CHAR_LS=`\u2028`,CHAR_PS=`\u2029`;function createScanner(str){let _buf=str,_index=0,_line=1,_column=1,_peekOffset=0,isCRLF=index$2=>_buf[index$2]===CHAR_CR&&_buf[index$2+1]===CHAR_LF,isLF=index$2=>_buf[index$2]===CHAR_LF,isPS=index$2=>_buf[index$2]===CHAR_PS,isLS=index$2=>_buf[index$2]===CHAR_LS,isLineEnd=index$2=>isCRLF(index$2)||isLF(index$2)||isPS(index$2)||isLS(index$2),index$1=()=>_index,line=()=>_line,column=()=>_column,peekOffset=()=>_peekOffset,charAt=offset$2=>isCRLF(offset$2)||isPS(offset$2)||isLS(offset$2)?CHAR_LF:_buf[offset$2],currentChar=()=>charAt(_index),currentPeek=()=>charAt(_index+_peekOffset);function next(){return _peekOffset=0,isLineEnd(_index)&&(_line++,_column=0),isCRLF(_index)&&_index++,_index++,_column++,_buf[_index]}function peek$1(){return isCRLF(_index+_peekOffset)&&_peekOffset++,_peekOffset++,_buf[_index+_peekOffset]}function reset(){_index=0,_line=1,_column=1,_peekOffset=0}function resetPeek(offset$2=0){_peekOffset=offset$2}function skipToPeek(){let target$1=_index+_peekOffset;for(;target$1!==_index;)next();_peekOffset=0}return{index:index$1,line,column,peekOffset,charAt,currentChar,currentPeek,next,peek:peek$1,reset,resetPeek,skipToPeek}}const EOF=void 0,DOT=`.`,LITERAL_DELIMITER=`'`,ERROR_DOMAIN$3=`tokenizer`;function createTokenizer(source,options$1={}){let location$1=options$1.location!==!1,_scnr=createScanner(source),currentOffset=()=>_scnr.index(),currentPosition=()=>createPosition(_scnr.line(),_scnr.column(),_scnr.index()),_initLoc=currentPosition(),_initOffset=currentOffset(),_context$1={currentType:13,offset:_initOffset,startLoc:_initLoc,endLoc:_initLoc,lastType:13,lastOffset:_initOffset,lastStartLoc:_initLoc,lastEndLoc:_initLoc,braceNest:0,inLinked:!1,text:``},context$1=()=>_context$1,{onError}=options$1;function emitError(code$1,pos,offset$2,...args){let ctx=context$1();if(pos.column+=offset$2,pos.offset+=offset$2,onError){let loc=location$1?createLocation(ctx.startLoc,pos):null,err=createCompileError(code$1,loc,{domain:ERROR_DOMAIN$3,args});onError(err)}}function getToken(context$2,type,value$1){context$2.endLoc=currentPosition(),context$2.currentType=type;let token={type};return location$1&&(token.loc=createLocation(context$2.startLoc,context$2.endLoc)),value$1!=null&&(token.value=value$1),token}let getEndToken=context$2=>getToken(context$2,13);function eat(scnr,ch$1){return scnr.currentChar()===ch$1?(scnr.next(),ch$1):(emitError(CompileErrorCodes.EXPECTED_TOKEN,currentPosition(),0,ch$1),``)}function peekSpaces(scnr){let buf=``;for(;scnr.currentPeek()===CHAR_SP||scnr.currentPeek()===CHAR_LF;)buf+=scnr.currentPeek(),scnr.peek();return buf}function skipSpaces(scnr){let buf=peekSpaces(scnr);return scnr.skipToPeek(),buf}function isIdentifierStart(ch$1){if(ch$1===EOF)return!1;let cc$2=ch$1.charCodeAt(0);return cc$2>=97&&cc$2<=122||cc$2>=65&&cc$2<=90||cc$2===95}function isNumberStart(ch$1){if(ch$1===EOF)return!1;let cc$2=ch$1.charCodeAt(0);return cc$2>=48&&cc$2<=57}function isNamedIdentifierStart(scnr,context$2){let{currentType}=context$2;if(currentType!==2)return!1;peekSpaces(scnr);let ret=isIdentifierStart(scnr.currentPeek());return scnr.resetPeek(),ret}function isListIdentifierStart(scnr,context$2){let{currentType}=context$2;if(currentType!==2)return!1;peekSpaces(scnr);let ch$1=scnr.currentPeek()===`-`?scnr.peek():scnr.currentPeek(),ret=isNumberStart(ch$1);return scnr.resetPeek(),ret}function isLiteralStart(scnr,context$2){let{currentType}=context$2;if(currentType!==2)return!1;peekSpaces(scnr);let ret=scnr.currentPeek()===LITERAL_DELIMITER;return scnr.resetPeek(),ret}function isLinkedDotStart(scnr,context$2){let{currentType}=context$2;if(currentType!==7)return!1;peekSpaces(scnr);let ret=scnr.currentPeek()===`.`;return scnr.resetPeek(),ret}function isLinkedModifierStart(scnr,context$2){let{currentType}=context$2;if(currentType!==8)return!1;peekSpaces(scnr);let ret=isIdentifierStart(scnr.currentPeek());return scnr.resetPeek(),ret}function isLinkedDelimiterStart(scnr,context$2){let{currentType}=context$2;if(!(currentType===7||currentType===11))return!1;peekSpaces(scnr);let ret=scnr.currentPeek()===`:`;return scnr.resetPeek(),ret}function isLinkedReferStart(scnr,context$2){let{currentType}=context$2;if(currentType!==9)return!1;let fn$6=()=>{let ch$1=scnr.currentPeek();return ch$1===`{`?isIdentifierStart(scnr.peek()):ch$1===`@`||ch$1===`|`||ch$1===`:`||ch$1===`.`||ch$1===CHAR_SP||!ch$1?!1:ch$1===CHAR_LF?(scnr.peek(),fn$6()):isTextStart(scnr,!1)},ret=fn$6();return scnr.resetPeek(),ret}function isPluralStart(scnr){peekSpaces(scnr);let ret=scnr.currentPeek()===`|`;return scnr.resetPeek(),ret}function isTextStart(scnr,reset=!0){let fn$6=(hasSpace=!1,prev=``)=>{let ch$1=scnr.currentPeek();return ch$1===`{`||ch$1===`@`||!ch$1?hasSpace:ch$1===`|`?!(prev===CHAR_SP||prev===CHAR_LF):ch$1===CHAR_SP?(scnr.peek(),fn$6(!0,CHAR_SP)):ch$1===CHAR_LF?(scnr.peek(),fn$6(!0,CHAR_LF)):!0},ret=fn$6();return reset&&scnr.resetPeek(),ret}function takeChar(scnr,fn$6){let ch$1=scnr.currentChar();return ch$1===EOF?EOF:fn$6(ch$1)?(scnr.next(),ch$1):null}function isIdentifier(ch$1){let cc$2=ch$1.charCodeAt(0);return cc$2>=97&&cc$2<=122||cc$2>=65&&cc$2<=90||cc$2>=48&&cc$2<=57||cc$2===95||cc$2===36}function takeIdentifierChar(scnr){return takeChar(scnr,isIdentifier)}function isNamedIdentifier(ch$1){let cc$2=ch$1.charCodeAt(0);return cc$2>=97&&cc$2<=122||cc$2>=65&&cc$2<=90||cc$2>=48&&cc$2<=57||cc$2===95||cc$2===36||cc$2===45}function takeNamedIdentifierChar(scnr){return takeChar(scnr,isNamedIdentifier)}function isDigit(ch$1){let cc$2=ch$1.charCodeAt(0);return cc$2>=48&&cc$2<=57}function takeDigit(scnr){return takeChar(scnr,isDigit)}function isHexDigit(ch$1){let cc$2=ch$1.charCodeAt(0);return cc$2>=48&&cc$2<=57||cc$2>=65&&cc$2<=70||cc$2>=97&&cc$2<=102}function takeHexDigit(scnr){return takeChar(scnr,isHexDigit)}function getDigits(scnr){let ch$1=``,num$2=``;for(;ch$1=takeDigit(scnr);)num$2+=ch$1;return num$2}function readText(scnr){let buf=``;for(;;){let ch$1=scnr.currentChar();if(ch$1===`{`||ch$1===`}`||ch$1===`@`||ch$1===`|`||!ch$1)break;if(ch$1===CHAR_SP||ch$1===CHAR_LF)if(isTextStart(scnr))buf+=ch$1,scnr.next();else if(isPluralStart(scnr))break;else buf+=ch$1,scnr.next();else buf+=ch$1,scnr.next()}return buf}function readNamedIdentifier(scnr){skipSpaces(scnr);let ch$1=``,name$2=``;for(;ch$1=takeNamedIdentifierChar(scnr);)name$2+=ch$1;return scnr.currentChar()===EOF&&emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE,currentPosition(),0),name$2}function readListIdentifier(scnr){skipSpaces(scnr);let value$1=``;return scnr.currentChar()===`-`?(scnr.next(),value$1+=`-${getDigits(scnr)}`):value$1+=getDigits(scnr),scnr.currentChar()===EOF&&emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE,currentPosition(),0),value$1}function isLiteral$1(ch$1){return ch$1!==LITERAL_DELIMITER&&ch$1!==CHAR_LF}function readLiteral(scnr){skipSpaces(scnr),eat(scnr,`'`);let ch$1=``,literal=``;for(;ch$1=takeChar(scnr,isLiteral$1);)ch$1===`\\`?literal+=readEscapeSequence(scnr):literal+=ch$1;let current=scnr.currentChar();return current===CHAR_LF||current===EOF?(emitError(CompileErrorCodes.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,currentPosition(),0),current===CHAR_LF&&(scnr.next(),eat(scnr,`'`)),literal):(eat(scnr,`'`),literal)}function readEscapeSequence(scnr){let ch$1=scnr.currentChar();switch(ch$1){case`\\`:case`'`:return scnr.next(),`\\${ch$1}`;case`u`:return readUnicodeEscapeSequence(scnr,ch$1,4);case`U`:return readUnicodeEscapeSequence(scnr,ch$1,6);default:return emitError(CompileErrorCodes.UNKNOWN_ESCAPE_SEQUENCE,currentPosition(),0,ch$1),``}}function readUnicodeEscapeSequence(scnr,unicode,digits$1){eat(scnr,unicode);let sequence=``;for(let i$1=0;i$1{let ch$1=scnr.currentChar();return ch$1===`{`||ch$1===`@`||ch$1===`|`||ch$1===`(`||ch$1===`)`||!ch$1||ch$1===CHAR_SP?buf:(buf+=ch$1,scnr.next(),fn$6(buf))};return fn$6(``)}function readPlural(scnr){skipSpaces(scnr);let plural=eat(scnr,`|`);return skipSpaces(scnr),plural}function readTokenInPlaceholder(scnr,context$2){let token=null,ch$1=scnr.currentChar();switch(ch$1){case`{`:return context$2.braceNest>=1&&emitError(CompileErrorCodes.NOT_ALLOW_NEST_PLACEHOLDER,currentPosition(),0),scnr.next(),token=getToken(context$2,2,`{`),skipSpaces(scnr),context$2.braceNest++,token;case`}`:return context$2.braceNest>0&&context$2.currentType===2&&emitError(CompileErrorCodes.EMPTY_PLACEHOLDER,currentPosition(),0),scnr.next(),token=getToken(context$2,3,`}`),context$2.braceNest--,context$2.braceNest>0&&skipSpaces(scnr),context$2.inLinked&&context$2.braceNest===0&&(context$2.inLinked=!1),token;case`@`:return context$2.braceNest>0&&emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE,currentPosition(),0),token=readTokenInLinked(scnr,context$2)||getEndToken(context$2),context$2.braceNest=0,token;default:{let validNamedIdentifier=!0,validListIdentifier=!0,validLiteral=!0;if(isPluralStart(scnr))return context$2.braceNest>0&&emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE,currentPosition(),0),token=getToken(context$2,1,readPlural(scnr)),context$2.braceNest=0,context$2.inLinked=!1,token;if(context$2.braceNest>0&&(context$2.currentType===4||context$2.currentType===5||context$2.currentType===6))return emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE,currentPosition(),0),context$2.braceNest=0,readToken(scnr,context$2);if(validNamedIdentifier=isNamedIdentifierStart(scnr,context$2))return token=getToken(context$2,4,readNamedIdentifier(scnr)),skipSpaces(scnr),token;if(validListIdentifier=isListIdentifierStart(scnr,context$2))return token=getToken(context$2,5,readListIdentifier(scnr)),skipSpaces(scnr),token;if(validLiteral=isLiteralStart(scnr,context$2))return token=getToken(context$2,6,readLiteral(scnr)),skipSpaces(scnr),token;if(!validNamedIdentifier&&!validListIdentifier&&!validLiteral)return token=getToken(context$2,12,readInvalidIdentifier(scnr)),emitError(CompileErrorCodes.INVALID_TOKEN_IN_PLACEHOLDER,currentPosition(),0,token.value),skipSpaces(scnr),token;break}}return token}function readTokenInLinked(scnr,context$2){let{currentType}=context$2,token=null,ch$1=scnr.currentChar();switch((currentType===7||currentType===8||currentType===11||currentType===9)&&(ch$1===CHAR_LF||ch$1===CHAR_SP)&&emitError(CompileErrorCodes.INVALID_LINKED_FORMAT,currentPosition(),0),ch$1){case`@`:return scnr.next(),token=getToken(context$2,7,`@`),context$2.inLinked=!0,token;case`.`:return skipSpaces(scnr),scnr.next(),getToken(context$2,8,`.`);case`:`:return skipSpaces(scnr),scnr.next(),getToken(context$2,9,`:`);default:return isPluralStart(scnr)?(token=getToken(context$2,1,readPlural(scnr)),context$2.braceNest=0,context$2.inLinked=!1,token):isLinkedDotStart(scnr,context$2)||isLinkedDelimiterStart(scnr,context$2)?(skipSpaces(scnr),readTokenInLinked(scnr,context$2)):isLinkedModifierStart(scnr,context$2)?(skipSpaces(scnr),getToken(context$2,11,readLinkedModifier(scnr))):isLinkedReferStart(scnr,context$2)?(skipSpaces(scnr),ch$1===`{`?readTokenInPlaceholder(scnr,context$2)||token:getToken(context$2,10,readLinkedRefer(scnr))):(currentType===7&&emitError(CompileErrorCodes.INVALID_LINKED_FORMAT,currentPosition(),0),context$2.braceNest=0,context$2.inLinked=!1,readToken(scnr,context$2))}}function readToken(scnr,context$2){let token={type:13};if(context$2.braceNest>0)return readTokenInPlaceholder(scnr,context$2)||getEndToken(context$2);if(context$2.inLinked)return readTokenInLinked(scnr,context$2)||getEndToken(context$2);let ch$1=scnr.currentChar();switch(ch$1){case`{`:return readTokenInPlaceholder(scnr,context$2)||getEndToken(context$2);case`}`:return emitError(CompileErrorCodes.UNBALANCED_CLOSING_BRACE,currentPosition(),0),scnr.next(),getToken(context$2,3,`}`);case`@`:return readTokenInLinked(scnr,context$2)||getEndToken(context$2);default:if(isPluralStart(scnr))return token=getToken(context$2,1,readPlural(scnr)),context$2.braceNest=0,context$2.inLinked=!1,token;if(isTextStart(scnr))return getToken(context$2,0,readText(scnr));break}return token}function nextToken(){let{currentType,offset:offset$2,startLoc,endLoc}=_context$1;return _context$1.lastType=currentType,_context$1.lastOffset=offset$2,_context$1.lastStartLoc=startLoc,_context$1.lastEndLoc=endLoc,_context$1.offset=currentOffset(),_context$1.startLoc=currentPosition(),_scnr.currentChar()===EOF?getToken(_context$1,13):readToken(_scnr,_context$1)}return{nextToken,currentOffset,currentPosition,context:context$1}}const ERROR_DOMAIN$2=`parser`,KNOWN_ESCAPES=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function fromEscapeSequence(match,codePoint4,codePoint6){switch(match){case`\\\\`:return`\\`;case`\\'`:return`'`;default:{let codePoint=parseInt(codePoint4||codePoint6,16);return codePoint<=55295||codePoint>=57344?String.fromCodePoint(codePoint):`�`}}}function createParser(options$1={}){let location$1=options$1.location!==!1,{onError}=options$1;function emitError(tokenzer,code$1,start,offset$2,...args){let end=tokenzer.currentPosition();if(end.offset+=offset$2,end.column+=offset$2,onError){let loc=location$1?createLocation(start,end):null,err=createCompileError(code$1,loc,{domain:ERROR_DOMAIN$2,args});onError(err)}}function startNode(type,offset$2,loc){let node$1={type};return location$1&&(node$1.start=offset$2,node$1.end=offset$2,node$1.loc={start:loc,end:loc}),node$1}function endNode(node$1,offset$2,pos,type){location$1&&(node$1.end=offset$2,node$1.loc&&(node$1.loc.end=pos))}function parseText(tokenizer,value$1){let context$1=tokenizer.context(),node$1=startNode(3,context$1.offset,context$1.startLoc);return node$1.value=value$1,endNode(node$1,tokenizer.currentOffset(),tokenizer.currentPosition()),node$1}function parseList(tokenizer,index$1){let context$1=tokenizer.context(),{lastOffset:offset$2,lastStartLoc:loc}=context$1,node$1=startNode(5,offset$2,loc);return node$1.index=parseInt(index$1,10),tokenizer.nextToken(),endNode(node$1,tokenizer.currentOffset(),tokenizer.currentPosition()),node$1}function parseNamed$1(tokenizer,key$2){let context$1=tokenizer.context(),{lastOffset:offset$2,lastStartLoc:loc}=context$1,node$1=startNode(4,offset$2,loc);return node$1.key=key$2,tokenizer.nextToken(),endNode(node$1,tokenizer.currentOffset(),tokenizer.currentPosition()),node$1}function parseLiteral(tokenizer,value$1){let context$1=tokenizer.context(),{lastOffset:offset$2,lastStartLoc:loc}=context$1,node$1=startNode(9,offset$2,loc);return node$1.value=value$1.replace(KNOWN_ESCAPES,fromEscapeSequence),tokenizer.nextToken(),endNode(node$1,tokenizer.currentOffset(),tokenizer.currentPosition()),node$1}function parseLinkedModifier(tokenizer){let token=tokenizer.nextToken(),context$1=tokenizer.context(),{lastOffset:offset$2,lastStartLoc:loc}=context$1,node$1=startNode(8,offset$2,loc);return token.type===11?(token.value??emitError(tokenizer,CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,context$1.lastStartLoc,0,getTokenCaption(token)),node$1.value=token.value||``,endNode(node$1,tokenizer.currentOffset(),tokenizer.currentPosition()),{node:node$1}):(emitError(tokenizer,CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_MODIFIER,context$1.lastStartLoc,0),node$1.value=``,endNode(node$1,offset$2,loc),{nextConsumeToken:token,node:node$1})}function parseLinkedKey(tokenizer,value$1){let context$1=tokenizer.context(),node$1=startNode(7,context$1.offset,context$1.startLoc);return node$1.value=value$1,endNode(node$1,tokenizer.currentOffset(),tokenizer.currentPosition()),node$1}function parseLinked(tokenizer){let context$1=tokenizer.context(),linkedNode=startNode(6,context$1.offset,context$1.startLoc),token=tokenizer.nextToken();if(token.type===8){let parsed=parseLinkedModifier(tokenizer);linkedNode.modifier=parsed.node,token=parsed.nextConsumeToken||tokenizer.nextToken()}switch(token.type!==9&&emitError(tokenizer,CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,context$1.lastStartLoc,0,getTokenCaption(token)),token=tokenizer.nextToken(),token.type===2&&(token=tokenizer.nextToken()),token.type){case 10:token.value??emitError(tokenizer,CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,context$1.lastStartLoc,0,getTokenCaption(token)),linkedNode.key=parseLinkedKey(tokenizer,token.value||``);break;case 4:token.value??emitError(tokenizer,CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,context$1.lastStartLoc,0,getTokenCaption(token)),linkedNode.key=parseNamed$1(tokenizer,token.value||``);break;case 5:token.value??emitError(tokenizer,CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,context$1.lastStartLoc,0,getTokenCaption(token)),linkedNode.key=parseList(tokenizer,token.value||``);break;case 6:token.value??emitError(tokenizer,CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,context$1.lastStartLoc,0,getTokenCaption(token)),linkedNode.key=parseLiteral(tokenizer,token.value||``);break;default:{emitError(tokenizer,CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_KEY,context$1.lastStartLoc,0);let nextContext=tokenizer.context(),emptyLinkedKeyNode=startNode(7,nextContext.offset,nextContext.startLoc);return emptyLinkedKeyNode.value=``,endNode(emptyLinkedKeyNode,nextContext.offset,nextContext.startLoc),linkedNode.key=emptyLinkedKeyNode,endNode(linkedNode,nextContext.offset,nextContext.startLoc),{nextConsumeToken:token,node:linkedNode}}}return endNode(linkedNode,tokenizer.currentOffset(),tokenizer.currentPosition()),{node:linkedNode}}function parseMessage(tokenizer){let context$1=tokenizer.context(),startOffset=context$1.currentType===1?tokenizer.currentOffset():context$1.offset,startLoc=context$1.currentType===1?context$1.endLoc:context$1.startLoc,node$1=startNode(2,startOffset,startLoc);node$1.items=[];let nextToken=null;do{let token=nextToken||tokenizer.nextToken();switch(nextToken=null,token.type){case 0:token.value??emitError(tokenizer,CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,context$1.lastStartLoc,0,getTokenCaption(token)),node$1.items.push(parseText(tokenizer,token.value||``));break;case 5:token.value??emitError(tokenizer,CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,context$1.lastStartLoc,0,getTokenCaption(token)),node$1.items.push(parseList(tokenizer,token.value||``));break;case 4:token.value??emitError(tokenizer,CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,context$1.lastStartLoc,0,getTokenCaption(token)),node$1.items.push(parseNamed$1(tokenizer,token.value||``));break;case 6:token.value??emitError(tokenizer,CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,context$1.lastStartLoc,0,getTokenCaption(token)),node$1.items.push(parseLiteral(tokenizer,token.value||``));break;case 7:{let parsed=parseLinked(tokenizer);node$1.items.push(parsed.node),nextToken=parsed.nextConsumeToken||null;break}}}while(context$1.currentType!==13&&context$1.currentType!==1);let endOffset=context$1.currentType===1?context$1.lastOffset:tokenizer.currentOffset(),endLoc=context$1.currentType===1?context$1.lastEndLoc:tokenizer.currentPosition();return endNode(node$1,endOffset,endLoc),node$1}function parsePlural(tokenizer,offset$2,loc,msgNode){let context$1=tokenizer.context(),hasEmptyMessage=msgNode.items.length===0,node$1=startNode(1,offset$2,loc);node$1.cases=[],node$1.cases.push(msgNode);do{let msg=parseMessage(tokenizer);hasEmptyMessage||=msg.items.length===0,node$1.cases.push(msg)}while(context$1.currentType!==13);return hasEmptyMessage&&emitError(tokenizer,CompileErrorCodes.MUST_HAVE_MESSAGES_IN_PLURAL,loc,0),endNode(node$1,tokenizer.currentOffset(),tokenizer.currentPosition()),node$1}function parseResource(tokenizer){let context$1=tokenizer.context(),{offset:offset$2,startLoc}=context$1,msgNode=parseMessage(tokenizer);return context$1.currentType===13?msgNode:parsePlural(tokenizer,offset$2,startLoc,msgNode)}function parse$4(source){let tokenizer=createTokenizer(source,assign({},options$1)),context$1=tokenizer.context(),node$1=startNode(0,context$1.offset,context$1.startLoc);return location$1&&node$1.loc&&(node$1.loc.source=source),node$1.body=parseResource(tokenizer),options$1.onCacheKey&&(node$1.cacheKey=options$1.onCacheKey(source)),context$1.currentType!==13&&emitError(tokenizer,CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,context$1.lastStartLoc,0,source[context$1.offset]||``),endNode(node$1,tokenizer.currentOffset(),tokenizer.currentPosition()),node$1}return{parse:parse$4}}function getTokenCaption(token){if(token.type===13)return`EOF`;let name$2=(token.value||``).replace(/\r?\n/gu,`\\n`);return name$2.length>10?name$2.slice(0,9)+`…`:name$2}function createTransformer(ast,options$1={}){let _context$1={ast,helpers:new Set},context$1=()=>_context$1,helper=name$2=>(_context$1.helpers.add(name$2),name$2);return{context:context$1,helper}}function traverseNodes(nodes,transformer){for(let i$1=0;i$1optimizeMessageNode(c$4)),ast}function optimizeMessageNode(message$1){if(message$1.items.length===1){let item=message$1.items[0];(item.type===3||item.type===9)&&(message$1.static=item.value,delete item.value)}else{let values=[];for(let i$1=0;i$1_context$1;function push$1(code$1,node$1){_context$1.code+=code$1}function _newline(n$2,withBreakLine=!0){let _breakLineCode=withBreakLine?breakLineCode:``;push$1(_needIndent?_breakLineCode+` `.repeat(n$2):_breakLineCode)}function indent(withNewLine=!0){let level=++_context$1.indentLevel;withNewLine&&_newline(level)}function deindent(withNewLine=!0){let level=--_context$1.indentLevel;withNewLine&&_newline(level)}function newline(){_newline(_context$1.indentLevel)}let helper=key$2=>`_${key$2}`,needIndent=()=>_context$1.needIndent;return{context:context$1,push:push$1,indent,deindent,newline,helper,needIndent}}function generateLinkedNode(generator,node$1){let{helper}=generator;generator.push(`${helper(`linked`)}(`),generateNode(generator,node$1.key),node$1.modifier?(generator.push(`, `),generateNode(generator,node$1.modifier),generator.push(`, _type`)):generator.push(`, undefined, _type`),generator.push(`)`)}function generateMessageNode(generator,node$1){let{helper,needIndent}=generator;generator.push(`${helper(`normalize`)}([`),generator.indent(needIndent());let length=node$1.items.length;for(let i$1=0;i$11){generator.push(`${helper(`plural`)}([`),generator.indent(needIndent());let length=node$1.cases.length;for(let i$1=0;i$1{let mode=isString(options$1.mode)?options$1.mode:`normal`,filename=isString(options$1.filename)?options$1.filename:`message.intl`,sourceMap=!!options$1.sourceMap,breakLineCode=options$1.breakLineCode==null?mode===`arrow`?`;`:` -`:options$1.breakLineCode,needIndent=options$1.needIndent?options$1.needIndent:mode!==`arrow`,helpers=ast.helpers||[],generator=createCodeGenerator(ast,{mode,filename,sourceMap,breakLineCode,needIndent});generator.push(mode===`normal`?`function __msg__ (ctx) {`:`(ctx) => {`),generator.indent(needIndent),helpers.length>0&&(generator.push(`const { ${join(helpers.map(s$1=>`${s$1}: _${s$1}`),`, `)} } = ctx`),generator.newline()),generator.push(`return `),generateNode(generator,ast),generator.deindent(needIndent),generator.push(`}`),delete ast.helpers;let{code:code$1,map}=generator.context();return{ast,code:code$1,map:map?map.toJSON():void 0}};function baseCompile(source,options$1={}){let assignedOptions=assign({},options$1),jit=!!assignedOptions.jit,enalbeMinify=!!assignedOptions.minify,enambeOptimize=assignedOptions.optimize==null?!0:assignedOptions.optimize,parser=createParser(assignedOptions),ast=parser.parse(source);return jit?(enambeOptimize&&optimize(ast),enalbeMinify&&minify(ast),{ast,code:``}):(transform(ast,assignedOptions),generate(ast,assignedOptions))}function initFeatureFlags$1(){typeof __INTLIFY_PROD_DEVTOOLS__!=`boolean`&&(getGlobalThis().__INTLIFY_PROD_DEVTOOLS__=!1)}function isMessageAST(val){return isObject(val)&&resolveType(val)===0&&(hasOwn(val,`b`)||hasOwn(val,`body`))}const PROPS_BODY=[`b`,`body`];function resolveBody(node$1){return resolveProps(node$1,PROPS_BODY)}const PROPS_CASES=[`c`,`cases`];function resolveCases(node$1){return resolveProps(node$1,PROPS_CASES,[])}const PROPS_STATIC=[`s`,`static`];function resolveStatic(node$1){return resolveProps(node$1,PROPS_STATIC)}const PROPS_ITEMS=[`i`,`items`];function resolveItems(node$1){return resolveProps(node$1,PROPS_ITEMS,[])}const PROPS_TYPE=[`t`,`type`];function resolveType(node$1){return resolveProps(node$1,PROPS_TYPE)}const PROPS_VALUE=[`v`,`value`];function resolveValue$1(node$1,type){let resolved=resolveProps(node$1,PROPS_VALUE);if(resolved!=null)return resolved;throw createUnhandleNodeError(type)}const PROPS_MODIFIER=[`m`,`modifier`];function resolveLinkedModifier(node$1){return resolveProps(node$1,PROPS_MODIFIER)}const PROPS_KEY=[`k`,`key`];function resolveLinkedKey(node$1){let resolved=resolveProps(node$1,PROPS_KEY);if(resolved)return resolved;throw createUnhandleNodeError(6)}function resolveProps(node$1,props,defaultValue){for(let i$1=0;i$1formatParts(ctx,ast);return msg}function formatParts(ctx,ast){let body$2=resolveBody(ast);if(body$2==null)throw createUnhandleNodeError(0);let type=resolveType(body$2);if(type===1){let plural=body$2,cases=resolveCases(plural);return ctx.plural(cases.reduce((messages,c$4)=>[...messages,formatMessageParts(ctx,c$4)],[]))}else return formatMessageParts(ctx,body$2)}function formatMessageParts(ctx,node$1){let static_=resolveStatic(node$1);if(static_!=null)return ctx.type===`text`?static_:ctx.normalize([static_]);{let messages=resolveItems(node$1).reduce((acm,c$4)=>[...acm,formatMessagePart(ctx,c$4)],[]);return ctx.normalize(messages)}}function formatMessagePart(ctx,node$1){let type=resolveType(node$1);switch(type){case 3:return resolveValue$1(node$1,type);case 9:return resolveValue$1(node$1,type);case 4:{let named$1=node$1;if(hasOwn(named$1,`k`)&&named$1.k)return ctx.interpolate(ctx.named(named$1.k));if(hasOwn(named$1,`key`)&&named$1.key)return ctx.interpolate(ctx.named(named$1.key));throw createUnhandleNodeError(type)}case 5:{let list$2=node$1;if(hasOwn(list$2,`i`)&&isNumber(list$2.i))return ctx.interpolate(ctx.list(list$2.i));if(hasOwn(list$2,`index`)&&isNumber(list$2.index))return ctx.interpolate(ctx.list(list$2.index));throw createUnhandleNodeError(type)}case 6:{let linked=node$1,modifier=resolveLinkedModifier(linked),key$2=resolveLinkedKey(linked);return ctx.linked(formatMessagePart(ctx,key$2),modifier?formatMessagePart(ctx,modifier):void 0,ctx.type)}case 7:return resolveValue$1(node$1,type);case 8:return resolveValue$1(node$1,type);default:throw Error(`unhandled node on format message part: ${type}`)}}const defaultOnCacheKey=message$1=>message$1;let compileCache=create();function baseCompile$1(message$1,options$1={}){let detectError=!1,onError=options$1.onError||defaultOnError;return options$1.onError=err=>{detectError=!0,onError(err)},{...baseCompile(message$1,options$1),detectError}}function compile(message$1,context$1){if(isString(message$1)){let warnHtmlMessage=isBoolean(context$1.warnHtmlMessage)?context$1.warnHtmlMessage:!0,onCacheKey=context$1.onCacheKey||defaultOnCacheKey,cacheKey=onCacheKey(message$1),cached=compileCache[cacheKey];if(cached)return cached;let{ast,detectError}=baseCompile$1(message$1,{...context$1,location:!1,jit:!0}),msg=format$1(ast);return detectError?msg:compileCache[cacheKey]=msg}else{let cacheKey=message$1.cacheKey;if(cacheKey){let cached=compileCache[cacheKey];return cached||(compileCache[cacheKey]=format$1(message$1))}else return format$1(message$1)}}let devtools=null;function setDevToolsHook(hook){devtools=hook}function initI18nDevTools(i18n$1,version$1,meta){devtools&&devtools.emit(`i18n:init`,{timestamp:Date.now(),i18n:i18n$1,version:version$1,meta})}const translateDevTools=createDevToolsHook(`function:translate`);function createDevToolsHook(hook){return payloads=>devtools&&devtools.emit(hook,payloads)}const CoreErrorCodes={INVALID_ARGUMENT:COMPILE_ERROR_CODES_EXTEND_POINT,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_NON_STRING_MESSAGE:20,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},CORE_ERROR_CODES_EXTEND_POINT=24;function createCoreError(code$1){return createCompileError(code$1,null,void 0)}const errorMessages$1={[CoreErrorCodes.INVALID_ARGUMENT]:`Invalid arguments`,[CoreErrorCodes.INVALID_DATE_ARGUMENT]:`The date provided is an invalid Date object.Make sure your Date represents a valid date.`,[CoreErrorCodes.INVALID_ISO_DATE_ARGUMENT]:`The argument provided is not a valid ISO date string`,[CoreErrorCodes.NOT_SUPPORT_NON_STRING_MESSAGE]:`Not support non-string message`,[CoreErrorCodes.NOT_SUPPORT_LOCALE_PROMISE_VALUE]:`cannot support promise value`,[CoreErrorCodes.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION]:`cannot support async function`,[CoreErrorCodes.NOT_SUPPORT_LOCALE_TYPE]:`cannot support locale type`};function getLocale$1(context$1,options$1){return options$1.locale==null?resolveLocale(context$1.locale):resolveLocale(options$1.locale)}let _resolveLocale;function resolveLocale(locale){if(isString(locale))return locale;if(isFunction(locale)){if(locale.resolvedOnce&&_resolveLocale!=null)return _resolveLocale;if(locale.constructor.name===`Function`){let resolve$1=locale();if(isPromise(resolve$1))throw createCoreError(CoreErrorCodes.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return _resolveLocale=resolve$1}else throw createCoreError(CoreErrorCodes.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw createCoreError(CoreErrorCodes.NOT_SUPPORT_LOCALE_TYPE)}function fallbackWithSimple(ctx,fallback,start){return[...new Set([start,...isArray(fallback)?fallback:isObject(fallback)?Object.keys(fallback):isString(fallback)?[fallback]:[start]])]}function fallbackWithLocaleChain(ctx,fallback,start){let startLocale=isString(start)?start:DEFAULT_LOCALE,context$1=ctx;context$1.__localeChainCache||=new Map;let chain$1=context$1.__localeChainCache.get(startLocale);if(!chain$1){chain$1=[];let block=[start];for(;isArray(block);)block=appendBlockToChain(chain$1,block,fallback);let defaults$1=isArray(fallback)||!isPlainObject(fallback)?fallback:fallback.default?fallback.default:null;block=isString(defaults$1)?[defaults$1]:defaults$1,isArray(block)&&appendBlockToChain(chain$1,block,!1),context$1.__localeChainCache.set(startLocale,chain$1)}return chain$1}function appendBlockToChain(chain$1,block,blocks){let follow=!0;for(let i$1=0;i$1{key$2===void 0?key$2=newChar:key$2+=newChar},actions[1]=()=>{key$2!==void 0&&(keys$3.push(key$2),key$2=void 0)},actions[2]=()=>{actions[0](),subPathDepth++},actions[3]=()=>{if(subPathDepth>0)subPathDepth--,mode=4,actions[0]();else{if(subPathDepth=0,key$2===void 0||(key$2=formatSubPath(key$2),key$2===!1))return!1;actions[1]()}};function maybeUnescapeQuote(){let nextChar=path[index$1+1];if(mode===5&&nextChar===`'`||mode===6&&nextChar===`"`)return index$1++,newChar=`\\`+nextChar,actions[0](),!0}for(;mode!==null;)if(index$1++,c$4=path[index$1],!(c$4===`\\`&&maybeUnescapeQuote())){if(type=getPathCharType(c$4),typeMap=pathStateMachine[mode],transition=typeMap[type]||typeMap.l||8,transition===8||(mode=transition[0],transition[1]!==void 0&&(action=actions[transition[1]],action&&(newChar=c$4,action()===!1))))return;if(mode===7)return keys$3}}const cache=new Map;function resolveWithKeyValue(obj,path){return isObject(obj)?obj[path]:null}function resolveValue(obj,path){if(!isObject(obj))return null;let hit=cache.get(path);if(hit||(hit=parse(path),hit&&cache.set(path,hit)),!hit)return null;let len=hit.length,last=obj,i$1=0;for(;i$1`${str.charAt(0).toLocaleUpperCase()}${str.substr(1)}`;function getDefaultLinkedModifiers(){return{upper:(val,type)=>type===`text`&&isString(val)?val.toUpperCase():type===`vnode`&&isObject(val)&&`__v_isVNode`in val?val.children.toUpperCase():val,lower:(val,type)=>type===`text`&&isString(val)?val.toLowerCase():type===`vnode`&&isObject(val)&&`__v_isVNode`in val?val.children.toLowerCase():val,capitalize:(val,type)=>type===`text`&&isString(val)?capitalize(val):type===`vnode`&&isObject(val)&&`__v_isVNode`in val?capitalize(val.children):val}}let _compiler;function registerMessageCompiler(compiler$1){_compiler=compiler$1}let _resolver;function registerMessageResolver(resolver$1){_resolver=resolver$1}let _fallbacker;function registerLocaleFallbacker(fallbacker){_fallbacker=fallbacker}let _additionalMeta=null;const setAdditionalMeta=meta=>{_additionalMeta=meta},getAdditionalMeta=()=>_additionalMeta;let _fallbackContext=null;const setFallbackContext=context$1=>{_fallbackContext=context$1},getFallbackContext=()=>_fallbackContext;let _cid=0;function createCoreContext(options$1={}){let onWarn=isFunction(options$1.onWarn)?options$1.onWarn:warn,version$1=isString(options$1.version)?options$1.version:VERSION$1,locale=isString(options$1.locale)||isFunction(options$1.locale)?options$1.locale:DEFAULT_LOCALE,_locale=isFunction(locale)?DEFAULT_LOCALE:locale,fallbackLocale=isArray(options$1.fallbackLocale)||isPlainObject(options$1.fallbackLocale)||isString(options$1.fallbackLocale)||options$1.fallbackLocale===!1?options$1.fallbackLocale:_locale,messages=isPlainObject(options$1.messages)?options$1.messages:createResources(_locale),datetimeFormats=isPlainObject(options$1.datetimeFormats)?options$1.datetimeFormats:createResources(_locale),numberFormats=isPlainObject(options$1.numberFormats)?options$1.numberFormats:createResources(_locale),modifiers=assign(create(),options$1.modifiers,getDefaultLinkedModifiers()),pluralRules=options$1.pluralRules||create(),missing=isFunction(options$1.missing)?options$1.missing:null,missingWarn=isBoolean(options$1.missingWarn)||isRegExp(options$1.missingWarn)?options$1.missingWarn:!0,fallbackWarn=isBoolean(options$1.fallbackWarn)||isRegExp(options$1.fallbackWarn)?options$1.fallbackWarn:!0,fallbackFormat=!!options$1.fallbackFormat,unresolving=!!options$1.unresolving,postTranslation=isFunction(options$1.postTranslation)?options$1.postTranslation:null,processor=isPlainObject(options$1.processor)?options$1.processor:null,warnHtmlMessage=isBoolean(options$1.warnHtmlMessage)?options$1.warnHtmlMessage:!0,escapeParameter=!!options$1.escapeParameter,messageCompiler=isFunction(options$1.messageCompiler)?options$1.messageCompiler:_compiler,messageResolver=isFunction(options$1.messageResolver)?options$1.messageResolver:_resolver||resolveWithKeyValue,localeFallbacker=isFunction(options$1.localeFallbacker)?options$1.localeFallbacker:_fallbacker||fallbackWithSimple,fallbackContext=isObject(options$1.fallbackContext)?options$1.fallbackContext:void 0,internalOptions=options$1,__datetimeFormatters=isObject(internalOptions.__datetimeFormatters)?internalOptions.__datetimeFormatters:new Map,__numberFormatters=isObject(internalOptions.__numberFormatters)?internalOptions.__numberFormatters:new Map,__meta=isObject(internalOptions.__meta)?internalOptions.__meta:{};_cid++;let context$1={version:version$1,cid:_cid,locale,fallbackLocale,messages,modifiers,pluralRules,missing,missingWarn,fallbackWarn,fallbackFormat,unresolving,postTranslation,processor,warnHtmlMessage,escapeParameter,messageCompiler,messageResolver,localeFallbacker,fallbackContext,onWarn,__meta};return context$1.datetimeFormats=datetimeFormats,context$1.numberFormats=numberFormats,context$1.__datetimeFormatters=__datetimeFormatters,context$1.__numberFormatters=__numberFormatters,__INTLIFY_PROD_DEVTOOLS__&&initI18nDevTools(context$1,version$1,__meta),context$1}const createResources=locale=>({[locale]:create()});function handleMissing(context$1,key$2,locale,missingWarn,type){let{missing,onWarn}=context$1;if(missing!==null){let ret=missing(context$1,locale,key$2,type);return isString(ret)?ret:key$2}else return key$2}function updateFallbackLocale(ctx,locale,fallback){let context$1=ctx;context$1.__localeChainCache=new Map,ctx.localeFallbacker(ctx,fallback,locale)}function isAlmostSameLocale(locale,compareLocale){return locale===compareLocale?!1:locale.split(`-`)[0]===compareLocale.split(`-`)[0]}function isImplicitFallback(targetLocale,locales){let index$1=locales.indexOf(targetLocale);if(index$1===-1)return!1;for(let i$1=index$1+1;i$1{DATETIME_FORMAT_OPTIONS_KEYS.includes(key$2)?overrides[key$2]=arg2[key$2]:options$1[key$2]=arg2[key$2]}),isString(arg3)?options$1.locale=arg3:isPlainObject(arg3)&&(overrides=arg3),isPlainObject(arg4)&&(overrides=arg4),[options$1.key||``,value$1,options$1,overrides]}function clearDateTimeFormat(ctx,locale,format$2){let context$1=ctx;for(let key$2 in format$2){let id$1=`${locale}__${key$2}`;if(!context$1.__datetimeFormatters.has(id$1))continue;context$1.__datetimeFormatters.delete(id$1)}}function number(context$1,...args){let{numberFormats,unresolving,fallbackLocale,onWarn,localeFallbacker}=context$1,{__numberFormatters}=context$1,[key$2,value$1,options$1,overrides]=parseNumberArgs(...args),missingWarn=isBoolean(options$1.missingWarn)?options$1.missingWarn:context$1.missingWarn,fallbackWarn=isBoolean(options$1.fallbackWarn)?options$1.fallbackWarn:context$1.fallbackWarn,part=!!options$1.part,locale=getLocale$1(context$1,options$1),locales=localeFallbacker(context$1,fallbackLocale,locale);if(!isString(key$2)||key$2===``)return new Intl.NumberFormat(locale,overrides).format(value$1);let numberFormat={},targetLocale,format$2=null,from=locale,to$2=null,type=`number format`;for(let i$1=0;i$1{NUMBER_FORMAT_OPTIONS_KEYS.includes(key$2)?overrides[key$2]=arg2[key$2]:options$1[key$2]=arg2[key$2]}),isString(arg3)?options$1.locale=arg3:isPlainObject(arg3)&&(overrides=arg3),isPlainObject(arg4)&&(overrides=arg4),[options$1.key||``,value$1,options$1,overrides]}function clearNumberFormat(ctx,locale,format$2){let context$1=ctx;for(let key$2 in format$2){let id$1=`${locale}__${key$2}`;if(!context$1.__numberFormatters.has(id$1))continue;context$1.__numberFormatters.delete(id$1)}}const DEFAULT_MODIFIER=str=>str,DEFAULT_MESSAGE=ctx=>``,DEFAULT_MESSAGE_DATA_TYPE=`text`,DEFAULT_NORMALIZE=values=>values.length===0?``:join(values),DEFAULT_INTERPOLATE=toDisplayString$1;function pluralDefault(choice,choicesLength){return choice=Math.abs(choice),choicesLength===2?choice?choice>1?1:0:1:choice?Math.min(choice,2):0}function getPluralIndex(options$1){let index$1=isNumber(options$1.pluralIndex)?options$1.pluralIndex:-1;return options$1.named&&(isNumber(options$1.named.count)||isNumber(options$1.named.n))?isNumber(options$1.named.count)?options$1.named.count:isNumber(options$1.named.n)?options$1.named.n:index$1:index$1}function normalizeNamed(pluralIndex,props){props.count||=pluralIndex,props.n||=pluralIndex}function createMessageContext(options$1={}){let locale=options$1.locale,pluralIndex=getPluralIndex(options$1),pluralRule=isObject(options$1.pluralRules)&&isString(locale)&&isFunction(options$1.pluralRules[locale])?options$1.pluralRules[locale]:pluralDefault,orgPluralRule=isObject(options$1.pluralRules)&&isString(locale)&&isFunction(options$1.pluralRules[locale])?pluralDefault:void 0,plural=messages=>messages[pluralRule(pluralIndex,messages.length,orgPluralRule)],_list=options$1.list||[],list$2=index$1=>_list[index$1],_named=options$1.named||create();isNumber(options$1.pluralIndex)&&normalizeNamed(pluralIndex,_named);let named$1=key$2=>_named[key$2];function message$1(key$2,useLinked){let msg=isFunction(options$1.messages)?options$1.messages(key$2,!!useLinked):isObject(options$1.messages)?options$1.messages[key$2]:!1;return msg||(options$1.parent?options$1.parent.message(key$2):DEFAULT_MESSAGE)}let _modifier=name$2=>options$1.modifiers?options$1.modifiers[name$2]:DEFAULT_MODIFIER,normalize$3=isPlainObject(options$1.processor)&&isFunction(options$1.processor.normalize)?options$1.processor.normalize:DEFAULT_NORMALIZE,interpolate$2=isPlainObject(options$1.processor)&&isFunction(options$1.processor.interpolate)?options$1.processor.interpolate:DEFAULT_INTERPOLATE,type=isPlainObject(options$1.processor)&&isString(options$1.processor.type)?options$1.processor.type:DEFAULT_MESSAGE_DATA_TYPE,linked=(key$2,...args)=>{let[arg1,arg2]=args,type$1=`text`,modifier=``;args.length===1?isObject(arg1)?(modifier=arg1.modifier||modifier,type$1=arg1.type||type$1):isString(arg1)&&(modifier=arg1||modifier):args.length===2&&(isString(arg1)&&(modifier=arg1||modifier),isString(arg2)&&(type$1=arg2||type$1));let ret=message$1(key$2,!0)(ctx),msg=type$1===`vnode`&&isArray(ret)&&modifier?ret[0]:ret;return modifier?_modifier(modifier)(msg,type$1):msg},ctx={list:list$2,named:named$1,plural,linked,message:message$1,type,interpolate:interpolate$2,normalize:normalize$3,values:assign(create(),_list,_named)};return ctx}const NOOP_MESSAGE_FUNCTION=()=>``,isMessageFunction=val=>isFunction(val);function translate(context$1,...args){let{fallbackFormat,postTranslation,unresolving,messageCompiler,fallbackLocale,messages}=context$1,[key$2,options$1]=parseTranslateArgs(...args),missingWarn=isBoolean(options$1.missingWarn)?options$1.missingWarn:context$1.missingWarn,fallbackWarn=isBoolean(options$1.fallbackWarn)?options$1.fallbackWarn:context$1.fallbackWarn,escapeParameter=isBoolean(options$1.escapeParameter)?options$1.escapeParameter:context$1.escapeParameter,resolvedMessage=!!options$1.resolvedMessage,defaultMsgOrKey=isString(options$1.default)||isBoolean(options$1.default)?isBoolean(options$1.default)?messageCompiler?key$2:()=>key$2:options$1.default:fallbackFormat?messageCompiler?key$2:()=>key$2:null,enableDefaultMsg=fallbackFormat||defaultMsgOrKey!=null&&(isString(defaultMsgOrKey)||isFunction(defaultMsgOrKey)),locale=getLocale$1(context$1,options$1);escapeParameter&&escapeParams(options$1);let[formatScope,targetLocale,message$1]=resolvedMessage?[key$2,locale,messages[locale]||create()]:resolveMessageFormat(context$1,key$2,locale,fallbackLocale,fallbackWarn,missingWarn),format$2=formatScope,cacheBaseKey=key$2;if(!resolvedMessage&&!(isString(format$2)||isMessageAST(format$2)||isMessageFunction(format$2))&&enableDefaultMsg&&(format$2=defaultMsgOrKey,cacheBaseKey=format$2),!resolvedMessage&&(!(isString(format$2)||isMessageAST(format$2)||isMessageFunction(format$2))||!isString(targetLocale)))return unresolving?NOT_REOSLVED:key$2;let occurred=!1,onError=()=>{occurred=!0},msg=isMessageFunction(format$2)?format$2:compileMessageFormat(context$1,key$2,targetLocale,format$2,cacheBaseKey,onError);if(occurred)return format$2;let ctxOptions=getMessageContextOptions(context$1,targetLocale,message$1,options$1),msgContext=createMessageContext(ctxOptions),messaged=evaluateMessage(context$1,msg,msgContext),ret=postTranslation?postTranslation(messaged,key$2):messaged;if(__INTLIFY_PROD_DEVTOOLS__){let payloads={timestamp:Date.now(),key:isString(key$2)?key$2:isMessageFunction(format$2)?format$2.key:``,locale:targetLocale||(isMessageFunction(format$2)?format$2.locale:``),format:isString(format$2)?format$2:isMessageFunction(format$2)?format$2.source:``,message:ret};payloads.meta=assign({},context$1.__meta,getAdditionalMeta()||{}),translateDevTools(payloads)}return ret}function escapeParams(options$1){isArray(options$1.list)?options$1.list=options$1.list.map(item=>isString(item)?escapeHtml(item):item):isObject(options$1.named)&&Object.keys(options$1.named).forEach(key$2=>{isString(options$1.named[key$2])&&(options$1.named[key$2]=escapeHtml(options$1.named[key$2]))})}function resolveMessageFormat(context$1,key$2,locale,fallbackLocale,fallbackWarn,missingWarn){let{messages,onWarn,messageResolver:resolveValue$2,localeFallbacker}=context$1,locales=localeFallbacker(context$1,fallbackLocale,locale),message$1=create(),targetLocale,format$2=null,from=locale,to$2=null,type=`translate`;for(let i$1=0;i$1format$2;return msg$1.locale=targetLocale,msg$1.key=key$2,msg$1}let start=null,startTag,endTag,msg=messageCompiler(format$2,getCompileContext(context$1,targetLocale,cacheBaseKey,format$2,warnHtmlMessage,onError));return msg.locale=targetLocale,msg.key=key$2,msg.source=format$2,msg}function evaluateMessage(context$1,msg,msgCtx){let start=null,startTag,endTag,messaged=msg(msgCtx);return messaged}function parseTranslateArgs(...args){let[arg1,arg2,arg3]=args,options$1=create();if(!isString(arg1)&&!isNumber(arg1)&&!isMessageFunction(arg1)&&!isMessageAST(arg1))throw createCoreError(CoreErrorCodes.INVALID_ARGUMENT);let key$2=isNumber(arg1)?String(arg1):(isMessageFunction(arg1),arg1);return isNumber(arg2)?options$1.plural=arg2:isString(arg2)?options$1.default=arg2:isPlainObject(arg2)&&!isEmptyObject(arg2)?options$1.named=arg2:isArray(arg2)&&(options$1.list=arg2),isNumber(arg3)?options$1.plural=arg3:isString(arg3)?options$1.default=arg3:isPlainObject(arg3)&&assign(options$1,arg3),[key$2,options$1]}function getCompileContext(context$1,locale,key$2,source,warnHtmlMessage,onError){return{locale,key:key$2,warnHtmlMessage,onError:err=>{throw onError&&onError(err),err},onCacheKey:source$1=>generateFormatCacheKey(locale,key$2,source$1)}}function getMessageContextOptions(context$1,locale,message$1,options$1){let{modifiers,pluralRules,messageResolver:resolveValue$2,fallbackLocale,fallbackWarn,missingWarn,fallbackContext}=context$1,resolveMessage=(key$2,useLinked)=>{let val=resolveValue$2(message$1,key$2);if(val==null&&(fallbackContext||useLinked)){let[,,message$2]=resolveMessageFormat(fallbackContext||context$1,key$2,locale,fallbackLocale,fallbackWarn,missingWarn);val=resolveValue$2(message$2,key$2)}if(isString(val)||isMessageAST(val)){let occurred=!1,onError=()=>{occurred=!0},msg=compileMessageFormat(context$1,key$2,locale,val,key$2,onError);return occurred?NOOP_MESSAGE_FUNCTION:msg}else if(isMessageFunction(val))return val;else return NOOP_MESSAGE_FUNCTION},ctxOptions={locale,modifiers,pluralRules,messages:resolveMessage};return context$1.processor&&(ctxOptions.processor=context$1.processor),options$1.list&&(ctxOptions.list=options$1.list),options$1.named&&(ctxOptions.named=options$1.named),isNumber(options$1.plural)&&(ctxOptions.pluralIndex=options$1.plural),ctxOptions}initFeatureFlags$1();const VERSION=`11.1.9`;function initFeatureFlags(){typeof __INTLIFY_PROD_DEVTOOLS__!=`boolean`&&(getGlobalThis().__INTLIFY_PROD_DEVTOOLS__=!1)}const I18nErrorCodes={UNEXPECTED_RETURN_TYPE:CORE_ERROR_CODES_EXTEND_POINT,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:30,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32,NOT_COMPATIBLE_LEGACY_VUE_I18N:33,NOT_AVAILABLE_COMPOSITION_IN_LEGACY:34,DUPLICATE_USE_I18N_CALLING:35};function createI18nError(code$1,...args){return createCompileError(code$1,null,void 0)}const errorMessages={[I18nErrorCodes.UNEXPECTED_RETURN_TYPE]:`Unexpected return type in composer`,[I18nErrorCodes.INVALID_ARGUMENT]:`Invalid argument`,[I18nErrorCodes.MUST_BE_CALL_SETUP_TOP]:"Must be called at the top of a `setup` function",[I18nErrorCodes.NOT_INSTALLED]:"Need to install with `app.use` function",[I18nErrorCodes.UNEXPECTED_ERROR]:`Unexpected error`,[I18nErrorCodes.REQUIRED_VALUE]:`Required in value: {0}`,[I18nErrorCodes.INVALID_VALUE]:`Invalid value`,[I18nErrorCodes.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN]:`Cannot setup vue-devtools plugin`,[I18nErrorCodes.NOT_INSTALLED_WITH_PROVIDE]:"Need to install with `provide` function",[I18nErrorCodes.NOT_COMPATIBLE_LEGACY_VUE_I18N]:`Not compatible legacy VueI18n.`,[I18nErrorCodes.NOT_AVAILABLE_COMPOSITION_IN_LEGACY]:`Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly`,[I18nErrorCodes.DUPLICATE_USE_I18N_CALLING]:"Duplicate `useI18n` calling by local scope. Please don't call it on local scope"},TranslateVNodeSymbol=makeSymbol(`__translateVNode`),DatetimePartsSymbol=makeSymbol(`__datetimeParts`),NumberPartsSymbol=makeSymbol(`__numberParts`),SetPluralRulesSymbol=makeSymbol(`__setPluralRules`);makeSymbol(`__intlifyMeta`);const InejctWithOptionSymbol=makeSymbol(`__injectWithOption`),DisposeSymbol=makeSymbol(`__dispose`),I18nWarnCodes={FALLBACK_TO_ROOT:CORE_WARN_CODES_EXTEND_POINT,NOT_FOUND_PARENT_SCOPE:9,IGNORE_OBJ_FLATTEN:10,DEPRECATE_LEGACY_MODE:11,DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE:12},warnMessages={[I18nWarnCodes.FALLBACK_TO_ROOT]:`Fall back to {type} '{key}' with root locale.`,[I18nWarnCodes.NOT_FOUND_PARENT_SCOPE]:`Not found parent scope. use the global scope.`,[I18nWarnCodes.IGNORE_OBJ_FLATTEN]:`Ignore object flatten: '{key}' key has an string value`,[I18nWarnCodes.DEPRECATE_LEGACY_MODE]:`Legacy API mode has been deprecated in v11. Use Composition API mode instead. +`:options$1.breakLineCode,needIndent=options$1.needIndent?options$1.needIndent:mode!==`arrow`,helpers=ast.helpers||[],generator=createCodeGenerator(ast,{mode,filename,sourceMap,breakLineCode,needIndent});generator.push(mode===`normal`?`function __msg__ (ctx) {`:`(ctx) => {`),generator.indent(needIndent),helpers.length>0&&(generator.push(`const { ${join(helpers.map(s$1=>`${s$1}: _${s$1}`),`, `)} } = ctx`),generator.newline()),generator.push(`return `),generateNode(generator,ast),generator.deindent(needIndent),generator.push(`}`),delete ast.helpers;let{code:code$1,map}=generator.context();return{ast,code:code$1,map:map?map.toJSON():void 0}};function baseCompile(source,options$1={}){let assignedOptions=assign({},options$1),jit=!!assignedOptions.jit,enalbeMinify=!!assignedOptions.minify,enambeOptimize=assignedOptions.optimize==null?!0:assignedOptions.optimize,parser=createParser(assignedOptions),ast=parser.parse(source);return jit?(enambeOptimize&&optimize(ast),enalbeMinify&&minify(ast),{ast,code:``}):(transform(ast,assignedOptions),generate(ast,assignedOptions))}function initFeatureFlags$1(){typeof __INTLIFY_PROD_DEVTOOLS__!=`boolean`&&(getGlobalThis().__INTLIFY_PROD_DEVTOOLS__=!1)}function isMessageAST(val){return isObject(val)&&resolveType(val)===0&&(hasOwn(val,`b`)||hasOwn(val,`body`))}const PROPS_BODY=[`b`,`body`];function resolveBody(node$1){return resolveProps(node$1,PROPS_BODY)}const PROPS_CASES=[`c`,`cases`];function resolveCases(node$1){return resolveProps(node$1,PROPS_CASES,[])}const PROPS_STATIC=[`s`,`static`];function resolveStatic(node$1){return resolveProps(node$1,PROPS_STATIC)}const PROPS_ITEMS=[`i`,`items`];function resolveItems(node$1){return resolveProps(node$1,PROPS_ITEMS,[])}const PROPS_TYPE=[`t`,`type`];function resolveType(node$1){return resolveProps(node$1,PROPS_TYPE)}const PROPS_VALUE=[`v`,`value`];function resolveValue$1(node$1,type){let resolved=resolveProps(node$1,PROPS_VALUE);if(resolved!=null)return resolved;throw createUnhandleNodeError(type)}const PROPS_MODIFIER=[`m`,`modifier`];function resolveLinkedModifier(node$1){return resolveProps(node$1,PROPS_MODIFIER)}const PROPS_KEY=[`k`,`key`];function resolveLinkedKey(node$1){let resolved=resolveProps(node$1,PROPS_KEY);if(resolved)return resolved;throw createUnhandleNodeError(6)}function resolveProps(node$1,props,defaultValue){for(let i$1=0;i$1formatParts(ctx,ast);return msg}function formatParts(ctx,ast){let body$2=resolveBody(ast);if(body$2==null)throw createUnhandleNodeError(0);let type=resolveType(body$2);if(type===1){let plural=body$2,cases=resolveCases(plural);return ctx.plural(cases.reduce((messages,c$4)=>[...messages,formatMessageParts(ctx,c$4)],[]))}else return formatMessageParts(ctx,body$2)}function formatMessageParts(ctx,node$1){let static_=resolveStatic(node$1);if(static_!=null)return ctx.type===`text`?static_:ctx.normalize([static_]);{let messages=resolveItems(node$1).reduce((acm,c$4)=>[...acm,formatMessagePart(ctx,c$4)],[]);return ctx.normalize(messages)}}function formatMessagePart(ctx,node$1){let type=resolveType(node$1);switch(type){case 3:return resolveValue$1(node$1,type);case 9:return resolveValue$1(node$1,type);case 4:{let named$1=node$1;if(hasOwn(named$1,`k`)&&named$1.k)return ctx.interpolate(ctx.named(named$1.k));if(hasOwn(named$1,`key`)&&named$1.key)return ctx.interpolate(ctx.named(named$1.key));throw createUnhandleNodeError(type)}case 5:{let list$2=node$1;if(hasOwn(list$2,`i`)&&isNumber(list$2.i))return ctx.interpolate(ctx.list(list$2.i));if(hasOwn(list$2,`index`)&&isNumber(list$2.index))return ctx.interpolate(ctx.list(list$2.index));throw createUnhandleNodeError(type)}case 6:{let linked=node$1,modifier=resolveLinkedModifier(linked),key$2=resolveLinkedKey(linked);return ctx.linked(formatMessagePart(ctx,key$2),modifier?formatMessagePart(ctx,modifier):void 0,ctx.type)}case 7:return resolveValue$1(node$1,type);case 8:return resolveValue$1(node$1,type);default:throw Error(`unhandled node on format message part: ${type}`)}}const defaultOnCacheKey=message$1=>message$1;let compileCache=create();function baseCompile$1(message$1,options$1={}){let detectError=!1,onError=options$1.onError||defaultOnError;return options$1.onError=err=>{detectError=!0,onError(err)},{...baseCompile(message$1,options$1),detectError}}function compile(message$1,context$1){if(isString(message$1)){let warnHtmlMessage=isBoolean(context$1.warnHtmlMessage)?context$1.warnHtmlMessage:!0,onCacheKey=context$1.onCacheKey||defaultOnCacheKey,cacheKey=onCacheKey(message$1),cached=compileCache[cacheKey];if(cached)return cached;let{ast,detectError}=baseCompile$1(message$1,{...context$1,location:!1,jit:!0}),msg=format$1(ast);return detectError?msg:compileCache[cacheKey]=msg}else{let cacheKey=message$1.cacheKey;if(cacheKey){let cached=compileCache[cacheKey];return cached||(compileCache[cacheKey]=format$1(message$1))}else return format$1(message$1)}}let devtools=null;function setDevToolsHook(hook){devtools=hook}function initI18nDevTools(i18n$1,version$1,meta){devtools&&devtools.emit(`i18n:init`,{timestamp:Date.now(),i18n:i18n$1,version:version$1,meta})}const translateDevTools=createDevToolsHook(`function:translate`);function createDevToolsHook(hook){return payloads=>devtools&&devtools.emit(hook,payloads)}const CoreErrorCodes={INVALID_ARGUMENT:COMPILE_ERROR_CODES_EXTEND_POINT,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_NON_STRING_MESSAGE:20,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},CORE_ERROR_CODES_EXTEND_POINT=24;function createCoreError(code$1){return createCompileError(code$1,null,void 0)}const errorMessages$1={[CoreErrorCodes.INVALID_ARGUMENT]:`Invalid arguments`,[CoreErrorCodes.INVALID_DATE_ARGUMENT]:`The date provided is an invalid Date object.Make sure your Date represents a valid date.`,[CoreErrorCodes.INVALID_ISO_DATE_ARGUMENT]:`The argument provided is not a valid ISO date string`,[CoreErrorCodes.NOT_SUPPORT_NON_STRING_MESSAGE]:`Not support non-string message`,[CoreErrorCodes.NOT_SUPPORT_LOCALE_PROMISE_VALUE]:`cannot support promise value`,[CoreErrorCodes.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION]:`cannot support async function`,[CoreErrorCodes.NOT_SUPPORT_LOCALE_TYPE]:`cannot support locale type`};function getLocale$1(context$1,options$1){return options$1.locale==null?resolveLocale(context$1.locale):resolveLocale(options$1.locale)}let _resolveLocale;function resolveLocale(locale){if(isString(locale))return locale;if(isFunction(locale)){if(locale.resolvedOnce&&_resolveLocale!=null)return _resolveLocale;if(locale.constructor.name===`Function`){let resolve$1=locale();if(isPromise(resolve$1))throw createCoreError(CoreErrorCodes.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return _resolveLocale=resolve$1}else throw createCoreError(CoreErrorCodes.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw createCoreError(CoreErrorCodes.NOT_SUPPORT_LOCALE_TYPE)}function fallbackWithSimple(ctx,fallback,start){return[...new Set([start,...isArray(fallback)?fallback:isObject(fallback)?Object.keys(fallback):isString(fallback)?[fallback]:[start]])]}function fallbackWithLocaleChain(ctx,fallback,start){let startLocale=isString(start)?start:DEFAULT_LOCALE,context$1=ctx;context$1.__localeChainCache||=new Map;let chain$1=context$1.__localeChainCache.get(startLocale);if(!chain$1){chain$1=[];let block=[start];for(;isArray(block);)block=appendBlockToChain(chain$1,block,fallback);let defaults$1=isArray(fallback)||!isPlainObject(fallback)?fallback:fallback.default?fallback.default:null;block=isString(defaults$1)?[defaults$1]:defaults$1,isArray(block)&&appendBlockToChain(chain$1,block,!1),context$1.__localeChainCache.set(startLocale,chain$1)}return chain$1}function appendBlockToChain(chain$1,block,blocks){let follow=!0;for(let i$1=0;i$1{key$2===void 0?key$2=newChar:key$2+=newChar},actions[1]=()=>{key$2!==void 0&&(keys$3.push(key$2),key$2=void 0)},actions[2]=()=>{actions[0](),subPathDepth++},actions[3]=()=>{if(subPathDepth>0)subPathDepth--,mode=4,actions[0]();else{if(subPathDepth=0,key$2===void 0||(key$2=formatSubPath(key$2),key$2===!1))return!1;actions[1]()}};function maybeUnescapeQuote(){let nextChar=path[index$1+1];if(mode===5&&nextChar===`'`||mode===6&&nextChar===`"`)return index$1++,newChar=`\\`+nextChar,actions[0](),!0}for(;mode!==null;)if(index$1++,c$4=path[index$1],!(c$4===`\\`&&maybeUnescapeQuote())){if(type=getPathCharType(c$4),typeMap=pathStateMachine[mode],transition=typeMap[type]||typeMap.l||8,transition===8||(mode=transition[0],transition[1]!==void 0&&(action=actions[transition[1]],action&&(newChar=c$4,action()===!1))))return;if(mode===7)return keys$3}}const cache=new Map;function resolveWithKeyValue(obj,path){return isObject(obj)?obj[path]:null}function resolveValue(obj,path){if(!isObject(obj))return null;let hit=cache.get(path);if(hit||(hit=parse(path),hit&&cache.set(path,hit)),!hit)return null;let len=hit.length,last=obj,i$1=0;for(;i$1`${str.charAt(0).toLocaleUpperCase()}${str.substr(1)}`;function getDefaultLinkedModifiers(){return{upper:(val,type)=>type===`text`&&isString(val)?val.toUpperCase():type===`vnode`&&isObject(val)&&`__v_isVNode`in val?val.children.toUpperCase():val,lower:(val,type)=>type===`text`&&isString(val)?val.toLowerCase():type===`vnode`&&isObject(val)&&`__v_isVNode`in val?val.children.toLowerCase():val,capitalize:(val,type)=>type===`text`&&isString(val)?capitalize(val):type===`vnode`&&isObject(val)&&`__v_isVNode`in val?capitalize(val.children):val}}let _compiler;function registerMessageCompiler(compiler$1){_compiler=compiler$1}let _resolver;function registerMessageResolver(resolver$1){_resolver=resolver$1}let _fallbacker;function registerLocaleFallbacker(fallbacker){_fallbacker=fallbacker}let _additionalMeta=null;const setAdditionalMeta=meta=>{_additionalMeta=meta},getAdditionalMeta=()=>_additionalMeta;let _fallbackContext=null;const setFallbackContext=context$1=>{_fallbackContext=context$1},getFallbackContext=()=>_fallbackContext;let _cid=0;function createCoreContext(options$1={}){let onWarn=isFunction(options$1.onWarn)?options$1.onWarn:warn,version$1=isString(options$1.version)?options$1.version:VERSION$1,locale=isString(options$1.locale)||isFunction(options$1.locale)?options$1.locale:DEFAULT_LOCALE,_locale=isFunction(locale)?DEFAULT_LOCALE:locale,fallbackLocale=isArray(options$1.fallbackLocale)||isPlainObject(options$1.fallbackLocale)||isString(options$1.fallbackLocale)||options$1.fallbackLocale===!1?options$1.fallbackLocale:_locale,messages=isPlainObject(options$1.messages)?options$1.messages:createResources(_locale),datetimeFormats=isPlainObject(options$1.datetimeFormats)?options$1.datetimeFormats:createResources(_locale),numberFormats=isPlainObject(options$1.numberFormats)?options$1.numberFormats:createResources(_locale),modifiers=assign(create(),options$1.modifiers,getDefaultLinkedModifiers()),pluralRules=options$1.pluralRules||create(),missing=isFunction(options$1.missing)?options$1.missing:null,missingWarn=isBoolean(options$1.missingWarn)||isRegExp(options$1.missingWarn)?options$1.missingWarn:!0,fallbackWarn=isBoolean(options$1.fallbackWarn)||isRegExp(options$1.fallbackWarn)?options$1.fallbackWarn:!0,fallbackFormat=!!options$1.fallbackFormat,unresolving=!!options$1.unresolving,postTranslation=isFunction(options$1.postTranslation)?options$1.postTranslation:null,processor=isPlainObject(options$1.processor)?options$1.processor:null,warnHtmlMessage=isBoolean(options$1.warnHtmlMessage)?options$1.warnHtmlMessage:!0,escapeParameter=!!options$1.escapeParameter,messageCompiler=isFunction(options$1.messageCompiler)?options$1.messageCompiler:_compiler,messageResolver=isFunction(options$1.messageResolver)?options$1.messageResolver:_resolver||resolveWithKeyValue,localeFallbacker=isFunction(options$1.localeFallbacker)?options$1.localeFallbacker:_fallbacker||fallbackWithSimple,fallbackContext=isObject(options$1.fallbackContext)?options$1.fallbackContext:void 0,internalOptions=options$1,__datetimeFormatters=isObject(internalOptions.__datetimeFormatters)?internalOptions.__datetimeFormatters:new Map,__numberFormatters=isObject(internalOptions.__numberFormatters)?internalOptions.__numberFormatters:new Map,__meta=isObject(internalOptions.__meta)?internalOptions.__meta:{};_cid++;let context$1={version:version$1,cid:_cid,locale,fallbackLocale,messages,modifiers,pluralRules,missing,missingWarn,fallbackWarn,fallbackFormat,unresolving,postTranslation,processor,warnHtmlMessage,escapeParameter,messageCompiler,messageResolver,localeFallbacker,fallbackContext,onWarn,__meta};return context$1.datetimeFormats=datetimeFormats,context$1.numberFormats=numberFormats,context$1.__datetimeFormatters=__datetimeFormatters,context$1.__numberFormatters=__numberFormatters,__INTLIFY_PROD_DEVTOOLS__&&initI18nDevTools(context$1,version$1,__meta),context$1}const createResources=locale=>({[locale]:create()});function handleMissing(context$1,key$2,locale,missingWarn,type){let{missing,onWarn}=context$1;if(missing!==null){let ret=missing(context$1,locale,key$2,type);return isString(ret)?ret:key$2}else return key$2}function updateFallbackLocale(ctx,locale,fallback){let context$1=ctx;context$1.__localeChainCache=new Map,ctx.localeFallbacker(ctx,fallback,locale)}function isAlmostSameLocale(locale,compareLocale){return locale===compareLocale?!1:locale.split(`-`)[0]===compareLocale.split(`-`)[0]}function isImplicitFallback(targetLocale,locales){let index$1=locales.indexOf(targetLocale);if(index$1===-1)return!1;for(let i$1=index$1+1;i$1{DATETIME_FORMAT_OPTIONS_KEYS.includes(key$2)?overrides[key$2]=arg2[key$2]:options$1[key$2]=arg2[key$2]}),isString(arg3)?options$1.locale=arg3:isPlainObject(arg3)&&(overrides=arg3),isPlainObject(arg4)&&(overrides=arg4),[options$1.key||``,value$1,options$1,overrides]}function clearDateTimeFormat(ctx,locale,format$2){let context$1=ctx;for(let key$2 in format$2){let id$1=`${locale}__${key$2}`;if(!context$1.__datetimeFormatters.has(id$1))continue;context$1.__datetimeFormatters.delete(id$1)}}function number(context$1,...args){let{numberFormats,unresolving,fallbackLocale,onWarn,localeFallbacker}=context$1,{__numberFormatters}=context$1,[key$2,value$1,options$1,overrides]=parseNumberArgs(...args),missingWarn=isBoolean(options$1.missingWarn)?options$1.missingWarn:context$1.missingWarn,fallbackWarn=isBoolean(options$1.fallbackWarn)?options$1.fallbackWarn:context$1.fallbackWarn,part=!!options$1.part,locale=getLocale$1(context$1,options$1),locales=localeFallbacker(context$1,fallbackLocale,locale);if(!isString(key$2)||key$2===``)return new Intl.NumberFormat(locale,overrides).format(value$1);let numberFormat={},targetLocale,format$2=null,from=locale,to$2=null,type=`number format`;for(let i$1=0;i$1{NUMBER_FORMAT_OPTIONS_KEYS.includes(key$2)?overrides[key$2]=arg2[key$2]:options$1[key$2]=arg2[key$2]}),isString(arg3)?options$1.locale=arg3:isPlainObject(arg3)&&(overrides=arg3),isPlainObject(arg4)&&(overrides=arg4),[options$1.key||``,value$1,options$1,overrides]}function clearNumberFormat(ctx,locale,format$2){let context$1=ctx;for(let key$2 in format$2){let id$1=`${locale}__${key$2}`;if(!context$1.__numberFormatters.has(id$1))continue;context$1.__numberFormatters.delete(id$1)}}const DEFAULT_MODIFIER=str=>str,DEFAULT_MESSAGE=ctx=>``,DEFAULT_MESSAGE_DATA_TYPE=`text`,DEFAULT_NORMALIZE=values=>values.length===0?``:join(values),DEFAULT_INTERPOLATE=toDisplayString$1;function pluralDefault(choice,choicesLength){return choice=Math.abs(choice),choicesLength===2?choice?choice>1?1:0:1:choice?Math.min(choice,2):0}function getPluralIndex(options$1){let index$1=isNumber(options$1.pluralIndex)?options$1.pluralIndex:-1;return options$1.named&&(isNumber(options$1.named.count)||isNumber(options$1.named.n))?isNumber(options$1.named.count)?options$1.named.count:isNumber(options$1.named.n)?options$1.named.n:index$1:index$1}function normalizeNamed(pluralIndex,props){props.count||=pluralIndex,props.n||=pluralIndex}function createMessageContext(options$1={}){let locale=options$1.locale,pluralIndex=getPluralIndex(options$1),pluralRule=isObject(options$1.pluralRules)&&isString(locale)&&isFunction(options$1.pluralRules[locale])?options$1.pluralRules[locale]:pluralDefault,orgPluralRule=isObject(options$1.pluralRules)&&isString(locale)&&isFunction(options$1.pluralRules[locale])?pluralDefault:void 0,plural=messages=>messages[pluralRule(pluralIndex,messages.length,orgPluralRule)],_list=options$1.list||[],list$2=index$1=>_list[index$1],_named=options$1.named||create();isNumber(options$1.pluralIndex)&&normalizeNamed(pluralIndex,_named);let named$1=key$2=>_named[key$2];function message$1(key$2,useLinked){let msg=isFunction(options$1.messages)?options$1.messages(key$2,!!useLinked):isObject(options$1.messages)?options$1.messages[key$2]:!1;return msg||(options$1.parent?options$1.parent.message(key$2):DEFAULT_MESSAGE)}let _modifier=name$2=>options$1.modifiers?options$1.modifiers[name$2]:DEFAULT_MODIFIER,normalize$3=isPlainObject(options$1.processor)&&isFunction(options$1.processor.normalize)?options$1.processor.normalize:DEFAULT_NORMALIZE,interpolate$2=isPlainObject(options$1.processor)&&isFunction(options$1.processor.interpolate)?options$1.processor.interpolate:DEFAULT_INTERPOLATE,type=isPlainObject(options$1.processor)&&isString(options$1.processor.type)?options$1.processor.type:DEFAULT_MESSAGE_DATA_TYPE,linked=(key$2,...args)=>{let[arg1,arg2]=args,type$1=`text`,modifier=``;args.length===1?isObject(arg1)?(modifier=arg1.modifier||modifier,type$1=arg1.type||type$1):isString(arg1)&&(modifier=arg1||modifier):args.length===2&&(isString(arg1)&&(modifier=arg1||modifier),isString(arg2)&&(type$1=arg2||type$1));let ret=message$1(key$2,!0)(ctx),msg=type$1===`vnode`&&isArray(ret)&&modifier?ret[0]:ret;return modifier?_modifier(modifier)(msg,type$1):msg},ctx={list:list$2,named:named$1,plural,linked,message:message$1,type,interpolate:interpolate$2,normalize:normalize$3,values:assign(create(),_list,_named)};return ctx}const NOOP_MESSAGE_FUNCTION=()=>``,isMessageFunction=val=>isFunction(val);function translate(context$1,...args){let{fallbackFormat,postTranslation,unresolving,messageCompiler,fallbackLocale,messages}=context$1,[key$2,options$1]=parseTranslateArgs(...args),missingWarn=isBoolean(options$1.missingWarn)?options$1.missingWarn:context$1.missingWarn,fallbackWarn=isBoolean(options$1.fallbackWarn)?options$1.fallbackWarn:context$1.fallbackWarn,escapeParameter=isBoolean(options$1.escapeParameter)?options$1.escapeParameter:context$1.escapeParameter,resolvedMessage=!!options$1.resolvedMessage,defaultMsgOrKey=isString(options$1.default)||isBoolean(options$1.default)?isBoolean(options$1.default)?messageCompiler?key$2:()=>key$2:options$1.default:fallbackFormat?messageCompiler?key$2:()=>key$2:null,enableDefaultMsg=fallbackFormat||defaultMsgOrKey!=null&&(isString(defaultMsgOrKey)||isFunction(defaultMsgOrKey)),locale=getLocale$1(context$1,options$1);escapeParameter&&escapeParams(options$1);let[formatScope,targetLocale,message$1]=resolvedMessage?[key$2,locale,messages[locale]||create()]:resolveMessageFormat(context$1,key$2,locale,fallbackLocale,fallbackWarn,missingWarn),format$2=formatScope,cacheBaseKey=key$2;if(!resolvedMessage&&!(isString(format$2)||isMessageAST(format$2)||isMessageFunction(format$2))&&enableDefaultMsg&&(format$2=defaultMsgOrKey,cacheBaseKey=format$2),!resolvedMessage&&(!(isString(format$2)||isMessageAST(format$2)||isMessageFunction(format$2))||!isString(targetLocale)))return unresolving?NOT_REOSLVED:key$2;let occurred=!1,onError=()=>{occurred=!0},msg=isMessageFunction(format$2)?format$2:compileMessageFormat(context$1,key$2,targetLocale,format$2,cacheBaseKey,onError);if(occurred)return format$2;let ctxOptions=getMessageContextOptions(context$1,targetLocale,message$1,options$1),msgContext=createMessageContext(ctxOptions),messaged=evaluateMessage(context$1,msg,msgContext),ret=postTranslation?postTranslation(messaged,key$2):messaged;if(escapeParameter&&isString(ret)&&(ret=sanitizeTranslatedHtml(ret)),__INTLIFY_PROD_DEVTOOLS__){let payloads={timestamp:Date.now(),key:isString(key$2)?key$2:isMessageFunction(format$2)?format$2.key:``,locale:targetLocale||(isMessageFunction(format$2)?format$2.locale:``),format:isString(format$2)?format$2:isMessageFunction(format$2)?format$2.source:``,message:ret};payloads.meta=assign({},context$1.__meta,getAdditionalMeta()||{}),translateDevTools(payloads)}return ret}function escapeParams(options$1){isArray(options$1.list)?options$1.list=options$1.list.map(item=>isString(item)?escapeHtml(item):item):isObject(options$1.named)&&Object.keys(options$1.named).forEach(key$2=>{isString(options$1.named[key$2])&&(options$1.named[key$2]=escapeHtml(options$1.named[key$2]))})}function resolveMessageFormat(context$1,key$2,locale,fallbackLocale,fallbackWarn,missingWarn){let{messages,onWarn,messageResolver:resolveValue$2,localeFallbacker}=context$1,locales=localeFallbacker(context$1,fallbackLocale,locale),message$1=create(),targetLocale,format$2=null,from=locale,to$2=null,type=`translate`;for(let i$1=0;i$1format$2;return msg$1.locale=targetLocale,msg$1.key=key$2,msg$1}let start=null,startTag,endTag,msg=messageCompiler(format$2,getCompileContext(context$1,targetLocale,cacheBaseKey,format$2,warnHtmlMessage,onError));return msg.locale=targetLocale,msg.key=key$2,msg.source=format$2,msg}function evaluateMessage(context$1,msg,msgCtx){let start=null,startTag,endTag,messaged=msg(msgCtx);return messaged}function parseTranslateArgs(...args){let[arg1,arg2,arg3]=args,options$1=create();if(!isString(arg1)&&!isNumber(arg1)&&!isMessageFunction(arg1)&&!isMessageAST(arg1))throw createCoreError(CoreErrorCodes.INVALID_ARGUMENT);let key$2=isNumber(arg1)?String(arg1):(isMessageFunction(arg1),arg1);return isNumber(arg2)?options$1.plural=arg2:isString(arg2)?options$1.default=arg2:isPlainObject(arg2)&&!isEmptyObject(arg2)?options$1.named=arg2:isArray(arg2)&&(options$1.list=arg2),isNumber(arg3)?options$1.plural=arg3:isString(arg3)?options$1.default=arg3:isPlainObject(arg3)&&assign(options$1,arg3),[key$2,options$1]}function getCompileContext(context$1,locale,key$2,source,warnHtmlMessage,onError){return{locale,key:key$2,warnHtmlMessage,onError:err=>{throw onError&&onError(err),err},onCacheKey:source$1=>generateFormatCacheKey(locale,key$2,source$1)}}function getMessageContextOptions(context$1,locale,message$1,options$1){let{modifiers,pluralRules,messageResolver:resolveValue$2,fallbackLocale,fallbackWarn,missingWarn,fallbackContext}=context$1,resolveMessage=(key$2,useLinked)=>{let val=resolveValue$2(message$1,key$2);if(val==null&&(fallbackContext||useLinked)){let[,,message$2]=resolveMessageFormat(fallbackContext||context$1,key$2,locale,fallbackLocale,fallbackWarn,missingWarn);val=resolveValue$2(message$2,key$2)}if(isString(val)||isMessageAST(val)){let occurred=!1,onError=()=>{occurred=!0},msg=compileMessageFormat(context$1,key$2,locale,val,key$2,onError);return occurred?NOOP_MESSAGE_FUNCTION:msg}else if(isMessageFunction(val))return val;else return NOOP_MESSAGE_FUNCTION},ctxOptions={locale,modifiers,pluralRules,messages:resolveMessage};return context$1.processor&&(ctxOptions.processor=context$1.processor),options$1.list&&(ctxOptions.list=options$1.list),options$1.named&&(ctxOptions.named=options$1.named),isNumber(options$1.plural)&&(ctxOptions.pluralIndex=options$1.plural),ctxOptions}initFeatureFlags$1();const VERSION=`11.1.10`;function initFeatureFlags(){typeof __INTLIFY_PROD_DEVTOOLS__!=`boolean`&&(getGlobalThis().__INTLIFY_PROD_DEVTOOLS__=!1)}const I18nErrorCodes={UNEXPECTED_RETURN_TYPE:CORE_ERROR_CODES_EXTEND_POINT,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:30,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32,NOT_COMPATIBLE_LEGACY_VUE_I18N:33,NOT_AVAILABLE_COMPOSITION_IN_LEGACY:34,DUPLICATE_USE_I18N_CALLING:35};function createI18nError(code$1,...args){return createCompileError(code$1,null,void 0)}const errorMessages={[I18nErrorCodes.UNEXPECTED_RETURN_TYPE]:`Unexpected return type in composer`,[I18nErrorCodes.INVALID_ARGUMENT]:`Invalid argument`,[I18nErrorCodes.MUST_BE_CALL_SETUP_TOP]:"Must be called at the top of a `setup` function",[I18nErrorCodes.NOT_INSTALLED]:"Need to install with `app.use` function",[I18nErrorCodes.UNEXPECTED_ERROR]:`Unexpected error`,[I18nErrorCodes.REQUIRED_VALUE]:`Required in value: {0}`,[I18nErrorCodes.INVALID_VALUE]:`Invalid value`,[I18nErrorCodes.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN]:`Cannot setup vue-devtools plugin`,[I18nErrorCodes.NOT_INSTALLED_WITH_PROVIDE]:"Need to install with `provide` function",[I18nErrorCodes.NOT_COMPATIBLE_LEGACY_VUE_I18N]:`Not compatible legacy VueI18n.`,[I18nErrorCodes.NOT_AVAILABLE_COMPOSITION_IN_LEGACY]:`Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly`,[I18nErrorCodes.DUPLICATE_USE_I18N_CALLING]:"Duplicate `useI18n` calling by local scope. Please don't call it on local scope"},TranslateVNodeSymbol=makeSymbol(`__translateVNode`),DatetimePartsSymbol=makeSymbol(`__datetimeParts`),NumberPartsSymbol=makeSymbol(`__numberParts`),SetPluralRulesSymbol=makeSymbol(`__setPluralRules`);makeSymbol(`__intlifyMeta`);const InejctWithOptionSymbol=makeSymbol(`__injectWithOption`),DisposeSymbol=makeSymbol(`__dispose`),I18nWarnCodes={FALLBACK_TO_ROOT:CORE_WARN_CODES_EXTEND_POINT,NOT_FOUND_PARENT_SCOPE:9,IGNORE_OBJ_FLATTEN:10,DEPRECATE_LEGACY_MODE:11,DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE:12},warnMessages={[I18nWarnCodes.FALLBACK_TO_ROOT]:`Fall back to {type} '{key}' with root locale.`,[I18nWarnCodes.NOT_FOUND_PARENT_SCOPE]:`Not found parent scope. use the global scope.`,[I18nWarnCodes.IGNORE_OBJ_FLATTEN]:`Ignore object flatten: '{key}' key has an string value`,[I18nWarnCodes.DEPRECATE_LEGACY_MODE]:`Legacy API mode has been deprecated in v11. Use Composition API mode instead. About how to use the Composition API mode, see https://vue-i18n.intlify.dev/guide/advanced/composition.html`,[I18nWarnCodes.DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE]:`'v-t' has been deprecated in v11. Use translate APIs ('t' or '$t') instead.`};function handleFlatJson(obj){if(!isObject(obj)||isMessageAST(obj))return obj;for(let key$2 in obj){if(!hasOwn(obj,key$2))continue;if(!key$2.includes(`.`))isObject(obj[key$2])&&handleFlatJson(obj[key$2]);else{let subKeys=key$2.split(`.`),lastIndex=subKeys.length-1,currentObj=obj,hasStringValue=!1;for(let i$1=0;i$1{if(`locale`in custom&&`resource`in custom){let{locale:locale$1,resource}=custom;locale$1?(ret[locale$1]=ret[locale$1]||create(),deepCopy(resource,ret[locale$1])):deepCopy(resource,ret)}else isString(custom)&&deepCopy(JSON.parse(custom),ret)}),messageResolver==null&&flatJson)for(let key$2 in ret)hasOwn(ret,key$2)&&handleFlatJson(ret[key$2]);return ret}function getComponentOptions(instance){return instance.type}function adjustI18nResources(gl,options$1,componentOptions){let messages=isObject(options$1.messages)?options$1.messages:create();`__i18nGlobal`in componentOptions&&(messages=getLocaleMessages(gl.locale.value,{messages,__i18n:componentOptions.__i18nGlobal}));let locales=Object.keys(messages);if(locales.length&&locales.forEach(locale=>{gl.mergeLocaleMessage(locale,messages[locale])}),isObject(options$1.datetimeFormats)){let locales$1=Object.keys(options$1.datetimeFormats);locales$1.length&&locales$1.forEach(locale=>{gl.mergeDateTimeFormat(locale,options$1.datetimeFormats[locale])})}if(isObject(options$1.numberFormats)){let locales$1=Object.keys(options$1.numberFormats);locales$1.length&&locales$1.forEach(locale=>{gl.mergeNumberFormat(locale,options$1.numberFormats[locale])})}}function createTextNode(key$2){return createVNode(Text,null,key$2,0)}const DEVTOOLS_META=`__INTLIFY_META__`,NOOP_RETURN_ARRAY=()=>[],NOOP_RETURN_FALSE=()=>!1;let composerID=0;function defineCoreMissingHandler(missing){return(ctx,locale,key$2,type)=>missing(locale,key$2,getCurrentInstance()||void 0,type)}const getMetaInfo=()=>{let instance=getCurrentInstance(),meta=null;return instance&&(meta=getComponentOptions(instance)[DEVTOOLS_META])?{[DEVTOOLS_META]:meta}:null};function createComposer(options$1={}){let{__root,__injectWithOption}=options$1,_isGlobal=__root===void 0,flatJson=options$1.flatJson,_ref=inBrowser?ref:shallowRef,_inheritLocale=isBoolean(options$1.inheritLocale)?options$1.inheritLocale:!0,_locale=_ref(__root&&_inheritLocale?__root.locale.value:isString(options$1.locale)?options$1.locale:DEFAULT_LOCALE),_fallbackLocale=_ref(__root&&_inheritLocale?__root.fallbackLocale.value:isString(options$1.fallbackLocale)||isArray(options$1.fallbackLocale)||isPlainObject(options$1.fallbackLocale)||options$1.fallbackLocale===!1?options$1.fallbackLocale:_locale.value),_messages=_ref(getLocaleMessages(_locale.value,options$1)),_datetimeFormats=_ref(isPlainObject(options$1.datetimeFormats)?options$1.datetimeFormats:{[_locale.value]:{}}),_numberFormats=_ref(isPlainObject(options$1.numberFormats)?options$1.numberFormats:{[_locale.value]:{}}),_missingWarn=__root?__root.missingWarn:isBoolean(options$1.missingWarn)||isRegExp(options$1.missingWarn)?options$1.missingWarn:!0,_fallbackWarn=__root?__root.fallbackWarn:isBoolean(options$1.fallbackWarn)||isRegExp(options$1.fallbackWarn)?options$1.fallbackWarn:!0,_fallbackRoot=__root?__root.fallbackRoot:isBoolean(options$1.fallbackRoot)?options$1.fallbackRoot:!0,_fallbackFormat=!!options$1.fallbackFormat,_missing=isFunction(options$1.missing)?options$1.missing:null,_runtimeMissing=isFunction(options$1.missing)?defineCoreMissingHandler(options$1.missing):null,_postTranslation=isFunction(options$1.postTranslation)?options$1.postTranslation:null,_warnHtmlMessage=__root?__root.warnHtmlMessage:isBoolean(options$1.warnHtmlMessage)?options$1.warnHtmlMessage:!0,_escapeParameter=!!options$1.escapeParameter,_modifiers=__root?__root.modifiers:isPlainObject(options$1.modifiers)?options$1.modifiers:{},_pluralRules=options$1.pluralRules||__root&&__root.pluralRules,_context$1,getCoreContext=()=>{_isGlobal&&setFallbackContext(null);let ctxOptions={version:VERSION,locale:_locale.value,fallbackLocale:_fallbackLocale.value,messages:_messages.value,modifiers:_modifiers,pluralRules:_pluralRules,missing:_runtimeMissing===null?void 0:_runtimeMissing,missingWarn:_missingWarn,fallbackWarn:_fallbackWarn,fallbackFormat:_fallbackFormat,unresolving:!0,postTranslation:_postTranslation===null?void 0:_postTranslation,warnHtmlMessage:_warnHtmlMessage,escapeParameter:_escapeParameter,messageResolver:options$1.messageResolver,messageCompiler:options$1.messageCompiler,__meta:{framework:`vue`}};ctxOptions.datetimeFormats=_datetimeFormats.value,ctxOptions.numberFormats=_numberFormats.value,ctxOptions.__datetimeFormatters=isPlainObject(_context$1)?_context$1.__datetimeFormatters:void 0,ctxOptions.__numberFormatters=isPlainObject(_context$1)?_context$1.__numberFormatters:void 0;let ctx=createCoreContext(ctxOptions);return _isGlobal&&setFallbackContext(ctx),ctx};_context$1=getCoreContext(),updateFallbackLocale(_context$1,_locale.value,_fallbackLocale.value);function trackReactivityValues(){return[_locale.value,_fallbackLocale.value,_messages.value,_datetimeFormats.value,_numberFormats.value]}let locale=computed({get:()=>_locale.value,set:val=>{_context$1.locale=val,_locale.value=val}}),fallbackLocale=computed({get:()=>_fallbackLocale.value,set:val=>{_context$1.fallbackLocale=val,_fallbackLocale.value=val,updateFallbackLocale(_context$1,_locale.value,val)}}),messages=computed(()=>_messages.value),datetimeFormats=computed(()=>_datetimeFormats.value),numberFormats=computed(()=>_numberFormats.value);function getPostTranslationHandler(){return isFunction(_postTranslation)?_postTranslation:null}function setPostTranslationHandler(handler){_postTranslation=handler,_context$1.postTranslation=handler}function getMissingHandler(){return _missing}function setMissingHandler(handler){handler!==null&&(_runtimeMissing=defineCoreMissingHandler(handler)),_missing=handler,_context$1.missing=_runtimeMissing}function isResolvedTranslateMessage(type,arg){return type!==`translate`||!arg.resolvedMessage}let wrapWithDeps=(fn$6,argumentParser,warnType,fallbackSuccess,fallbackFail,successCondition)=>{trackReactivityValues();let ret;try{__INTLIFY_PROD_DEVTOOLS__,_isGlobal||(_context$1.fallbackContext=__root?getFallbackContext():void 0),ret=fn$6(_context$1)}finally{__INTLIFY_PROD_DEVTOOLS__,_isGlobal||(_context$1.fallbackContext=void 0)}if(warnType!==`translate exists`&&isNumber(ret)&&ret===NOT_REOSLVED||warnType===`translate exists`&&!ret){let[key$2,arg2]=argumentParser();return __root&&_fallbackRoot?fallbackSuccess(__root):fallbackFail(key$2)}else if(successCondition(ret))return ret;else throw createI18nError(I18nErrorCodes.UNEXPECTED_RETURN_TYPE)};function t(...args){return wrapWithDeps(context$1=>Reflect.apply(translate,null,[context$1,...args]),()=>parseTranslateArgs(...args),`translate`,root$3=>Reflect.apply(root$3.t,root$3,[...args]),key$2=>key$2,val=>isString(val))}function rt$5(...args){let[arg1,arg2,arg3]=args;if(arg3&&!isObject(arg3))throw createI18nError(I18nErrorCodes.INVALID_ARGUMENT);return t(arg1,arg2,assign({resolvedMessage:!0},arg3||{}))}function d$2(...args){return wrapWithDeps(context$1=>Reflect.apply(datetime,null,[context$1,...args]),()=>parseDateTimeArgs(...args),`datetime format`,root$3=>Reflect.apply(root$3.d,root$3,[...args]),()=>MISSING_RESOLVE_VALUE,val=>isString(val)||isArray(val))}function n$2(...args){return wrapWithDeps(context$1=>Reflect.apply(number,null,[context$1,...args]),()=>parseNumberArgs(...args),`number format`,root$3=>Reflect.apply(root$3.n,root$3,[...args]),()=>MISSING_RESOLVE_VALUE,val=>isString(val)||isArray(val))}function normalize$3(values){return values.map(val=>isString(val)||isNumber(val)||isBoolean(val)?createTextNode(String(val)):val)}let interpolate$2=val=>val,processor={normalize:normalize$3,interpolate:interpolate$2,type:`vnode`};function translateVNode(...args){return wrapWithDeps(context$1=>{let ret,_context$2=context$1;try{_context$2.processor=processor,ret=Reflect.apply(translate,null,[_context$2,...args])}finally{_context$2.processor=null}return ret},()=>parseTranslateArgs(...args),`translate`,root$3=>root$3[TranslateVNodeSymbol](...args),key$2=>[createTextNode(key$2)],val=>isArray(val))}function numberParts(...args){return wrapWithDeps(context$1=>Reflect.apply(number,null,[context$1,...args]),()=>parseNumberArgs(...args),`number format`,root$3=>root$3[NumberPartsSymbol](...args),NOOP_RETURN_ARRAY,val=>isString(val)||isArray(val))}function datetimeParts(...args){return wrapWithDeps(context$1=>Reflect.apply(datetime,null,[context$1,...args]),()=>parseDateTimeArgs(...args),`datetime format`,root$3=>root$3[DatetimePartsSymbol](...args),NOOP_RETURN_ARRAY,val=>isString(val)||isArray(val))}function setPluralRules(rules){_pluralRules=rules,_context$1.pluralRules=_pluralRules}function te$3(key$2,locale$1){return wrapWithDeps(()=>{if(!key$2)return!1;let targetLocale=isString(locale$1)?locale$1:_locale.value,message$1=getLocaleMessage(targetLocale),resolved=_context$1.messageResolver(message$1,key$2);return isMessageAST(resolved)||isMessageFunction(resolved)||isString(resolved)},()=>[key$2],`translate exists`,root$3=>Reflect.apply(root$3.te,root$3,[key$2,locale$1]),NOOP_RETURN_FALSE,val=>isBoolean(val))}function resolveMessages(key$2){let messages$1=null,locales=fallbackWithLocaleChain(_context$1,_fallbackLocale.value,_locale.value);for(let i$1=0;i$1{_inheritLocale&&(_locale.value=val,_context$1.locale=val,updateFallbackLocale(_context$1,_locale.value,_fallbackLocale.value))}),watch(__root.fallbackLocale,val=>{_inheritLocale&&(_fallbackLocale.value=val,_context$1.fallbackLocale=val,updateFallbackLocale(_context$1,_locale.value,_fallbackLocale.value))}));let composer={id:composerID,locale,fallbackLocale,get inheritLocale(){return _inheritLocale},set inheritLocale(val){_inheritLocale=val,val&&__root&&(_locale.value=__root.locale.value,_fallbackLocale.value=__root.fallbackLocale.value,updateFallbackLocale(_context$1,_locale.value,_fallbackLocale.value))},get availableLocales(){return Object.keys(_messages.value).sort()},messages,get modifiers(){return _modifiers},get pluralRules(){return _pluralRules||{}},get isGlobal(){return _isGlobal},get missingWarn(){return _missingWarn},set missingWarn(val){_missingWarn=val,_context$1.missingWarn=_missingWarn},get fallbackWarn(){return _fallbackWarn},set fallbackWarn(val){_fallbackWarn=val,_context$1.fallbackWarn=_fallbackWarn},get fallbackRoot(){return _fallbackRoot},set fallbackRoot(val){_fallbackRoot=val},get fallbackFormat(){return _fallbackFormat},set fallbackFormat(val){_fallbackFormat=val,_context$1.fallbackFormat=_fallbackFormat},get warnHtmlMessage(){return _warnHtmlMessage},set warnHtmlMessage(val){_warnHtmlMessage=val,_context$1.warnHtmlMessage=val},get escapeParameter(){return _escapeParameter},set escapeParameter(val){_escapeParameter=val,_context$1.escapeParameter=val},t,getLocaleMessage,setLocaleMessage,mergeLocaleMessage,getPostTranslationHandler,setPostTranslationHandler,getMissingHandler,setMissingHandler,[SetPluralRulesSymbol]:setPluralRules};return composer.datetimeFormats=datetimeFormats,composer.numberFormats=numberFormats,composer.rt=rt$5,composer.te=te$3,composer.tm=tm$1,composer.d=d$2,composer.n=n$2,composer.getDateTimeFormat=getDateTimeFormat,composer.setDateTimeFormat=setDateTimeFormat,composer.mergeDateTimeFormat=mergeDateTimeFormat,composer.getNumberFormat=getNumberFormat,composer.setNumberFormat=setNumberFormat,composer.mergeNumberFormat=mergeNumberFormat,composer[InejctWithOptionSymbol]=__injectWithOption,composer[TranslateVNodeSymbol]=translateVNode,composer[DatetimePartsSymbol]=datetimeParts,composer[NumberPartsSymbol]=numberParts,composer}const baseFormatProps={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:val=>val===`parent`||val===`global`,default:`parent`},i18n:{type:Object}};function getInterpolateArg({slots},keys$3){if(keys$3.length===1&&keys$3[0]===`default`){let ret=slots.default?slots.default():[];return ret.reduce((slot,current)=>[...slot,...current.type===Fragment?current.children:[current]],[])}else return keys$3.reduce((arg,key$2)=>{let slot=slots[key$2];return slot&&(arg[key$2]=slot()),arg},create())}function getFragmentableTag(){return Fragment}const TranslationImpl=defineComponent({name:`i18n-t`,props:assign({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:val=>isNumber(val)||!isNaN(val)}},baseFormatProps),setup(props,context$1){let{slots,attrs}=context$1,i18n$1=props.i18n||useI18n({useScope:props.scope,__useComponent:!0});return()=>{let keys$3=Object.keys(slots).filter(key$2=>key$2[0]!==`_`),options$1=create();props.locale&&(options$1.locale=props.locale),props.plural!==void 0&&(options$1.plural=isString(props.plural)?+props.plural:props.plural);let arg=getInterpolateArg(context$1,keys$3),children=i18n$1[TranslateVNodeSymbol](props.keypath,arg,options$1),assignedAttrs=assign(create(),attrs),tag=isString(props.tag)||isObject(props.tag)?props.tag:getFragmentableTag();return h(tag,assignedAttrs,children)}}}),Translation=TranslationImpl;function isVNode$1(target$1){return isArray(target$1)&&!isString(target$1[0])}function renderFormatter(props,context$1,slotKeys,partFormatter){let{slots,attrs}=context$1;return()=>{let options$1={part:!0},overrides=create();props.locale&&(options$1.locale=props.locale),isString(props.format)?options$1.key=props.format:isObject(props.format)&&(isString(props.format.key)&&(options$1.key=props.format.key),overrides=Object.keys(props.format).reduce((options$2,prop)=>slotKeys.includes(prop)?assign(create(),options$2,{[prop]:props.format[prop]}):options$2,create()));let parts=partFormatter(props.value,options$1,overrides),children=[options$1.key];isArray(parts)?children=parts.map((part,index$1)=>{let slot=slots[part.type],node$1=slot?slot({[part.type]:part.value,index:index$1,parts}):[part.value];return isVNode$1(node$1)&&(node$1[0].key=`${part.type}-${index$1}`),node$1}):isString(parts)&&(children=[parts]);let assignedAttrs=assign(create(),attrs),tag=isString(props.tag)||isObject(props.tag)?props.tag:getFragmentableTag();return h(tag,assignedAttrs,children)}}const NumberFormatImpl=defineComponent({name:`i18n-n`,props:assign({value:{type:Number,required:!0},format:{type:[String,Object]}},baseFormatProps),setup(props,context$1){let i18n$1=props.i18n||useI18n({useScope:props.scope,__useComponent:!0});return renderFormatter(props,context$1,NUMBER_FORMAT_OPTIONS_KEYS,(...args)=>i18n$1[NumberPartsSymbol](...args))}}),NumberFormat=NumberFormatImpl;function getComposer$1(i18n$1,instance){let i18nInternal=i18n$1;if(i18n$1.mode===`composition`)return i18nInternal.__getInstance(instance)||i18n$1.global;{let vueI18n=i18nInternal.__getInstance(instance);return vueI18n==null?i18n$1.global.__composer:vueI18n.__composer}}function vTDirective(i18n$1){let _process=binding=>{let{instance,value:value$1}=binding;if(!instance||!instance.$)throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);let composer=getComposer$1(i18n$1,instance.$),parsedValue=parseValue(value$1);return[Reflect.apply(composer.t,composer,[...makeParams(parsedValue)]),composer]},register=(el$1,binding)=>{let[textContent,composer]=_process(binding);inBrowser&&i18n$1.global===composer&&(el$1.__i18nWatcher=watch(composer.locale,()=>{binding.instance&&binding.instance.$forceUpdate()})),el$1.__composer=composer,el$1.textContent=textContent},unregister=el$1=>{inBrowser&&el$1.__i18nWatcher&&(el$1.__i18nWatcher(),el$1.__i18nWatcher=void 0,delete el$1.__i18nWatcher),el$1.__composer&&(el$1.__composer=void 0,delete el$1.__composer)},update=(el$1,{value:value$1})=>{if(el$1.__composer){let composer=el$1.__composer,parsedValue=parseValue(value$1);el$1.textContent=Reflect.apply(composer.t,composer,[...makeParams(parsedValue)])}},getSSRProps=binding=>{let[textContent]=_process(binding);return{textContent}};return{created:register,unmounted:unregister,beforeUpdate:update,getSSRProps}}function parseValue(value$1){if(isString(value$1))return{path:value$1};if(isPlainObject(value$1)){if(!(`path`in value$1))throw createI18nError(I18nErrorCodes.REQUIRED_VALUE,`path`);return value$1}else throw createI18nError(I18nErrorCodes.INVALID_VALUE)}function makeParams(value$1){let{path,locale,args,choice,plural}=value$1,options$1={},named$1=args||{};return isString(locale)&&(options$1.locale=locale),isNumber(choice)&&(options$1.plural=choice),isNumber(plural)&&(options$1.plural=plural),[path,named$1,options$1]}function apply(app,i18n$1,...options$1){let pluginOptions=isPlainObject(options$1[0])?options$1[0]:{},globalInstall=isBoolean(pluginOptions.globalInstall)?pluginOptions.globalInstall:!0;globalInstall&&([Translation.name,`I18nT`].forEach(name$2=>app.component(name$2,Translation)),[NumberFormat.name,`I18nN`].forEach(name$2=>app.component(name$2,NumberFormat)),[DatetimeFormat.name,`I18nD`].forEach(name$2=>app.component(name$2,DatetimeFormat))),app.directive(`t`,vTDirective(i18n$1))}const I18nInjectionKey=makeSymbol(`global-vue-i18n`);function createI18n(options$1={}){let __legacyMode=!1,__globalInjection=isBoolean(options$1.globalInjection)?options$1.globalInjection:!0,__instances=new Map,[globalScope,__global]=createGlobal(options$1,__legacyMode),symbol=makeSymbol(``);function __getInstance(component){return __instances.get(component)||null}function __setInstance(component,instance){__instances.set(component,instance)}function __deleteInstance(component){__instances.delete(component)}let i18n$1={get mode(){return`composition`},async install(app,...options$2){if(app.__VUE_I18N_SYMBOL__=symbol,app.provide(app.__VUE_I18N_SYMBOL__,i18n$1),isPlainObject(options$2[0])){let opts=options$2[0];i18n$1.__composerExtend=opts.__composerExtend,i18n$1.__vueI18nExtend=opts.__vueI18nExtend}let globalReleaseHandler=null;__globalInjection&&(globalReleaseHandler=injectGlobalFields(app,i18n$1.global)),apply(app,i18n$1,...options$2);let unmountApp=app.unmount;app.unmount=()=>{globalReleaseHandler&&globalReleaseHandler(),i18n$1.dispose(),unmountApp()}},get global(){return __global},dispose(){globalScope.stop()},__instances,__getInstance,__setInstance,__deleteInstance};return i18n$1}function useI18n(options$1={}){let instance=getCurrentInstance();if(instance==null)throw createI18nError(I18nErrorCodes.MUST_BE_CALL_SETUP_TOP);if(!instance.isCE&&instance.appContext.app!=null&&!instance.appContext.app.__VUE_I18N_SYMBOL__)throw createI18nError(I18nErrorCodes.NOT_INSTALLED);let i18n$1=getI18nInstance(instance),gl=getGlobalComposer(i18n$1),componentOptions=getComponentOptions(instance),scope=getScope(options$1,componentOptions);if(scope===`global`)return adjustI18nResources(gl,options$1,componentOptions),gl;if(scope===`parent`){let composer$1=getComposer(i18n$1,instance,options$1.__useComponent);return composer$1??=gl,composer$1}let i18nInternal=i18n$1,composer=i18nInternal.__getInstance(instance);if(composer==null){let composerOptions=assign({},options$1);`__i18n`in componentOptions&&(composerOptions.__i18n=componentOptions.__i18n),gl&&(composerOptions.__root=gl),composer=createComposer(composerOptions),i18nInternal.__composerExtend&&(composer[DisposeSymbol]=i18nInternal.__composerExtend(composer)),setupLifeCycle(i18nInternal,instance,composer),i18nInternal.__setInstance(instance,composer)}return composer}function createGlobal(options$1,legacyMode){let scope=effectScope(),obj=scope.run(()=>createComposer(options$1));if(obj==null)throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);return[scope,obj]}function getI18nInstance(instance){let i18n$1=inject(instance.isCE?I18nInjectionKey:instance.appContext.app.__VUE_I18N_SYMBOL__);if(!i18n$1)throw createI18nError(instance.isCE?I18nErrorCodes.NOT_INSTALLED_WITH_PROVIDE:I18nErrorCodes.UNEXPECTED_ERROR);return i18n$1}function getScope(options$1,componentOptions){return isEmptyObject(options$1)?`__i18n`in componentOptions?`local`:`global`:options$1.useScope?options$1.useScope:`local`}function getGlobalComposer(i18n$1){return i18n$1.mode===`composition`?i18n$1.global:i18n$1.global.__composer}function getComposer(i18n$1,target$1,useComponent=!1){let composer=null,root$3=target$1.root,current=getParentComponentInstance(target$1,useComponent);for(;current!=null;){let i18nInternal=i18n$1;if(i18n$1.mode===`composition`&&(composer=i18nInternal.__getInstance(current)),composer!=null||root$3===current)break;current=current.parent}return composer}function getParentComponentInstance(target$1,useComponent=!1){return target$1==null?null:useComponent&&target$1.vnode.ctx||target$1.parent}function setupLifeCycle(i18n$1,target$1,composer){let emitter=null;onMounted(()=>{},target$1),onUnmounted(()=>{let _composer=composer;i18n$1.__deleteInstance(target$1);let dispose$1=_composer[DisposeSymbol];dispose$1&&(dispose$1(),delete _composer[DisposeSymbol])},target$1)}const globalExportProps=[`locale`,`fallbackLocale`,`availableLocales`],globalExportMethods=[`t`,`rt`,`d`,`n`,`tm`,`te`];function injectGlobalFields(app,composer){let i18n$1=Object.create(null);globalExportProps.forEach(prop=>{let desc=Object.getOwnPropertyDescriptor(composer,prop);if(!desc)throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);let wrap$3=isRef(desc.value)?{get(){return desc.value.value},set(val){desc.value.value=val}}:{get(){return desc.get&&desc.get()}};Object.defineProperty(i18n$1,prop,wrap$3)}),app.config.globalProperties.$i18n=i18n$1,globalExportMethods.forEach(method=>{let desc=Object.getOwnPropertyDescriptor(composer,method);if(!desc||!desc.value)throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);Object.defineProperty(app.config.globalProperties,`$${method}`,desc)});let dispose$1=()=>{delete app.config.globalProperties.$i18n,globalExportMethods.forEach(method=>{delete app.config.globalProperties[`$${method}`]})};return dispose$1}const DatetimeFormatImpl=defineComponent({name:`i18n-d`,props:assign({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},baseFormatProps),setup(props,context$1){let i18n$1=props.i18n||useI18n({useScope:props.scope,__useComponent:!0});return renderFormatter(props,context$1,DATETIME_FORMAT_OPTIONS_KEYS,(...args)=>i18n$1[DatetimePartsSymbol](...args))}}),DatetimeFormat=DatetimeFormatImpl;if(initFeatureFlags(),registerMessageCompiler(compile),registerMessageResolver(resolveValue),registerLocaleFallbacker(fallbackWithLocaleChain),__INTLIFY_PROD_DEVTOOLS__){let target$1=getGlobalThis();target$1.__INTLIFY__=!0,setDevToolsHook(target$1.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const createChatProvider=options$1=>({chat:model=>Object.assign(options$1,{model})}),createEmbedProvider=options$1=>({embed:model=>Object.assign(options$1,{model})}),createImageProvider=options$1=>({image:model=>Object.assign(options$1,{model})}),createModelProvider=options$1=>({model:()=>options$1}),createSpeechProvider=options$1=>({speech:model=>Object.assign(options$1,{model})}),createTranscriptionProvider=options$1=>({transcription:model=>Object.assign(options$1,{model})}),createMetadataProvider=(id$1,otherMeta)=>({metadata:{id:id$1,...otherMeta}}),merge$1=(...arr)=>Object.assign(arr[0],...arr.slice(1)),createAnthropic=(apiKey,baseURL=`https://api.anthropic.com/v1/`)=>merge$1(createMetadataProvider(`anthropic`),createChatProvider({apiKey,baseURL}),createModelProvider({apiKey,baseURL})),createAzure=async options$1=>{let headers=typeof options$1.apiKey==`string`?{"api-key":options$1.apiKey}:void 0,baseURL=`https://${options$1.resourceName}.services.ai.azure.com/models/`,fetch$1=async(input,init)=>{if(options$1.apiVersion!=null&&input.searchParams.set(`api-version`,options$1.apiVersion),typeof options$1.apiKey==`function`){init.headers??={};let token=`Bearer ${await options$1.apiKey()}`;Array.isArray(init.headers)?init.headers.push([`Authorization`,token]):init.headers instanceof Headers?init.headers.append(`Authorization`,token):init.headers.Authorization=token}return globalThis.fetch(input,init)};return merge$1(createMetadataProvider(`azure`),createChatProvider({baseURL,fetch:fetch$1,headers}),createEmbedProvider({baseURL,fetch:fetch$1,headers}),createSpeechProvider({baseURL,fetch:fetch$1,headers}),createTranscriptionProvider({baseURL,fetch:fetch$1,headers}),createModelProvider({baseURL,fetch:fetch$1,headers}))},createDeepSeek=(apiKey,baseURL=`https://api.deepseek.com/`)=>merge$1(createMetadataProvider(`deepseek`),createChatProvider({apiKey,baseURL}),createModelProvider({apiKey,baseURL})),createFireworks=(apiKey,baseURL=`https://api.fireworks.ai/inference/v1/`)=>merge$1(createMetadataProvider(`fireworks`),createChatProvider({apiKey,baseURL}),createEmbedProvider({apiKey,baseURL}),createModelProvider({apiKey,baseURL})),createGoogleGenerativeAI=(apiKey,baseURL=`https://generativelanguage.googleapis.com/v1beta/openai/`)=>merge$1(createMetadataProvider(`google-generative-ai`),createChatProvider({apiKey,baseURL}),createEmbedProvider({apiKey,baseURL}),createModelProvider({apiKey,baseURL})),createMistral=(apiKey,baseURL=`https://api.mistral.ai/v1/`)=>merge$1(createMetadataProvider(`mistral`),createChatProvider({apiKey,baseURL}),createEmbedProvider({apiKey,baseURL}),createModelProvider({apiKey,baseURL})),createMoonshot=(apiKey,baseURL=`https://api.moonshot.cn/v1/`)=>merge$1(createMetadataProvider(`moonshot`),createChatProvider({apiKey,baseURL}),createModelProvider({apiKey,baseURL})),createNovita=(apiKey,baseURL=`https://api.novita.ai/v3/openai/`)=>merge$1(createMetadataProvider(`novita`),createChatProvider({apiKey,baseURL}),createModelProvider({apiKey,baseURL})),createOpenAI=(apiKey,baseURL=`https://api.openai.com/v1/`)=>merge$1(createMetadataProvider(`openai`),createChatProvider({apiKey,baseURL}),createEmbedProvider({apiKey,baseURL}),createImageProvider({apiKey,baseURL}),createModelProvider({apiKey,baseURL}),createSpeechProvider({apiKey,baseURL}),createTranscriptionProvider({apiKey,baseURL})),createOpenRouter=(apiKey,baseURL=``)=>merge$1(createMetadataProvider(`openrouter`),{chat:(model,openRouterOptions)=>{let requestOptions={apiKey,baseURL,model},toOpenRouterOptions=({extraHeaders,models:models$1,provider})=>{extraHeaders!=null&&(requestOptions.headers??={},Object.assign(requestOptions.headers,extraHeaders));let transformedProvider;return provider!=null&&(transformedProvider=objCamelToSnake$1(provider)),objCamelToSnake$1({models:models$1,provider:transformedProvider})};return{...openRouterOptions?toOpenRouterOptions(openRouterOptions):{},...requestOptions}}},createModelProvider({apiKey,baseURL})),createPerplexity=(apiKey,baseURL=`https://api.perplexity.ai/`)=>merge$1(createMetadataProvider(`perplexity`),createChatProvider({apiKey,baseURL})),createTogetherAI=(apiKey,baseURL=`https://api.together.xyz/v1/`)=>merge$1(createMetadataProvider(`together-ai`),createChatProvider({apiKey,baseURL}),createEmbedProvider({apiKey,baseURL}),createModelProvider({apiKey,baseURL,fetch:async(...args)=>globalThis.fetch(...args).then(async res=>res.json()).then(data$12=>Response.json({data:data$12,object:`list`}))})),createWorkersAI=(apiKey,accountId)=>{let baseURL=`https://api.cloudflare.com/client/v4/accounts/${accountId}/ai/v1/`;return merge$1(createMetadataProvider(`workers-ai`),createChatProvider({apiKey,baseURL}),createEmbedProvider({apiKey,baseURL}))},createXAI=(apiKey,baseURL=`https://api.x.ai/v1/`)=>merge$1(createMetadataProvider(`xai`),createChatProvider({apiKey,baseURL}),createModelProvider({apiKey,baseURL})),createOllama=(baseURL=`http://localhost:11434/v1/`)=>merge$1(createMetadataProvider(`ollama`),createChatProvider({baseURL}),createEmbedProvider({baseURL}),createModelProvider({baseURL})),decodeBase64=b64=>{let binString=atob(b64),size$2=binString.length,bytes=new Uint8Array(size$2);for(let i$1=0;i$1merge$1(createMetadataProvider(`player2`),createChatProvider({baseURL,headers:{"player2-game-key":gameKey}}),createSpeechProvider({baseURL,fetch:async(input,reqInit)=>{let newUrl=`${input.toString().slice(0,-12)}tts/speak`;try{let{input:input2,response_format,speed,voice,...rest}=JSON.parse(reqInit?.body),modified={audio_format:response_format,play_in_app:!1,speed:speed??1,text:input2,voice_ids:voice==null?[]:[voice],...rest};reqInit&&(reqInit.body=JSON.stringify(modified))}catch(err){console.warn(`Could not parse body as JSON:`,err)}return globalThis.fetch(newUrl,reqInit).then(async res=>res.json()).then(json=>{let base64=json.data??``,bytes=decodeBase64(base64);return new Response(bytes,{headers:{"Content-Type":`audio/mpeg`},status:200})})},headers:{"player2-game-key":gameKey}}));async function check(){try{if(isInNodejsRuntime())return{supported:!1,isNode:!0,reason:``,fp16Supported:!1};if(typeof navigator>`u`||!navigator.gpu)return{supported:!1,isNode:!1,reason:`WebGPU is not available (navigator.gpu is undefined)`,fp16Supported:!1};let adapter=await navigator.gpu.requestAdapter();return adapter?{supported:!0,isNode:!1,reason:``,adapter,fp16Supported:adapter.features.has(`shader-f16`)}:{supported:!1,isNode:!1,reason:`WebGPU is not supported (no adapter found)`,fp16Supported:!1}}catch(error){let errorMessage=error instanceof Error?error.toString():String(error);return{supported:!1,isNode:!1,reason:errorMessage,fp16Supported:!1}}}function isInNodejsRuntime(){return typeof process<`u`&&`versions`in process&&process.versions!=null&&typeof process.versions==`object`&&`node`in process.versions&&process.versions.node!=null}async function isWebGPUSupported(){return check().then(result=>result.supported)}const merge=(...arr)=>Object.assign(arr[0],...arr.slice(1));var XSAIError=class extends Error{response;constructor(message$1,response){super(message$1),this.name=`XSAIError`,this.response=response}};const strCamelToSnake=str=>str.replace(/[A-Z]/g,s$1=>`_${s$1.toLowerCase()}`),objCamelToSnake=obj=>Object.fromEntries(Object.entries(obj).map(([k$4,v$2])=>[strCamelToSnake(k$4),v$2])),clean$1=obj=>Object.fromEntries(Object.entries(obj).filter(([,v$2])=>v$2!==void 0)),requestHeaders$1=(headers,apiKey)=>clean$1({Authorization:apiKey===void 0?void 0:`Bearer ${apiKey}`,...headers}),requestURL$1=(path,baseURL)=>{let base=baseURL.toString();return new URL(path,base.endsWith(`/`)?base:`${base}/`)},responseCatch$1=async res=>{if(!res.ok)throw new XSAIError(`Remote sent ${res.status} response: ${await res.text()}`,res);if(!res.body)throw new XSAIError(`Response body is empty from remote server`,res);if(!(res.body instanceof ReadableStream))throw new XSAIError(`Expected Response body to be a ReadableStream, but got ${String(res.body)}; Content Type is ${res.headers.get(`Content-Type`)}`,res);return res},responseJSON$1=async res=>responseCatch$1(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}`)}});var createUnElevenLabs=(apiKey,baseURL=`http://localhost:5933/v1/`)=>{let toUnSpeechOptions=({applyTextNormalization,languageCode,nextRequestIds,nextText,previousRequestIds,previousText,pronunciationDictionaryLocators,seed,voiceSettings})=>({extraBody:objCamelToSnake({applyTextNormalization,languageCode,nextRequestIds,nextText,previousRequestIds,previousText,pronunciationDictionaryLocators:pronunciationDictionaryLocators?pronunciationDictionaryLocators.map(pdl=>objCamelToSnake(pdl)):void 0,seed,voiceSettings:objCamelToSnake(voiceSettings??{similarityBoost:.75,stability:.5})})}),speechProvider={speech:(model,options$1)=>({...options$1?toUnSpeechOptions(options$1):{},apiKey,baseURL,model:`elevenlabs/${model}`})},voiceProvider={voice:options$1=>(baseURL.endsWith(`v1/`)?baseURL=baseURL.slice(0,-3):baseURL.endsWith(`v1`)&&(baseURL=baseURL.slice(0,-2)),{query:`provider=elevenlabs`,...options$1?toUnSpeechOptions(options$1):{},apiKey,baseURL})};return merge(speechProvider,voiceProvider)},createUnMicrosoft=(apiKey,baseURL=`http://localhost:5933/v1/`)=>{let toUnSpeechOptions=options$1=>{let{deploymentId,region,sampleRate}=options$1,extraBody={deploymentId,region,sampleRate};return`disableSsml`in options$1?extraBody.disableSsml=options$1.disableSsml:`lang`in options$1&&(extraBody.lang=options$1.lang,extraBody.gender=options$1.gender,extraBody.voice=options$1.voice),{extraBody:objCamelToSnake(extraBody)}},speechProvider={speech:(model,options$1)=>({...options$1?toUnSpeechOptions(options$1):{},apiKey,baseURL,model:`microsoft/${model}`})},voiceProvider={voice:options$1=>(baseURL.endsWith(`v1/`)?baseURL=baseURL.slice(0,-3):baseURL.endsWith(`v1`)&&(baseURL=baseURL.slice(0,-2)),{query:`region=${options$1?.region}&provider=microsoft`,...options$1?toUnSpeechOptions(options$1):{},apiKey,baseURL})};return merge(speechProvider,voiceProvider)},createUnVolcengine=(apiKey,baseURL=`http://localhost:5933/v1/`)=>{let toUnSpeechOptions=options$1=>{let extraBody={app:{appid:options$1.app?.appId,token:apiKey}};return options$1.app!==void 0&&(extraBody.app={...options$1.app,appid:options$1.app?.appId,token:apiKey}),options$1.user!==void 0&&(extraBody.user=options$1.user),options$1.audio!==void 0&&(extraBody.audio=options$1.audio),{extraBody:objCamelToSnake(extraBody)}},speechProvider={speech:(model,options$1)=>({...options$1?toUnSpeechOptions(options$1):{},apiKey,baseURL,model:`volcengine/${model}`})},voiceProvider={voice:options$1=>(baseURL.endsWith(`v1/`)?baseURL=baseURL.slice(0,-3):baseURL.endsWith(`v1`)&&(baseURL=baseURL.slice(0,-2)),{query:`provider=volcengine`,...options$1?toUnSpeechOptions(options$1):{},apiKey,baseURL})};return merge(speechProvider,voiceProvider)},createUnAlibabaCloud=(apiKey,baseURL=`http://localhost:5933/v1/`)=>{let toUnSpeechOptions=options$1=>{let{sampleRate,volume,rate,pitch}=options$1,extraBody={sampleRate,volume,rate,pitch};return Object.keys(extraBody).forEach(key$2=>extraBody[key$2]===void 0&&delete extraBody[key$2]),{extraBody:objCamelToSnake(extraBody)}},speechProvider={speech:(model,options$1)=>({...options$1?toUnSpeechOptions(options$1):{},apiKey,baseURL,model:`alibaba/${model}`})},voiceProvider={voice:options$1=>{let adjustedBaseURL=baseURL;return adjustedBaseURL.endsWith(`v1/`)?adjustedBaseURL=adjustedBaseURL.slice(0,-3):adjustedBaseURL.endsWith(`v1`)&&(adjustedBaseURL=adjustedBaseURL.slice(0,-2)),{query:`provider=alibaba`,...options$1?toUnSpeechOptions(options$1):{},apiKey,baseURL:adjustedBaseURL}}};return merge(speechProvider,voiceProvider)},listVoices=async options$1=>(options$1.fetch??globalThis.fetch)(requestURL$1(options$1.query?`api/voices?${options$1.query}`:`api/voices`,options$1.baseURL),{headers:requestHeaders$1({...options$1.headers},options$1.apiKey),method:`GET`,signal:options$1.abortSignal}).then(responseJSON$1).then(({voices})=>voices);const models=[{model_id:`eleven_multilingual_v2`,name:`Eleven Multilingual v2`,can_be_finetuned:!0,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!0,can_use_speaker_boost:!0,serves_pro_voices:!1,token_cost_factor:1,description:`Our most life-like, emotionally rich mode in 29 languages. Best for voice overs, audiobooks, post-production, or any other content creation needs.`,requires_alpha_access:!1,max_characters_request_free_user:1e4,max_characters_request_subscribed_user:1e4,maximum_text_length_per_request:1e4,languages:[{language_id:`en`,name:`English`},{language_id:`ja`,name:`Japanese`},{language_id:`zh`,name:`Chinese`},{language_id:`de`,name:`German`},{language_id:`hi`,name:`Hindi`},{language_id:`fr`,name:`French`},{language_id:`ko`,name:`Korean`},{language_id:`pt`,name:`Portuguese`},{language_id:`it`,name:`Italian`},{language_id:`es`,name:`Spanish`},{language_id:`id`,name:`Indonesian`},{language_id:`nl`,name:`Dutch`},{language_id:`tr`,name:`Turkish`},{language_id:`fil`,name:`Filipino`},{language_id:`pl`,name:`Polish`},{language_id:`sv`,name:`Swedish`},{language_id:`bg`,name:`Bulgarian`},{language_id:`ro`,name:`Romanian`},{language_id:`ar`,name:`Arabic`},{language_id:`cs`,name:`Czech`},{language_id:`el`,name:`Greek`},{language_id:`fi`,name:`Finnish`},{language_id:`hr`,name:`Croatian`},{language_id:`ms`,name:`Malay`},{language_id:`sk`,name:`Slovak`},{language_id:`da`,name:`Danish`},{language_id:`ta`,name:`Tamil`},{language_id:`uk`,name:`Ukrainian`},{language_id:`ru`,name:`Russian`}],model_rates:{character_cost_multiplier:1},concurrency_group:`standard`},{model_id:`eleven_flash_v2_5`,name:`Eleven Flash v2.5`,can_be_finetuned:!0,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!1,can_use_speaker_boost:!1,serves_pro_voices:!1,token_cost_factor:1,description:`Our ultra low latency model in 32 languages. Ideal for conversational use cases.`,requires_alpha_access:!1,max_characters_request_free_user:4e4,max_characters_request_subscribed_user:4e4,maximum_text_length_per_request:4e4,languages:[{language_id:`en`,name:`English`},{language_id:`ja`,name:`Japanese`},{language_id:`zh`,name:`Chinese`},{language_id:`de`,name:`German`},{language_id:`hi`,name:`Hindi`},{language_id:`fr`,name:`French`},{language_id:`ko`,name:`Korean`},{language_id:`pt`,name:`Portuguese`},{language_id:`it`,name:`Italian`},{language_id:`es`,name:`Spanish`},{language_id:`ru`,name:`Russian`},{language_id:`id`,name:`Indonesian`},{language_id:`nl`,name:`Dutch`},{language_id:`tr`,name:`Turkish`},{language_id:`fil`,name:`Filipino`},{language_id:`pl`,name:`Polish`},{language_id:`sv`,name:`Swedish`},{language_id:`bg`,name:`Bulgarian`},{language_id:`ro`,name:`Romanian`},{language_id:`ar`,name:`Arabic`},{language_id:`cs`,name:`Czech`},{language_id:`el`,name:`Greek`},{language_id:`fi`,name:`Finnish`},{language_id:`hr`,name:`Croatian`},{language_id:`ms`,name:`Malay`},{language_id:`sk`,name:`Slovak`},{language_id:`da`,name:`Danish`},{language_id:`ta`,name:`Tamil`},{language_id:`uk`,name:`Ukrainian`},{language_id:`hu`,name:`Hungarian`},{language_id:`no`,name:`Norwegian`},{language_id:`vi`,name:`Vietnamese`}],model_rates:{character_cost_multiplier:.5},concurrency_group:`turbo`},{model_id:`eleven_turbo_v2_5`,name:`Eleven Turbo v2.5`,can_be_finetuned:!0,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!1,can_use_speaker_boost:!1,serves_pro_voices:!1,token_cost_factor:1,description:`Our high quality, low latency model in 32 languages. Best for developer use cases where speed matters and you need non-English languages.`,requires_alpha_access:!1,max_characters_request_free_user:4e4,max_characters_request_subscribed_user:4e4,maximum_text_length_per_request:4e4,languages:[{language_id:`en`,name:`English`},{language_id:`ja`,name:`Japanese`},{language_id:`zh`,name:`Chinese`},{language_id:`de`,name:`German`},{language_id:`hi`,name:`Hindi`},{language_id:`fr`,name:`French`},{language_id:`ko`,name:`Korean`},{language_id:`pt`,name:`Portuguese`},{language_id:`it`,name:`Italian`},{language_id:`es`,name:`Spanish`},{language_id:`ru`,name:`Russian`},{language_id:`id`,name:`Indonesian`},{language_id:`nl`,name:`Dutch`},{language_id:`tr`,name:`Turkish`},{language_id:`fil`,name:`Filipino`},{language_id:`pl`,name:`Polish`},{language_id:`sv`,name:`Swedish`},{language_id:`bg`,name:`Bulgarian`},{language_id:`ro`,name:`Romanian`},{language_id:`ar`,name:`Arabic`},{language_id:`cs`,name:`Czech`},{language_id:`el`,name:`Greek`},{language_id:`fi`,name:`Finnish`},{language_id:`hr`,name:`Croatian`},{language_id:`ms`,name:`Malay`},{language_id:`sk`,name:`Slovak`},{language_id:`da`,name:`Danish`},{language_id:`ta`,name:`Tamil`},{language_id:`uk`,name:`Ukrainian`},{language_id:`vi`,name:`Vietnamese`},{language_id:`no`,name:`Norwegian`},{language_id:`hu`,name:`Hungarian`}],model_rates:{character_cost_multiplier:.5},concurrency_group:`turbo`},{model_id:`eleven_turbo_v2`,name:`Eleven Turbo v2`,can_be_finetuned:!0,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!1,can_use_speaker_boost:!1,serves_pro_voices:!1,token_cost_factor:1,description:`Our English-only, low latency model. Best for developer use cases where speed matters and you only need English. Performance is on par with Turbo v2.5.`,requires_alpha_access:!1,max_characters_request_free_user:3e4,max_characters_request_subscribed_user:3e4,maximum_text_length_per_request:3e4,languages:[{language_id:`en`,name:`English`}],model_rates:{character_cost_multiplier:.5},concurrency_group:`turbo`},{model_id:`eleven_flash_v2`,name:`Eleven Flash v2`,can_be_finetuned:!0,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!1,can_use_speaker_boost:!1,serves_pro_voices:!1,token_cost_factor:1,description:`Our ultra low latency model in english. Ideal for conversational use cases.`,requires_alpha_access:!1,max_characters_request_free_user:3e4,max_characters_request_subscribed_user:3e4,maximum_text_length_per_request:3e4,languages:[{language_id:`en`,name:`English`}],model_rates:{character_cost_multiplier:.5},concurrency_group:`turbo`},{model_id:`eleven_english_sts_v2`,name:`Eleven English v2`,can_be_finetuned:!1,can_do_text_to_speech:!1,can_do_voice_conversion:!0,can_use_style:!0,can_use_speaker_boost:!0,serves_pro_voices:!1,token_cost_factor:1,description:`Our state-of-the-art speech to speech model suitable for scenarios where you need maximum control over the content and prosody of your generations.`,requires_alpha_access:!1,max_characters_request_free_user:5e3,max_characters_request_subscribed_user:5e3,maximum_text_length_per_request:5e3,languages:[{language_id:`en`,name:`English`}],model_rates:{character_cost_multiplier:1},concurrency_group:`standard`},{model_id:`eleven_multilingual_v1`,name:`Eleven Multilingual v1`,can_be_finetuned:!1,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!1,can_use_speaker_boost:!1,serves_pro_voices:!1,token_cost_factor:1,description:`Our first Multilingual model, capability of generating speech in 10 languages. Now outclassed by Multilingual v2 (for content creation) and Turbo v2.5 (for low latency use cases).`,requires_alpha_access:!1,max_characters_request_free_user:1e4,max_characters_request_subscribed_user:1e4,maximum_text_length_per_request:1e4,languages:[{language_id:`en`,name:`English`},{language_id:`de`,name:`German`},{language_id:`pl`,name:`Polish`},{language_id:`es`,name:`Spanish`},{language_id:`it`,name:`Italian`},{language_id:`fr`,name:`French`},{language_id:`pt`,name:`Portuguese`},{language_id:`hi`,name:`Hindi`},{language_id:`ar`,name:`Arabic`}],model_rates:{character_cost_multiplier:1},concurrency_group:`standard`},{model_id:`eleven_multilingual_sts_v2`,name:`Eleven Multilingual v2`,can_be_finetuned:!0,can_do_text_to_speech:!1,can_do_voice_conversion:!0,can_use_style:!0,can_use_speaker_boost:!0,serves_pro_voices:!1,token_cost_factor:1,description:`Our cutting-edge, multilingual speech-to-speech model is designed for situations that demand unparalleled control over both the content and the prosody of the generated speech across various languages.`,requires_alpha_access:!1,max_characters_request_free_user:1e4,max_characters_request_subscribed_user:1e4,maximum_text_length_per_request:1e4,languages:[{language_id:`en`,name:`English`},{language_id:`ja`,name:`Japanese`},{language_id:`zh`,name:`Chinese`},{language_id:`de`,name:`German`},{language_id:`hi`,name:`Hindi`},{language_id:`fr`,name:`French`},{language_id:`ko`,name:`Korean`},{language_id:`pt`,name:`Portuguese`},{language_id:`it`,name:`Italian`},{language_id:`es`,name:`Spanish`},{language_id:`ru`,name:`Russian`},{language_id:`id`,name:`Indonesian`},{language_id:`nl`,name:`Dutch`},{language_id:`tr`,name:`Turkish`},{language_id:`fil`,name:`Filipino`},{language_id:`pl`,name:`Polish`},{language_id:`sv`,name:`Swedish`},{language_id:`bg`,name:`Bulgarian`},{language_id:`ro`,name:`Romanian`},{language_id:`ar`,name:`Arabic`},{language_id:`cs`,name:`Czech`},{language_id:`el`,name:`Greek`},{language_id:`fi`,name:`Finnish`},{language_id:`hr`,name:`Croatian`},{language_id:`ms`,name:`Malay`},{language_id:`sk`,name:`Slovak`},{language_id:`da`,name:`Danish`},{language_id:`ta`,name:`Tamil`},{language_id:`uk`,name:`Ukrainian`}],model_rates:{character_cost_multiplier:1},concurrency_group:`standard`},{model_id:`eleven_monolingual_v1`,name:`Eleven English v1`,can_be_finetuned:!1,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!1,can_use_speaker_boost:!1,serves_pro_voices:!1,token_cost_factor:1,description:`Our first ever text to speech model. Now outclassed by Multilingual v2 (for content creation) and Turbo v2.5 (for low latency use cases).`,requires_alpha_access:!1,max_characters_request_free_user:1e4,max_characters_request_subscribed_user:1e4,maximum_text_length_per_request:1e4,languages:[{language_id:`en`,name:`English`}],model_rates:{character_cost_multiplier:1},concurrency_group:`standard`}],useProvidersStore=defineStore(`providers`,()=>{let providerCredentials=useLocalStorage(`settings/credentials/providers`,{}),{t}=useI18n();async function fetchOpenRouterModels(config){try{let response=await fetch(`https://openrouter.ai/api/v1/models`,{headers:{Authorization:`Bearer ${config.apiKey.trim()}`,"Content-Type":`application/json`}});if(!response.ok)throw Error(`Failed to fetch OpenRouter models: ${response.statusText}`);let data$12=await response.json();return data$12.data.map(model=>({id:model.id,name:model.name||model.id,provider:`openrouter-ai`,description:model.description||``,contextLength:model.context_length,deprecated:!1}))}catch(error){throw console.error(`Error fetching OpenRouter models:`,error),error}}let providerMetadata={"openrouter-ai":{id:`openrouter-ai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.openrouter.title`,name:`OpenRouter`,descriptionKey:`settings.pages.providers.provider.openrouter.description`,description:`openrouter.ai`,icon:`i-lobe-icons:openrouter`,defaultOptions:()=>({baseUrl:`https://openrouter.ai/api/v1/`}),createProvider:async config=>createOpenRouter(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async config=>fetchOpenRouterModels(config)},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},"app-local-audio-speech":{id:`app-local-audio-speech`,category:`speech`,tasks:[`text-to-speech`,`tts`],isAvailableBy:async()=>`window`in globalThis&&globalThis.window!=null&&`__TAURI__`in globalThis.window&&globalThis.window.__TAURI__!=null,nameKey:`settings.pages.providers.provider.app-local-audio-speech.title`,name:`App (Local)`,descriptionKey:`settings.pages.providers.provider.app-local-audio-speech.description`,description:`https://github.com/huggingface/candle`,icon:`i-lobe-icons:huggingface`,defaultOptions:()=>({}),createProvider:async config=>createOpenAI(config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createOpenAI(config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`app-local-candle`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>config.baseUrl?fetch(`${config.baseUrl.trim()}models`).then(response=>response.ok).catch(()=>!1):!1}},"app-local-audio-transcription":{id:`app-local-audio-transcription`,category:`transcription`,tasks:[`speech-to-text`,`automatic-speech-recognition`,`asr`,`stt`],isAvailableBy:async()=>`window`in globalThis&&globalThis.window!=null&&`__TAURI__`in globalThis.window&&globalThis.window.__TAURI__!=null,nameKey:`settings.pages.providers.provider.app-local-audio-transcription.title`,name:`App (Local)`,descriptionKey:`settings.pages.providers.provider.app-local-audio-transcription.description`,description:`https://github.com/huggingface/candle`,icon:`i-lobe-icons:huggingface`,defaultOptions:()=>({}),createProvider:async config=>createOpenAI(config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createOpenAI(config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`app-local-candle`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>config.baseUrl?fetch(`${config.baseUrl.trim()}models`).then(response=>response.ok).catch(()=>!1):!1}},"browser-local-audio-speech":{id:`browser-local-audio-speech`,category:`speech`,tasks:[`text-to-speech`,`tts`],isAvailableBy:async()=>{let webGPUAvailable=await isWebGPUSupported();if(webGPUAvailable)return!0;if(`navigator`in globalThis&&globalThis.navigator!=null&&`deviceMemory`in globalThis.navigator&&typeof globalThis.navigator.deviceMemory==`number`){let memory=globalThis.navigator.deviceMemory;if(memory>=8)return!0}return!1},nameKey:`settings.pages.providers.provider.browser-local-audio-speech.title`,name:`Browser (Local)`,descriptionKey:`settings.pages.providers.provider.browser-local-audio-speech.description`,description:`https://github.com/moeru-ai/xsai-transformers`,icon:`i-lobe-icons:huggingface`,defaultOptions:()=>({}),createProvider:async config=>createOpenAI(config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createOpenAI(config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`browser-local-transformers`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>config.baseUrl?fetch(`${config.baseUrl.trim()}models`).then(response=>response.ok).catch(()=>!1):!1}},"browser-local-audio-transcription":{id:`browser-local-audio-transcription`,category:`transcription`,tasks:[`speech-to-text`,`automatic-speech-recognition`,`asr`,`stt`],isAvailableBy:async()=>{let webGPUAvailable=await isWebGPUSupported();if(webGPUAvailable)return!0;if(`navigator`in globalThis&&globalThis.navigator!=null&&`deviceMemory`in globalThis.navigator&&typeof globalThis.navigator.deviceMemory==`number`){let memory=globalThis.navigator.deviceMemory;if(memory>=8)return!0}return!1},nameKey:`settings.pages.providers.provider.browser-local-audio-transcription.title`,name:`Browser (Local)`,descriptionKey:`settings.pages.providers.provider.browser-local-audio-transcription.description`,description:`https://github.com/moeru-ai/xsai-transformers`,icon:`i-lobe-icons:huggingface`,defaultOptions:()=>({}),createProvider:async config=>createOpenAI(config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createOpenAI(config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`browser-local-transformers`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>config.baseUrl?fetch(`${config.baseUrl.trim()}models`).then(response=>response.ok).catch(()=>!1):!1}},ollama:{id:`ollama`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.ollama.title`,name:`Ollama`,descriptionKey:`settings.pages.providers.provider.ollama.description`,description:`ollama.com`,icon:`i-lobe-icons:ollama`,defaultOptions:()=>({baseUrl:`http://localhost:11434/v1/`}),createProvider:async config=>createOllama(config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createOllama(config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`ollama`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>config.baseUrl?fetch(`${config.baseUrl.trim()}models`).then(response=>response.ok).catch(()=>!1):!1}},"ollama-embedding":{id:`ollama-embedding`,category:`embed`,tasks:[`text-feature-extraction`],nameKey:`settings.pages.providers.provider.ollama.title`,name:`Ollama`,descriptionKey:`settings.pages.providers.provider.ollama.description`,description:`ollama.com`,icon:`i-lobe-icons:ollama`,defaultOptions:()=>({baseUrl:`http://localhost:11434/v1/`}),createProvider:async config=>createOllama(config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createOllama(config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`ollama`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>!!config.baseUrl}},vllm:{id:`vllm`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.vllm.title`,name:`vLLM`,descriptionKey:`settings.pages.providers.provider.vllm.description`,description:`vllm.ai`,iconColor:`i-lobe-icons:vllm`,createProvider:async config=>createOllama(config.baseUrl.trim()),capabilities:{listModels:async()=>[{id:`llama-2-7b`,name:`Llama 2 (7B)`,provider:`vllm`,description:`Meta's Llama 2 7B parameter model`,contextLength:4096},{id:`llama-2-13b`,name:`Llama 2 (13B)`,provider:`vllm`,description:`Meta's Llama 2 13B parameter model`,contextLength:4096},{id:`llama-2-70b`,name:`Llama 2 (70B)`,provider:`vllm`,description:`Meta's Llama 2 70B parameter model`,contextLength:4096},{id:`mistral-7b`,name:`Mistral (7B)`,provider:`vllm`,description:`Mistral AI's 7B parameter model`,contextLength:8192},{id:`mixtral-8x7b`,name:`Mixtral (8x7B)`,provider:`vllm`,description:`Mistral AI's Mixtral 8x7B MoE model`,contextLength:32768},{id:`custom`,name:`Custom Model`,provider:`vllm`,description:`Specify a custom model name`,contextLength:0}]},validators:{validateProviderConfig:config=>!!config.baseUrl}},openai:{id:`openai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.openai.title`,name:`OpenAI`,descriptionKey:`settings.pages.providers.provider.openai.description`,description:`openai.com`,icon:`i-lobe-icons:openai`,defaultOptions:()=>({baseUrl:`https://api.openai.com/v1/`}),createProvider:async config=>createOpenAI(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createOpenAI(config.apiKey.trim(),config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`openai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},"openai-audio-speech":{id:`openai-audio-speech`,category:`speech`,tasks:[`text-to-speech`],nameKey:`settings.pages.providers.provider.openai.title`,name:`OpenAI`,descriptionKey:`settings.pages.providers.provider.openai.description`,description:`openai.com`,icon:`i-lobe-icons:openai`,defaultOptions:()=>({baseUrl:`https://api.openai.com/v1/`}),createProvider:async config=>createOpenAI(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createOpenAI(config.apiKey.trim(),config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`openai`,description:``,contextLength:0,deprecated:!1})),listVoices:async()=>[{id:`alloy`,name:`Alloy`,provider:`openai-audio-speech`,languages:[]},{id:`ash`,name:`Ash`,provider:`openai-audio-speech`,languages:[]},{id:`ballad`,name:`Ballad`,provider:`openai-audio-speech`,languages:[]},{id:`coral`,name:`Coral`,provider:`openai-audio-speech`,languages:[]},{id:`echo`,name:`Echo`,provider:`openai-audio-speech`,languages:[]},{id:`fable`,name:`Fable`,provider:`openai-audio-speech`,languages:[]},{id:`onyx`,name:`Onyx`,provider:`openai-audio-speech`,languages:[]},{id:`nova`,name:`Nova`,provider:`openai-audio-speech`,languages:[]},{id:`sage`,name:`Sage`,provider:`openai-audio-speech`,languages:[]},{id:`shimmer`,name:`Shimmer`,provider:`openai-audio-speech`,languages:[]},{id:`verse`,name:`Verse`,provider:`openai-audio-speech`,languages:[]}]},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},"openai-audio-transcription":{id:`openai-audio-transcription`,category:`transcription`,tasks:[`speech-to-text`,`automatic-speech-recognition`,`asr`,`stt`],nameKey:`settings.pages.providers.provider.openai.title`,name:`OpenAI`,descriptionKey:`settings.pages.providers.provider.openai.description`,description:`openai.com`,icon:`i-lobe-icons:openai`,defaultOptions:()=>({baseUrl:`https://api.openai.com/v1/`}),createProvider:async config=>createOpenAI(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createOpenAI(config.apiKey.trim(),config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`openai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},"azure-ai-foundry":{id:`azure-ai-foundry`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.azure_ai_foundry.title`,name:`Azure AI Foundry`,descriptionKey:`settings.pages.providers.provider.azure_ai_foundry.description`,description:`azure.com`,icon:`i-lobe-icons:microsoft`,defaultOptions:()=>({}),createProvider:async config=>await createAzure({apiKey:async()=>config.apiKey.trim(),resourceName:config.resourceName,apiVersion:config.apiVersion}),capabilities:{listModels:async config=>[{id:config.modelId}].map(model=>({id:model.id,name:model.id,provider:`azure-ai-foundry`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.resourceName&&!!config.modelId}},anthropic:{id:`anthropic`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.anthropic.title`,name:`Anthropic`,descriptionKey:`settings.pages.providers.provider.anthropic.description`,description:`anthropic.com`,icon:`i-lobe-icons:anthropic`,defaultOptions:()=>({baseUrl:`https://api.anthropic.com/v1/`}),createProvider:async config=>createAnthropic(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async()=>[{id:`claude-3-7-sonnet-20250219`,name:`Claude 3.7 Sonnet`,provider:`anthropic`,description:``,contextLength:0,deprecated:!1},{id:`claude-3-5-sonnet-20241022`,name:`Claude 3.5 Sonnet (New)`,provider:`anthropic`,description:``,contextLength:0,deprecated:!1},{id:`claude-3-5-haiku-20241022`,name:`Claude 3.5 Haiku`,provider:`anthropic`,description:``,contextLength:0,deprecated:!1},{id:`claude-3-5-sonnet-20240620`,name:`Claude 3.5 Sonnet (Old)`,provider:`anthropic`,description:``,contextLength:0,deprecated:!1},{id:`claude-3-haiku-20240307`,name:`Claude 3 Haiku`,provider:`anthropic`,description:``,contextLength:0,deprecated:!1},{id:`claude-3-opus-20240229`,name:`Claude 3 Opus`,provider:`anthropic`,description:``,contextLength:0,deprecated:!1}]},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},"google-generative-ai":{id:`google-generative-ai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.google-generative-ai.title`,name:`Google Gemini`,descriptionKey:`settings.pages.providers.provider.google-generative-ai.description`,description:`ai.google.dev`,icon:`i-lobe-icons:gemini`,defaultOptions:()=>({baseUrl:`https://generativelanguage.googleapis.com/v1beta/openai/`}),createProvider:async config=>createGoogleGenerativeAI(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createGoogleGenerativeAI(config.apiKey.trim(),config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`google-generative-ai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},xai:{id:`xai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.xai.title`,name:`xAI`,descriptionKey:`settings.pages.providers.provider.xai.description`,description:`x.ai`,icon:`i-lobe-icons:xai`,createProvider:async config=>createXAI(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createXAI(config.apiKey.trim(),config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`xai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},deepseek:{id:`deepseek`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.deepseek.title`,name:`DeepSeek`,descriptionKey:`settings.pages.providers.provider.deepseek.description`,description:`deepseek.com`,iconColor:`i-lobe-icons:deepseek`,defaultOptions:()=>({baseUrl:`https://api.deepseek.com/`}),createProvider:async config=>createDeepSeek(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createDeepSeek(config.apiKey.trim(),config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`deepseek`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},elevenlabs:{id:`elevenlabs`,category:`speech`,tasks:[`text-to-speech`],nameKey:`settings.pages.providers.provider.elevenlabs.title`,name:`ElevenLabs`,descriptionKey:`settings.pages.providers.provider.elevenlabs.description`,description:`elevenlabs.io`,icon:`i-simple-icons:elevenlabs`,defaultOptions:()=>({baseUrl:`https://unspeech.hyp3r.link/v1/`,voiceSettings:{similarityBoost:.75,stability:.5}}),createProvider:async config=>createUnElevenLabs(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async()=>models.map(model=>({id:model.model_id,name:model.name,provider:`elevenlabs`,description:model.description,contextLength:0,deprecated:!1})),listVoices:async config=>{let provider=createUnElevenLabs(config.apiKey.trim(),config.baseUrl.trim()),voices=await listVoices({...provider.voice()}),ariaIndex=voices.findIndex(voice=>voice.name.includes(`Aria`)),billIndex=voices.findIndex(voice=>voice.name.includes(`Bill`)),startIndex=ariaIndex===-1?0:ariaIndex,endIndex=billIndex===-1?voices.length-1:billIndex,lowerIndex=Math.min(startIndex,endIndex),higherIndex=Math.max(startIndex,endIndex),rearrangedVoices=[...voices.slice(0,lowerIndex),...voices.slice(higherIndex+1),...voices.slice(lowerIndex,higherIndex+1)];return rearrangedVoices.map(voice=>({id:voice.id,name:voice.name,provider:`elevenlabs`,previewURL:voice.preview_audio_url,languages:voice.languages}))}},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},"microsoft-speech":{id:`microsoft-speech`,category:`speech`,tasks:[`text-to-speech`],nameKey:`settings.pages.providers.provider.microsoft-speech.title`,name:`Microsoft / Azure Speech`,descriptionKey:`settings.pages.providers.provider.microsoft-speech.description`,description:`speech.microsoft.com`,iconColor:`i-lobe-icons:microsoft`,defaultOptions:()=>({baseUrl:`https://unspeech.hyp3r.link/v1/`}),createProvider:async config=>createUnMicrosoft(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async()=>[{id:`v1`,name:`v1`,provider:`microsoft-speech`,description:``,contextLength:0,deprecated:!1}],listVoices:async config=>{let provider=createUnMicrosoft(config.apiKey.trim(),config.baseUrl.trim()),voices=await listVoices({...provider.voice({region:config.region})});return voices.map(voice=>({id:voice.id,name:voice.name,provider:`microsoft-speech`,previewURL:voice.preview_audio_url,languages:voice.languages,gender:voice.labels?.gender}))}},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},"alibaba-cloud-model-studio":{id:`alibaba-cloud-model-studio`,category:`speech`,tasks:[`text-to-speech`],nameKey:`settings.pages.providers.provider.alibaba-cloud-model-studio.title`,name:`Alibaba Cloud Model Studio`,descriptionKey:`settings.pages.providers.provider.alibaba-cloud-model-studio.description`,description:`bailian.console.aliyun.com`,iconColor:`i-lobe-icons:alibabacloud`,defaultOptions:()=>({baseUrl:`https://unspeech.hyp3r.link/v1/`}),createProvider:async config=>createUnAlibabaCloud(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listVoices:async config=>{let provider=createUnAlibabaCloud(config.apiKey.trim(),config.baseUrl.trim()),voices=await listVoices({...provider.voice()});return voices.map(voice=>({id:voice.id,name:voice.name,provider:`alibaba-cloud-model-studio`,previewURL:voice.preview_audio_url,languages:voice.languages,gender:voice.labels?.gender}))},listModels:async()=>[{id:`cozyvoice-v1`,name:`CozyVoice`,provider:`alibaba-cloud-model-studio`,description:``,contextLength:0,deprecated:!1},{id:`cozyvoice-v2`,name:`CozyVoice (New)`,provider:`alibaba-cloud-model-studio`,description:``,contextLength:0,deprecated:!1}]},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},volcengine:{id:`volcengine`,category:`speech`,tasks:[`text-to-speech`],nameKey:`settings.pages.providers.provider.volcengine.title`,name:`settings.pages.providers.provider.volcengine.title`,descriptionKey:`settings.pages.providers.provider.volcengine.description`,description:`volcengine.com`,iconColor:`i-lobe-icons:volcengine`,defaultOptions:()=>({baseUrl:`https://unspeech.hyp3r.link/v1/`}),createProvider:async config=>createUnVolcengine(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listVoices:async config=>{let provider=createUnVolcengine(config.apiKey.trim(),config.baseUrl.trim()),voices=await listVoices({...provider.voice()});return voices.map(voice=>({id:voice.id,name:voice.name,provider:`volcano-engine`,previewURL:voice.preview_audio_url,languages:voice.languages,gender:voice.labels?.gender}))},listModels:async()=>[{id:`v1`,name:`v1`,provider:`volcano-engine`,description:``,contextLength:0,deprecated:!1}]},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl&&!!config.app&&!!config.app.appId}},"together-ai":{id:`together-ai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.together.title`,name:`Together.ai`,descriptionKey:`settings.pages.providers.provider.together.description`,description:`together.ai`,iconColor:`i-lobe-icons:together`,createProvider:async config=>createTogetherAI(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createTogetherAI(config.apiKey.trim(),config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`together-ai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},"novita-ai":{id:`novita-ai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.novita.title`,name:`Novita`,descriptionKey:`settings.pages.providers.provider.novita.description`,description:`novita.ai`,iconColor:`i-lobe-icons:novita`,createProvider:async config=>createNovita(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createNovita(config.apiKey.trim(),config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`novita-ai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},"fireworks-ai":{id:`fireworks-ai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.fireworks.title`,name:`Fireworks.ai`,descriptionKey:`settings.pages.providers.provider.fireworks.description`,description:`fireworks.ai`,icon:`i-lobe-icons:fireworks`,createProvider:async config=>createFireworks(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createFireworks(config.apiKey.trim(),config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`fireworks-ai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},"featherless-ai":{id:`featherless-ai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.featherless.title`,name:`Featherless.ai`,descriptionKey:`settings.pages.providers.provider.featherless.description`,description:`featherless.ai`,icon:`i-lobe-icons:featherless-ai`,defaultOptions:()=>({baseUrl:`https://api.featherless.ai/v1/`}),createProvider:async config=>createOpenAI(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createOpenAI(config.apiKey.trim(),config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`featherless-ai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},"cloudflare-workers-ai":{id:`cloudflare-workers-ai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.cloudflare-workers-ai.title`,name:`Cloudflare Workers AI`,descriptionKey:`settings.pages.providers.provider.cloudflare-workers-ai.description`,description:`cloudflare.com`,iconColor:`i-lobe-icons:cloudflare`,createProvider:async config=>createWorkersAI(config.apiKey.trim(),config.accountId),capabilities:{listModels:async()=>[]},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.accountId}},"perplexity-ai":{id:`perplexity-ai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.perplexity.title`,name:`Perplexity`,descriptionKey:`settings.pages.providers.provider.perplexity.description`,description:`perplexity.ai`,icon:`i-lobe-icons:perplexity`,defaultOptions:()=>({baseUrl:`https://api.perplexity.ai`}),createProvider:async config=>createPerplexity(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async()=>[{id:`sonar-small-online`,name:`Sonar Small (Online)`,provider:`perplexity-ai`,description:`Efficient model with online search capabilities`,contextLength:12e3},{id:`sonar-medium-online`,name:`Sonar Medium (Online)`,provider:`perplexity-ai`,description:`Balanced model with online search capabilities`,contextLength:12e3},{id:`sonar-large-online`,name:`Sonar Large (Online)`,provider:`perplexity-ai`,description:`Powerful model with online search capabilities`,contextLength:12e3},{id:`codey-small`,name:`Codey Small`,provider:`perplexity-ai`,description:`Specialized for code generation and understanding`,contextLength:12e3},{id:`codey-large`,name:`Codey Large`,provider:`perplexity-ai`,description:`Advanced code generation and understanding`,contextLength:12e3}]},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},"mistral-ai":{id:`mistral-ai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.mistral.title`,name:`Mistral`,descriptionKey:`settings.pages.providers.provider.mistral.description`,description:`mistral.ai`,iconColor:`i-lobe-icons:mistral`,createProvider:async config=>createMistral(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createMistral(config.apiKey.trim(),config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`mistral-ai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},"moonshot-ai":{id:`moonshot-ai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.moonshot.title`,name:`Moonshot AI`,descriptionKey:`settings.pages.providers.provider.moonshot.description`,description:`moonshot.ai`,icon:`i-lobe-icons:moonshot`,createProvider:async config=>createMoonshot(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createMoonshot(config.apiKey.trim(),config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`moonshot-ai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},player2:{id:`player2`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.player2.title`,name:`Player2`,descriptionKey:`settings.pages.providers.provider.player2.description`,description:`player2.game`,icon:`i-lobe-icons:player2`,defaultOptions:()=>({baseUrl:`http://localhost:4315/v1/`}),createProvider:config=>createPlayer2(config.baseUrl.trim()),capabilities:{listModels:async()=>[{id:`player2-model`,name:`Player2 Model`,provider:`player2`}]},validators:{validateProviderConfig:async config=>!!config.baseUrl&&await fetch(`${config.baseUrl}/health`,{method:`GET`,headers:{"player2-game-key":`airi`}}).then(response=>response.ok).catch(()=>!1)}},"player2-speech":{id:`player2-speech`,category:`speech`,tasks:[`text-to-speech`],nameKey:`settings.pages.providers.provider.player2.title`,name:`Player2 Speech`,descriptionKey:`settings.pages.providers.provider.player2.description`,description:`player2.game`,icon:`i-lobe-icons:player2`,defaultOptions:()=>({baseUrl:`http://localhost:4315/v1/`}),createProvider:async config=>createPlayer2(config.baseUrl.trim(),`airi`),capabilities:{listVoices:async()=>await fetch(`http://localhost:4315/v1/tts/voices`).then(res=>res.json()).then(({voices})=>voices.map(({id:id$1,language,name:name$2,gender})=>({id:id$1,name:name$2,provider:`player2-speech`,gender,languages:[{american_english:{code:`en`,title:`English`},british_english:{code:`en`,title:`English`},japanese:{code:`ja`,title:`Japanese`},mandarin_chinese:{code:`zh`,title:`Chinese`},spanish:{code:`es`,title:`Spanish`},french:{code:`fr`,title:`French`},hindi:{code:`hi`,title:`Hindi`},italian:{code:`it`,title:`Italian`},brazilian_portuguese:{code:`pt`,title:`Portuguese`}}[language]]})))},validators:{validateProviderConfig:config=>!!config.baseUrl}}};async function validateProvider(providerId){let config=providerCredentials.value[providerId];if(!config)return!1;let metadata=providerMetadata[providerId];return metadata?await metadata.validators.validateProviderConfig(config):!1}let configuredProviders=ref({});function initializeProvider(providerId){if(!providerCredentials.value[providerId]){let metadata=providerMetadata[providerId],defaultOptions=metadata.defaultOptions?.()||{};providerCredentials.value[providerId]={baseUrl:defaultOptions.baseUrl||``}}}Object.keys(providerMetadata).forEach(initializeProvider);async function updateConfigurationStatus(){await Promise.all(Object.keys(providerMetadata).map(async providerId=>{configuredProviders.value[providerId]=await validateProvider(providerId)}))}updateConfigurationStatus(),watch(providerCredentials,updateConfigurationStatus,{deep:!0});let availableProviders=computed(()=>Object.keys(providerMetadata).filter(providerId=>configuredProviders.value[providerId])),availableModels=ref({}),isLoadingModels=ref({}),modelLoadError=ref({});async function fetchModelsForProvider(providerId){let config=providerCredentials.value[providerId];if(!config)return[];let metadata=providerMetadata[providerId];if(!metadata)return[];isLoadingModels.value[providerId]=!0,modelLoadError.value[providerId]=null;try{let models$1=metadata.capabilities.listModels?await metadata.capabilities.listModels(config):[];return availableModels.value[providerId]=models$1.map(model=>({id:model.id,name:model.name,description:model.description,contextLength:model.contextLength,deprecated:model.deprecated,provider:providerId})),availableModels.value[providerId]}catch(error){return console.error(`Error fetching models for ${providerId}:`,error),modelLoadError.value[providerId]=error instanceof Error?error.message:`Unknown error`,[]}finally{isLoadingModels.value[providerId]=!1}}function getModelsForProvider(providerId){return availableModels.value[providerId]||[]}let allAvailableModels=computed(()=>{let models$1=[];for(let providerId of availableProviders.value)models$1.push(...availableModels.value[providerId]||[]);return models$1});async function loadModelsForConfiguredProviders(){for(let providerId of availableProviders.value)providerMetadata[providerId].capabilities.listModels&&await fetchModelsForProvider(providerId)}function getProviderMetadata(providerId){let metadata=providerMetadata[providerId];if(!metadata)throw Error(`Provider metadata for ${providerId} not found`);return{...metadata,localizedName:t(metadata.nameKey,metadata.name),localizedDescription:t(metadata.descriptionKey,metadata.description)}}let allProvidersMetadata=computed(()=>Object.values(providerMetadata).map(metadata=>({...metadata,localizedName:t(metadata.nameKey,metadata.name),localizedDescription:t(metadata.descriptionKey,metadata.description),configured:configuredProviders.value[metadata.id]||!1})));async function getProviderInstance(providerId){let config=providerCredentials.value[providerId];if(!config)throw Error(`Provider credentials for ${providerId} not found`);let metadata=providerMetadata[providerId];if(!metadata)throw Error(`Provider metadata for ${providerId} not found`);try{return await metadata.createProvider(config)}catch(error){throw console.error(`Error creating provider instance for ${providerId}:`,error),error}}let availableProvidersMetadata=computedAsync(async()=>{let providers=[];for(let provider of allProvidersMetadata.value){let p$5=getProviderMetadata(provider.id),isAvailableBy=p$5.isAvailableBy||(()=>!0),isAvailable=await isAvailableBy();isAvailable&&providers.push(provider)}return providers},[]),allChatProvidersMetadata=computed(()=>availableProvidersMetadata.value.filter(metadata=>metadata.category===`chat`)),allAudioSpeechProvidersMetadata=computed(()=>availableProvidersMetadata.value.filter(metadata=>metadata.category===`speech`)),allAudioTranscriptionProvidersMetadata=computed(()=>availableProvidersMetadata.value.filter(metadata=>metadata.category===`transcription`)),configuredChatProvidersMetadata=computed(()=>allChatProvidersMetadata.value.filter(metadata=>configuredProviders.value[metadata.id])),configuredSpeechProvidersMetadata=computed(()=>allAudioSpeechProvidersMetadata.value.filter(metadata=>configuredProviders.value[metadata.id])),configuredTranscriptionProvidersMetadata=computed(()=>allAudioTranscriptionProvidersMetadata.value.filter(metadata=>configuredProviders.value[metadata.id]));function getProviderConfig(providerId){return providerCredentials.value[providerId]}return{providers:providerCredentials,getProviderConfig,availableProviders,configuredProviders,providerMetadata,getProviderMetadata,allProvidersMetadata,initializeProvider,validateProvider,availableModels,isLoadingModels,modelLoadError,fetchModelsForProvider,getModelsForProvider,allAvailableModels,loadModelsForConfiguredProviders,getProviderInstance,availableProvidersMetadata,allChatProvidersMetadata,allAudioSpeechProvidersMetadata,allAudioTranscriptionProvidersMetadata,configuredChatProvidersMetadata,configuredSpeechProvidersMetadata,configuredTranscriptionProvidersMetadata}}),useConsciousnessStore=defineStore(`consciousness`,()=>{let providersStore=useProvidersStore(),activeProvider=useLocalStorage(`settings/consciousness/active-provider`,``),activeModel=useLocalStorage(`settings/consciousness/active-model`,``),activeCustomModelName=useLocalStorage(`settings/consciousness/active-custom-model`,``),expandedDescriptions=ref({}),modelSearchQuery=ref(``),supportsModelListing=computed(()=>providersStore.getProviderMetadata(activeProvider.value)?.capabilities.listModels!==void 0),providerModels=computed(()=>providersStore.getModelsForProvider(activeProvider.value)),isLoadingActiveProviderModels=computed(()=>providersStore.isLoadingModels[activeProvider.value]||!1),activeProviderModelError=computed(()=>providersStore.modelLoadError[activeProvider.value]||null),filteredModels=computed(()=>{if(!modelSearchQuery.value.trim())return providerModels.value;let query=modelSearchQuery.value.toLowerCase().trim();return providerModels.value.filter(model=>model.name.toLowerCase().includes(query)||model.id.toLowerCase().includes(query)||model.description&&model.description.toLowerCase().includes(query))});function resetModelSelection(){activeModel.value=``,activeCustomModelName.value=``,expandedDescriptions.value={},modelSearchQuery.value=``}async function loadModelsForProvider(provider){provider&&providersStore.getProviderMetadata(provider)?.capabilities.listModels!==void 0&&await providersStore.fetchModelsForProvider(provider)}async function getModelsForProvider(provider){return provider&&providersStore.getProviderMetadata(provider)?.capabilities.listModels!==void 0?providersStore.getModelsForProvider(provider):[]}let configured=computed(()=>!!activeProvider.value&&!!activeModel.value);return{configured,activeProvider,activeModel,customModelName:activeCustomModelName,expandedDescriptions,modelSearchQuery,supportsModelListing,providerModels,isLoadingActiveProviderModels,activeProviderModelError,filteredModels,resetModelSelection,loadModelsForProvider,getModelsForProvider}}),generateSpeech=async options$1=>(options$1.fetch??globalThis.fetch)(requestURL(`audio/speech`,options$1.baseURL),{body:requestBody(options$1),headers:requestHeaders({"Content-Type":`application/json`,...options$1.headers},options$1.apiKey),method:`POST`,signal:options$1.abortSignal}).then(responseCatch).then(async res=>res.arrayBuffer()),noncharacter=/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/g;function escape(value$1,subset$4,unsafe$2){let result=clean(value$1);return unsafe$2?result.replace(unsafe$2,encode):encode(result);function encode(value$2){return stringifyEntitiesLight(value$2,{subset:subset$4})}}function clean(value$1){return String(value$1||``).replace(noncharacter,``)}const unsafe$1=/]]>/g,subset$3=[`>`];function cdata(node$1){return``}function comment(node$1){return``}const subset$2=[` `,` `,` `,`"`,`&`,`'`,`/`,`<`,`=`,`>`];function name$1(value$1){return escape(value$1,subset$2)}function value(value$1,state){let result=String(value$1),quote=state.options.quote||`"`;if(state.options.quoteSmart){let other=quote===`"`?`'`:`"`;ccount(result,quote)>ccount(result,other)&&(quote=other)}return quote+escape(result,[`<`,`&`,quote])+quote}function doctype(node$1,state){let nodeName=name$1(node$1.name),pub=node$1.public,sys=node$1.system,result=``}const own$1={}.hasOwnProperty;function element(node$1,state){let nodeName=name$1(node$1.name),content$2=all(node$1,state),attributes=node$1.attributes||{},close=content$2?!1:state.options.closeEmptyElements,attrs=[],key$2;for(key$2 in attributes)if(own$1.call(attributes,key$2)){let result=attributes[key$2];result!=null&&attrs.push(name$1(key$2)+`=`+value(result,state))}return`<`+nodeName+(attrs.length===0?``:` `+attrs.join(` `))+(close?(state.options.tightClose?``:` `)+`/`:``)+`>`+content$2+(close?``:``)}const unsafe=/\?>/g,subset$1=[`>`];function instruction(node$1){let nodeName=name$1(node$1.name)||`x`,result=escape(node$1.value,subset$1,unsafe);return``}const subset=[`&`,`<`];function text(node$1){return escape(node$1.value,subset)}function raw(node$1,state){return state.options.allowDangerousXml?node$1.value:text(node$1)}const own={}.hasOwnProperty,handlers={cdata,comment,doctype,element,instruction,raw,root:all,text};function one(node$1,state){let type=node$1&&node$1.type;if(!type)throw Error("Expected node, not `"+node$1+"`");if(!own.call(handlers,type))throw Error("Cannot compile unknown node `"+type+"`");let handle$1=handlers[type],result=handle$1(node$1,state);return result}function all(parent,state){let children=parent&&parent.children||[],index$1=-1,results=[];for(;++index$1{let providersStore=useProvidersStore(),{allAudioSpeechProvidersMetadata}=storeToRefs(providersStore),activeSpeechProvider=useLocalStorage(`settings/speech/active-provider`,``),activeSpeechModel=useLocalStorage(`settings/speech/active-model`,`eleven_multilingual_v2`),activeSpeechVoiceId=useLocalStorage(`settings/speech/voice`,``),activeSpeechVoice=ref(),pitch=useLocalStorage(`settings/speech/pitch`,0),rate=useLocalStorage(`settings/speech/rate`,1),ssmlEnabled=useLocalStorage(`settings/speech/ssml-enabled`,!1),isLoadingSpeechProviderVoices=ref(!1),speechProviderError=ref(null),availableVoices=ref({}),selectedLanguage=useLocalStorage(`settings/speech/language`,`en-US`),modelSearchQuery=ref(``),availableSpeechProvidersMetadata=computed(()=>allAudioSpeechProvidersMetadata.value),supportsModelListing=computed(()=>providersStore.getProviderMetadata(activeSpeechProvider.value)?.capabilities.listModels!==void 0),providerModels=computed(()=>providersStore.getModelsForProvider(activeSpeechProvider.value)),isLoadingActiveProviderModels=computed(()=>providersStore.isLoadingModels[activeSpeechProvider.value]||!1),activeProviderModelError=computed(()=>providersStore.modelLoadError[activeSpeechProvider.value]||null),filteredModels=computed(()=>{if(!modelSearchQuery.value.trim())return providerModels.value;let query=modelSearchQuery.value.toLowerCase().trim();return providerModels.value.filter(model=>model.name.toLowerCase().includes(query)||model.id.toLowerCase().includes(query)||model.description&&model.description.toLowerCase().includes(query))}),supportsSSML=computed(()=>[`elevenlabs`,`microsoft-speech`,`azure-speech`,`google`,`alibaba-cloud-model-studio`,`volcengine`].includes(activeSpeechProvider.value));async function loadVoicesForProvider(provider){if(!provider)return[];isLoadingSpeechProviderVoices.value=!0,speechProviderError.value=null;try{let voices=await providersStore.getProviderMetadata(provider).capabilities.listVoices?.(providersStore.getProviderConfig(provider))||[];return availableVoices.value[provider]=voices,voices}catch(error){return console.error(`Error fetching voices for ${provider}:`,error),speechProviderError.value=error instanceof Error?error.message:`Unknown error`,[]}finally{isLoadingSpeechProviderVoices.value=!1}}function getVoicesForProvider(provider){return availableVoices.value[provider]||[]}watch(activeSpeechProvider,async newProvider=>{newProvider&&await loadVoicesForProvider(newProvider)}),onMounted(()=>{loadVoicesForProvider(activeSpeechProvider.value).then(()=>{activeSpeechVoiceId.value&&(activeSpeechVoice.value=availableVoices.value[activeSpeechProvider.value]?.find(voice=>voice.id===activeSpeechVoiceId.value))})}),watch(activeSpeechVoiceId,voiceId=>{voiceId&&(activeSpeechVoice.value=availableVoices.value[activeSpeechProvider.value]?.find(voice=>voice.id===voiceId))},{immediate:!0}),watch(availableVoices,voices=>{activeSpeechVoiceId.value&&(activeSpeechVoice.value=voices[activeSpeechProvider.value]?.find(voice=>voice.id===activeSpeechVoiceId.value))},{immediate:!0});async function speech(provider,model,input,voice,providerConfig={}){let response=await generateSpeech({...provider.speech(model,{...providerConfig}),input,voice});return response}function generateSSML(text$5,voice,providerConfig){let pitch$1=providerConfig?.pitch,speed=providerConfig?.speed,volume=providerConfig?.volume,prosody={pitch:pitch$1==null?void 0:pitch$1>0?`+${pitch$1}%`:`-${pitch$1}%`,rate:speed==null?void 0:speed===1?`1`:`${speed}`,volume:volume==null?void 0:volume>0?`+${volume}%`:`${volume}%`},ssmlXast=x(`speak`,{version:`1.0`,xmlns:`http://www.w3.org/2001/10/synthesis`,"xml:lang":voice.languages[0]?.code||`en-US`},[x(`voice`,{name:voice.id,gender:voice.gender||`neutral`},[Object.entries(prosody).filter(([_$2,value$1])=>value$1!=null).length>0?x(`prosody`,{pitch:pitch$1==null?void 0:pitch$1>0?`+${pitch$1}%`:`-${pitch$1}%`,rate:speed==null?void 0:speed===1?`1`:`${speed}`,volume:volume==null?void 0:volume>0?`+${volume}%`:`${volume}%`},[text$5]):text$5])]);return toXml(ssmlXast)}let configured=computed(()=>!!activeSpeechProvider.value&&!!activeSpeechModel.value&&!!activeSpeechVoiceId.value);return{configured,activeSpeechProvider,activeSpeechModel,activeSpeechVoice,activeSpeechVoiceId,pitch,rate,ssmlEnabled,selectedLanguage,isLoadingSpeechProviderVoices,speechProviderError,availableVoices,modelSearchQuery,availableSpeechProvidersMetadata,supportsSSML,supportsModelListing,providerModels,isLoadingActiveProviderModels,activeProviderModelError,filteredModels,speech,loadVoicesForProvider,getVoicesForProvider,generateSSML}}),useAiriCardStore=defineStore(`airi-card`,()=>{let cards=useLocalStorage(`airi-cards`,new Map),activeCardId=useLocalStorage(`airi-card-active-id`,`default`),activeCard=computed(()=>cards.value.get(activeCardId.value)),consciousnessStore=useConsciousnessStore(),speechStore=useSpeechStore(),{activeModel:activeConsciousnessModel}=storeToRefs(consciousnessStore),{activeSpeechVoiceId,activeSpeechModel}=storeToRefs(speechStore),addCard=card=>{let newCardId=crypto.randomUUID();return cards.value.set(newCardId,newAiriCard(card)),newCardId},removeCard=id$1=>{cards.value.delete(id$1)},getCard=id$1=>cards.value.get(id$1);function resolveAiriExtension(card){let existingExtension=`data`in card?card.data?.extensions?.airi:card.extensions?.airi,defaultModules={consciousness:{model:activeConsciousnessModel.value},speech:{model:activeSpeechModel.value,voice_id:activeSpeechVoiceId.value}};return existingExtension?{modules:{consciousness:{model:existingExtension.modules?.consciousness?.model??defaultModules.consciousness.model},speech:{model:existingExtension.modules?.speech?.model??defaultModules.speech.model,voice_id:existingExtension.modules?.speech?.voice_id??defaultModules.speech.voice_id,pitch:existingExtension.modules?.speech?.pitch,rate:existingExtension.modules?.speech?.rate,ssml:existingExtension.modules?.speech?.ssml,language:existingExtension.modules?.speech?.language},vrm:existingExtension.modules?.vrm,live2d:existingExtension.modules?.live2d},agents:existingExtension.agents??{}}:{modules:defaultModules,agents:{}}}function newAiriCard(card){if(`data`in card){let ccv3Card=card;return{name:ccv3Card.data.name,version:ccv3Card.data.character_version??`1.0.0`,description:ccv3Card.data.description??``,creator:ccv3Card.data.creator??``,notes:ccv3Card.data.creator_notes??``,notesMultilingual:ccv3Card.data.creator_notes_multilingual,personality:ccv3Card.data.personality??``,scenario:ccv3Card.data.scenario??``,greetings:[ccv3Card.data.first_mes,...ccv3Card.data.alternate_greetings??[]],greetingsGroupOnly:ccv3Card.data.group_only_greetings??[],systemPrompt:ccv3Card.data.system_prompt??``,postHistoryInstructions:ccv3Card.data.post_history_instructions??``,messageExample:ccv3Card.data.mes_example?ccv3Card.data.mes_example.split(` `).filter(Boolean).map(example=>example.split(` @@ -5052,4 +5058,4 @@ 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:`设定模型放置的空间坐标。 坐标轴已被可视化。 -`,title:`缩放与位置`,scale:`缩放`,x:`X轴偏移`,y:`Y 轴偏移`,z:`Z轴偏移`,fov:`视角调整(度)`,"rotation-y":`模型朝向(Y轴旋转)`,"camera-distance":`相机距离(画面缩放)`},"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:`你`}},tabs:{chat:`聊天`,clothes:`换装`,custom:`自定义`}},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={"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`),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$2,from)=>{to$2.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{useMessageContentQueue as $,useVRM as A,useSettings as B,useLive2d as C,useChatStore as D,useHearingStore as E,useAiriCardStore as F,useSpeechStore as G,generateSpeech as H,useConsciousnessStore as I,useProvidersStore as J,check as K,useI18n as L,ZodFirstPartyTypeKind as M,missingDependenciesUrl as N,tryImport as O,streamText as P,useWhisper as Q,useVRMEmote as R,loadVrm as S,useIdleEyeSaccades as T,useBlink as U,loadVRMAnimation as V,clipFromVRMAnimation as W,VRMUtils as X,randomSaccadeInterval as Y,randFloat as Z,lerp$1 as _,useResizeObserver as a$,useDelayMessageQueue as a1,useEmotionsMessageQueue as a2,useQueue as a3,useMicVAD as a4,useMarkdown as a5,useAudioRecorder as a6,sleep$1 as a7,merge$2 as a8,useAudioContext as a9,Callout_default as aA,TimeSeriesChart_default as aB,llmInferenceEndToken as aC,EmotionThinkMotionName as aD,EmotionNeutralMotionName as aE,EMOTION_EmotionMotionName_value as aF,EMOTION_VRMExpressionName_value as aG,Emotion as aH,formatHex as aI,ThresholdMeter_default as aJ,TestDummyMarker_default as aK,__plugin_vue_export_helper_default as aL,LevelMeter_default as aM,useRouter as aN,useRoute as aO,RouterLink as aP,RouterView as aQ,__vitePreload as aR,storeToRefs as aS,useDark as aT,breakpointsTailwind as aU,useMouse as aV,useScreenSafeArea as aW,useFileDialog as aX,useLocalStorage as aY,useObjectUrl as aZ,usePointer as a_,useSpeakingStore as aa,Dialog_default as ab,CursorFloating_default as ac,Skeleton_default as ad,Screen_default as ae,ErrorContainer_default as af,Button_default as ag,VoiceCardManySelect_default as ah,RadioCardSimple_default as ai,RadioCardManySelect_default as aj,Alert_default as ak,IconStatusItem_default as al,IconItem_default as am,Section_default as an,Select_default as ao,Option_default as ap,RoundRange_default as aq,ColorHueRange_default as ar,FieldValues_default as as,FieldSelect_default as at,FieldRange_default as au,FieldKeyValues_default as av,FieldInput_default as aw,Input_default as ax,FieldCheckbox_default as ay,PageHeader_default as az,ColorPalette_default as b,normalizeClass as b$,useDevicesList as b0,useClipboard as b1,useElementBounding as b2,useUserMedia as b3,useBreakpoints as b4,refDebounced as b5,refThrottled as b6,watchDebounced as b7,useDebounceFn as b8,until as b9,openBlock as bA,createBaseVNode as bB,KeepAlive as bC,renderList as bD,createTextVNode as bE,useTemplateRef as bF,createBlock as bG,useModel as bH,renderSlot as bI,withDirectives as bJ,onMounted as bK,resolveComponent as bL,Fragment as bM,computed as bN,nextTick as bO,defineComponent as bP,createCommentVNode as bQ,withCtx as bR,createElementBlock as bS,onUnmounted as bT,createVNode as bU,isRef as bV,toRef as bW,ref as bX,toRaw as bY,shallowRef as bZ,unref as b_,defu as ba,io$1 as bb,Vn$1 as bc,Ee$1 as bd,pe$2 as be,PerspectiveCamera as bf,Vector3 as bg,Spherical as bh,Ray as bi,MOUSE as bj,Plane as bk,Quaternion as bl,Controls as bm,TOUCH as bn,MathUtils as bo,AnimationMixer as bp,Vector2 as bq,vModelCheckbox as br,vModelSelect as bs,Transition as bt,vModelText as bu,vModelRadio as bv,withModifiers as bw,mergeModels as bx,watch as by,resolveDirective as bz,Pu as c,normalizeStyle as c0,toDisplayString as c1,__commonJSMin as c2,__export as c3,__toDynamicImportESM as c4,__require as c5,__toESM as c6,Av as d,$u as e,Tv as f,Bu as g,Nv as h,kv as i,Vv as j,Iv as k,Ov as l,nu as m,Mv as n,Fv as o,TranscriptionProviderSettings_default as p,TranscriptionPlayground_default as q,SpeechProviderSettings_default as r,SpeechPlayground_default as s,ProviderSettingsLayout_default as t,ProviderSettingsContainer_default as u,ProviderBasicSettings_default as v,ProviderBaseUrlInput_default as w,ProviderApiKeyInput_default as x,ProviderAdvancedSettings_default as y,ProviderAccountIdInput_default as z}; \ No newline at end of file +`,title:`缩放与位置`,scale:`缩放`,x:`X轴偏移`,y:`Y 轴偏移`,z:`Z轴偏移`,fov:`视角调整(度)`,"rotation-y":`模型朝向(Y轴旋转)`,"camera-distance":`相机距离(画面缩放)`},"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:`你`}},tabs:{chat:`聊天`,clothes:`换装`,custom:`自定义`}},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={"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`),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$2,from)=>{to$2.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{useDelayMessageQueue as $,useVRM as A,useSettings as B,useLive2d as C,useChatStore as D,useHearingStore as E,useAiriCardStore as F,useSpeechStore as G,generateSpeech as H,useConsciousnessStore as I,useProvidersStore as J,check as K,useI18n as L,ZodFirstPartyTypeKind as M,missingDependenciesUrl as N,tryImport as O,streamText as P,useWhisper as Q,useVRMEmote as R,loadVrm as S,clipFromVRMAnimation as T,useIdleEyeSaccades as U,useBlink as V,loadVRMAnimation as W,VRMUtils as X,randomSaccadeInterval as Y,randFloat as Z,lerp$1 as _,useLocalStorage as a$,useEmotionsMessageQueue as a1,useMessageContentQueue as a2,useQueue as a3,useMicVAD as a4,useMarkdown as a5,useAudioRecorder as a6,sleep$1 as a7,merge$2 as a8,useSpeakingStore as a9,Callout_default as aA,TimeSeriesChart_default as aB,llmInferenceEndToken as aC,EmotionThinkMotionName as aD,EmotionNeutralMotionName as aE,EMOTION_EmotionMotionName_value as aF,EMOTION_VRMExpressionName_value as aG,Emotion as aH,formatHex as aI,ThresholdMeter_default as aJ,TestDummyMarker_default as aK,__plugin_vue_export_helper_default as aL,LevelMeter_default as aM,useRouter as aN,useRoute as aO,RouterLink as aP,RouterView as aQ,__vitePreload as aR,storeToRefs as aS,useElementBounding as aT,useUserMedia as aU,useBreakpoints as aV,useDark as aW,breakpointsTailwind as aX,useScreenSafeArea as aY,useMouse as aZ,useFileDialog as a_,useAudioContext as aa,Dialog_default as ab,CursorFloating_default as ac,Skeleton_default as ad,Screen_default as ae,ErrorContainer_default as af,Button_default as ag,VoiceCardManySelect_default as ah,RadioCardSimple_default as ai,RadioCardManySelect_default as aj,Alert_default as ak,IconStatusItem_default as al,IconItem_default as am,Section_default as an,Select_default as ao,Option_default as ap,RoundRange_default as aq,ColorHueRange_default as ar,FieldValues_default as as,FieldSelect_default as at,FieldRange_default as au,FieldKeyValues_default as av,FieldInput_default as aw,Input_default as ax,FieldCheckbox_default as ay,PageHeader_default as az,ColorPalette_default as b,normalizeStyle as b$,useObjectUrl as b0,usePointer as b1,useResizeObserver as b2,useDevicesList as b3,useClipboard as b4,until as b5,refDebounced as b6,refThrottled as b7,watchDebounced as b8,useDebounceFn as b9,createBlock as bA,useModel as bB,renderSlot as bC,withDirectives as bD,onMounted as bE,resolveComponent as bF,Fragment as bG,computed as bH,nextTick as bI,defineComponent as bJ,createCommentVNode as bK,withCtx as bL,createElementBlock as bM,onUnmounted as bN,createVNode as bO,mergeModels as bP,watch as bQ,KeepAlive as bR,resolveDirective as bS,openBlock as bT,createBaseVNode as bU,isRef as bV,toRef as bW,ref as bX,toRaw as bY,shallowRef as bZ,unref as b_,defu as ba,io$1 as bb,Vn$1 as bc,Ee$1 as bd,pe$2 as be,PerspectiveCamera as bf,Spherical as bg,Vector3 as bh,Ray as bi,MOUSE as bj,Plane as bk,TOUCH as bl,Quaternion as bm,Controls as bn,MathUtils as bo,AnimationMixer as bp,Vector2 as bq,withModifiers as br,vModelCheckbox as bs,vModelSelect as bt,vModelText as bu,Transition as bv,vModelRadio as bw,renderList as bx,createTextVNode as by,useTemplateRef as bz,Fv as c,toDisplayString as c0,normalizeClass as c1,__commonJSMin as c2,__export as c3,__toDynamicImportESM as c4,__require as c5,__toESM as c6,Pu as d,Av as e,$u as f,Tv as g,Bu as h,Nv as i,kv as j,Vv as k,Iv as l,Ov as m,nu as n,Mv as o,TranscriptionProviderSettings_default as p,TranscriptionPlayground_default as q,SpeechProviderSettings_default as r,SpeechPlayground_default as s,ProviderSettingsLayout_default as t,ProviderSettingsContainer_default as u,ProviderBasicSettings_default as v,ProviderBaseUrlInput_default as w,ProviderApiKeyInput_default as x,ProviderAdvancedSettings_default as y,ProviderAccountIdInput_default as z}; \ No newline at end of file diff --git a/assets/memory-CFffyGxF.js b/assets/memory-CFffyGxF.js new file mode 100644 index 0000000000000000000000000000000000000000..c41266c24826b871bc09ccdbc9a0f014753b9e34 --- /dev/null +++ b/assets/memory-CFffyGxF.js @@ -0,0 +1 @@ +import{aA as e,bD as t,bG as n,bJ as r,bL as i,bM as a,bO as o,bS as s,bT as c,bU as l,b_ as u,by as d}from"./index-J3uhnpYL.js";import{b as f}from"./route-block-DVyt-3Cw.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=r({__name:`index`,setup(r){return(r,f)=>{let m=s(`motion`);return c(),a(n,null,[l(`div`,null,[o(u(e),{label:`In development, needs your help!`,theme:`orange`},{default:i(()=>f[0]||=[l(`div`,null,[d(` This functionality is still under development. If you have any suggestions or would like to contribute, please reach out to us on our `),l(`a`,{underline:``,"decoration-dotted":``,href:`https://github.com/moeru-ai/airi/issues`},`GitHub issues page`),d(`. The source code of this page is located at `),l(`a`,{underline:``,"decoration-dotted":``,href:`https://github.com/moeru-ai/airi/tree/main/apps/stage-web/src/pages/settings/memory/index.vue`},`here`),d(`. `)],-1)]),_:1,__:[0]})]),t((c(),a(`div`,p,f[1]||=[l(`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-DFoYeFiJ.js b/assets/memory-DFoYeFiJ.js deleted file mode 100644 index 846128abe6ac19c000e42ca1cdee7fca020b5b1f..0000000000000000000000000000000000000000 --- a/assets/memory-DFoYeFiJ.js +++ /dev/null @@ -1 +0,0 @@ -import{aA as e,bA as t,bB as n,bE as r,bJ as i,bM as a,bP as o,bR as s,bS as c,bU as l,b_ as u,bz as d}from"./index-BFym949y.js";import{b as f}from"./route-block-DVyt-3Cw.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=d(`motion`);return t(),c(a,null,[n(`div`,null,[l(u(e),{label:`In development, needs your help!`,theme:`orange`},{default:s(()=>f[0]||=[n(`div`,null,[r(` 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`),r(`. 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`),r(`. `)],-1)]),_:1,__:[0]})]),i((t(),c(`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 diff --git a/assets/memory-long-term-Bfhngu6P.js b/assets/memory-long-term-Bfhngu6P.js deleted file mode 100644 index af6046dc7cd69f9e9376d1ff1729b72feb5a1b46..0000000000000000000000000000000000000000 --- a/assets/memory-long-term-Bfhngu6P.js +++ /dev/null @@ -1 +0,0 @@ -import{bA as e,bP as t,bS as n}from"./index-BFym949y.js";import{b as r}from"./route-block-DVyt-3Cw.js";var i=t({__name:`memory-long-term`,setup(t){return(t,r)=>(e(),n(`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-DiDwEey2.js b/assets/memory-long-term-DiDwEey2.js new file mode 100644 index 0000000000000000000000000000000000000000..11010f7bb331f3708a85a4cfa85f676ade2c75a4 --- /dev/null +++ b/assets/memory-long-term-DiDwEey2.js @@ -0,0 +1 @@ +import{bJ as e,bM as t,bT as n}from"./index-J3uhnpYL.js";import{b as r}from"./route-block-DVyt-3Cw.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-short-term-ajNCalDy.js b/assets/memory-short-term-ajNCalDy.js new file mode 100644 index 0000000000000000000000000000000000000000..0cd761e45f1238e7b8df3c901cadc3c93f4ca82d --- /dev/null +++ b/assets/memory-short-term-ajNCalDy.js @@ -0,0 +1 @@ +import{bJ as e,bM as t,bT as n}from"./index-J3uhnpYL.js";import{b as r}from"./route-block-DVyt-3Cw.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/memory-short-term-cIlmNFtC.js b/assets/memory-short-term-cIlmNFtC.js deleted file mode 100644 index 1da19d10ce1d54b2ac479055d17dc3bc138f0e1a..0000000000000000000000000000000000000000 --- a/assets/memory-short-term-cIlmNFtC.js +++ /dev/null @@ -1 +0,0 @@ -import{bA as e,bP as t,bS as n}from"./index-BFym949y.js";import{b as r}from"./route-block-DVyt-3Cw.js";var i=t({__name:`memory-short-term`,setup(t){return(t,r)=>(e(),n(`div`))}});typeof r==`function`&&r(i);var a=i;export{a as default}; \ No newline at end of file diff --git a/assets/messages-CYxzuiqf.js b/assets/messages-CYxzuiqf.js deleted file mode 100644 index ef24e68d32d72d43cc6b789856310afa4c13cb06..0000000000000000000000000000000000000000 --- a/assets/messages-CYxzuiqf.js +++ /dev/null @@ -1 +0,0 @@ -import"./Basic-CcFV8fg0.js";import{b as e}from"./Textarea-DQ3UodrM.js";import{$ as t,a3 as n,aC as r,bA as i,bB as a,bD as o,bM as s,bP as c,bS as l,bU as u,bX as d,b_ as f,c1 as p}from"./index-BFym949y.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)=>(i(),l(`div`,m,[a(`div`,h,[u(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),(i(!0),l(s,null,o(b.value,e=>(i(),l(`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/messages-CgBnFGDa.js b/assets/messages-CgBnFGDa.js new file mode 100644 index 0000000000000000000000000000000000000000..aeb2c737bfb262923c0d683f71ee249d01a56212 --- /dev/null +++ b/assets/messages-CgBnFGDa.js @@ -0,0 +1 @@ +import"./Basic-Cwa2X3hA.js";import{b as e}from"./Textarea-C55W7JzB.js";import{a2 as t,a3 as n,aC as r,bG as i,bJ as a,bM as o,bO as s,bT as c,bU as l,bX as u,b_ as d,bx as f,c0 as p}from"./index-J3uhnpYL.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=a({__name:`messages`,setup(a){let y=u(``),b=u([]),x=u(!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)=>(c(),o(`div`,m,[l(`div`,h,[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`]),l(`button`,g,p(x.value?`Processing...`:`Send`),1)]),l(`div`,_,[l(`div`,v,[n[1]||=l(`h3`,{"font-normal":``},` TTS Message `,-1),(c(!0),o(i,null,f(b.value,e=>(c(),o(`div`,{key:e},[l(`div`,null,p(e),1)]))),128))])])]))}}),b=y;export{b as default}; \ No newline at end of file diff --git a/assets/microsoft-speech-C7ThD9iN.js b/assets/microsoft-speech-C7ThD9iN.js new file mode 100644 index 0000000000000000000000000000000000000000..c77c6d421db047751541b529e973acd3a7e91221 --- /dev/null +++ b/assets/microsoft-speech-C7ThD9iN.js @@ -0,0 +1 @@ +import{G as e,J as t,L as n,aS as r,au as i,aw as a,bA as o,bE as s,bH as c,bJ as l,bL as u,bO as d,bQ as f,bT as p,bU as m,bX as h,b_ as g,r as _,s as v}from"./index-J3uhnpYL.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b={flex:`~ col gap-4`},x=`microsoft-speech`,S=`v1`;var C=l({__name:`microsoft-speech`,setup(l){let{t:y}=n(),C={pitch:0,speed:1,volume:0},w=e(),T=t(),{providers:E}=r(T),D=h(0),O=h(1),k=h(0),A=c({get:()=>E.value[x]?.region,set:e=>{E.value[x]||(E.value[x]={region:`eastasia`}),E.value[x].region=e}}),j=c(()=>!!E.value[x]?.apiKey),M=c(()=>w.availableVoices[x]||[]);s(async()=>{A.value||=`eastasia`,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,t)=>(p(),o(g(_),{"provider-id":x,"default-model":S,"additional-settings":C},{"basic-settings":u(()=>[d(g(a),{modelValue:A.value,"onUpdate:modelValue":t[0]||=e=>A.value=e,label:g(y)(`settings.pages.providers.provider.microsoft-speech.fields.field.region.label`),description:g(y)(`settings.pages.providers.provider.microsoft-speech.fields.field.region.description`),placeholder:`eastasia`,required:``,type:`text`},null,8,[`modelValue`,`label`,`description`])]),"voice-settings":u(()=>[m(`div`,b,[d(g(i),{modelValue:D.value,"onUpdate:modelValue":t[1]||=e=>D.value=e,label:g(y)(`settings.pages.providers.provider.common.fields.field.pitch.label`),description:g(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`]),d(g(i),{modelValue:O.value,"onUpdate:modelValue":t[2]||=e=>O.value=e,label:g(y)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:g(y)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:2,step:.01},null,8,[`modelValue`,`label`,`description`]),d(g(i),{modelValue:k.value,"onUpdate:modelValue":t[3]||=e=>k.value=e,label:g(y)(`settings.pages.providers.provider.common.fields.field.volume.label`),description:g(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:u(()=>[d(g(v),{"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/microsoft-speech-CszGvA6L.js b/assets/microsoft-speech-CszGvA6L.js deleted file mode 100644 index 2f819f09d08aecdddfabb64e5bfe12b9a8c4c97e..0000000000000000000000000000000000000000 --- a/assets/microsoft-speech-CszGvA6L.js +++ /dev/null @@ -1 +0,0 @@ -import{G as e,J as t,L as n,aS as r,au as i,aw as a,bA as o,bB as s,bG as c,bK as l,bN as u,bP as d,bR as f,bU as p,bX as m,b_ as h,by as g,r as _,s as v}from"./index-BFym949y.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b={flex:`~ col gap-4`},x=`microsoft-speech`,S=`v1`;var C=d({__name:`microsoft-speech`,setup(d){let{t:y}=n(),C={pitch:0,speed:1,volume:0},w=e(),T=t(),{providers:E}=r(T),D=m(0),O=m(1),k=m(0),A=u({get:()=>E.value[x]?.region,set:e=>{E.value[x]||(E.value[x]={region:`eastasia`}),E.value[x].region=e}}),j=u(()=>!!E.value[x]?.apiKey),M=u(()=>w.availableVoices[x]||[]);l(async()=>{A.value||=`eastasia`,await w.loadVoicesForProvider(x)}),g([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,t)=>(o(),c(h(_),{"provider-id":x,"default-model":S,"additional-settings":C},{"basic-settings":f(()=>[p(h(a),{modelValue:A.value,"onUpdate:modelValue":t[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":f(()=>[s(`div`,b,[p(h(i),{modelValue:D.value,"onUpdate:modelValue":t[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`]),p(h(i),{modelValue:O.value,"onUpdate:modelValue":t[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`]),p(h(i),{modelValue:k.value,"onUpdate:modelValue":t[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:f(()=>[p(h(v),{"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-CbjOvuKb.js b/assets/mistral-ai-CbjOvuKb.js new file mode 100644 index 0000000000000000000000000000000000000000..34b9fcc81cda51e89ca855044a6108e72a1bd213 --- /dev/null +++ b/assets/mistral-ai-CbjOvuKb.js @@ -0,0 +1 @@ +import{J as e,L as t,aN as n,aS as r,bA as i,bE as a,bH as o,bJ as s,bL as c,bO as l,bQ as u,bT as d,b_ as f,t as p,u as m,v as h,w as g,x as _,y as v}from"./index-J3uhnpYL.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b=`mistral-ai`;var x=s({__name:`mistral-ai`,setup(s){let{t:y}=t(),x=n(),S=e(),{providers:C}=r(S),w=o(()=>S.getProviderMetadata(b)),T=o({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=o({get:()=>C.value[b]?.baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});a(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||``}),u([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)=>(d(),i(f(p),{"provider-name":w.value?.localizedName,"provider-icon-color":w.value?.iconColor,"on-back":()=>f(x).back()},{default:c(()=>[l(f(m),null,{default:c(()=>[l(f(h),{title:f(y)(`settings.pages.providers.common.section.basic.title`),description:f(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:c(()=>[l(f(_),{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`]),l(f(v),{title:f(y)(`settings.pages.providers.common.section.advanced.title`)},{default:c(()=>[l(f(g),{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/mistral-ai-PlMgYfnI.js b/assets/mistral-ai-PlMgYfnI.js deleted file mode 100644 index d804f20700cbe74ad763856f24d5b11281ce16d1..0000000000000000000000000000000000000000 --- a/assets/mistral-ai-PlMgYfnI.js +++ /dev/null @@ -1 +0,0 @@ -import{J as e,L as t,aN as n,aS as r,bA as i,bG as a,bK as o,bN as s,bP as c,bR as l,bU as u,b_ as d,by as f,t as p,u as m,v as h,w as g,x as _,y as v}from"./index-BFym949y.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b=`mistral-ai`;var x=c({__name:`mistral-ai`,setup(c){let{t:y}=t(),x=n(),S=e(),{providers:C}=r(S),w=s(()=>S.getProviderMetadata(b)),T=s({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=s({get:()=>C.value[b]?.baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});o(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||``}),f([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)=>(i(),a(d(p),{"provider-name":w.value?.localizedName,"provider-icon-color":w.value?.iconColor,"on-back":()=>d(x).back()},{default:l(()=>[u(d(m),null,{default:l(()=>[u(d(h),{title:d(y)(`settings.pages.providers.common.section.basic.title`),description:d(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:l(()=>[u(d(_),{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`]),u(d(v),{title:d(y)(`settings.pages.providers.common.section.advanced.title`)},{default:l(()=>[u(d(g),{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-C6mXogRh.js b/assets/models-C6mXogRh.js deleted file mode 100644 index b99c67165fd50f5a9b403afa19d008a4ea06845b..0000000000000000000000000000000000000000 --- a/assets/models-C6mXogRh.js +++ /dev/null @@ -1 +0,0 @@ -import{A as e,B as t,C as n,L as r,aA as i,aE as a,aH as o,aS as s,aX as c,aZ as l,ag as u,an as d,au as f,ax as p,b as m,b$ as h,bA as g,bB as _,bD as v,bE as y,bG as b,bJ as x,bM as S,bP as C,bQ as w,bR as T,bS as E,bU as D,bV as O,bX as k,b_ as A,bs as j,by as M,bz as N,c1 as P,c6 as F}from"./index-BFym949y.js";import"./import-url-browser-CzbE4_30.js";import"./duckdb-mvp-1eM9E9sB.js";import{b as I}from"./route-block-DVyt-3Cw.js";import{c as L,g as R,h as z,j as B}from"./Scenes-CZrLq5ZX.js";import{b as V}from"./browser-UfbE_1lV.js";import{b as H}from"./IconAnimation-DfKVRS59.js";import{b as U}from"./icon-animation-ChTUnIeG.js";var ee=F(z()),te=F(B());const ne={flex:``,"items-center":``,"gap-2":``},re={"font-medium":``,"font-mono":``},ie={flex:``,"gap-2":``},W=[`onUpdate:modelValue`],G=[`href`,`download`],K={flex:``,"items-center":``},q={flex:``,"items-center":``},J={flex:``,"items-center":``};var Y=C({__name:`Live2D`,props:{palette:{}},emits:[`extractColorsFromModel`,`switchToVRM`],setup(e){let{t}=r(),i=c({accept:`application/zip`}),C=n(),{modelFile:N,motionMap:F,loadSource:I,loadingModel:L,availableMotions:R,modelUrl:z,currentMotion:B,scale:V,position:H}=s(C),U=k(z.value);i.onChange(e=>{e&&e.length>0&&(F.value={},N.value=e[0],I.value=`file`,L.value=!0)}),M(L,e=>{e||I.value===`file`&&R.value.forEach(e=>{e.motionName in o?F.value[e.fileName]=e.motionName:F.value[e.fileName]=a})});async function Y(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 X(){let e=await te.default.getItem(`live2dModel`);if(!e)return;let t=await Y(e,F.value);N.value=t,I.value=`file`,L.value=!0}let Z=l(N);return(e,n)=>(g(),E(S,null,[D(A(d),{title:A(t)(`settings.live2d.switch-to-vrm.title`),icon:`i-solar:magic-stick-3-bold-duotone`,class:h([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:T(()=>[D(A(u),{variant:`secondary`,onClick:n[0]||=t=>e.$emit(`switchToVRM`)},{default:T(()=>[y(P(A(t)(`settings.live2d.switch-to-vrm.change-to-vrm`)),1)]),_:1})]),_:1},8,[`title`]),D(A(d),{title:A(t)(`settings.live2d.change-model.title`),icon:`i-solar:magic-stick-3-bold-duotone`,"inner-class":`text-sm`,class:h([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:T(()=>[D(A(u),{variant:`secondary`,onClick:n[1]||=e=>A(i).open()},{default:T(()=>[y(P(A(t)(`settings.live2d.change-model.from-file`))+`... `,1)]),_:1}),_(`div`,ne,[D(A(p),{modelValue:U.value,"onUpdate:modelValue":n[2]||=e=>U.value=e,disabled:A(L),class:`flex-1`,placeholder:A(t)(`settings.live2d.change-model.from-url-placeholder`)},null,8,[`modelValue`,`disabled`,`placeholder`]),D(A(u),{size:`sm`,variant:`secondary`,onClick:n[3]||=e=>z.value=U.value},{default:T(()=>[y(P(A(t)(`settings.live2d.change-model.from-url`)),1)]),_:1})])]),_:1},8,[`title`]),D(A(d),{title:A(t)(`settings.live2d.theme-color-from-model.title`),icon:`i-solar:magic-stick-3-bold-duotone`,"inner-class":`text-sm`,class:h([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:T(()=>[D(A(m),{class:`mb-4 mt-2`,colors:e.palette.map(e=>({hex:e,name:e})),"mx-auto":``},null,8,[`colors`]),D(A(u),{variant:`secondary`,onClick:n[4]||=t=>e.$emit(`extractColorsFromModel`)},{default:T(()=>[y(P(A(t)(`settings.live2d.theme-color-from-model.button-extract.title`)),1)]),_:1})]),_:1},8,[`title`]),A(I)===`file`?(g(),b(A(d),{key:0,title:A(t)(`settings.live2d.edit-motion-map.title`),icon:`i-solar:face-scan-circle-bold-duotone`,class:h([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:T(()=>[(g(!0),E(S,null,v(A(R),e=>(g(),E(`div`,{key:e.fileName,flex:``,"items-center":``,"justify-between":``,"text-sm":``},[_(`span`,re,P(e.fileName),1),_(`div`,ie,[x(_(`select`,{"onUpdate:modelValue":t=>A(F)[e.fileName]=t},[(g(!0),E(S,null,v(Object.keys(A(o)),e=>(g(),E(`option`,{key:e},P(e),1))),128))],8,W),[[j,A(F)[e.fileName]]]),D(A(u),{class:`form-control`,onClick:t=>B.value={group:e.motionName,index:e.motionIndex}},{default:T(()=>n[11]||=[y(` Play `)]),_:2,__:[11]},1032,[`onClick`])])]))),128)),D(A(u),{onClick:X},{default:T(()=>n[12]||=[y(` Save and patch `)]),_:1,__:[12]}),_(`a`,{"mt-2":``,block:``,href:A(Z),download:`${A(N)?.name||`live2d`}-motion-edited.zip`},[D(A(u),{"w-full":``},{default:T(()=>n[13]||=[y(`Export`)]),_:1,__:[13]})],8,G)]),_:1},8,[`title`])):w(``,!0),D(A(d),{title:A(t)(`settings.live2d.scale-and-position.title`),icon:`i-solar:scale-bold-duotone`,class:h([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:T(()=>[D(A(f),{modelValue:A(V),"onUpdate:modelValue":n[6]||=e=>O(V)?V.value=e:null,as:`div`,min:.5,max:2,step:.01,label:A(t)(`settings.live2d.scale-and-position.scale`)},{label:T(()=>[_(`div`,K,[_(`div`,null,P(A(t)(`settings.live2d.scale-and-position.scale`)),1),_(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:n[5]||=()=>V.value=1},n[14]||=[_(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)])])]),_:1},8,[`modelValue`,`label`]),D(A(f),{modelValue:A(H).x,"onUpdate:modelValue":n[8]||=e=>A(H).x=e,as:`div`,min:-100,max:100,step:1,label:A(t)(`settings.live2d.scale-and-position.x`)},{label:T(()=>[_(`div`,q,[_(`div`,null,P(A(t)(`settings.live2d.scale-and-position.x`)),1),_(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:n[7]||=()=>A(H).x=0},n[15]||=[_(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)])])]),_:1},8,[`modelValue`,`label`]),D(A(f),{modelValue:A(H).y,"onUpdate:modelValue":n[10]||=e=>A(H).y=e,as:`div`,min:-100,max:100,step:1,label:A(t)(`settings.live2d.scale-and-position.y`)},{label:T(()=>[_(`div`,J,[_(`div`,null,P(A(t)(`settings.live2d.scale-and-position.y`)),1),_(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:n[9]||=()=>A(H).y=0},n[16]||=[_(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)])])]),_:1},8,[`modelValue`,`label`])]),_:1},8,[`title`])],64))}}),X=Y;const Z={flex:``,"items-center":``,"gap-2":``},ae={class:`text-sm text-neutral-600 space-y-1`},oe={class:`flex justify-between`},se={class:`flex justify-between`},ce={class:`flex justify-between`},le={class:`text-sm text-neutral-600 space-y-1`},ue={flex:``,"items-center":``},de={flex:``,"items-center":``},fe={flex:``,"items-center":``},pe={flex:``,"items-center":``},me={flex:``,"items-center":``},he={flex:``,"items-center":``};var Q=C({__name:`VRM`,props:{palette:{}},emits:[`extractColorsFromModel`,`switchToLive2D`],setup(t){let{t:n}=r(),a=c({accept:`.vrm`}),o=e(),{modelFile:l,loadSource:v,loadingModel:b,modelUrl:x,modelSize:C,modelOffset:w,cameraFOV:j,selectedModel:M,modelRotationY:N,cameraDistance:F}=s(o),I=k(x.value);a.onChange(e=>{e&&e.length>0&&(l.value=e[0],v.value=`file`,b.value=!0,I.value=``)});function L(){if(x.value=I.value,x.value===M.value){console.warn(`Model URL is the same as the selected model, no need to reload.`);return}if(!x.value&&M.value===o.defaultModelUrl){I.value=o.defaultModelUrl;return}v.value=`url`,b.value=!0,I.value=M.value}function R(){let e=j.value/2*Math.PI/180;F.value=C.value.y/3/Math.tan(e)}return(e,t)=>(g(),E(S,null,[D(A(d),{title:A(n)(`settings.vrm.switch-to-vrm.title`),icon:`i-solar:magic-stick-3-bold-duotone`,class:h([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:T(()=>[D(A(u),{variant:`secondary`,onClick:t[0]||=t=>e.$emit(`switchToLive2D`)},{default:T(()=>[y(P(A(n)(`settings.vrm.switch-to-vrm.change-to-vrm`)),1)]),_:1})]),_:1},8,[`title`]),D(A(d),{title:A(n)(`settings.vrm.change-model.title`),icon:`i-solar:magic-stick-3-bold-duotone`,"inner-class":`text-sm`,class:h([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:T(()=>[D(A(u),{variant:`secondary`,onClick:t[1]||=()=>{A(a).reset(),A(a).open()}},{default:T(()=>[y(P(A(n)(`settings.vrm.change-model.from-file`))+`... `,1)]),_:1}),_(`div`,Z,[D(A(p),{modelValue:I.value,"onUpdate:modelValue":t[2]||=e=>I.value=e,disabled:A(b),class:`flex-1`,placeholder:A(n)(`settings.vrm.change-model.from-url-placeholder`)},null,8,[`modelValue`,`disabled`,`placeholder`]),D(A(u),{size:`sm`,variant:`secondary`,onClick:L},{default:T(()=>[y(P(A(n)(`settings.vrm.change-model.from-url`)),1)]),_:1})])]),_:1},8,[`title`]),D(A(d),{title:A(n)(`settings.vrm.theme-color-from-model.title`),icon:`i-solar:magic-stick-3-bold-duotone`,"inner-class":`text-sm`,class:h([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:T(()=>[D(A(m),{class:`mb-4 mt-2`,colors:e.palette.map(e=>({hex:e,name:e})),"mx-auto":``},null,8,[`colors`]),D(A(u),{variant:`secondary`,onClick:t[3]||=t=>e.$emit(`extractColorsFromModel`)},{default:T(()=>[y(P(A(n)(`settings.vrm.theme-color-from-model.button-extract.title`)),1)]),_:1})]),_:1},8,[`title`]),D(A(d),{title:A(n)(`settings.vrm.scale-and-position.title`),icon:`i-solar:scale-bold-duotone`,class:h([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:T(()=>[D(A(i),{label:A(n)(`settings.vrm.scale-and-position.model-info-title`)},{default:T(()=>[_(`div`,null,[_(`div`,ae,[_(`div`,oe,[_(`span`,null,P(A(n)(`settings.vrm.scale-and-position.model-info-x`)),1),_(`span`,null,P(A(C).x.toFixed(4)),1)]),_(`div`,se,[_(`span`,null,P(A(n)(`settings.vrm.scale-and-position.model-info-y`)),1),_(`span`,null,P(A(C).y.toFixed(4)),1)]),_(`div`,ce,[_(`span`,null,P(A(n)(`settings.vrm.scale-and-position.model-info-z`)),1),_(`span`,null,P(A(C).z.toFixed(4)),1)])])])]),_:1},8,[`label`]),D(A(i),{theme:`lime`,label:`Tips!`},{default:T(()=>[_(`div`,le,P(A(n)(`settings.vrm.scale-and-position.tips`)),1)]),_:1}),D(A(f),{modelValue:A(w).x,"onUpdate:modelValue":t[5]||=e=>A(w).x=e,as:`div`,min:-A(C).x*2,max:A(C).x*2,step:A(C).x/100,label:A(n)(`settings.vrm.scale-and-position.x`),"format-value":e=>e.toFixed(4)},{label:T(()=>[_(`div`,ue,[_(`div`,null,P(A(n)(`settings.vrm.scale-and-position.x`)),1),_(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:t[4]||=()=>A(w).x=0},t[15]||=[_(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)])])]),_:1},8,[`modelValue`,`min`,`max`,`step`,`label`,`format-value`]),D(A(f),{modelValue:A(w).y,"onUpdate:modelValue":t[7]||=e=>A(w).y=e,as:`div`,min:-A(C).y*2,max:A(C).y*2,step:A(C).y/100,label:A(n)(`settings.vrm.scale-and-position.y`),"format-value":e=>e.toFixed(4)},{label:T(()=>[_(`div`,de,[_(`div`,null,P(A(n)(`settings.vrm.scale-and-position.y`)),1),_(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:t[6]||=()=>A(w).y=0},t[16]||=[_(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)])])]),_:1},8,[`modelValue`,`min`,`max`,`step`,`label`,`format-value`]),D(A(f),{modelValue:A(w).y,"onUpdate:modelValue":t[9]||=e=>A(w).y=e,as:`div`,min:-A(C).z*2,max:A(C).z*2,step:A(C).z/100,label:A(n)(`settings.vrm.scale-and-position.z`),"format-value":e=>e.toFixed(4)},{label:T(()=>[_(`div`,fe,[_(`div`,null,P(A(n)(`settings.vrm.scale-and-position.z`)),1),_(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:t[8]||=()=>A(w).z=0},t[17]||=[_(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)])])]),_:1},8,[`modelValue`,`min`,`max`,`step`,`label`,`format-value`]),D(A(f),{"model-value":A(j),as:`div`,min:1,max:180,step:1,label:A(n)(`settings.vrm.scale-and-position.fov`),"onUpdate:modelValue":t[11]||=e=>j.value=e},{label:T(()=>[_(`div`,pe,[_(`div`,null,P(A(n)(`settings.vrm.scale-and-position.fov`)),1),_(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:t[10]||=()=>j.value=40},t[18]||=[_(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)])])]),_:1},8,[`model-value`,`label`]),D(A(f),{modelValue:A(F),"onUpdate:modelValue":t[12]||=e=>O(F)?F.value=e:null,as:`div`,min:A(C).z,max:A(C).z*20,step:A(C).z/100,label:A(n)(`settings.vrm.scale-and-position.camera-distance`)},{label:T(()=>[_(`div`,me,[_(`div`,null,P(A(n)(`settings.vrm.scale-and-position.camera-distance`)),1),_(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:R},t[19]||=[_(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)])])]),_:1},8,[`modelValue`,`min`,`max`,`step`,`label`]),D(A(f),{"model-value":A(N),as:`div`,min:-180,max:180,step:1,label:A(n)(`settings.vrm.scale-and-position.rotation-y`),"onUpdate:modelValue":t[14]||=e=>N.value=e},{label:T(()=>[_(`div`,he,[_(`div`,null,P(A(n)(`settings.vrm.scale-and-position.rotation-y`)),1),_(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:t[13]||=()=>N.value=0},t[20]||=[_(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)])])]),_:1},8,[`model-value`,`label`])]),_:1},8,[`title`])],64))}}),ge=Q;const _e={"h-full":``,"w-full":``,"p-2":``};var ve=C({__name:`index`,props:{palette:{},live2dSceneClass:{},live2dSettingsClass:{},vrmSceneClass:{},vrmSettingsClass:{}},emits:[`extractColorsFromModel`],setup(e){let n=e,{stageView:r}=s(t());return(e,t)=>(g(),E(S,null,[A(r)===`2d`?(g(),E(S,{key:0},[_(`div`,{class:h([...n.live2dSceneClass?typeof n.live2dSceneClass==`string`?[n.live2dSceneClass]:n.live2dSceneClass:[]])},[D(R)],2),_(`div`,{flex:`~ col gap-2`,class:h([...n.live2dSettingsClass?typeof n.live2dSettingsClass==`string`?[n.live2dSettingsClass]:n.live2dSettingsClass:[]])},[D(X,{palette:e.palette,onExtractColorsFromModel:t[0]||=t=>e.$emit(`extractColorsFromModel`),onSwitchToVRM:t[1]||=e=>r.value=`3d`},null,8,[`palette`])],2)],64)):w(``,!0),A(r)===`3d`?(g(),E(S,{key:1},[_(`div`,{class:h([...n.vrmSceneClass?typeof n.vrmSceneClass==`string`?[n.vrmSceneClass]:n.vrmSceneClass:[]])},[D(L)],2),_(`div`,_e,[_(`div`,{flex:`~ col gap-2`,class:h([...n.vrmSettingsClass?typeof n.vrmSettingsClass==`string`?[n.vrmSettingsClass]:n.vrmSettingsClass:[]])},[D(ge,{palette:e.palette,onExtractColorsFromModel:t[2]||=t=>e.$emit(`extractColorsFromModel`),onSwitchToLive2D:t[3]||=e=>r.value=`2d`},null,8,[`palette`])],2)])],64)):w(``,!0)],64))}}),ye=ve;const be={flex:``,class:`relative h-full flex-col-reverse md:flex-row`},xe={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=k(),n=k([]);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 V(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}=U(`i-solar:people-nearby-bold-duotone`);return(e,t)=>{let s=N(`motion`);return g(),E(S,null,[_(`div`,be,[D(A(ye),{"live-2d-scene-class":`absolute max-h-[calc(100dvh-100px-56px)] w-full h-full`,"live-2d-settings-class":`w-100% md:w-40% lg:w-30% xl:w-30% 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-40% lg:w-30% xl:w-30% 2xl:w-30% h-fit sm:max-h-80dvh overflow-y-scroll relative`,palette:n.value,onExtractColorsFromModel:r},null,8,[`palette`])]),A(a)?(g(),b(H,{key:0,"z-index":-1,icon:A(o),"icon-size":12,duration:1e3,started:A(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`])):x((g(),E(`div`,xe,t[0]||=[_(`div`,{text:`60`,"i-solar:people-nearby-bold-duotone":``},null,-1)])),[[s]])],64)}}});typeof I==`function`&&I($);var Se=$;export{Se as default}; \ No newline at end of file diff --git a/assets/models-WA_l83eR.js b/assets/models-WA_l83eR.js new file mode 100644 index 0000000000000000000000000000000000000000..512a3f23565de0dbb3b3dd9b792be6a2cbc52e08 --- /dev/null +++ b/assets/models-WA_l83eR.js @@ -0,0 +1 @@ +import{A as e,B as t,C as n,L as r,aA as i,aE as a,aH as o,aS as s,a_ as c,ag as l,an as u,au as d,ax as f,b as p,b0 as m,bA as h,bD as g,bG as _,bJ as v,bK as y,bL as b,bM as x,bO as S,bQ as C,bS as w,bT as T,bU as E,bV as D,bX as O,b_ as k,bt as A,bx as j,by as M,c0 as N,c1 as P,c6 as F}from"./index-J3uhnpYL.js";import"./import-url-browser-BymzNjKM.js";import"./duckdb-mvp-1eM9E9sB.js";import{b as I}from"./route-block-DVyt-3Cw.js";import{c as L,g as R,h as z,j as B}from"./Scenes-CEy5mzwe.js";import{b as V}from"./browser-UfbE_1lV.js";import{b as H}from"./IconAnimation-BEHmQAW0.js";import{b as U}from"./icon-animation-kCs3SNq8.js";var ee=F(z()),te=F(B());const ne={flex:``,"items-center":``,"gap-2":``},re={"font-medium":``,"font-mono":``},ie={flex:``,"gap-2":``},W=[`onUpdate:modelValue`],G=[`href`,`download`],K={flex:``,"items-center":``},q={flex:``,"items-center":``},J={flex:``,"items-center":``};var Y=v({__name:`Live2D`,props:{palette:{}},emits:[`extractColorsFromModel`,`switchToVRM`],setup(e){let{t}=r(),i=c({accept:`application/zip`}),v=n(),{modelFile:w,motionMap:F,loadSource:I,loadingModel:L,availableMotions:R,modelUrl:z,currentMotion:B,scale:V,position:H}=s(v),U=O(z.value);i.onChange(e=>{e&&e.length>0&&(F.value={},w.value=e[0],I.value=`file`,L.value=!0)}),C(L,e=>{e||I.value===`file`&&R.value.forEach(e=>{e.motionName in o?F.value[e.fileName]=e.motionName:F.value[e.fileName]=a})});async function Y(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 X(){let e=await te.default.getItem(`live2dModel`);if(!e)return;let t=await Y(e,F.value);w.value=t,I.value=`file`,L.value=!0}let Z=m(w);return(e,n)=>(T(),x(_,null,[S(k(u),{title:k(t)(`settings.live2d.switch-to-vrm.title`),icon:`i-solar:magic-stick-3-bold-duotone`,class:P([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:b(()=>[S(k(l),{variant:`secondary`,onClick:n[0]||=t=>e.$emit(`switchToVRM`)},{default:b(()=>[M(N(k(t)(`settings.live2d.switch-to-vrm.change-to-vrm`)),1)]),_:1})]),_:1},8,[`title`]),S(k(u),{title:k(t)(`settings.live2d.change-model.title`),icon:`i-solar:magic-stick-3-bold-duotone`,"inner-class":`text-sm`,class:P([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:b(()=>[S(k(l),{variant:`secondary`,onClick:n[1]||=e=>k(i).open()},{default:b(()=>[M(N(k(t)(`settings.live2d.change-model.from-file`))+`... `,1)]),_:1}),E(`div`,ne,[S(k(f),{modelValue:U.value,"onUpdate:modelValue":n[2]||=e=>U.value=e,disabled:k(L),class:`flex-1`,placeholder:k(t)(`settings.live2d.change-model.from-url-placeholder`)},null,8,[`modelValue`,`disabled`,`placeholder`]),S(k(l),{size:`sm`,variant:`secondary`,onClick:n[3]||=e=>z.value=U.value},{default:b(()=>[M(N(k(t)(`settings.live2d.change-model.from-url`)),1)]),_:1})])]),_:1},8,[`title`]),S(k(u),{title:k(t)(`settings.live2d.theme-color-from-model.title`),icon:`i-solar:magic-stick-3-bold-duotone`,"inner-class":`text-sm`,class:P([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:b(()=>[S(k(p),{class:`mb-4 mt-2`,colors:e.palette.map(e=>({hex:e,name:e})),"mx-auto":``},null,8,[`colors`]),S(k(l),{variant:`secondary`,onClick:n[4]||=t=>e.$emit(`extractColorsFromModel`)},{default:b(()=>[M(N(k(t)(`settings.live2d.theme-color-from-model.button-extract.title`)),1)]),_:1})]),_:1},8,[`title`]),k(I)===`file`?(T(),h(k(u),{key:0,title:k(t)(`settings.live2d.edit-motion-map.title`),icon:`i-solar:face-scan-circle-bold-duotone`,class:P([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:b(()=>[(T(!0),x(_,null,j(k(R),e=>(T(),x(`div`,{key:e.fileName,flex:``,"items-center":``,"justify-between":``,"text-sm":``},[E(`span`,re,N(e.fileName),1),E(`div`,ie,[g(E(`select`,{"onUpdate:modelValue":t=>k(F)[e.fileName]=t},[(T(!0),x(_,null,j(Object.keys(k(o)),e=>(T(),x(`option`,{key:e},N(e),1))),128))],8,W),[[A,k(F)[e.fileName]]]),S(k(l),{class:`form-control`,onClick:t=>B.value={group:e.motionName,index:e.motionIndex}},{default:b(()=>n[11]||=[M(` Play `)]),_:2,__:[11]},1032,[`onClick`])])]))),128)),S(k(l),{onClick:X},{default:b(()=>n[12]||=[M(` Save and patch `)]),_:1,__:[12]}),E(`a`,{"mt-2":``,block:``,href:k(Z),download:`${k(w)?.name||`live2d`}-motion-edited.zip`},[S(k(l),{"w-full":``},{default:b(()=>n[13]||=[M(`Export`)]),_:1,__:[13]})],8,G)]),_:1},8,[`title`])):y(``,!0),S(k(u),{title:k(t)(`settings.live2d.scale-and-position.title`),icon:`i-solar:scale-bold-duotone`,class:P([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:b(()=>[S(k(d),{modelValue:k(V),"onUpdate:modelValue":n[6]||=e=>D(V)?V.value=e:null,as:`div`,min:.5,max:2,step:.01,label:k(t)(`settings.live2d.scale-and-position.scale`)},{label:b(()=>[E(`div`,K,[E(`div`,null,N(k(t)(`settings.live2d.scale-and-position.scale`)),1),E(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:n[5]||=()=>V.value=1},n[14]||=[E(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)])])]),_:1},8,[`modelValue`,`label`]),S(k(d),{modelValue:k(H).x,"onUpdate:modelValue":n[8]||=e=>k(H).x=e,as:`div`,min:-100,max:100,step:1,label:k(t)(`settings.live2d.scale-and-position.x`)},{label:b(()=>[E(`div`,q,[E(`div`,null,N(k(t)(`settings.live2d.scale-and-position.x`)),1),E(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:n[7]||=()=>k(H).x=0},n[15]||=[E(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)])])]),_:1},8,[`modelValue`,`label`]),S(k(d),{modelValue:k(H).y,"onUpdate:modelValue":n[10]||=e=>k(H).y=e,as:`div`,min:-100,max:100,step:1,label:k(t)(`settings.live2d.scale-and-position.y`)},{label:b(()=>[E(`div`,J,[E(`div`,null,N(k(t)(`settings.live2d.scale-and-position.y`)),1),E(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:n[9]||=()=>k(H).y=0},n[16]||=[E(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)])])]),_:1},8,[`modelValue`,`label`])]),_:1},8,[`title`])],64))}}),X=Y;const Z={flex:``,"items-center":``,"gap-2":``},ae={class:`text-sm text-neutral-600 space-y-1`},oe={class:`flex justify-between`},se={class:`flex justify-between`},ce={class:`flex justify-between`},le={class:`text-sm text-neutral-600 space-y-1`},ue={flex:``,"items-center":``},de={flex:``,"items-center":``},fe={flex:``,"items-center":``},pe={flex:``,"items-center":``},me={flex:``,"items-center":``},he={flex:``,"items-center":``};var Q=v({__name:`VRM`,props:{palette:{}},emits:[`extractColorsFromModel`,`switchToLive2D`],setup(t){let{t:n}=r(),a=c({accept:`.vrm`}),o=e(),{modelFile:m,loadSource:h,loadingModel:g,modelUrl:v,modelSize:y,modelOffset:C,cameraFOV:w,selectedModel:A,modelRotationY:j,cameraDistance:F}=s(o),I=O(v.value);a.onChange(e=>{e&&e.length>0&&(m.value=e[0],h.value=`file`,g.value=!0,I.value=``)});function L(){if(v.value=I.value,v.value===A.value){console.warn(`Model URL is the same as the selected model, no need to reload.`);return}if(!v.value&&A.value===o.defaultModelUrl){I.value=o.defaultModelUrl;return}h.value=`url`,g.value=!0,I.value=A.value}function R(){let e=w.value/2*Math.PI/180;F.value=y.value.y/3/Math.tan(e)}return(e,t)=>(T(),x(_,null,[S(k(u),{title:k(n)(`settings.vrm.switch-to-vrm.title`),icon:`i-solar:magic-stick-3-bold-duotone`,class:P([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:b(()=>[S(k(l),{variant:`secondary`,onClick:t[0]||=t=>e.$emit(`switchToLive2D`)},{default:b(()=>[M(N(k(n)(`settings.vrm.switch-to-vrm.change-to-vrm`)),1)]),_:1})]),_:1},8,[`title`]),S(k(u),{title:k(n)(`settings.vrm.change-model.title`),icon:`i-solar:magic-stick-3-bold-duotone`,"inner-class":`text-sm`,class:P([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:b(()=>[S(k(l),{variant:`secondary`,onClick:t[1]||=()=>{k(a).reset(),k(a).open()}},{default:b(()=>[M(N(k(n)(`settings.vrm.change-model.from-file`))+`... `,1)]),_:1}),E(`div`,Z,[S(k(f),{modelValue:I.value,"onUpdate:modelValue":t[2]||=e=>I.value=e,disabled:k(g),class:`flex-1`,placeholder:k(n)(`settings.vrm.change-model.from-url-placeholder`)},null,8,[`modelValue`,`disabled`,`placeholder`]),S(k(l),{size:`sm`,variant:`secondary`,onClick:L},{default:b(()=>[M(N(k(n)(`settings.vrm.change-model.from-url`)),1)]),_:1})])]),_:1},8,[`title`]),S(k(u),{title:k(n)(`settings.vrm.theme-color-from-model.title`),icon:`i-solar:magic-stick-3-bold-duotone`,"inner-class":`text-sm`,class:P([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:b(()=>[S(k(p),{class:`mb-4 mt-2`,colors:e.palette.map(e=>({hex:e,name:e})),"mx-auto":``},null,8,[`colors`]),S(k(l),{variant:`secondary`,onClick:t[3]||=t=>e.$emit(`extractColorsFromModel`)},{default:b(()=>[M(N(k(n)(`settings.vrm.theme-color-from-model.button-extract.title`)),1)]),_:1})]),_:1},8,[`title`]),S(k(u),{title:k(n)(`settings.vrm.scale-and-position.title`),icon:`i-solar:scale-bold-duotone`,class:P([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:b(()=>[S(k(i),{label:k(n)(`settings.vrm.scale-and-position.model-info-title`)},{default:b(()=>[E(`div`,null,[E(`div`,ae,[E(`div`,oe,[E(`span`,null,N(k(n)(`settings.vrm.scale-and-position.model-info-x`)),1),E(`span`,null,N(k(y).x.toFixed(4)),1)]),E(`div`,se,[E(`span`,null,N(k(n)(`settings.vrm.scale-and-position.model-info-y`)),1),E(`span`,null,N(k(y).y.toFixed(4)),1)]),E(`div`,ce,[E(`span`,null,N(k(n)(`settings.vrm.scale-and-position.model-info-z`)),1),E(`span`,null,N(k(y).z.toFixed(4)),1)])])])]),_:1},8,[`label`]),S(k(i),{theme:`lime`,label:`Tips!`},{default:b(()=>[E(`div`,le,N(k(n)(`settings.vrm.scale-and-position.tips`)),1)]),_:1}),S(k(d),{modelValue:k(C).x,"onUpdate:modelValue":t[5]||=e=>k(C).x=e,as:`div`,min:-k(y).x*2,max:k(y).x*2,step:k(y).x/100,label:k(n)(`settings.vrm.scale-and-position.x`),"format-value":e=>e.toFixed(4)},{label:b(()=>[E(`div`,ue,[E(`div`,null,N(k(n)(`settings.vrm.scale-and-position.x`)),1),E(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:t[4]||=()=>k(C).x=0},t[15]||=[E(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)])])]),_:1},8,[`modelValue`,`min`,`max`,`step`,`label`,`format-value`]),S(k(d),{modelValue:k(C).y,"onUpdate:modelValue":t[7]||=e=>k(C).y=e,as:`div`,min:-k(y).y*2,max:k(y).y*2,step:k(y).y/100,label:k(n)(`settings.vrm.scale-and-position.y`),"format-value":e=>e.toFixed(4)},{label:b(()=>[E(`div`,de,[E(`div`,null,N(k(n)(`settings.vrm.scale-and-position.y`)),1),E(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:t[6]||=()=>k(C).y=0},t[16]||=[E(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)])])]),_:1},8,[`modelValue`,`min`,`max`,`step`,`label`,`format-value`]),S(k(d),{modelValue:k(C).y,"onUpdate:modelValue":t[9]||=e=>k(C).y=e,as:`div`,min:-k(y).z*2,max:k(y).z*2,step:k(y).z/100,label:k(n)(`settings.vrm.scale-and-position.z`),"format-value":e=>e.toFixed(4)},{label:b(()=>[E(`div`,fe,[E(`div`,null,N(k(n)(`settings.vrm.scale-and-position.z`)),1),E(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:t[8]||=()=>k(C).z=0},t[17]||=[E(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)])])]),_:1},8,[`modelValue`,`min`,`max`,`step`,`label`,`format-value`]),S(k(d),{"model-value":k(w),as:`div`,min:1,max:180,step:1,label:k(n)(`settings.vrm.scale-and-position.fov`),"onUpdate:modelValue":t[11]||=e=>w.value=e},{label:b(()=>[E(`div`,pe,[E(`div`,null,N(k(n)(`settings.vrm.scale-and-position.fov`)),1),E(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:t[10]||=()=>w.value=40},t[18]||=[E(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)])])]),_:1},8,[`model-value`,`label`]),S(k(d),{modelValue:k(F),"onUpdate:modelValue":t[12]||=e=>D(F)?F.value=e:null,as:`div`,min:k(y).z,max:k(y).z*20,step:k(y).z/100,label:k(n)(`settings.vrm.scale-and-position.camera-distance`)},{label:b(()=>[E(`div`,me,[E(`div`,null,N(k(n)(`settings.vrm.scale-and-position.camera-distance`)),1),E(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:R},t[19]||=[E(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)])])]),_:1},8,[`modelValue`,`min`,`max`,`step`,`label`]),S(k(d),{"model-value":k(j),as:`div`,min:-180,max:180,step:1,label:k(n)(`settings.vrm.scale-and-position.rotation-y`),"onUpdate:modelValue":t[14]||=e=>j.value=e},{label:b(()=>[E(`div`,he,[E(`div`,null,N(k(n)(`settings.vrm.scale-and-position.rotation-y`)),1),E(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:t[13]||=()=>j.value=0},t[20]||=[E(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)])])]),_:1},8,[`model-value`,`label`])]),_:1},8,[`title`])],64))}}),ge=Q;const _e={"h-full":``,"w-full":``,"p-2":``};var ve=v({__name:`index`,props:{palette:{},live2dSceneClass:{},live2dSettingsClass:{},vrmSceneClass:{},vrmSettingsClass:{}},emits:[`extractColorsFromModel`],setup(e){let n=e,{stageView:r}=s(t());return(e,t)=>(T(),x(_,null,[k(r)===`2d`?(T(),x(_,{key:0},[E(`div`,{class:P([...n.live2dSceneClass?typeof n.live2dSceneClass==`string`?[n.live2dSceneClass]:n.live2dSceneClass:[]])},[S(R)],2),E(`div`,{flex:`~ col gap-2`,class:P([...n.live2dSettingsClass?typeof n.live2dSettingsClass==`string`?[n.live2dSettingsClass]:n.live2dSettingsClass:[]])},[S(X,{palette:e.palette,onExtractColorsFromModel:t[0]||=t=>e.$emit(`extractColorsFromModel`),onSwitchToVRM:t[1]||=e=>r.value=`3d`},null,8,[`palette`])],2)],64)):y(``,!0),k(r)===`3d`?(T(),x(_,{key:1},[E(`div`,{class:P([...n.vrmSceneClass?typeof n.vrmSceneClass==`string`?[n.vrmSceneClass]:n.vrmSceneClass:[]])},[S(L)],2),E(`div`,_e,[E(`div`,{flex:`~ col gap-2`,class:P([...n.vrmSettingsClass?typeof n.vrmSettingsClass==`string`?[n.vrmSettingsClass]:n.vrmSettingsClass:[]])},[S(ge,{palette:e.palette,onExtractColorsFromModel:t[2]||=t=>e.$emit(`extractColorsFromModel`),onSwitchToLive2D:t[3]||=e=>r.value=`2d`},null,8,[`palette`])],2)])],64)):y(``,!0)],64))}}),ye=ve;const be={flex:``,class:`relative h-full flex-col-reverse md:flex-row`},xe={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 $=v({__name:`index`,setup(e){let t=O(),n=O([]);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 V(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}=U(`i-solar:people-nearby-bold-duotone`);return(e,t)=>{let s=w(`motion`);return T(),x(_,null,[E(`div`,be,[S(k(ye),{"live-2d-scene-class":`absolute max-h-[calc(100dvh-100px-56px)] w-full h-full`,"live-2d-settings-class":`w-100% md:w-40% lg:w-30% xl:w-30% 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-40% lg:w-30% xl:w-30% 2xl:w-30% h-fit sm:max-h-80dvh overflow-y-scroll relative`,palette:n.value,onExtractColorsFromModel:r},null,8,[`palette`])]),k(a)?(T(),h(H,{key:0,"z-index":-1,icon:k(o),"icon-size":12,duration:1e3,started:k(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`])):g((T(),x(`div`,xe,t[0]||=[E(`div`,{text:`60`,"i-solar:people-nearby-bold-duotone":``},null,-1)])),[[s]])],64)}}});typeof I==`function`&&I($);var Se=$;export{Se as default}; \ No newline at end of file diff --git a/assets/modules-BSQfB0qf.js b/assets/modules-CMn92Qgp.js similarity index 79% rename from assets/modules-BSQfB0qf.js rename to assets/modules-CMn92Qgp.js index dd64b0182dd69a4eb27accf3388d2577c745ebe7..4cdfb9abaa59c7e062ec43a1ea34ea97190236fc 100644 --- a/assets/modules-BSQfB0qf.js +++ b/assets/modules-CMn92Qgp.js @@ -1 +1 @@ -import{G as e,I as t,L as n,al as r,bA as i,bB as a,bD as o,bG as s,bJ as c,bM as l,bN as u,bP as d,bS as f,b_ as p,bz as m}from"./index-BFym949y.js";import{b as h}from"./route-block-DVyt-3Cw.js";import{b as g}from"./IconAnimation-DfKVRS59.js";import{b as _}from"./icon-animation-ChTUnIeG.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=d({__name:`index`,setup(d){let{t:h}=n(),b=u(()=>[{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:t().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:e().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,t)=>{let n=m(`motion`);return i(),f(l,null,[a(`div`,v,[(i(!0),f(l,null,o(b.value,(e,t)=>c((i(),s(p(r),{key:e.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+t*10,delay:t*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`])),[[n]])),128))]),p(S)?(i(),s(g,{key:0,icon:p(C),"icon-size":12,duration:1e3,started:p(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`])):c((i(),f(`div`,y,t[0]||=[a(`div`,{text:`60`,"i-solar:layers-bold-duotone":``},null,-1)])),[[n]])],64)}}});typeof h==`function`&&h(b);var x=b;export{x as default}; \ No newline at end of file +import{G as e,I as t,L as n,al as r,bA as i,bD as a,bG as o,bH as s,bJ as c,bM as l,bS as u,bT as d,bU as f,b_ as p,bx as m}from"./index-J3uhnpYL.js";import{b as h}from"./route-block-DVyt-3Cw.js";import{b as g}from"./IconAnimation-BEHmQAW0.js";import{b as _}from"./icon-animation-kCs3SNq8.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=c({__name:`index`,setup(c){let{t:h}=n(),b=s(()=>[{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:t().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:e().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,t)=>{let n=u(`motion`);return d(),l(o,null,[f(`div`,v,[(d(!0),l(o,null,m(b.value,(e,t)=>a((d(),i(p(r),{key:e.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+t*10,delay:t*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`])),[[n]])),128))]),p(S)?(d(),i(g,{key:0,icon:p(C),"icon-size":12,duration:1e3,started:p(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`])):a((d(),l(`div`,y,t[0]||=[f(`div`,{text:`60`,"i-solar:layers-bold-duotone":``},null,-1)])),[[n]])],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-CFXUeFnc.js b/assets/moonshot-ai-CFXUeFnc.js new file mode 100644 index 0000000000000000000000000000000000000000..93ad70013c8ff698db352fe027742da464ded6f7 --- /dev/null +++ b/assets/moonshot-ai-CFXUeFnc.js @@ -0,0 +1 @@ +import{J as e,L as t,aN as n,aS as r,bA as i,bE as a,bH as o,bJ as s,bL as c,bO as l,bQ as u,bT as d,b_ as f,t as p,u as m,v as h,w as g,x as _,y as v}from"./index-J3uhnpYL.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b=`moonshot-ai`;var x=s({__name:`moonshot-ai`,setup(s){let{t:y}=t(),x=n(),S=e(),{providers:C}=r(S),w=o(()=>S.getProviderMetadata(b)),T=o({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=o({get:()=>C.value[b]?.baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});a(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||``}),u([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)=>(d(),i(f(p),{"provider-name":w.value?.localizedName,"provider-icon":w.value?.icon,"on-back":()=>f(x).back()},{default:c(()=>[l(f(m),null,{default:c(()=>[l(f(h),{title:f(y)(`settings.pages.providers.common.section.basic.title`),description:f(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:c(()=>[l(f(_),{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`]),l(f(v),{title:f(y)(`settings.pages.providers.common.section.advanced.title`)},{default:c(()=>[l(f(g),{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/moonshot-ai-CMPzQdws.js b/assets/moonshot-ai-CMPzQdws.js deleted file mode 100644 index 4f0c19b9fe82730c79e06d5115014ceeb57add47..0000000000000000000000000000000000000000 --- a/assets/moonshot-ai-CMPzQdws.js +++ /dev/null @@ -1 +0,0 @@ -import{J as e,L as t,aN as n,aS as r,bA as i,bG as a,bK as o,bN as s,bP as c,bR as l,bU as u,b_ as d,by as f,t as p,u as m,v as h,w as g,x as _,y as v}from"./index-BFym949y.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b=`moonshot-ai`;var x=c({__name:`moonshot-ai`,setup(c){let{t:y}=t(),x=n(),S=e(),{providers:C}=r(S),w=s(()=>S.getProviderMetadata(b)),T=s({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=s({get:()=>C.value[b]?.baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});o(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||``}),f([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)=>(i(),a(d(p),{"provider-name":w.value?.localizedName,"provider-icon":w.value?.icon,"on-back":()=>d(x).back()},{default:l(()=>[u(d(m),null,{default:l(()=>[u(d(h),{title:d(y)(`settings.pages.providers.common.section.basic.title`),description:d(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:l(()=>[u(d(_),{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`]),u(d(v),{title:d(y)(`settings.pages.providers.common.section.advanced.title`)},{default:l(()=>[u(d(g),{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-B-sn63fK.js b/assets/novita-ai-B-sn63fK.js deleted file mode 100644 index 78ff949bec39de3da8bace9bca602447ea20b045..0000000000000000000000000000000000000000 --- a/assets/novita-ai-B-sn63fK.js +++ /dev/null @@ -1 +0,0 @@ -import{J as e,L as t,aN as n,aS as r,bA as i,bG as a,bK as o,bN as s,bP as c,bR as l,bU as u,b_ as d,by as f,t as p,u as m,v as h,w as g,x as _,y as v}from"./index-BFym949y.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b=`novita-ai`;var x=c({__name:`novita-ai`,setup(c){let{t:y}=t(),x=n(),S=e(),{providers:C}=r(S),w=s(()=>S.getProviderMetadata(b)),T=s({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=s({get:()=>C.value[b]?.baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});o(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||``}),f([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)=>(i(),a(d(p),{"provider-name":w.value?.localizedName,"provider-icon-color":w.value?.iconColor,"on-back":()=>d(x).back()},{default:l(()=>[u(d(m),null,{default:l(()=>[u(d(h),{title:d(y)(`settings.pages.providers.common.section.basic.title`),description:d(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:l(()=>[u(d(_),{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`]),u(d(v),{title:d(y)(`settings.pages.providers.common.section.advanced.title`)},{default:l(()=>[u(d(g),{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/novita-ai-CDmSyd2p.js b/assets/novita-ai-CDmSyd2p.js new file mode 100644 index 0000000000000000000000000000000000000000..c703112df8900c6cacf912cda0f9c02f91a9cbc6 --- /dev/null +++ b/assets/novita-ai-CDmSyd2p.js @@ -0,0 +1 @@ +import{J as e,L as t,aN as n,aS as r,bA as i,bE as a,bH as o,bJ as s,bL as c,bO as l,bQ as u,bT as d,b_ as f,t as p,u as m,v as h,w as g,x as _,y as v}from"./index-J3uhnpYL.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b=`novita-ai`;var x=s({__name:`novita-ai`,setup(s){let{t:y}=t(),x=n(),S=e(),{providers:C}=r(S),w=o(()=>S.getProviderMetadata(b)),T=o({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=o({get:()=>C.value[b]?.baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});a(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||``}),u([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)=>(d(),i(f(p),{"provider-name":w.value?.localizedName,"provider-icon-color":w.value?.iconColor,"on-back":()=>f(x).back()},{default:c(()=>[l(f(m),null,{default:c(()=>[l(f(h),{title:f(y)(`settings.pages.providers.common.section.basic.title`),description:f(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:c(()=>[l(f(_),{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`]),l(f(v),{title:f(y)(`settings.pages.providers.common.section.advanced.title`)},{default:c(()=>[l(f(g),{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--RoUgpZl.js b/assets/ollama--RoUgpZl.js deleted file mode 100644 index 3b65a362fe50e6914eef5da28fbb3fc5e343261c..0000000000000000000000000000000000000000 --- a/assets/ollama--RoUgpZl.js +++ /dev/null @@ -1 +0,0 @@ -import{J as e,L as t,aN as n,aS as r,av as i,bA as a,bG as o,bK as s,bN as c,bP as l,bR as u,bU as d,bX as f,b_ as p,by as m,t as h,u as g,v as _,w as v,y}from"./index-BFym949y.js";import{b}from"./route-block-DVyt-3Cw.js";const x=`ollama`;var S=l({__name:`ollama`,setup(l){let{t:b}=t(),S=n(),C=e(),{providers:w}=r(C),T=c(()=>C.getProviderMetadata(x)),E=c({get:()=>w.value[x]?.baseUrl||T.value?.defaultOptions?.().baseUrl||``,set:e=>{w.value[x]||(w.value[x]={}),w.value[x].baseUrl=e}});s(()=>{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 m(O,e=>{e.length>0&&(e[e.length-1].key!==``||e[e.length-1].value!==``)&&e.push({key:``,value:``})},{deep:!0,immediate:!0}),(e,t)=>(a(),o(p(h),{"provider-name":T.value?.localizedName,"provider-icon":T.value?.icon,"on-back":()=>p(S).back()},{default:u(()=>[d(p(g),null,{default:u(()=>[d(p(_),{title:p(b)(`settings.pages.providers.common.section.basic.title`),description:p(b)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:u(()=>[d(p(v),{modelValue:E.value,"onUpdate:modelValue":t[0]||=e=>E.value=e,placeholder:T.value?.defaultOptions?.().baseUrl||``,required:``},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`title`,`description`]),d(p(y),{title:p(b)(`settings.pages.providers.common.section.advanced.title`)},{default:u(()=>[d(p(i),{modelValue:O.value,"onUpdate:modelValue":t[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:t[2]||=(e,t)=>k(O.value,e,t),onRemove:t[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/ollama-DEbOkWEd.js b/assets/ollama-DEbOkWEd.js new file mode 100644 index 0000000000000000000000000000000000000000..d55b42fea19a4855de54a2a03fff5b7850ae6c58 --- /dev/null +++ b/assets/ollama-DEbOkWEd.js @@ -0,0 +1 @@ +import{J as e,L as t,aN as n,aS as r,av as i,bA as a,bE as o,bH as s,bJ as c,bL as l,bO as u,bQ as d,bT as f,bX as p,b_ as m,t as h,u as g,v as _,w as v,y}from"./index-J3uhnpYL.js";import{b}from"./route-block-DVyt-3Cw.js";const x=`ollama`;var S=c({__name:`ollama`,setup(c){let{t:b}=t(),S=n(),C=e(),{providers:w}=r(C),T=s(()=>C.getProviderMetadata(x)),E=s({get:()=>w.value[x]?.baseUrl||T.value?.defaultOptions?.().baseUrl||``,set:e=>{w.value[x]||(w.value[x]={}),w.value[x].baseUrl=e}});o(()=>{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=p([{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 d(O,e=>{e.length>0&&(e[e.length-1].key!==``||e[e.length-1].value!==``)&&e.push({key:``,value:``})},{deep:!0,immediate:!0}),(e,t)=>(f(),a(m(h),{"provider-name":T.value?.localizedName,"provider-icon":T.value?.icon,"on-back":()=>m(S).back()},{default:l(()=>[u(m(g),null,{default:l(()=>[u(m(_),{title:m(b)(`settings.pages.providers.common.section.basic.title`),description:m(b)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:l(()=>[u(m(v),{modelValue:E.value,"onUpdate:modelValue":t[0]||=e=>E.value=e,placeholder:T.value?.defaultOptions?.().baseUrl||``,required:``},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`title`,`description`]),u(m(y),{title:m(b)(`settings.pages.providers.common.section.advanced.title`)},{default:l(()=>[u(m(i),{modelValue:O.value,"onUpdate:modelValue":t[1]||=e=>O.value=e,label:m(b)(`settings.pages.providers.common.section.advanced.fields.field.headers.label`),description:m(b)(`settings.pages.providers.common.section.advanced.fields.field.headers.description`),"key-placeholder":m(b)(`settings.pages.providers.common.section.advanced.fields.field.headers.key.placeholder`),"value-placeholder":m(b)(`settings.pages.providers.common.section.advanced.fields.field.headers.value.placeholder`),onAdd:t[2]||=(e,t)=>k(O.value,e,t),onRemove:t[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-BaqtySWH.js b/assets/openai-BaqtySWH.js deleted file mode 100644 index 1c73a18fdbdffcbb0bead297cfb4a5f74b4e2281..0000000000000000000000000000000000000000 --- a/assets/openai-BaqtySWH.js +++ /dev/null @@ -1 +0,0 @@ -import{J as e,L as t,aN as n,aS as r,bA as i,bG as a,bK as o,bN as s,bP as c,bR as l,bU as u,b_ as d,by as f,t as p,u as m,v as h,w as g,x as _,y as v}from"./index-BFym949y.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b=`openai`;var x=c({__name:`openai`,setup(c){let{t:y}=t(),x=n(),S=e(),{providers:C}=r(S),w=s(()=>S.getProviderMetadata(b)),T=s({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=s({get:()=>C.value[b]?.baseUrl||`https://api.openai.com/v1/`,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});o(()=>{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/`}),f([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)=>(i(),a(d(p),{"provider-name":w.value?.localizedName||`OpenAI`,"provider-icon":w.value?.icon,"on-back":()=>d(x).back()},{default:l(()=>[u(d(m),null,{default:l(()=>[u(d(h),{title:d(y)(`settings.pages.providers.common.section.basic.title`),description:d(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:l(()=>[u(d(_),{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`]),u(d(v),{title:d(y)(`settings.pages.providers.common.section.advanced.title`)},{default:l(()=>[u(d(g),{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-CfOD6NWP.js b/assets/openai-CfOD6NWP.js new file mode 100644 index 0000000000000000000000000000000000000000..72ae29e0e0a8afbbb0b3a873a16780b1ab800041 --- /dev/null +++ b/assets/openai-CfOD6NWP.js @@ -0,0 +1 @@ +import{J as e,L as t,aN as n,aS as r,bA as i,bE as a,bH as o,bJ as s,bL as c,bO as l,bQ as u,bT as d,b_ as f,t as p,u as m,v as h,w as g,x as _,y as v}from"./index-J3uhnpYL.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b=`openai`;var x=s({__name:`openai`,setup(s){let{t:y}=t(),x=n(),S=e(),{providers:C}=r(S),w=o(()=>S.getProviderMetadata(b)),T=o({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=o({get:()=>C.value[b]?.baseUrl||`https://api.openai.com/v1/`,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});a(()=>{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/`}),u([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)=>(d(),i(f(p),{"provider-name":w.value?.localizedName||`OpenAI`,"provider-icon":w.value?.icon,"on-back":()=>f(x).back()},{default:c(()=>[l(f(m),null,{default:c(()=>[l(f(h),{title:f(y)(`settings.pages.providers.common.section.basic.title`),description:f(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:c(()=>[l(f(_),{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`]),l(f(v),{title:f(y)(`settings.pages.providers.common.section.advanced.title`)},{default:c(()=>[l(f(g),{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-DWlI47_x.js b/assets/openai-audio-speech-DWlI47_x.js deleted file mode 100644 index cca07e6edcc3d92b94d25857f9d85abb30714574..0000000000000000000000000000000000000000 --- a/assets/openai-audio-speech-DWlI47_x.js +++ /dev/null @@ -1 +0,0 @@ -import{G as e,J as t,L as n,aS as r,au as i,bA as a,bG as o,bN as s,bP as c,bR as l,bU as u,bX as d,b_ as f,by as p,r as m,s as h}from"./index-BFym949y.js";import{b as g}from"./route-block-DVyt-3Cw.js";const _=`openai-audio-speech`,v=`gpt-4o-mini-tts`;var y=c({__name:`openai-audio-speech`,setup(c){let g=e(),y=t(),{providers:b}=r(y),{t:x}=n(),S={speed:1},C=d(1),w=s(()=>!!b.value[_]?.apiKey),T=s(()=>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 p(C,async()=>{let e=y.getProviderConfig(_);e.speed=C.value}),(e,t)=>(a(),o(f(m),{"provider-id":_,"default-model":v,"additional-settings":S},{"voice-settings":l(()=>[u(f(i),{modelValue:C.value,"onUpdate:modelValue":t[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:l(()=>[u(f(h),{"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-speech-tr83Tays.js b/assets/openai-audio-speech-tr83Tays.js new file mode 100644 index 0000000000000000000000000000000000000000..0529e06bdfc40276a18d867ef2a6e9dee19206f7 --- /dev/null +++ b/assets/openai-audio-speech-tr83Tays.js @@ -0,0 +1 @@ +import{G as e,J as t,L as n,aS as r,au as i,bA as a,bH as o,bJ as s,bL as c,bO as l,bQ as u,bT as d,bX as f,b_ as p,r as m,s as h}from"./index-J3uhnpYL.js";import{b as g}from"./route-block-DVyt-3Cw.js";const _=`openai-audio-speech`,v=`gpt-4o-mini-tts`;var y=s({__name:`openai-audio-speech`,setup(s){let g=e(),y=t(),{providers:b}=r(y),{t:x}=n(),S={speed:1},C=f(1),w=o(()=>!!b.value[_]?.apiKey),T=o(()=>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 u(C,async()=>{let e=y.getProviderConfig(_);e.speed=C.value}),(e,t)=>(d(),a(p(m),{"provider-id":_,"default-model":v,"additional-settings":S},{"voice-settings":c(()=>[l(p(i),{modelValue:C.value,"onUpdate:modelValue":t[0]||=e=>C.value=e,label:p(x)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:p(x)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:2,step:.01},null,8,[`modelValue`,`label`,`description`])]),playground:c(()=>[l(p(h),{"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-DxV0q5KK.js b/assets/openai-audio-transcription-53P1cwTz.js similarity index 51% rename from assets/openai-audio-transcription-DxV0q5KK.js rename to assets/openai-audio-transcription-53P1cwTz.js index 594bb8e2e439bd71f3b9bdaf8d90ff72c55152eb..b2d13c41909444929b810378a6f7cb0a77edf989 100644 --- a/assets/openai-audio-transcription-DxV0q5KK.js +++ b/assets/openai-audio-transcription-53P1cwTz.js @@ -1 +1 @@ -import{E as e,J as t,aS as n,bA as r,bG as i,bN as a,bP as o,bR as s,bU as c,b_ as l,p as u,q as d}from"./index-BFym949y.js";import{b as f}from"./route-block-DVyt-3Cw.js";const p=`openai-audio-transcription`,m=`whisper-1`;var h=o({__name:`openai-audio-transcription`,setup(o){let f=e(),h=t(),{providers:g}=n(h),_=a(()=>!!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(e,t)=>(r(),i(l(u),{"provider-id":p,"default-model":m},{playground:s(()=>[c(l(d),{"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{E as e,J as t,aS as n,bA as r,bH as i,bJ as a,bL as o,bO as s,bT as c,b_ as l,p as u,q as d}from"./index-J3uhnpYL.js";import{b as f}from"./route-block-DVyt-3Cw.js";const p=`openai-audio-transcription`,m=`whisper-1`;var h=a({__name:`openai-audio-transcription`,setup(a){let f=e(),h=t(),{providers:g}=n(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(e,t)=>(c(),r(l(u),{"provider-id":p,"default-model":m},{playground:o(()=>[s(l(d),{"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-BGXHC_hT.js b/assets/openrouter-ai-BGXHC_hT.js new file mode 100644 index 0000000000000000000000000000000000000000..6a81526b4783de23fffdfc07a1d15e8c32b1340b --- /dev/null +++ b/assets/openrouter-ai-BGXHC_hT.js @@ -0,0 +1 @@ +import{J as e,L as t,aN as n,aS as r,bA as i,bE as a,bH as o,bJ as s,bL as c,bO as l,bQ as u,bT as d,b_ as f,t as p,u as m,v as h,w as g,x as _,y as v}from"./index-J3uhnpYL.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b=`openrouter-ai`;var x=s({__name:`openrouter-ai`,setup(s){let{t:y}=t(),x=n(),S=e(),{providers:C}=r(S),w=o(()=>S.getProviderMetadata(b)),T=o({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=o({get:()=>C.value[b]?.baseUrl||w.value?.defaultOptions?.().baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});a(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||w.value?.defaultOptions?.().baseUrl||``}),u([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)=>(d(),i(f(p),{"provider-name":w.value?.localizedName,"provider-icon":w.value?.icon,"on-back":()=>f(x).back()},{default:c(()=>[l(f(m),null,{default:c(()=>[l(f(h),{title:f(y)(`settings.pages.providers.common.section.basic.title`),description:f(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:c(()=>[l(f(_),{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`]),l(f(v),{title:f(y)(`settings.pages.providers.common.section.advanced.title`)},{default:c(()=>[l(f(g),{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/openrouter-ai-DVJv8zTp.js b/assets/openrouter-ai-DVJv8zTp.js deleted file mode 100644 index 40c04faf9a6f70ebc12516827b1f0412458db418..0000000000000000000000000000000000000000 --- a/assets/openrouter-ai-DVJv8zTp.js +++ /dev/null @@ -1 +0,0 @@ -import{J as e,L as t,aN as n,aS as r,bA as i,bG as a,bK as o,bN as s,bP as c,bR as l,bU as u,b_ as d,by as f,t as p,u as m,v as h,w as g,x as _,y as v}from"./index-BFym949y.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b=`openrouter-ai`;var x=c({__name:`openrouter-ai`,setup(c){let{t:y}=t(),x=n(),S=e(),{providers:C}=r(S),w=s(()=>S.getProviderMetadata(b)),T=s({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=s({get:()=>C.value[b]?.baseUrl||w.value?.defaultOptions?.().baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});o(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||w.value?.defaultOptions?.().baseUrl||``}),f([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)=>(i(),a(d(p),{"provider-name":w.value?.localizedName,"provider-icon":w.value?.icon,"on-back":()=>d(x).back()},{default:l(()=>[u(d(m),null,{default:l(()=>[u(d(h),{title:d(y)(`settings.pages.providers.common.section.basic.title`),description:d(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:l(()=>[u(d(_),{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`]),u(d(v),{title:d(y)(`settings.pages.providers.common.section.advanced.title`)},{default:l(()=>[u(d(g),{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-CTAnVDmW.js b/assets/pages-CTAnVDmW.js deleted file mode 100644 index b3debbb2519c5db937c6683ac1dc96d375335224..0000000000000000000000000000000000000000 --- a/assets/pages-CTAnVDmW.js +++ /dev/null @@ -1 +0,0 @@ -import"./Basic-CcFV8fg0.js";import{b as e,d as t}from"./theme-color-BKoDN9T_.js";import{C as n,aS as r,aT as i,aU as a,aV as o,b4 as s,bA as c,bB as l,bG as u,bK as d,bP as f,bQ as p,bR as m,bU as h,bX as g,b_ as _,by as v}from"./index-BFym949y.js";import"./import-url-browser-CzbE4_30.js";import"./duckdb-mvp-1eM9E9sB.js";import"./HeaderLink-BXWLCGTy.js";import{b as y}from"./route-block-DVyt-3Cw.js";import{b}from"./Scenes-CZrLq5ZX.js";import{b as x,c as S,d as C,e as w,f as T,g as E}from"./AnimatedWave-DHHIvVVC.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}),d(()=>R()),(e,t)=>(c(),u(E,null,{default:m(()=>[h(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:m(()=>[l(`div`,D,[l(`div`,O,[h(T,{class:`hidden md:flex`}),h(C,{class:`flex md:hidden`})]),l(`div`,k,[h(_(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)?p(``,!0):(c(),u(w,{key:0,h:`85dvh`,absolute:``,"right-4":``,flex:``,"flex-1":``,"flex-col":``,"max-w":`500px`,"min-w":`30%`})),_(L)?(c(),u(S,{key:1,onSettingsOpen:j})):p(``,!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-DgHFu8YX.js b/assets/pages-DgHFu8YX.js new file mode 100644 index 0000000000000000000000000000000000000000..b01368cc6e3ff20943c9df45fa9c269afbe38a92 --- /dev/null +++ b/assets/pages-DgHFu8YX.js @@ -0,0 +1 @@ +import"./Basic-Cwa2X3hA.js";import{c as e,d as t}from"./theme-color-BcLm08J4.js";import{C as n,aS as r,aV as i,aW as a,aX as o,aZ as s,bA as c,bE as l,bJ as u,bK as d,bL as f,bO as p,bQ as m,bT as h,bU as g,bX as _,b_ as v}from"./index-J3uhnpYL.js";import"./import-url-browser-BymzNjKM.js";import"./duckdb-mvp-1eM9E9sB.js";import"./HeaderLink-C5rYwZW4.js";import{b as y}from"./route-block-DVyt-3Cw.js";import{b}from"./Scenes-CEy5mzwe.js";import{b as x,c as S,d as C,e as w,f as T,g as E}from"./AnimatedWave-BNwebIpR.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}),l(()=>R()),(e,t)=>(h(),c(E,null,{default:f(()=>[p(x,{class:`widgets top-widgets`,"fill-color":v(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:f(()=>[g(`div`,D,[g(`div`,O,[p(T,{class:`hidden md:flex`}),p(C,{class:`flex md:hidden`})]),g(`div`,k,[p(v(b),{"flex-1":``,"min-w":`1/2`,paused:A.value,"focus-at":{x:v(M).x.value,y:v(M).y.value},"x-offset":`${v(L)?v(P).x:v(P).x-10}%`,"y-offset":v(F).y,scale:v(N)},null,8,[`paused`,`focus-at`,`x-offset`,`y-offset`,`scale`]),v(L)?d(``,!0):(h(),c(w,{key:0,h:`85dvh`,absolute:``,"right-4":``,flex:``,"flex-1":``,"flex-col":``,"max-w":`500px`,"min-w":`30%`})),v(L)?(h(),c(S,{key:1,onSettingsOpen:j})):d(``,!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-CNQFJoOP.js b/assets/plain-CNQFJoOP.js deleted file mode 100644 index 3b2401249fb4a9175722c8a29ced1cf95587e966..0000000000000000000000000000000000000000 --- a/assets/plain-CNQFJoOP.js +++ /dev/null @@ -1 +0,0 @@ -import{aL as e,bA as t,bG as n,bL as r}from"./index-BFym949y.js";const i={};function a(e,i){let a=r(`RouterView`);return t(),n(a)}var o=e(i,[[`render`,a]]);export{o as default}; \ No newline at end of file diff --git a/assets/plain-vwAfWNiv.js b/assets/plain-vwAfWNiv.js new file mode 100644 index 0000000000000000000000000000000000000000..9c50c278b2f0348c821072624b2e53eb52223e64 --- /dev/null +++ b/assets/plain-vwAfWNiv.js @@ -0,0 +1 @@ +import{aL as e,bA as t,bF as n,bT as r}from"./index-J3uhnpYL.js";const i={};function a(e,i){let a=n(`RouterView`);return r(),t(a)}var o=e(i,[[`render`,a]]);export{o as default}; \ No newline at end of file diff --git a/assets/player2-92SQ5DhN.js b/assets/player2-92SQ5DhN.js new file mode 100644 index 0000000000000000000000000000000000000000..b419635e3dd4a3cdbee1e7c0b6c346494ac7fef1 --- /dev/null +++ b/assets/player2-92SQ5DhN.js @@ -0,0 +1 @@ +import{J as e,L as t,aA as n,aN as r,aS as i,bE as a,bG as o,bH as s,bJ as c,bK as l,bL as u,bM as d,bO as f,bQ as p,bT as m,bU as h,bX as g,b_ as _,by as v,t as y,u as b,v as x,w as S}from"./index-J3uhnpYL.js";import{b as C}from"./route-block-DVyt-3Cw.js";const w={key:0,"mb-1":``},T=`player2`;var E=c({__name:`player2`,setup(c){let{t:C}=t(),E=r(),D=e(),{providers:O}=i(D),k=s(()=>D.getProviderMetadata(T)),A=s({get:()=>O.value[T]?.baseUrl||``,set:e=>{O.value[T]||(O.value[T]={}),O.value[T].baseUrl=e}}),j=g(!0);a(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}}),p([A],()=>{O.value[T]={...O.value[T],baseUrl:A.value||``}});function M(){O.value[T]={...k.value?.defaultOptions}}return(e,t)=>(m(),d(o,null,[j.value?l(``,!0):(m(),d(`div`,w,[f(_(n),{theme:`orange`},{label:u(()=>t[1]||=[v(` Player 2 is not running `)]),default:u(()=>[t[2]||=h(`div`,null,[v(` Please download and run the Player2 App: `),h(`a`,{href:`https://player2.game`,target:`_blank`,rel:`noopener noreferrer`},` https://player2.game `),h(`div`,null,[v(` After downloading, if you still are having trouble, please reach out to us on Discord: `),h(`a`,{href:`https://player2.game/discord`,target:`_blank`,rel:`noopener noreferrer`},` https://player2.game/discord `),v(`. `)])],-1)]),_:1,__:[2]})])),f(_(y),{"provider-name":k.value?.localizedName,"provider-icon":k.value?.icon,"on-back":()=>_(E).back()},{default:u(()=>[f(_(b),null,{default:u(()=>[f(_(x),{title:_(C)(`settings.pages.providers.common.section.basic.title`),description:_(C)(`settings.pages.providers.common.section.basic.description`),"on-reset":M},{default:u(()=>[f(_(S),{modelValue:A.value,"onUpdate:modelValue":t[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-C8nhkznT.js b/assets/player2-C8nhkznT.js deleted file mode 100644 index b8f6fdc803b7495e5e7ce87a848224b27265b50b..0000000000000000000000000000000000000000 --- a/assets/player2-C8nhkznT.js +++ /dev/null @@ -1 +0,0 @@ -import{J as e,L as t,aA as n,aN as r,aS as i,bA as a,bB as o,bE as s,bK as c,bM as l,bN as u,bP as d,bQ as f,bR as p,bS as m,bU as h,bX as g,b_ as _,by as v,t as y,u as b,v as x,w as S}from"./index-BFym949y.js";import{b as C}from"./route-block-DVyt-3Cw.js";const w={key:0,"mb-1":``},T=`player2`;var E=d({__name:`player2`,setup(d){let{t:C}=t(),E=r(),D=e(),{providers:O}=i(D),k=u(()=>D.getProviderMetadata(T)),A=u({get:()=>O.value[T]?.baseUrl||``,set:e=>{O.value[T]||(O.value[T]={}),O.value[T].baseUrl=e}}),j=g(!0);c(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}}),v([A],()=>{O.value[T]={...O.value[T],baseUrl:A.value||``}});function M(){O.value[T]={...k.value?.defaultOptions}}return(e,t)=>(a(),m(l,null,[j.value?f(``,!0):(a(),m(`div`,w,[h(_(n),{theme:`orange`},{label:p(()=>t[1]||=[s(` Player 2 is not running `)]),default:p(()=>[t[2]||=o(`div`,null,[s(` Please download and run the Player2 App: `),o(`a`,{href:`https://player2.game`,target:`_blank`,rel:`noopener noreferrer`},` https://player2.game `),o(`div`,null,[s(` 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 `),s(`. `)])],-1)]),_:1,__:[2]})])),h(_(y),{"provider-name":k.value?.localizedName,"provider-icon":k.value?.icon,"on-back":()=>_(E).back()},{default:p(()=>[h(_(b),null,{default:p(()=>[h(_(x),{title:_(C)(`settings.pages.providers.common.section.basic.title`),description:_(C)(`settings.pages.providers.common.section.basic.description`),"on-reset":M},{default:p(()=>[h(_(S),{modelValue:A.value,"onUpdate:modelValue":t[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-CYU2KX04.js b/assets/player2-speech-QfJzu0W0.js similarity index 50% rename from assets/player2-speech-CYU2KX04.js rename to assets/player2-speech-QfJzu0W0.js index 0864b459ff78c67a74433377954b477d1f555f1a..3ccde471c34d82cc332dacadd45339476f920026 100644 --- a/assets/player2-speech-CYU2KX04.js +++ b/assets/player2-speech-QfJzu0W0.js @@ -1 +1 @@ -import{G as e,J as t,L as n,aA as r,au as i,bA as a,bB as o,bE as s,bK as c,bM as l,bN as u,bP as d,bQ as f,bR as p,bS as m,bU as h,bX as g,b_ as _,by as v,r as y,s as b}from"./index-BFym949y.js";import{b as x}from"./route-block-DVyt-3Cw.js";const S={key:0,style:{color:`red`,"margin-bottom":`1rem`}},C=`player2-speech`,w=`v1`;var T=d({__name:`player2-speech`,setup(d){let x=g(1),T=e(),E=t(),{t:D}=n(),O=u(()=>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 c(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}}),v(x,async()=>{let e=E.getProviderConfig(C);e.speed=x.value}),(e,t)=>(a(),m(l,null,[A.value?f(``,!0):(a(),m(`div`,S,[h(_(r),{theme:`orange`},{label:p(()=>t[1]||=[s(` Player 2 is not running `)]),default:p(()=>[t[2]||=o(`div`,null,[s(` Please download and run the Player2 App: `),o(`a`,{href:`https://player2.game`,target:`_blank`,rel:`noopener noreferrer`},` https://player2.game `),o(`div`,null,[s(` 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 `),s(`. `)])],-1)]),_:1,__:[2]})])),h(_(y),{"provider-id":C,"default-model":w},{"voice-settings":p(()=>[h(_(i),{modelValue:x.value,"onUpdate:modelValue":t[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:p(()=>[h(_(b),{"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{G as e,J as t,L as n,aA as r,au as i,bE as a,bG as o,bH as s,bJ as c,bK as l,bL as u,bM as d,bO as f,bQ as p,bT as m,bU as h,bX as g,b_ as _,by as v,r as y,s as b}from"./index-J3uhnpYL.js";import{b as x}from"./route-block-DVyt-3Cw.js";const S={key:0,style:{color:`red`,"margin-bottom":`1rem`}},C=`player2-speech`,w=`v1`;var T=c({__name:`player2-speech`,setup(c){let x=g(1),T=e(),E=t(),{t:D}=n(),O=s(()=>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 a(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}}),p(x,async()=>{let e=E.getProviderConfig(C);e.speed=x.value}),(e,t)=>(m(),d(o,null,[A.value?l(``,!0):(m(),d(`div`,S,[f(_(r),{theme:`orange`},{label:u(()=>t[1]||=[v(` Player 2 is not running `)]),default:u(()=>[t[2]||=h(`div`,null,[v(` Please download and run the Player2 App: `),h(`a`,{href:`https://player2.game`,target:`_blank`,rel:`noopener noreferrer`},` https://player2.game `),h(`div`,null,[v(` After downloading, if you still are having trouble, please reach out to us on Discord: `),h(`a`,{href:`https://player2.game/discord`,target:`_blank`,rel:`noopener noreferrer`},` https://player2.game/discord `),v(`. `)])],-1)]),_:1,__:[2]})])),f(_(y),{"provider-id":C,"default-model":w},{"voice-settings":u(()=>[f(_(i),{modelValue:x.value,"onUpdate:modelValue":t[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:u(()=>[f(_(b),{"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-Ch51z8b2.js b/assets/polaroid-Ch51z8b2.js new file mode 100644 index 0000000000000000000000000000000000000000..4021ebc1f6018014509e204745302c02fbf376d5 --- /dev/null +++ b/assets/polaroid-Ch51z8b2.js @@ -0,0 +1 @@ +import{ae as e,bD as t,bG as n,bJ as r,bL as i,bM as a,bO as o,bQ as s,bT as c,bU as l,bX as u,b_ as d,bt as f,bx as p,c0 as m}from"./index-J3uhnpYL.js";import"./import-url-browser-BymzNjKM.js";import"./duckdb-mvp-1eM9E9sB.js";import{i as h,k as g}from"./Scenes-CEy5mzwe.js";const _={flex:``,"flex-col":``,"items-center":``,"gap-4":``},v={"h-full":``,"w-full":``},y=[`value`];var b=r({__name:`polaroid`,setup(r){let b=u(),x=u(),S=u(`idle`),C=u([]);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)}s(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(r,s)=>(c(),a(`div`,_,[l(`div`,v,[o(d(e),{relative:``,"min-h-70dvh":``},{default:i(({width:e,height:t})=>[o(d(g),{ref_key:`live2dCanvasRef`,ref:b,width:e,height:t,resolution:3,"rounded-full":``},{default:i(({app:n})=>[o(d(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})]),l(`div`,null,[t(l(`select`,{"onUpdate:modelValue":s[0]||=e=>S.value=e,"rounded-lg":``,"px-3":``,"py-2":``,onChange:s[1]||=e=>T(S.value)},[(c(!0),a(n,null,p(C.value,e=>(c(),a(`option`,{key:e.motionIndex,value:e.motionName},m(e.fileName),9,y))),128))],544),[[f,S.value]])]),l(`div`,{border:`2px solid white`,flex:``,"items-center":``,"justify-center":``,"rounded-full":``,"p-1":``},[l(`button`,{"h-18":``,"w-18":``,"rounded-full":``,bg:`white active:gray-50`,"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/polaroid-qE5EuLqQ.js b/assets/polaroid-qE5EuLqQ.js deleted file mode 100644 index c9eb532a13eb08a7aecb407540f328dcd52cd74b..0000000000000000000000000000000000000000 --- a/assets/polaroid-qE5EuLqQ.js +++ /dev/null @@ -1 +0,0 @@ -import{ae as e,bA as t,bB as n,bD as r,bJ as i,bM as a,bP as o,bR as s,bS as c,bU as l,bX as u,b_ as d,bs as f,by as p,c1 as m}from"./index-BFym949y.js";import"./import-url-browser-CzbE4_30.js";import"./duckdb-mvp-1eM9E9sB.js";import{i as h,k as g}from"./Scenes-CZrLq5ZX.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=u(),x=u(),S=u(`idle`),C=u([]);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)}p(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,u)=>(t(),c(`div`,_,[n(`div`,v,[l(d(e),{relative:``,"min-h-70dvh":``},{default:s(({width:e,height:t})=>[l(d(g),{ref_key:`live2dCanvasRef`,ref:b,width:e,height:t,resolution:3,"rounded-full":``},{default:s(({app:n})=>[l(d(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})]),n(`div`,null,[i(n(`select`,{"onUpdate:modelValue":u[0]||=e=>S.value=e,"rounded-lg":``,"px-3":``,"py-2":``,onChange:u[1]||=e=>T(S.value)},[(t(!0),c(a,null,r(C.value,e=>(t(),c(`option`,{key:e.motionIndex,value:e.motionName},m(e.fileName),9,y))),128))],544),[[f,S.value]])]),n(`div`,{border:`2px solid white`,flex:``,"items-center":``,"justify-center":``,"rounded-full":``,"p-1":``},[n(`button`,{"h-18":``,"w-18":``,"rounded-full":``,bg:`white active:gray-50`,"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-DLjH9JAw.js b/assets/providers-BEf5BA57.js similarity index 57% rename from assets/providers-DLjH9JAw.js rename to assets/providers-BEf5BA57.js index a3f16784d8611ecc404ee1bd6d6a2af6c3e18ce9..07219fbd4dba49c029a68cbe507045f556312ce0 100644 --- a/assets/providers-DLjH9JAw.js +++ b/assets/providers-BEf5BA57.js @@ -1 +1 @@ -import{J as e,L as t,aS as n,al as r,bA as i,bB as a,bD as o,bG as s,bJ as c,bL as l,bM as u,bP as d,bR as f,bS as p,bU as m,b_ as h,bz as g,c1 as _}from"./index-BFym949y.js";import{b as v}from"./route-block-DVyt-3Cw.js";import{b as y}from"./IconAnimation-DfKVRS59.js";import{b}from"./icon-animation-ChTUnIeG.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=d({__name:`index`,setup(d){let{t:v}=t(),F=e(),{allChatProvidersMetadata:I,allAudioSpeechProvidersMetadata:L,allAudioTranscriptionProvidersMetadata:R}=n(F),{iconAnimationStarted:z,showIconAnimation:B,animationIcon:V}=b(`i-solar:box-minimalistic-bold-duotone`);return(e,t)=>{let n=l(`i18n-t`),d=g(`motion`);return i(),p(u,null,[a(`div`,x,[a(`div`,S,[a(`div`,C,_(e.$t(`settings.pages.providers.helpinfo.title`)),1),a(`div`,w,[m(n,{keypath:`settings.pages.providers.helpinfo.description`},{chat:f(()=>t[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,[t[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,_(h(v)(`settings.pages.providers.explained.chat`)),1)]),t[1]||=a(`div`,{flex:``,"text-nowrap":``,"text-3xl":``,"font-normal":``},[a(`div`,null,` Chat `)],-1)])]),a(`div`,D,[(i(!0),p(u,null,o(h(I),(e,t)=>c((i(),s(h(r),{key:e.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+t*10,delay:t*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`])),[[d]])),128))]),a(`div`,O,[t[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,_(h(v)(`settings.pages.providers.explained.Speech`)),1)]),t[3]||=a(`div`,{flex:``,"text-nowrap":``,"text-3xl":``,"font-normal":``},[a(`div`,null,` Speech `)],-1)])]),a(`div`,A,[(i(!0),p(u,null,o(h(L),(e,t)=>c((i(),s(h(r),{key:e.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+t*10,delay:(h(I).length+t)*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`])),[[d]])),128))]),a(`div`,j,[t[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,_(h(v)(`settings.pages.providers.explained.Transcription`)),1)]),t[5]||=a(`div`,{flex:``,"text-nowrap":``,"text-3xl":``,"font-normal":``},[a(`div`,null,` Transcription `)],-1)])]),a(`div`,N,[(i(!0),p(u,null,o(h(R),(e,t)=>c((i(),s(h(r),{key:e.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+t*10,delay:(h(I).length+h(L).length+t)*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`])),[[d]])),128))])]),h(B)?(i(),s(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`])):c((i(),p(`div`,P,t[7]||=[a(`div`,{text:`60`,"i-solar:box-minimalistic-bold-duotone":``},null,-1)])),[[d]])],64)}}});typeof v==`function`&&v(F);var I=F;export{I as default}; \ No newline at end of file +import{J as e,L as t,aS as n,al as r,bA as i,bD as a,bF as o,bG as s,bJ as c,bL as l,bM as u,bO as d,bS as f,bT as p,bU as m,b_ as h,bx as g,c0 as _}from"./index-J3uhnpYL.js";import{b as v}from"./route-block-DVyt-3Cw.js";import{b as y}from"./IconAnimation-BEHmQAW0.js";import{b}from"./icon-animation-kCs3SNq8.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}=t(),F=e(),{allChatProvidersMetadata:I,allAudioSpeechProvidersMetadata:L,allAudioTranscriptionProvidersMetadata:R}=n(F),{iconAnimationStarted:z,showIconAnimation:B,animationIcon:V}=b(`i-solar:box-minimalistic-bold-duotone`);return(e,t)=>{let n=o(`i18n-t`),c=f(`motion`);return p(),u(s,null,[m(`div`,x,[m(`div`,S,[m(`div`,C,_(e.$t(`settings.pages.providers.helpinfo.title`)),1),m(`div`,w,[d(n,{keypath:`settings.pages.providers.helpinfo.description`},{chat:l(()=>t[0]||=[m(`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`},[m(`div`,{class:`i-solar:chat-square-like-bold-duotone`}),m(`strong`,{class:`font-semibold`},`Chat`)],-1)]),_:1})])]),m(`div`,T,[t[2]||=m(`div`,{"i-solar:chat-square-like-bold-duotone":``,text:`neutral-500 dark:neutral-400 4xl`},null,-1),m(`div`,null,[m(`div`,null,[m(`span`,E,_(h(v)(`settings.pages.providers.explained.chat`)),1)]),t[1]||=m(`div`,{flex:``,"text-nowrap":``,"text-3xl":``,"font-normal":``},[m(`div`,null,` Chat `)],-1)])]),m(`div`,D,[(p(!0),u(s,null,g(h(I),(e,t)=>a((p(),i(h(r),{key:e.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+t*10,delay:t*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`])),[[c]])),128))]),m(`div`,O,[t[4]||=m(`div`,{"i-solar:user-speak-rounded-bold-duotone":``,text:`neutral-500 dark:neutral-400 4xl`},null,-1),m(`div`,null,[m(`div`,null,[m(`span`,k,_(h(v)(`settings.pages.providers.explained.Speech`)),1)]),t[3]||=m(`div`,{flex:``,"text-nowrap":``,"text-3xl":``,"font-normal":``},[m(`div`,null,` Speech `)],-1)])]),m(`div`,A,[(p(!0),u(s,null,g(h(L),(e,t)=>a((p(),i(h(r),{key:e.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+t*10,delay:(h(I).length+t)*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`])),[[c]])),128))]),m(`div`,j,[t[6]||=m(`div`,{"i-solar:microphone-3-bold-duotone":``,text:`neutral-500 dark:neutral-400 4xl`},null,-1),m(`div`,null,[m(`div`,null,[m(`span`,M,_(h(v)(`settings.pages.providers.explained.Transcription`)),1)]),t[5]||=m(`div`,{flex:``,"text-nowrap":``,"text-3xl":``,"font-normal":``},[m(`div`,null,` Transcription `)],-1)])]),m(`div`,N,[(p(!0),u(s,null,g(h(R),(e,t)=>a((p(),i(h(r),{key:e.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+t*10,delay:(h(I).length+h(L).length+t)*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`])),[[c]])),128))])]),h(B)?(p(),i(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`])):a((p(),u(`div`,P,t[7]||=[m(`div`,{text:`60`,"i-solar:box-minimalistic-bold-duotone":``},null,-1)])),[[c]])],64)}}});typeof v==`function`&&v(F);var I=F;export{I as default}; \ No newline at end of file diff --git a/assets/queue-ClKCooOo.js b/assets/queue-BLcf1-Jv.js similarity index 78% rename from assets/queue-ClKCooOo.js rename to assets/queue-BLcf1-Jv.js index 3d58e3d6f6a9ca70e2812649b54c0a1a33de46be..7b3950d9d50c832b073b762ce9acc31acc86fab6 100644 --- a/assets/queue-ClKCooOo.js +++ b/assets/queue-BLcf1-Jv.js @@ -1 +1 @@ -import{a3 as e,a7 as t,bA as n,bB as r,bK as i,bP as a,bS as o,bX as s}from"./index-BFym949y.js";var c=a({__name:`queue`,setup(a){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 i(()=>{m()}),(e,t)=>(n(),o(`div`,null,t[0]||=[r(`div`,null,null,-1)]))}}),l=c;export{l as default}; \ No newline at end of file +import{a3 as e,a7 as t,bE as n,bJ as r,bM as i,bT as a,bU as o,bX as s}from"./index-J3uhnpYL.js";var c=r({__name:`queue`,setup(r){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 n(()=>{m()}),(e,t)=>(a(),i(`div`,null,t[0]||=[o(`div`,null,null,-1)]))}}),l=c;export{l as default}; \ No newline at end of file diff --git a/assets/scene-XjDq2xJ1.js b/assets/scene-XjDq2xJ1.js deleted file mode 100644 index c7779ac97bfe34e617a76a3c12c5eeb299dab0df..0000000000000000000000000000000000000000 --- a/assets/scene-XjDq2xJ1.js +++ /dev/null @@ -1 +0,0 @@ -import{aA as e,bA as t,bB as n,bE as r,bG as i,bJ as a,bM as o,bP as s,bR as c,bS as l,bU as u,b_ as d,bz as f}from"./index-BFym949y.js";import{b as p}from"./route-block-DVyt-3Cw.js";import{b as m}from"./IconAnimation-DfKVRS59.js";import{b as h}from"./icon-animation-ChTUnIeG.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=f(`motion`);return t(),l(o,null,[n(`div`,null,[u(d(e),{label:`In development, needs your help!`,theme:`orange`},{default:c(()=>h[0]||=[n(`div`,null,[r(` 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`),r(`. 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`),r(`. `)],-1)]),_:1,__:[0]})]),d(_)?(t(),i(m,{key:0,"z-index":-1,icon:d(v),"icon-size":12,duration:1e3,started:d(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`])):a((t(),l(`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/scene-ePckR2Tm.js b/assets/scene-ePckR2Tm.js new file mode 100644 index 0000000000000000000000000000000000000000..aef5c2b1227e8352929e9ef7b1748b791da656ca --- /dev/null +++ b/assets/scene-ePckR2Tm.js @@ -0,0 +1 @@ +import{aA as e,bA as t,bD as n,bG as r,bJ as i,bL as a,bM as o,bO as s,bS as c,bT as l,bU as u,b_ as d,by as f}from"./index-J3uhnpYL.js";import{b as p}from"./route-block-DVyt-3Cw.js";import{b as m}from"./IconAnimation-BEHmQAW0.js";import{b as h}from"./icon-animation-kCs3SNq8.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 _=i({__name:`index`,setup(i){let{iconAnimationStarted:p,showIconAnimation:_,animationIcon:v}=h(`i-solar:armchair-2-bold-duotone`);return(i,h)=>{let y=c(`motion`);return l(),o(r,null,[u(`div`,null,[s(d(e),{label:`In development, needs your help!`,theme:`orange`},{default:a(()=>h[0]||=[u(`div`,null,[f(` This functionality is still under development. If you have any suggestions or would like to contribute, please reach out to us on our `),u(`a`,{underline:``,"decoration-dotted":``,href:`https://github.com/moeru-ai/airi/issues`},`GitHub issues page`),f(`. The source code of this page is located at `),u(`a`,{underline:``,"decoration-dotted":``,href:`https://github.com/moeru-ai/airi/tree/main/apps/stage-web/src/pages/settings/scene/index.vue`},`here`),f(`. `)],-1)]),_:1,__:[0]})]),d(_)?(l(),t(m,{key:0,"z-index":-1,icon:d(v),"icon-size":12,duration:1e3,started:d(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`])):n((l(),o(`div`,g,h[1]||=[u(`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-DV-w6Z9d.js b/assets/settings-C_Bl0Dic.js similarity index 67% rename from assets/settings-DV-w6Z9d.js rename to assets/settings-C_Bl0Dic.js index 2c77eeaa59c4e6d5ae930da8e7e068096787ed4f..8313a2abf8b27ba5d886a7a0114acf4b2a73b4b7 100644 --- a/assets/settings-DV-w6Z9d.js +++ b/assets/settings-C_Bl0Dic.js @@ -1 +1 @@ -import{B as e,L as t,aN as n,am as r,bA as i,bB as a,bD as o,bG as s,bJ as c,bM as l,bN as u,bO as d,bP as f,bS as p,bX as m,b_ as h,bz as g,c0 as _}from"./index-BFym949y.js";import{b as v}from"./route-block-DVyt-3Cw.js";import{b as y}from"./IconAnimation-DfKVRS59.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=f({__name:`index`,setup(f){let v=n(),w=m(!1),T=m(),E=m(),{t:D}=t(),O=m(``),k=m(``),A=m(!1),j=e();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 d(),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=u(()=>[{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,t)=>{let n=g(`motion`);return i(),p(`div`,b,[t[0]||=a(`div`,null,null,-1),a(`div`,x,[(i(!0),p(l,null,o(F.value,(e,t)=>c((i(),s(h(r),{key:e.to,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250,style:_({transitionDelay:`${t*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`])),[[n]])),128))]),A.value&&!h(j).disableTransitions&&h(j).usePageSpecificTransitions?(i(),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`])):c((i(),p(`div`,S,[c(a(`div`,C,null,512),[[n]])])),[[n]])])}}});typeof v==`function`&&v(w);var T=w;export{T as default}; \ No newline at end of file +import{B as e,L as t,aN as n,am as r,b$ as i,bA as a,bD as o,bG as s,bH as c,bI as l,bJ as u,bM as d,bS as f,bT as p,bU as m,bX as h,b_ as g,bx as _}from"./index-J3uhnpYL.js";import{b as v}from"./route-block-DVyt-3Cw.js";import{b as y}from"./IconAnimation-BEHmQAW0.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=u({__name:`index`,setup(u){let v=n(),w=h(!1),T=h(),E=h(),{t:D}=t(),O=h(``),k=h(``),A=h(!1),j=e();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=c(()=>[{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,t)=>{let n=f(`motion`);return p(),d(`div`,b,[t[0]||=m(`div`,null,null,-1),m(`div`,x,[(p(!0),d(s,null,_(F.value,(e,t)=>o((p(),a(g(r),{key:e.to,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250,style:i({transitionDelay:`${t*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`])),[[n]])),128))]),A.value&&!g(j).disableTransitions&&g(j).usePageSpecificTransitions?(p(),a(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`])):o((p(),d(`div`,S,[o(m(`div`,C,null,512),[[n]])])),[[n]])])}}});typeof v==`function`&&v(w);var T=w;export{T as default}; \ No newline at end of file diff --git a/assets/settings-V--rxRsA.js b/assets/settings-DGA0gtM5.js similarity index 78% rename from assets/settings-V--rxRsA.js rename to assets/settings-DGA0gtM5.js index 569f2ec59c9eef167d273b9c953e03221ee31dc9..118f773b7587161da0fd549659fd8f7d085c7e82 100644 --- a/assets/settings-V--rxRsA.js +++ b/assets/settings-DGA0gtM5.js @@ -1 +1 @@ -import{c as e,d as t}from"./theme-color-BKoDN9T_.js";import{J as n,L as r,aO as i,aQ as a,aS as o,aT as s,az as c,bA as l,bB as u,bK as d,bN as f,bP as p,bS as m,bU as h,b_ as g,by as _}from"./index-BFym949y.js";import{b as v}from"./HeaderLink-BXWLCGTy.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=p({__name:`settings`,setup(p){let S=i(),C=s(),{t:w}=r(),T=n(),{allProvidersMetadata:E}=o(T),D=f(()=>{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=f(()=>D.value[S.path]),{updateThemeColor:k}=t(e({light:`rgb(255 255 255)`,dark:`rgb(18 18 18)`}));return _(C,()=>k(),{immediate:!0}),_(S,()=>k(),{immediate:!0}),d(()=>k()),(e,t)=>(l(),m(`div`,y,[u(`div`,b,[h(v)]),u(`div`,x,[h(g(c),{title:O.value?.title,subtitle:O.value?.subtitle},null,8,[`title`,`subtitle`]),h(g(a))])]))}}),C=S;export{C as default}; \ No newline at end of file +import{b as e,c as t}from"./theme-color-BcLm08J4.js";import{J as n,L as r,aO as i,aQ as a,aS as o,aW as s,az as c,bE as l,bH as u,bJ as d,bM as f,bO as p,bQ as m,bT as h,bU as g,b_ as _}from"./index-J3uhnpYL.js";import{b as v}from"./HeaderLink-C5rYwZW4.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=i(),C=s(),{t:w}=r(),T=n(),{allProvidersMetadata:E}=o(T),D=u(()=>{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=u(()=>D.value[S.path]),{updateThemeColor:k}=t(e({light:`rgb(255 255 255)`,dark:`rgb(18 18 18)`}));return m(C,()=>k(),{immediate:!0}),m(S,()=>k(),{immediate:!0}),l(()=>k()),(e,t)=>(h(),f(`div`,y,[g(`div`,b,[p(v)]),g(`div`,x,[p(_(c),{title:O.value?.title,subtitle:O.value?.subtitle},null,8,[`title`,`subtitle`]),p(_(a))])]))}}),C=S;export{C as default}; \ No newline at end of file diff --git a/assets/speech-uucZ9CVe.js b/assets/speech-DILdLlfV.js similarity index 50% rename from assets/speech-uucZ9CVe.js rename to assets/speech-DILdLlfV.js index 9f51fa028c3696ae51f688918b0191cb6628118c..adae0b603921f19f54944200c6f2d405df5c747d 100644 --- a/assets/speech-uucZ9CVe.js +++ b/assets/speech-DILdLlfV.js @@ -1 +1 @@ -import"./Basic-CcFV8fg0.js";import{b as e}from"./Textarea-DQ3UodrM.js";import{G as t,H as n,J as r,L as i,aK as ee,aP as te,aS as a,ad as o,af as s,ah as ne,ai as re,aj as ie,ak as c,au as l,aw as ae,ay as u,b$ as oe,bA as d,bB as f,bD as se,bE as p,bG as m,bJ as h,bK as ce,bM as g,bP as le,bQ as _,bR as v,bS as y,bT as ue,bU as b,bV as x,bX as S,b_ as C,bs as de,bu as fe,by as pe,bz as me,c1 as w}from"./index-BFym949y.js";import{b as T}from"./route-block-DVyt-3Cw.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`},Te={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=le({__name:`speech`,setup(le){let{t:T}=i(),A=r(),j=t(),{configuredSpeechProvidersMetadata:M}=a(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}=a(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(``);ce(async()=>{await A.loadModelsForConfiguredProviders(),await j.loadVoicesForProvider(N.value)}),pe(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 r=K.value?J.value:j.supportsSSML?j.generateSSML(q.value,F.value,{...t,pitch:L.value}):q.value,i=await n({...e.speech(P.value,t),input:r,voice:F.value.id});X.value=URL.createObjectURL(new Blob([i])),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=``)}ue(()=>{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,n)=>{let r=me(`motion`);return d(),y(g,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?(d(),y(`fieldset`,xe,[(d(!0),y(g,null,se(C(M),e=>(d(),m(C(re),{id:e.id,key:e.id,modelValue:C(N),"onUpdate:modelValue":n[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))])):(d(),y(`div`,Se,[b(C(te),{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(()=>n[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)?(d(),y(`div`,Ce,[f(`div`,we,[f(`div`,null,[f(`h2`,Te,w(C(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.title`)),1),f(`div`,E,[f(`span`,null,w(C(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle`)),1)])]),C(z)?(d(),y(`div`,D,[n[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)?(d(),m(C(s),{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)?(d(),m(C(c),{key:2,type:`warning`},{title:v(()=>[p(w(C(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models`)),1)]),content:v(()=>[p(w(C(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models_description`)),1)]),_:1})):C(R).length>0?(d(),m(C(ie),{key:3,modelValue:C(P),"onUpdate:modelValue":n[1]||=e=>x(P)?P.value=e:null,"search-query":C(V),"onUpdate:searchQuery":n[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`])):_(``,!0)])])):_(``,!0)])]),C(N)?(d(),y(`div`,O,[f(`div`,Ee,[n[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)?(d(),y(`div`,De,[f(`div`,Oe,[b(C(o),{class:`w-full rounded-lg p-2.5 text-sm`},{default:v(()=>n[15]||=[f(`div`,{class:`h-1lh`},null,-1)]),_:1,__:[15]}),f(`div`,ke,[b(C(o),{class:`w-full rounded-lg p-4 text-sm`},{default:v(()=>n[16]||=[f(`div`,{class:`h-1lh`},null,-1)]),_:1,__:[16]}),b(C(o),{class:`w-full rounded-lg p-4 text-sm`},{default:v(()=>n[17]||=[f(`div`,{class:`h-1lh`},null,-1)]),_:1,__:[17]}),b(C(o),{class:`w-full rounded-lg p-4 text-sm`},{default:v(()=>n[18]||=[f(`div`,{class:`h-1lh`},null,-1)]),_:1,__:[18]})]),b(C(o),{class:`w-full rounded-lg p-3 text-sm`},{default:v(()=>n[19]||=[f(`div`,{class:`h-1lh`},null,-1)]),_:1,__:[19]})])])):C(W)[C(N)]&&C(W)[C(N)].length>0?(d(),y(`div`,Ae,[b(C(ne),{"search-query":G.value,"onUpdate:searchQuery":n[3]||=e=>G.value=e,"voice-id":C(I),"onUpdate:voiceId":n[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)?(d(),m(C(s),{key:2,class:`mb-2`,title:`Error loading voices`,error:C(H)},null,8,[`error`])):(d(),m(C(c),{key:3,type:`warning`,icon:`i-solar:info-circle-line-duotone`,class:`mb-2`},{title:v(()=>n[20]||=[p(` No voices available `)]),content:v(()=>n[21]||=[p(` No voices were found for this provider. You can enter a custom voice name below. `)]),_:1})),f(`div`,je,[b(C(l),{modelValue:C(L),"onUpdate:modelValue":n[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`]),b(C(u),{modelValue:C(U),"onUpdate:modelValue":n[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?(d(),y(`div`,Me,[b(C(ae),{modelValue:C(I),"onUpdate:modelValue":n[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`?(d(),y(`div`,Ne,[n[23]||=f(`label`,{class:`mb-1 block text-sm font-medium`},` Model `,-1),h(f(`select`,{"onUpdate:modelValue":n[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`},n[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),[[de,C(P)]])])):_(``,!0),f(`div`,Pe,[b(C(l),{modelValue:C(L),"onUpdate:modelValue":n[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`])])])):_(``,!0)])])):_(``,!0)]),f(`div`,Fe,[f(`div`,Ie,[f(`h2`,Le,[f(`div`,Re,[b(C(ee)),f(`div`,null,w(C(T)(`settings.pages.providers.provider.elevenlabs.playground.title`)),1)])]),f(`div`,ze,[b(C(u),{modelValue:K.value,"onUpdate:modelValue":n[10]||=e=>K.value=e,label:`Use Custom SSML`,description:`Enable to input raw SSML instead of plain text`},null,8,[`modelValue`]),K.value?h((d(),y(`textarea`,{key:1,"onUpdate:modelValue":n[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)),[[fe,J.value]]):(d(),m(C(e),{key:0,modelValue:q.value,"onUpdate:modelValue":n[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`,Be,[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:oe({"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`,He,[n[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,Ve),X.value?(d(),y(`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:$},n[26]||=[f(`div`,{flex:`~ row`,"items-center":``,"gap-2":``},[f(`div`,{"i-solar:stop-circle-bold-duotone":``}),f(`span`,null,`Stop`)],-1)])):_(``,!0)]),X.value?(d(),y(`audio`,{key:2,ref_key:`audioPlayer`,ref:Z,src:X.value,controls:``,class:`mt-2 w-full`},null,8,Ue)):_(``,!0)])])])]),h((d(),y(`div`,k,n[27]||=[f(`div`,{text:`60`,"i-solar:user-speak-rounded-bold-duotone":``},null,-1)])),[[r]])],64)}}});typeof T==`function`&&T(A);var j=A;export{j as default}; \ No newline at end of file +import"./Basic-Cwa2X3hA.js";import{b as e}from"./Textarea-C55W7JzB.js";import{G as t,H as n,J as r,L as i,aK as ee,aP as te,aS as a,ad as o,af as s,ah as ne,ai as re,aj as ie,ak as c,au as l,aw as ae,ay as u,bA as d,bD as f,bE as oe,bG as p,bJ as se,bK as m,bL as h,bM as g,bN as ce,bO as _,bQ as le,bS as ue,bT as v,bU as y,bV as b,bX as x,b_ as S,bt as de,bu as fe,bx as pe,by as C,c0 as w,c1 as me}from"./index-J3uhnpYL.js";import{b as T}from"./route-block-DVyt-3Cw.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`},Te={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=se({__name:`speech`,setup(se){let{t:T}=i(),A=r(),j=t(),{configuredSpeechProvidersMetadata:M}=a(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}=a(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(``);oe(async()=>{await A.loadModelsForConfiguredProviders(),await j.loadVoicesForProvider(N.value)}),le(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 r=K.value?J.value:j.supportsSSML?j.generateSSML(q.value,F.value,{...t,pitch:L.value}):q.value,i=await n({...e.speech(P.value,t),input:r,voice:F.value.id});X.value=URL.createObjectURL(new Blob([i])),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,n)=>{let r=ue(`motion`);return v(),g(p,null,[y(`div`,he,[y(`div`,ge,[y(`div`,null,[y(`div`,_e,[y(`div`,null,[y(`h2`,ve,w(S(T)(`settings.pages.modules.speech.sections.section.provider-voice-selection.title`)),1),y(`div`,ye,[y(`span`,null,w(S(T)(`settings.pages.modules.speech.sections.section.provider-voice-selection.description`)),1)])]),y(`div`,be,[S(M).length>0?(v(),g(`fieldset`,xe,[(v(!0),g(p,null,pe(S(M),e=>(v(),d(S(re),{id:e.id,key:e.id,modelValue:S(N),"onUpdate:modelValue":n[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))])):(v(),g(`div`,Se,[_(S(te),{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(()=>n[13]||=[y(`div`,{"i-solar:warning-circle-line-duotone":``,class:`text-2xl text-amber-500 dark:text-amber-400`},null,-1),y(`div`,{class:`flex flex-col`},[y(`span`,{class:`font-medium`},`No Speech Providers Configured`),y(`span`,{class:`text-sm text-neutral-400 dark:text-neutral-500`},`Click here to set up your speech providers`)],-1),y(`div`,{"i-solar:arrow-right-line-duotone":``,class:`ml-auto text-xl text-neutral-400 dark:text-neutral-500`},null,-1)]),_:1,__:[13]})]))])]),y(`div`,null,[S(N)&&S(Ge)?(v(),g(`div`,Ce,[y(`div`,we,[y(`div`,null,[y(`h2`,Te,w(S(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.title`)),1),y(`div`,E,[y(`span`,null,w(S(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle`)),1)])]),S(z)?(v(),g(`div`,D,[n[14]||=y(`div`,{class:`mr-2 animate-spin`},[y(`div`,{"i-solar:spinner-line-duotone":``,"text-xl":``})],-1),y(`span`,null,w(S(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.loading`)),1)])):S(B)?(v(),d(S(s),{key:1,title:S(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.error`),error:S(B)},null,8,[`title`,`error`])):S(R).length===0&&!S(z)?(v(),d(S(c),{key:2,type:`warning`},{title:h(()=>[C(w(S(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models`)),1)]),content:h(()=>[C(w(S(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models_description`)),1)]),_:1})):S(R).length>0?(v(),d(S(ie),{key:3,modelValue:S(P),"onUpdate:modelValue":n[1]||=e=>b(P)?P.value=e:null,"search-query":S(V),"onUpdate:searchQuery":n[2]||=e=>b(V)?V.value=e:null,items:S(R),searchable:!0,"search-placeholder":S(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.search_placeholder`),"search-no-results-title":S(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results`),"search-no-results-description":S(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results_description`,{query:S(V)}),"search-results-text":S(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.search_results`,{count:`{count}`,total:`{total}`}),"custom-input-placeholder":S(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.custom_model_placeholder`),"expand-button-text":S(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.expand`),"collapse-button-text":S(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)])]),S(N)?(v(),g(`div`,O,[y(`div`,Ee,[n[24]||=y(`div`,null,[y(`h2`,{class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`},` Voice Configuration `),y(`div`,{text:`neutral-400 dark:neutral-500`},[y(`span`,null,`Customize how your AI assistant speaks`)])],-1),S(We)?(v(),g(`div`,De,[y(`div`,Oe,[_(S(o),{class:`w-full rounded-lg p-2.5 text-sm`},{default:h(()=>n[15]||=[y(`div`,{class:`h-1lh`},null,-1)]),_:1,__:[15]}),y(`div`,ke,[_(S(o),{class:`w-full rounded-lg p-4 text-sm`},{default:h(()=>n[16]||=[y(`div`,{class:`h-1lh`},null,-1)]),_:1,__:[16]}),_(S(o),{class:`w-full rounded-lg p-4 text-sm`},{default:h(()=>n[17]||=[y(`div`,{class:`h-1lh`},null,-1)]),_:1,__:[17]}),_(S(o),{class:`w-full rounded-lg p-4 text-sm`},{default:h(()=>n[18]||=[y(`div`,{class:`h-1lh`},null,-1)]),_:1,__:[18]})]),_(S(o),{class:`w-full rounded-lg p-3 text-sm`},{default:h(()=>n[19]||=[y(`div`,{class:`h-1lh`},null,-1)]),_:1,__:[19]})])])):S(W)[S(N)]&&S(W)[S(N)].length>0?(v(),g(`div`,Ae,[_(S(ne),{"search-query":G.value,"onUpdate:searchQuery":n[3]||=e=>G.value=e,"voice-id":S(I),"onUpdate:voiceId":n[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(T)(`settings.pages.modules.speech.sections.section.provider-voice-selection.search_voices_placeholder`),"search-no-results-title":S(T)(`settings.pages.modules.speech.sections.section.provider-voice-selection.no_voices`),"search-no-results-description":S(T)(`settings.pages.modules.speech.sections.section.provider-voice-selection.no_voices_description`),"search-results-text":S(T)(`settings.pages.modules.speech.sections.section.provider-voice-selection.search_voices_results`,{count:0,total:0}),"custom-input-placeholder":S(T)(`settings.pages.modules.speech.sections.section.provider-voice-selection.custom_voice_placeholder`),"expand-button-text":S(T)(`settings.pages.modules.speech.sections.section.provider-voice-selection.show_more`),"collapse-button-text":S(T)(`settings.pages.modules.speech.sections.section.provider-voice-selection.show_less`),"play-button-text":S(T)(`settings.pages.modules.speech.sections.section.provider-voice-selection.play_sample`),"pause-button-text":S(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`])])):S(H)?(v(),d(S(s),{key:2,class:`mb-2`,title:`Error loading voices`,error:S(H)},null,8,[`error`])):(v(),d(S(c),{key:3,type:`warning`,icon:`i-solar:info-circle-line-duotone`,class:`mb-2`},{title:h(()=>n[20]||=[C(` No voices available `)]),content:h(()=>n[21]||=[C(` No voices were found for this provider. You can enter a custom voice name below. `)]),_:1})),y(`div`,je,[_(S(l),{modelValue:S(L),"onUpdate:modelValue":n[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`]),_(S(u),{modelValue:S(U),"onUpdate:modelValue":n[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?(v(),g(`div`,Me,[_(S(ae),{modelValue:S(I),"onUpdate:modelValue":n[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`?(v(),g(`div`,Ne,[n[23]||=y(`label`,{class:`mb-1 block text-sm font-medium`},` Model `,-1),f(y(`select`,{"onUpdate:modelValue":n[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`},n[22]||=[y(`option`,{value:`eleven_monolingual_v1`},` Monolingual v1 `,-1),y(`option`,{value:`eleven_multilingual_v1`},` Multilingual v1 `,-1),y(`option`,{value:`eleven_multilingual_v2`},` Multilingual v2 `,-1)],512),[[de,S(P)]])])):m(``,!0),y(`div`,Pe,[_(S(l),{modelValue:S(L),"onUpdate:modelValue":n[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`])])])):m(``,!0)])])):m(``,!0)]),y(`div`,Fe,[y(`div`,Ie,[y(`h2`,Le,[y(`div`,Re,[_(S(ee)),y(`div`,null,w(S(T)(`settings.pages.providers.provider.elevenlabs.playground.title`)),1)])]),y(`div`,ze,[_(S(u),{modelValue:K.value,"onUpdate:modelValue":n[10]||=e=>K.value=e,label:`Use Custom SSML`,description:`Enable to input raw SSML instead of plain text`},null,8,[`modelValue`]),K.value?f((v(),g(`textarea`,{key:1,"onUpdate:modelValue":n[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)),[[fe,J.value]]):(v(),d(S(e),{key:0,modelValue:q.value,"onUpdate:modelValue":n[11]||=e=>q.value=e,"h-24":``,"w-full":``,placeholder:S(T)(`settings.pages.providers.provider.elevenlabs.playground.fields.field.input.placeholder`)},null,8,[`modelValue`,`placeholder`])),y(`div`,Be,[y(`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:me({"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},[y(`div`,He,[n[25]||=y(`div`,{"i-solar:play-circle-bold-duotone":``},null,-1),y(`span`,null,w(Y.value?S(T)(`settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.generating`):S(T)(`settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.label`)),1)])],10,Ve),X.value?(v(),g(`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:$},n[26]||=[y(`div`,{flex:`~ row`,"items-center":``,"gap-2":``},[y(`div`,{"i-solar:stop-circle-bold-duotone":``}),y(`span`,null,`Stop`)],-1)])):m(``,!0)]),X.value?(v(),g(`audio`,{key:2,ref_key:`audioPlayer`,ref:Z,src:X.value,controls:``,class:`mt-2 w-full`},null,8,Ue)):m(``,!0)])])])]),f((v(),g(`div`,k,n[27]||=[y(`div`,{text:`60`,"i-solar:user-speak-rounded-bold-duotone":``},null,-1)])),[[r]])],64)}}});typeof T==`function`&&T(A);var j=A;export{j as default}; \ No newline at end of file diff --git a/assets/stage-BJhNntgU.js b/assets/stage-BJhNntgU.js deleted file mode 100644 index eef419074770615647e68b5e3dc3fa4af7eb55e6..0000000000000000000000000000000000000000 --- a/assets/stage-BJhNntgU.js +++ /dev/null @@ -1 +0,0 @@ -import{aQ as e,bA as t,bP as n,bS as r,bU as i,b_ as a}from"./index-BFym949y.js";const o={text:`gray-700 dark:gray-200`,"font-cuteen":``,"h-full":``};var s=n({__name:`stage`,setup(n){return(n,s)=>(t(),r(`main`,o,[i(a(e))]))}}),c=s;export{c as default}; \ No newline at end of file diff --git a/assets/stage-BpXm32LC.js b/assets/stage-BpXm32LC.js new file mode 100644 index 0000000000000000000000000000000000000000..22f2f6790efbc2be6434052b2b4bc23b8f911b71 --- /dev/null +++ b/assets/stage-BpXm32LC.js @@ -0,0 +1 @@ +import{aQ as e,bJ as t,bM as n,bO as r,bT as i,b_ as a}from"./index-J3uhnpYL.js";const o={text:`gray-700 dark:gray-200`,"font-cuteen":``,"h-full":``};var s=t({__name:`stage`,setup(t){return(t,s)=>(i(),n(`main`,o,[r(a(e))]))}}),c=s;export{c as default}; \ No newline at end of file diff --git a/assets/stage-Ckabb-ev.js b/assets/stage-Ckabb-ev.js new file mode 100644 index 0000000000000000000000000000000000000000..b01368cc6e3ff20943c9df45fa9c269afbe38a92 --- /dev/null +++ b/assets/stage-Ckabb-ev.js @@ -0,0 +1 @@ +import"./Basic-Cwa2X3hA.js";import{c as e,d as t}from"./theme-color-BcLm08J4.js";import{C as n,aS as r,aV as i,aW as a,aX as o,aZ as s,bA as c,bE as l,bJ as u,bK as d,bL as f,bO as p,bQ as m,bT as h,bU as g,bX as _,b_ as v}from"./index-J3uhnpYL.js";import"./import-url-browser-BymzNjKM.js";import"./duckdb-mvp-1eM9E9sB.js";import"./HeaderLink-C5rYwZW4.js";import{b as y}from"./route-block-DVyt-3Cw.js";import{b}from"./Scenes-CEy5mzwe.js";import{b as x,c as S,d as C,e as w,f as T,g as E}from"./AnimatedWave-BNwebIpR.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}),l(()=>R()),(e,t)=>(h(),c(E,null,{default:f(()=>[p(x,{class:`widgets top-widgets`,"fill-color":v(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:f(()=>[g(`div`,D,[g(`div`,O,[p(T,{class:`hidden md:flex`}),p(C,{class:`flex md:hidden`})]),g(`div`,k,[p(v(b),{"flex-1":``,"min-w":`1/2`,paused:A.value,"focus-at":{x:v(M).x.value,y:v(M).y.value},"x-offset":`${v(L)?v(P).x:v(P).x-10}%`,"y-offset":v(F).y,scale:v(N)},null,8,[`paused`,`focus-at`,`x-offset`,`y-offset`,`scale`]),v(L)?d(``,!0):(h(),c(w,{key:0,h:`85dvh`,absolute:``,"right-4":``,flex:``,"flex-1":``,"flex-col":``,"max-w":`500px`,"min-w":`30%`})),v(L)?(h(),c(S,{key:1,onSettingsOpen:j})):d(``,!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-DfACZXa2.js b/assets/stage-DfACZXa2.js deleted file mode 100644 index b3debbb2519c5db937c6683ac1dc96d375335224..0000000000000000000000000000000000000000 --- a/assets/stage-DfACZXa2.js +++ /dev/null @@ -1 +0,0 @@ -import"./Basic-CcFV8fg0.js";import{b as e,d as t}from"./theme-color-BKoDN9T_.js";import{C as n,aS as r,aT as i,aU as a,aV as o,b4 as s,bA as c,bB as l,bG as u,bK as d,bP as f,bQ as p,bR as m,bU as h,bX as g,b_ as _,by as v}from"./index-BFym949y.js";import"./import-url-browser-CzbE4_30.js";import"./duckdb-mvp-1eM9E9sB.js";import"./HeaderLink-BXWLCGTy.js";import{b as y}from"./route-block-DVyt-3Cw.js";import{b}from"./Scenes-CZrLq5ZX.js";import{b as x,c as S,d as C,e as w,f as T,g as E}from"./AnimatedWave-DHHIvVVC.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}),d(()=>R()),(e,t)=>(c(),u(E,null,{default:m(()=>[h(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:m(()=>[l(`div`,D,[l(`div`,O,[h(T,{class:`hidden md:flex`}),h(C,{class:`flex md:hidden`})]),l(`div`,k,[h(_(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)?p(``,!0):(c(),u(w,{key:0,h:`85dvh`,absolute:``,"right-4":``,flex:``,"flex-1":``,"flex-col":``,"max-w":`500px`,"min-w":`30%`})),_(L)?(c(),u(S,{key:1,onSettingsOpen:j})):p(``,!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/sury-GtnkadyM-Dv3wvZV6.js b/assets/sury-GtnkadyM-CUwsFFlt.js similarity index 71% rename from assets/sury-GtnkadyM-Dv3wvZV6.js rename to assets/sury-GtnkadyM-CUwsFFlt.js index a0c1710c5f0aa99a71e0f7489d2faf553572e47a..163841ed649635d80da8abbb703b12ba8a273532 100644 --- a/assets/sury-GtnkadyM-Dv3wvZV6.js +++ b/assets/sury-GtnkadyM-CUwsFFlt.js @@ -1 +1 @@ -import{O as e,aR as t}from"./index-BFym949y.js";const n=async()=>{let{toJSONSchema:n}=await e(t(()=>import(`./__vite-optional-peer-dep_sury_xsschema-DBCftJAj.js`),[]),`sury`);return e=>n(e)};export{n as getToJsonSchemaFn}; \ No newline at end of file +import{O as e,aR as t}from"./index-J3uhnpYL.js";const n=async()=>{let{toJSONSchema:n}=await e(t(()=>import(`./__vite-optional-peer-dep_sury_xsschema-DBCftJAj.js`),[]),`sury`);return e=>n(e)};export{n as getToJsonSchemaFn}; \ No newline at end of file diff --git a/assets/theme-color-BKoDN9T_.js b/assets/theme-color-BcLm08J4.js similarity index 99% rename from assets/theme-color-BKoDN9T_.js rename to assets/theme-color-BcLm08J4.js index a5b4212ac7b21bb5ce9571561b1c7b52fed01f4b..ff2771c212d5497cd1879d48cd6781214c82408d 100644 --- a/assets/theme-color-BKoDN9T_.js +++ b/assets/theme-color-BcLm08J4.js @@ -1 +1 @@ -import{a7 as e,a8 as t,aT as n}from"./index-BFym949y.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||=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||=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{a7 as e,a8 as t,aW as n}from"./index-J3uhnpYL.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||=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||=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{hi as b,gi as c,mi as d}; \ No newline at end of file diff --git a/assets/together-ai-BHolxZvd.js b/assets/together-ai-BHolxZvd.js new file mode 100644 index 0000000000000000000000000000000000000000..5e6ddac228c3ac42f5b401dd68177315ad284331 --- /dev/null +++ b/assets/together-ai-BHolxZvd.js @@ -0,0 +1 @@ +import{J as e,L as t,aN as n,aS as r,bA as i,bE as a,bH as o,bJ as s,bL as c,bO as l,bQ as u,bT as d,b_ as f,t as p,u as m,v as h,w as g,x as _,y as v}from"./index-J3uhnpYL.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b=`together-ai`;var x=s({__name:`together-ai`,setup(s){let{t:y}=t(),x=n(),S=e(),{providers:C}=r(S),w=o(()=>S.getProviderMetadata(b)),T=o({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=o({get:()=>C.value[b]?.baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});a(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||``}),u([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)=>(d(),i(f(p),{"provider-name":w.value?.localizedName,"provider-icon-color":w.value?.iconColor,"on-back":()=>f(x).back()},{default:c(()=>[l(f(m),null,{default:c(()=>[l(f(h),{title:f(y)(`settings.pages.providers.common.section.basic.title`),description:f(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:c(()=>[l(f(_),{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`]),l(f(v),{title:f(y)(`settings.pages.providers.common.section.advanced.title`)},{default:c(()=>[l(f(g),{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/together-ai-COjt7TWP.js b/assets/together-ai-COjt7TWP.js deleted file mode 100644 index c22ec1b9424a3b5ae65be1b1a2356e5dfbc80b50..0000000000000000000000000000000000000000 --- a/assets/together-ai-COjt7TWP.js +++ /dev/null @@ -1 +0,0 @@ -import{J as e,L as t,aN as n,aS as r,bA as i,bG as a,bK as o,bN as s,bP as c,bR as l,bU as u,b_ as d,by as f,t as p,u as m,v as h,w as g,x as _,y as v}from"./index-BFym949y.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b=`together-ai`;var x=c({__name:`together-ai`,setup(c){let{t:y}=t(),x=n(),S=e(),{providers:C}=r(S),w=s(()=>S.getProviderMetadata(b)),T=s({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=s({get:()=>C.value[b]?.baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});o(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||``}),f([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)=>(i(),a(d(p),{"provider-name":w.value?.localizedName,"provider-icon-color":w.value?.iconColor,"on-back":()=>d(x).back()},{default:l(()=>[u(d(m),null,{default:l(()=>[u(d(h),{title:d(y)(`settings.pages.providers.common.section.basic.title`),description:d(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:l(()=>[u(d(_),{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`]),u(d(v),{title:d(y)(`settings.pages.providers.common.section.advanced.title`)},{default:l(()=>[u(d(g),{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-B6jLny9T.js b/assets/transformers.web-DPuLqcmp.js similarity index 55% rename from assets/transformers.web-B6jLny9T.js rename to assets/transformers.web-DPuLqcmp.js index 4092319b552960d48e385c8c4f4822503f671a49..e805d78e12a10cddfa919351f115fd9e43e6b659 100644 --- a/assets/transformers.web-B6jLny9T.js +++ b/assets/transformers.web-DPuLqcmp.js @@ -1,21 +1,21 @@ -import{c3 as e,c5 as t}from"./index-BFym949y.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 j={};e(j,{InferenceSession:()=>Ke,TRACE:()=>z,TRACE_FUNC_BEGIN:()=>He,TRACE_FUNC_END:()=>B,Tensor:()=>ze,default:()=>rf,env:()=>L,registerBackend:()=>P}); +import{c3 as e,c5 as t}from"./index-J3uhnpYL.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 j={};e(j,{InferenceSession:()=>We,TRACE:()=>V,TRACE_FUNC_BEGIN:()=>Be,TRACE_FUNC_END:()=>H,Tensor:()=>Le,default:()=>rf,env:()=>R,registerBackend:()=>fe}); /*! * ONNX Runtime Web v1.22.0-dev.20250409-89f8206ba4 * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. */ -var re=Object.defineProperty,ie=Object.getOwnPropertyDescriptor,ae=Object.getOwnPropertyNames,oe=Object.prototype.hasOwnProperty,se=(e=>typeof t<`u`?t:typeof Proxy<`u`?new Proxy(e,{get:(e,n)=>(typeof t<`u`?t:e)[n]}):e)(function(e){if(typeof t<`u`)return t.apply(this,arguments);throw Error(`Dynamic require of "`+e+`" is not supported`)}),M=(e,t)=>()=>(e&&(t=e(e=0)),t),N=(e,t)=>{for(var n in t)re(e,n,{get:t[n],enumerable:!0})},ce=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of ae(t))!oe.call(e,i)&&i!==n&&re(e,i,{get:()=>t[i],enumerable:!(r=ie(t,i))||r.enumerable});return e},le=e=>ce(re({},`__esModule`,{value:!0}),e),ue,de,P,F,fe,I=M(()=>{"use strict";ue=new Map,de=[],P=(e,t,n)=>{if(t&&typeof t.init==`function`&&typeof t.createInferenceSessionHandler==`function`){let r=ue.get(e);if(r===void 0)ue.set(e,{backend:t,priority:n});else{if(r.priority>n)return;if(r.priority===n&&r.backend!==t)throw Error(`cannot register backend "${e}" using priority ${n}`)}if(n>=0){let t=de.indexOf(e);t!==-1&&de.splice(t,1);for(let t=0;t{let t=ue.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}}},fe=async e=>{let t=e.executionProviders||[],n=t.map(e=>typeof e==`string`?e:e.name),r=n.length===0?de:n,i,a=[],o=new Set;for(let e of r){let t=await F(e);typeof t==`string`?a.push({name:e,err:t}):(i||=t,i===t&&o.add(e))}if(!i)throw Error(`no available backend found. ERR: ${a.map(e=>`[${e.name}] ${e.err}`).join(`, `)}`);for(let{name:e,err:t}of a)n.includes(e)&&console.warn(`removing requested execution provider "${e}" from session options because it is not available: ${t}`);let s=t.filter(e=>o.has(typeof e==`string`?e:e.name));return[i,new Proxy(e,{get:(e,t)=>t===`executionProviders`?s:Reflect.get(e,t)})]}}),pe=M(()=>{"use strict";I()}),me,he=M(()=>{"use strict";me=`1.22.0-dev.20250409-89f8206ba4`}),ge,_e,ve=M(()=>{"use strict";he(),ge=`warning`,_e={wasm:{},webgl:{},webgpu:{},versions:{common:me},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}`);ge=e}},get logLevel(){return ge}},Object.defineProperty(_e,`logLevel`,{enumerable:!0})}),L,ye=M(()=>{"use strict";ve(),L=_e}),be,xe,Se=M(()=>{"use strict";be=(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?t.format:`RGB`,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{"use strict";Re(),Ce=(e,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?t.tensorFormat:`RGB`,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,Ce(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(Ce(e.data,s))}});throw Error(`Input data provided is not supported - aborted tensor creation`)}if(o!==void 0)return Ce(o,s);throw Error(`Input data provided is not supported - aborted tensor creation`)},Te=(e,t)=>{let{width:n,height:r,download:i,dispose:a}=t,o=[1,r,n,4];return new Le({location:`texture`,type:`float32`,texture:e,dims:o,download:i,dispose:a})},Ee=(e,t)=>{let{dataType:n,dims:r,download:i,dispose:a}=t;return new Le({location:`gpu-buffer`,type:n??`float32`,gpuBuffer:e,dims:r,download:i,dispose:a})},De=(e,t)=>{let{dataType:n,dims:r,download:i,dispose:a}=t;return new Le({location:`ml-tensor`,type:n??`float32`,mlTensor:e,dims:r,download:i,dispose:a})},Oe=(e,t,n)=>new Le({location:`cpu-pinned`,type:e,data:t,dims:n??[t.length]})}),Ae,je,Me,Ne,R=M(()=>{"use strict";Ae=new Map([[`float32`,Float32Array],[`uint8`,Uint8Array],[`int8`,Int8Array],[`uint16`,Uint16Array],[`int16`,Int16Array],[`int32`,Int32Array],[`bool`,Uint8Array],[`float64`,Float64Array],[`uint32`,Uint32Array],[`int4`,Uint8Array],[`uint4`,Uint8Array]]),je=new Map([[Float32Array,`float32`],[Uint8Array,`uint8`],[Int8Array,`int8`],[Uint16Array,`uint16`],[Int16Array,`int16`],[Int32Array,`int32`],[Float64Array,`float64`],[Uint32Array,`uint32`]]),Me=!1,Ne=()=>{if(!Me){Me=!0;let e=typeof BigInt64Array<`u`&&BigInt64Array.from,t=typeof BigUint64Array<`u`&&BigUint64Array.from,n=globalThis.Float16Array,r=typeof n<`u`&&n.from;e&&(Ae.set(`int64`,BigInt64Array),je.set(BigInt64Array,`int64`)),t&&(Ae.set(`uint64`,BigUint64Array),je.set(BigUint64Array,`uint64`)),r?(Ae.set(`float16`,n),je.set(n,`float16`)):Ae.set(`float16`,Uint16Array)}}}),Pe,Fe,Ie=M(()=>{"use strict";Re(),Pe=e=>{let t=1;for(let n=0;n{switch(e.location){case`cpu`:return new Le(e.type,e.data,t);case`cpu-pinned`:return new Le({location:`cpu-pinned`,data:e.data,type:e.type,dims:t});case`texture`:return new Le({location:`texture`,texture:e.texture,type:e.type,dims:t});case`gpu-buffer`:return new Le({location:`gpu-buffer`,gpuBuffer:e.gpuBuffer,type:e.type,dims:t});case`ml-tensor`:return new Le({location:`ml-tensor`,mlTensor:e.mlTensor,type:e.type,dims:t});default:throw Error(`tensorReshape: tensor location ${e.location} is not supported`)}}}),Le,Re=M(()=>{"use strict";Se(),ke(),R(),Ie(),Le=class{constructor(e,t,n){Ne();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=Ae.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=Ae.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=je.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=Pe(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 we(e,t)}static fromTexture(e,t){return Te(e,t)}static fromGpuBuffer(e,t){return Ee(e,t)}static fromMLTensor(e,t){return De(e,t)}static fromPinnedBuffer(e,t,n){return Oe(e,t,n)}toDataURL(e){return be(this,e)}toImageData(e){return xe(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 Fe(this,e)}}}),ze,Be=M(()=>{"use strict";Re(),ze=Le}),z,Ve,He,B,Ue=M(()=>{"use strict";ve(),z=(e,t)=>{(typeof _e.trace>`u`?!_e.wasm.trace:!_e.trace)||console.timeStamp(`${e}::ORT::${t}`)},Ve=(e,t)=>{let n=Error().stack?.split(/\r\n|\r|\n/g)||[],r=!1;for(let i=0;i{(typeof _e.trace>`u`?!_e.wasm.trace:!_e.trace)||Ve(`BEGIN`,e)},B=e=>{(typeof _e.trace>`u`?!_e.wasm.trace:!_e.trace)||Ve(`END`,e)}}),We,Ge=M(()=>{"use strict";I(),Be(),Ue(),We=class e{constructor(e){this.handler=e}async run(e,t,n){He();let r={},i={};if(typeof e!=`object`||!e||e instanceof ze||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 ze)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(typeof n<`u`)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 ze)&&(e=!0,a=!1,r[n]=i)}if(e){if(typeof n==`object`&&n)i=n;else if(typeof n<`u`)throw TypeError(`'options' must be an object.`)}else i=t}}else if(typeof t<`u`)throw TypeError(`Unexpected argument[1]: must be 'fetches' or 'options'.`);for(let t of this.inputNames)if(typeof e[t]>`u`)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 ze?s[e]=t:s[e]=new ze(t.type,t.data,t.dims)}return B(),s}async release(){return this.handler.dispose()}static async create(t,n,r,i){He();let a,o={};if(typeof t==`string`){if(a=t,typeof n==`object`&&n)o=n;else if(typeof n<`u`)throw TypeError(`'options' must be an object.`)}else if(t instanceof Uint8Array){if(a=t,typeof n==`object`&&n)o=n;else if(typeof n<`u`)throw TypeError(`'options' must be an object.`)}else if(t instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&t instanceof SharedArrayBuffer){let e=t,s=0,c=t.byteLength;if(typeof n==`object`&&n)o=n;else if(typeof n==`number`){if(s=n,!Number.isSafeInteger(s))throw RangeError(`'byteOffset' must be an integer.`);if(s<0||s>=e.byteLength)throw RangeError(`'byteOffset' is out of range [0, ${e.byteLength}).`);if(c=t.byteLength-s,typeof r==`number`){if(c=r,!Number.isSafeInteger(c))throw RangeError(`'byteLength' must be an integer.`);if(c<=0||s+c>e.byteLength)throw RangeError(`'byteLength' is out of range (0, ${e.byteLength-s}].`);if(typeof i==`object`&&i)o=i;else if(typeof i<`u`)throw TypeError(`'options' must be an object.`)}else if(typeof r<`u`)throw TypeError(`'byteLength' must be a number.`)}else if(typeof n<`u`)throw TypeError(`'options' must be an object.`);a=new Uint8Array(e,s,c)}else throw TypeError(`Unexpected argument[0]: must be 'path' or 'buffer'.`);let[s,c]=await fe(o),l=await s.createInferenceSessionHandler(a,c);return B(),new e(l)}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}}}),Ke,qe=M(()=>{"use strict";Ge(),Ke=We}),Je=M(()=>{"use strict";}),Ye=M(()=>{"use strict";}),Xe=M(()=>{"use strict";}),Ze=M(()=>{"use strict";}),Qe={};N(Qe,{InferenceSession:()=>Ke,TRACE:()=>z,TRACE_FUNC_BEGIN:()=>He,TRACE_FUNC_END:()=>B,Tensor:()=>ze,env:()=>L,registerBackend:()=>P});var $e=M(()=>{"use strict";pe(),ye(),qe(),Be(),Je(),Ye(),Ue(),Xe(),Ze()}),et=M(()=>{"use strict";}),tt={};N(tt,{default:()=>it});var nt,rt,it,at=M(()=>{"use strict";Dd(),It(),Et(),nt=`ort-wasm-proxy-worker`,rt=globalThis.self?.name===nt,rt&&(self.onmessage=e=>{let{type:t,in:n}=e.data;try{switch(t){case`init-wasm`:Pt(n.wasm).then(()=>{hd(n).then(()=>{postMessage({type:t})},e=>{postMessage({type:t,err:e})})},e=>{postMessage({type:t,err:e})});break;case`init-ep`:{let{epName:e,env:r}=n;gd(r,e).then(()=>{postMessage({type:t})},e=>{postMessage({type:t,err:e})});break}case`copy-from`:{let{buffer:e}=n,r=bd(e);postMessage({type:t,out:r});break}case`create`:{let{model:e,options:r}=n;xd(e,r).then(e=>{postMessage({type:t,out:e})},e=>{postMessage({type:t,err:e})});break}case`release`:Sd(n),postMessage({type:t});break;case`run`:{let{sessionId:e,inputIndices:r,inputs:i,outputIndices:a,options:o}=n;wd(e,r,i,a,Array(a.length).fill(null),o).then(e=>{e.some(e=>e[3]!==`cpu`)?postMessage({type:t,err:`Proxy does not support non-cpu tensor location.`}):postMessage({type:t,out:e},Ed([...i,...e]))},e=>{postMessage({type:t,err:e})});break}case`end-profiling`:Td(n),postMessage({type:t});break;default:}}catch(e){postMessage({type:t,err:e})}}),it=rt?null:e=>new Worker(e??ht,{type:`module`,name:nt})}),ot={};N(ot,{default:()=>lt});var st,ct,lt,ut,dt=M(()=>{"use strict";ct=(st=import.meta.url,async function(e={}){var t,n,r=e,i=new Promise((e,r)=>{t=e,n=r}),a=typeof window==`object`,o=typeof WorkerGlobalScope<`u`,s=o&&self.name?.startsWith(`em-pthread`);r.mountExternalData=(e,t)=>{e.startsWith(`./`)&&(e=e.substring(2)),(r.Eb||=new Map).set(e,t)},r.unmountExternalData=()=>{delete r.Eb};var c=globalThis.SharedArrayBuffer??new WebAssembly.Memory({initial:0,maximum:0,pc:!0}).buffer.constructor;let l=e=>async(...t)=>{try{if(r.Fb)throw Error(`Session already started`);let n=r.Fb={dc:t[0],errors:[]},i=await e(...t);if(r.Fb!==n)throw Error(`Session mismatch`);r.Jb?.flush();let a=n.errors;if(0e),0{if(e===`webgpu`){[r.Jb,r.Ub,r.Yb,r.Kb,r.Xb,r.jb,r.Zb,r.ac,r.Vb,r.Wb,r.$b]=t;let e=r.Jb;r.jsepRegisterBuffer=(t,n,r,i)=>e.registerBuffer(t,n,r,i),r.jsepGetBuffer=t=>e.getBuffer(t),r.jsepCreateDownloader=(t,n,r)=>e.createDownloader(t,n,r),r.jsepOnCreateSession=t=>{e.onCreateSession(t)},r.jsepOnReleaseSession=t=>{e.onReleaseSession(t)},r.jsepOnRunStart=t=>e.onRunStart(t),r.bc=(t,n)=>{e.upload(t,n)}}else if(e===`webnn`){let e=t[0];[r.nc,r.Nb,r.webnnEnsureTensor,r.Ob,r.webnnDownloadTensor]=t.slice(1),r.webnnReleaseTensorId=r.Nb,r.webnnUploadTensor=r.Ob,r.webnnOnRunStart=t=>e.onRunStart(t),r.webnnOnRunEnd=e.onRunEnd.bind(e),r.webnnRegisterMLContext=(t,n)=>{e.registerMLContext(t,n)},r.webnnOnReleaseSession=t=>{e.onReleaseSession(t)},r.webnnCreateMLTensorDownloader=(t,n)=>e.createMLTensorDownloader(t,n),r.webnnRegisterMLTensor=(t,n,r,i)=>e.registerMLTensor(t,n,r,i),r.webnnCreateMLContext=t=>e.createMLContext(t),r.webnnRegisterMLConstant=(t,n,i,a,o,s)=>e.registerMLConstant(t,n,i,a,o,r.Eb,s),r.webnnRegisterGraphInput=e.registerGraphInput.bind(e),r.webnnIsGraphInput=e.isGraphInput.bind(e),r.webnnCreateTemporaryTensor=e.createTemporaryTensor.bind(e),r.webnnIsInt64Supported=e.isInt64Supported.bind(e)}};let u=()=>{let e=(e,t,n)=>(...r)=>{let i=tn,a=t?.();r=e(...r);let o=t?.();return a!==o&&(e=o,n(a),t=n=null),tn==i?r:new Promise((e,t)=>{sn={resolve:e,reject:t}})};(()=>{for(let t of[`_OrtAppendExecutionProvider`,`_OrtCreateSession`,`_OrtRun`,`_OrtRunWithBinding`,`_OrtBindInput`])r[t]=e(r[t],()=>r[t],e=>r[t]=e)})(),l!==void 0&&(r._OrtRun=l(r._OrtRun),r._OrtRunWithBinding=l(r._OrtRunWithBinding)),u=void 0};r.asyncInit=()=>{u?.()};var d,f,p=Object.assign({},r),m=(e,t)=>{throw t},h=``;(a||o)&&(o?h=self.location.href:typeof document<`u`&&document.currentScript&&(h=document.currentScript.src),st&&(h=st),h=h.startsWith(`blob:`)?``:h.slice(0,h.replace(/[?#].*/,``).lastIndexOf(`/`)+1),o&&(f=e=>{var t=new XMLHttpRequest;return t.open(`GET`,e,!1),t.responseType=`arraybuffer`,t.send(null),new Uint8Array(t.response)}),d=async e=>{if(re(e))return new Promise((t,n)=>{var r=new XMLHttpRequest;r.open(`GET`,e,!0),r.responseType=`arraybuffer`,r.onload=()=>{r.status==200||r.status==0&&r.response?t(r.response):n(r.status)},r.onerror=n,r.send(null)});var t=await fetch(e,{credentials:`same-origin`});if(t.ok)return t.arrayBuffer();throw Error(t.status+` : `+t.url)});var g=console.log.bind(console),_=console.error.bind(console),v=g,y=_;Object.assign(r,p),p=null;var b,x,S,C,w,T,E,D,O,k,A,ee,te,ne=r.wasmBinary,j=!1,re=e=>e.startsWith(`file://`);function ie(){return b.buffer!=C.buffer&&F(),C}function ae(){return b.buffer!=C.buffer&&F(),w}function oe(){return b.buffer!=C.buffer&&F(),T}function se(){return b.buffer!=C.buffer&&F(),E}function M(){return b.buffer!=C.buffer&&F(),D}function N(){return b.buffer!=C.buffer&&F(),O}function ce(){return b.buffer!=C.buffer&&F(),k}function le(){return b.buffer!=C.buffer&&F(),te}if(s){let e=function(t){try{var n=t.data,i=n.Bb;if(i===`load`){let t=[];self.onmessage=e=>t.push(e),self.startWorker=()=>{postMessage({Bb:`loaded`});for(let n of t)e(n);self.onmessage=e};for(let e of n.Rb)r[e]&&!r[e].proxy||(r[e]=(...t)=>{postMessage({Bb:`callHandler`,Qb:e,args:t})},e==`print`&&(v=r[e]),e==`printErr`&&(y=r[e]));b=n.kc,F(),de(n.lc)}else if(i===`run`){Ie(n.Ab),yr(n.Ab,0,0,1,0,0),R(),Vt(n.Ab),P||(hr(),P=!0);try{Le(n.fc,n.Hb)}catch(e){if(e!=`unwind`)throw e}}else n.target!==`setimmediate`&&(i===`checkMailbox`?P&&Ht():i&&(y(`worker: received unknown command ${i}`),y(n)))}catch(e){throw br(),e}};var ue=e,de,P=!1;y=function(...e){e=e.join(` `),console.error(e)},self.alert=function(...e){postMessage({Bb:`alert`,text:e.join(` `),ic:gr()})},self.onunhandledrejection=e=>{throw e.reason||e},self.onmessage=e}function F(){var e=b.buffer;r.HEAP8=C=new Int8Array(e),r.HEAP16=T=new Int16Array(e),r.HEAPU8=w=new Uint8Array(e),r.HEAPU16=E=new Uint16Array(e),r.HEAP32=D=new Int32Array(e),r.HEAPU32=O=new Uint32Array(e),r.HEAPF32=k=new Float32Array(e),r.HEAPF64=te=new Float64Array(e),r.HEAP64=A=new BigInt64Array(e),r.HEAPU64=ee=new BigUint64Array(e)}function fe(){s?startWorker(r):X.Ca()}s||(b=new WebAssembly.Memory({initial:256,maximum:65536,shared:!0}),F());var I,pe=0,me=null;function he(){if(--pe==0&&me){var e=me;me=null,e()}}function ge(e){throw y(e=`Aborted(`+e+`)`),j=!0,e=new WebAssembly.RuntimeError(e+`. Build with -sASSERTIONS for more info.`),n(e),e}function _e(){return{a:{L:ye,Aa:L,b:ze,$:z,A:Ue,pa:We,X:qe,Z:Je,qa:Ye,na:Xe,ga:Ze,ma:Qe,J:$e,Y:et,V:tt,oa:nt,W:rt,va:ot,E:mt,Q:gt,O:wt,D:Et,u:Dt,r:Ot,P:kt,z:Lt,R:Rt,ja:zt,T:Ut,aa:Gt,M:Kt,F:qt,ia:Vt,sa:Jt,t:Zt,Ba:Qt,w:un,o:fn,l:mn,c:yt,n:U,j:yn,v:W,p:bn,f:xn,s:Sn,m:Cn,e:wn,k:Tn,i:En,g:Dn,d:On,da:kn,ea:Nn,fa:Pn,ba:Fn,ca:In,N:zn,xa:Bn,ua:Un,h:Kn,C:qn,G:Jn,ta:Vn,x:Yn,ra:Xn,U:Zn,q:Rn,y:Qn,K:$n,S:er,za:rr,ya:ir,ka:J,la:or,_:Oe,B:sr,I:cr,ha:lr,H:ur,a:b,wa:Ee}}}var ve={829644:(e,t,n,i,a)=>{if(r===void 0||!r.Eb)return 1;if((e=B(Number(e>>>0))).startsWith(`./`)&&(e=e.substring(2)),!(e=r.Eb.get(e)))return 2;if(t=Number(t>>>0),n=Number(n>>>0),i=Number(i>>>0),t+n>e.byteLength)return 3;try{let o=e.subarray(t,t+n);switch(a){case 0:ae().set(o,i>>>0);break;case 1:r.mc?r.mc(i,o):r.bc(i,o);break;default:return 4}return 0}catch{return 4}},830468:(e,t,n)=>{r.Ob(e,ae().subarray(t>>>0,t+n>>>0))},830532:()=>r.nc(),830574:e=>{r.Nb(e)},830611:()=>{r.Vb()},830642:()=>{r.Wb()},830671:()=>{r.$b()},830696:e=>r.Ub(e),830729:e=>r.Yb(e),830761:(e,t,n)=>{r.Kb(Number(e),Number(t),Number(n),!0)},830824:(e,t,n)=>{r.Kb(Number(e),Number(t),Number(n))},830881:()=>typeof wasmOffsetConverter<`u`,830938:e=>{r.jb(`Abs`,e,void 0)},830989:e=>{r.jb(`Neg`,e,void 0)},831040:e=>{r.jb(`Floor`,e,void 0)},831093:e=>{r.jb(`Ceil`,e,void 0)},831145:e=>{r.jb(`Reciprocal`,e,void 0)},831203:e=>{r.jb(`Sqrt`,e,void 0)},831255:e=>{r.jb(`Exp`,e,void 0)},831306:e=>{r.jb(`Erf`,e,void 0)},831357:e=>{r.jb(`Sigmoid`,e,void 0)},831412:(e,t,n)=>{r.jb(`HardSigmoid`,e,{alpha:t,beta:n})},831491:e=>{r.jb(`Log`,e,void 0)},831542:e=>{r.jb(`Sin`,e,void 0)},831593:e=>{r.jb(`Cos`,e,void 0)},831644:e=>{r.jb(`Tan`,e,void 0)},831695:e=>{r.jb(`Asin`,e,void 0)},831747:e=>{r.jb(`Acos`,e,void 0)},831799:e=>{r.jb(`Atan`,e,void 0)},831851:e=>{r.jb(`Sinh`,e,void 0)},831903:e=>{r.jb(`Cosh`,e,void 0)},831955:e=>{r.jb(`Asinh`,e,void 0)},832008:e=>{r.jb(`Acosh`,e,void 0)},832061:e=>{r.jb(`Atanh`,e,void 0)},832114:e=>{r.jb(`Tanh`,e,void 0)},832166:e=>{r.jb(`Not`,e,void 0)},832217:(e,t,n)=>{r.jb(`Clip`,e,{min:t,max:n})},832286:e=>{r.jb(`Clip`,e,void 0)},832338:(e,t)=>{r.jb(`Elu`,e,{alpha:t})},832396:e=>{r.jb(`Gelu`,e,void 0)},832448:e=>{r.jb(`Relu`,e,void 0)},832500:(e,t)=>{r.jb(`LeakyRelu`,e,{alpha:t})},832564:(e,t)=>{r.jb(`ThresholdedRelu`,e,{alpha:t})},832634:(e,t)=>{r.jb(`Cast`,e,{to:t})},832692:e=>{r.jb(`Add`,e,void 0)},832743:e=>{r.jb(`Sub`,e,void 0)},832794:e=>{r.jb(`Mul`,e,void 0)},832845:e=>{r.jb(`Div`,e,void 0)},832896:e=>{r.jb(`Pow`,e,void 0)},832947:e=>{r.jb(`Equal`,e,void 0)},833e3:e=>{r.jb(`Greater`,e,void 0)},833055:e=>{r.jb(`GreaterOrEqual`,e,void 0)},833117:e=>{r.jb(`Less`,e,void 0)},833169:e=>{r.jb(`LessOrEqual`,e,void 0)},833228:(e,t,n,i,a)=>{r.jb(`ReduceMean`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},833403:(e,t,n,i,a)=>{r.jb(`ReduceMax`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},833577:(e,t,n,i,a)=>{r.jb(`ReduceMin`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},833751:(e,t,n,i,a)=>{r.jb(`ReduceProd`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},833926:(e,t,n,i,a)=>{r.jb(`ReduceSum`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},834100:(e,t,n,i,a)=>{r.jb(`ReduceL1`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},834273:(e,t,n,i,a)=>{r.jb(`ReduceL2`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},834446:(e,t,n,i,a)=>{r.jb(`ReduceLogSum`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},834623:(e,t,n,i,a)=>{r.jb(`ReduceSumSquare`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},834803:(e,t,n,i,a)=>{r.jb(`ReduceLogSumExp`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},834983:e=>{r.jb(`Where`,e,void 0)},835036:(e,t,n)=>{r.jb(`Transpose`,e,{perm:t?Array.from(M().subarray(Number(t)>>>0,Number(n)>>>0)):[]})},835160:(e,t,n,i)=>{r.jb(`DepthToSpace`,e,{blocksize:t,mode:B(n),format:i?`NHWC`:`NCHW`})},835293:(e,t,n,i)=>{r.jb(`DepthToSpace`,e,{blocksize:t,mode:B(n),format:i?`NHWC`:`NCHW`})},835426:(e,t,n,i,a,o,s,c,l,u,d,f,p,m,h)=>{r.jb(`ConvTranspose`,e,{format:l?`NHWC`:`NCHW`,autoPad:t,dilations:[n],group:i,kernelShape:[a],pads:[o,s],strides:[c],wIsConst:()=>!!ie()[u>>>0],outputPadding:d?Array.from(M().subarray(Number(d)>>>0,Number(f)>>>0)):[],outputShape:p?Array.from(M().subarray(Number(p)>>>0,Number(m)>>>0)):[],activation:B(h)})},835859:(e,t,n,i,a,o,s,c,l,u,d,f,p,m)=>{r.jb(`ConvTranspose`,e,{format:c?`NHWC`:`NCHW`,autoPad:t,dilations:Array.from(M().subarray(Number(n)>>>0,2+(Number(n)>>>0)>>>0)),group:i,kernelShape:Array.from(M().subarray(Number(a)>>>0,2+(Number(a)>>>0)>>>0)),pads:Array.from(M().subarray(Number(o)>>>0,4+(Number(o)>>>0)>>>0)),strides:Array.from(M().subarray(Number(s)>>>0,2+(Number(s)>>>0)>>>0)),wIsConst:()=>!!ie()[l>>>0],outputPadding:u?Array.from(M().subarray(Number(u)>>>0,Number(d)>>>0)):[],outputShape:f?Array.from(M().subarray(Number(f)>>>0,Number(p)>>>0)):[],activation:B(m)})},836520:(e,t,n,i,a,o,s,c,l,u,d,f,p,m,h)=>{r.jb(`ConvTranspose`,e,{format:l?`NHWC`:`NCHW`,autoPad:t,dilations:[n],group:i,kernelShape:[a],pads:[o,s],strides:[c],wIsConst:()=>!!ie()[u>>>0],outputPadding:d?Array.from(M().subarray(Number(d)>>>0,Number(f)>>>0)):[],outputShape:p?Array.from(M().subarray(Number(p)>>>0,Number(m)>>>0)):[],activation:B(h)})},836953:(e,t,n,i,a,o,s,c,l,u,d,f,p,m)=>{r.jb(`ConvTranspose`,e,{format:c?`NHWC`:`NCHW`,autoPad:t,dilations:Array.from(M().subarray(Number(n)>>>0,2+(Number(n)>>>0)>>>0)),group:i,kernelShape:Array.from(M().subarray(Number(a)>>>0,2+(Number(a)>>>0)>>>0)),pads:Array.from(M().subarray(Number(o)>>>0,4+(Number(o)>>>0)>>>0)),strides:Array.from(M().subarray(Number(s)>>>0,2+(Number(s)>>>0)>>>0)),wIsConst:()=>!!ie()[l>>>0],outputPadding:u?Array.from(M().subarray(Number(u)>>>0,Number(d)>>>0)):[],outputShape:f?Array.from(M().subarray(Number(f)>>>0,Number(p)>>>0)):[],activation:B(m)})},837614:(e,t)=>{r.jb(`GlobalAveragePool`,e,{format:t?`NHWC`:`NCHW`})},837705:(e,t,n,i,a,o,s,c,l,u,d,f,p,m)=>{r.jb(`AveragePool`,e,{format:m?`NHWC`:`NCHW`,auto_pad:t,ceil_mode:n,count_include_pad:i,storage_order:a,dilations:o?Array.from(M().subarray(Number(o)>>>0,Number(s)>>>0)):[],kernel_shape:c?Array.from(M().subarray(Number(c)>>>0,Number(l)>>>0)):[],pads:u?Array.from(M().subarray(Number(u)>>>0,Number(d)>>>0)):[],strides:f?Array.from(M().subarray(Number(f)>>>0,Number(p)>>>0)):[]})},838184:(e,t)=>{r.jb(`GlobalAveragePool`,e,{format:t?`NHWC`:`NCHW`})},838275:(e,t,n,i,a,o,s,c,l,u,d,f,p,m)=>{r.jb(`AveragePool`,e,{format:m?`NHWC`:`NCHW`,auto_pad:t,ceil_mode:n,count_include_pad:i,storage_order:a,dilations:o?Array.from(M().subarray(Number(o)>>>0,Number(s)>>>0)):[],kernel_shape:c?Array.from(M().subarray(Number(c)>>>0,Number(l)>>>0)):[],pads:u?Array.from(M().subarray(Number(u)>>>0,Number(d)>>>0)):[],strides:f?Array.from(M().subarray(Number(f)>>>0,Number(p)>>>0)):[]})},838754:(e,t)=>{r.jb(`GlobalMaxPool`,e,{format:t?`NHWC`:`NCHW`})},838841:(e,t,n,i,a,o,s,c,l,u,d,f,p,m)=>{r.jb(`MaxPool`,e,{format:m?`NHWC`:`NCHW`,auto_pad:t,ceil_mode:n,count_include_pad:i,storage_order:a,dilations:o?Array.from(M().subarray(Number(o)>>>0,Number(s)>>>0)):[],kernel_shape:c?Array.from(M().subarray(Number(c)>>>0,Number(l)>>>0)):[],pads:u?Array.from(M().subarray(Number(u)>>>0,Number(d)>>>0)):[],strides:f?Array.from(M().subarray(Number(f)>>>0,Number(p)>>>0)):[]})},839316:(e,t)=>{r.jb(`GlobalMaxPool`,e,{format:t?`NHWC`:`NCHW`})},839403:(e,t,n,i,a,o,s,c,l,u,d,f,p,m)=>{r.jb(`MaxPool`,e,{format:m?`NHWC`:`NCHW`,auto_pad:t,ceil_mode:n,count_include_pad:i,storage_order:a,dilations:o?Array.from(M().subarray(Number(o)>>>0,Number(s)>>>0)):[],kernel_shape:c?Array.from(M().subarray(Number(c)>>>0,Number(l)>>>0)):[],pads:u?Array.from(M().subarray(Number(u)>>>0,Number(d)>>>0)):[],strides:f?Array.from(M().subarray(Number(f)>>>0,Number(p)>>>0)):[]})},839878:(e,t,n,i,a)=>{r.jb(`Gemm`,e,{alpha:t,beta:n,transA:i,transB:a})},839982:e=>{r.jb(`MatMul`,e,void 0)},840036:(e,t,n,i)=>{r.jb(`ArgMax`,e,{keepDims:!!t,selectLastIndex:!!n,axis:i})},840144:(e,t,n,i)=>{r.jb(`ArgMin`,e,{keepDims:!!t,selectLastIndex:!!n,axis:i})},840252:(e,t)=>{r.jb(`Softmax`,e,{axis:t})},840315:(e,t)=>{r.jb(`Concat`,e,{axis:t})},840375:(e,t,n,i,a)=>{r.jb(`Split`,e,{axis:t,numOutputs:n,splitSizes:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},840531:e=>{r.jb(`Expand`,e,void 0)},840585:(e,t)=>{r.jb(`Gather`,e,{axis:Number(t)})},840656:(e,t)=>{r.jb(`GatherElements`,e,{axis:Number(t)})},840735:(e,t)=>{r.jb(`GatherND`,e,{batch_dims:Number(t)})},840814:(e,t,n,i,a,o,s,c,l,u,d)=>{r.jb(`Resize`,e,{antialias:t,axes:n?Array.from(M().subarray(Number(n)>>>0,Number(i)>>>0)):[],coordinateTransformMode:B(a),cubicCoeffA:o,excludeOutside:s,extrapolationValue:c,keepAspectRatioPolicy:B(l),mode:B(u),nearestMode:B(d)})},841176:(e,t,n,i,a,o,s)=>{r.jb(`Slice`,e,{starts:t?Array.from(M().subarray(Number(t)>>>0,Number(n)>>>0)):[],ends:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[],axes:o?Array.from(M().subarray(Number(o)>>>0,Number(s)>>>0)):[]})},841440:e=>{r.jb(`Tile`,e,void 0)},841492:(e,t,n)=>{r.jb(`InstanceNormalization`,e,{epsilon:t,format:n?`NHWC`:`NCHW`})},841606:(e,t,n)=>{r.jb(`InstanceNormalization`,e,{epsilon:t,format:n?`NHWC`:`NCHW`})},841720:e=>{r.jb(`Range`,e,void 0)},841773:(e,t)=>{r.jb(`Einsum`,e,{equation:B(t)})},841854:(e,t,n,i,a)=>{r.jb(`Pad`,e,{mode:t,value:n,pads:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},841997:(e,t,n,i,a,o)=>{r.jb(`BatchNormalization`,e,{epsilon:t,momentum:n,spatial:!!a,trainingMode:!!i,format:o?`NHWC`:`NCHW`})},842166:(e,t,n,i,a,o)=>{r.jb(`BatchNormalization`,e,{epsilon:t,momentum:n,spatial:!!a,trainingMode:!!i,format:o?`NHWC`:`NCHW`})},842335:(e,t,n)=>{r.jb(`CumSum`,e,{exclusive:Number(t),reverse:Number(n)})},842432:(e,t,n)=>{r.jb(`DequantizeLinear`,e,{axis:t,blockSize:n})},842522:(e,t,n,i,a)=>{r.jb(`GridSample`,e,{align_corners:t,mode:B(n),padding_mode:B(i),format:a?`NHWC`:`NCHW`})},842692:(e,t,n,i,a)=>{r.jb(`GridSample`,e,{align_corners:t,mode:B(n),padding_mode:B(i),format:a?`NHWC`:`NCHW`})},842862:(e,t)=>{r.jb(`ScatterND`,e,{reduction:B(t)})},842947:(e,t,n,i,a,o,s,c,l)=>{r.jb(`Attention`,e,{numHeads:t,isUnidirectional:n,maskFilterValue:i,scale:a,doRotary:o,qkvHiddenSizes:s?Array.from(M().subarray(Number(c)>>>0,Number(c)+s>>>0)):[],pastPresentShareBuffer:!!l})},843219:e=>{r.jb(`BiasAdd`,e,void 0)},843274:e=>{r.jb(`BiasSplitGelu`,e,void 0)},843335:e=>{r.jb(`FastGelu`,e,void 0)},843391:(e,t,n,i,a,o,s,c,l,u,d,f,p,m,h,g)=>{r.jb(`Conv`,e,{format:f?`NHWC`:`NCHW`,auto_pad:t,dilations:n?Array.from(M().subarray(Number(n)>>>0,Number(i)>>>0)):[],group:a,kernel_shape:o?Array.from(M().subarray(Number(o)>>>0,Number(s)>>>0)):[],pads:c?Array.from(M().subarray(Number(c)>>>0,Number(l)>>>0)):[],strides:u?Array.from(M().subarray(Number(u)>>>0,Number(d)>>>0)):[],w_is_const:()=>!!ie()[Number(p)>>>0],activation:B(m),activation_params:h?Array.from(ce().subarray(Number(h)>>>0,Number(g)>>>0)):[]})},843975:e=>{r.jb(`Gelu`,e,void 0)},844027:(e,t,n,i,a,o,s,c,l)=>{r.jb(`GroupQueryAttention`,e,{numHeads:t,kvNumHeads:n,scale:i,softcap:a,doRotary:o,rotaryInterleaved:s,smoothSoftmax:c,localWindowSize:l})},844244:(e,t,n,i)=>{r.jb(`LayerNormalization`,e,{axis:t,epsilon:n,simplified:!!i})},844355:(e,t,n,i)=>{r.jb(`LayerNormalization`,e,{axis:t,epsilon:n,simplified:!!i})},844466:(e,t,n,i,a,o)=>{r.jb(`MatMulNBits`,e,{k:t,n,accuracyLevel:i,bits:a,blockSize:o})},844593:(e,t,n,i,a,o)=>{r.jb(`MultiHeadAttention`,e,{numHeads:t,isUnidirectional:n,maskFilterValue:i,scale:a,doRotary:o})},844752:(e,t)=>{r.jb(`QuickGelu`,e,{alpha:t})},844816:(e,t,n,i,a)=>{r.jb(`RotaryEmbedding`,e,{interleaved:!!t,numHeads:n,rotaryEmbeddingDim:i,scale:a})},844955:(e,t,n)=>{r.jb(`SkipLayerNormalization`,e,{epsilon:t,simplified:!!n})},845057:(e,t,n)=>{r.jb(`SkipLayerNormalization`,e,{epsilon:t,simplified:!!n})},845159:(e,t,n,i)=>{r.jb(`GatherBlockQuantized`,e,{gatherAxis:t,quantizeAxis:n,blockSize:i})},845280:e=>{r.Zb(e)},845314:(e,t)=>r.ac(Number(e),Number(t),r.Fb.dc,r.Fb.errors)};function L(e,t,n){return ln(async()=>{await r.Xb(Number(e),Number(t),Number(n))})}function ye(){return typeof wasmOffsetConverter<`u`}class be{name=`ExitStatus`;constructor(e){this.message=`Program terminated with exit(${e})`,this.status=e}}var xe=e=>{e.terminate(),e.onmessage=()=>{}},Se=[],Ce=e=>{ke.length==0&&(Fe(),Pe(ke[0]));var t=ke.pop();if(!t)return 6;Ae.push(t),Me[e.Ab]=t,t.Ab=e.Ab;var n={Bb:`run`,fc:e.ec,Hb:e.Hb,Ab:e.Ab};return t.postMessage(n,e.Mb),0},we=0,Te=(e,t,...n)=>{for(var r=2*n.length,i=kr(),a=Or(8*r),o=a>>>3,s=0;s>>0]=c)}return e=xr(e,0,r,a,t),Dr(i),e};function Ee(e){if(s)return Te(0,1,e);if(S=e,!(0{if(S=e,s)throw De(e),`unwind`;Ee(e)},ke=[],Ae=[],je=[],Me={},Ne=e=>{var t=e.Ab;delete Me[t],ke.push(e),Ae.splice(Ae.indexOf(e),1),e.Ab=0,Sr(t)};function R(){je.forEach(e=>e())}var Pe=e=>new Promise(t=>{e.onmessage=n=>{var i=(n=n.data).Bb;if(n.Gb&&n.Gb!=gr()){var a=Me[n.Gb];a?a.postMessage(n,n.Mb):y(`Internal error! Worker sent a message "${i}" to target pthread ${n.Gb}, but that thread no longer exists!`)}else i===`checkMailbox`?Ht():i===`spawnThread`?Ce(n):i===`cleanupThread`?Ne(Me[n.hc]):i===`loaded`?(e.loaded=!0,t(e)):i===`alert`?alert(`Thread ${n.ic}: ${n.text}`):n.target===`setimmediate`?e.postMessage(n):i===`callHandler`?r[n.Qb](...n.args):i&&y(`worker sent an unknown command ${i}`)},e.onerror=e=>{throw y(`worker sent an error! ${e.filename}:${e.lineno}: ${e.message}`),e};var n,i=[];for(n of[])r.propertyIsEnumerable(n)&&i.push(n);e.postMessage({Bb:`load`,Rb:i,kc:b,lc:x})});function Fe(){var e=new Worker((()=>{let e=URL;return import.meta.url>`file:`&&import.meta.url<`file;`?new e(`ort.bundle.min.mjs`,import.meta.url):new URL(import.meta.url)})(),{type:`module`,workerData:`em-pthread`,name:`em-pthread`});ke.push(e)}var Ie=e=>{F();var t=N()[e+52>>>2>>>0];e=N()[e+56>>>2>>>0],Er(t,t-e),Dr(t)},Le=(e,t)=>{we=0,e=Ar(e,t),0>>=0);throw t>>>=0,n>>>=0,N()[r.Ib+16>>>2>>>0]=0,N()[r.Ib+4>>>2>>>0]=t,N()[r.Ib+8>>>2>>>0]=n,e}function Be(e,t,n,r){return s?Te(2,1,e,t,n,r):z(e,t,n,r)}function z(e,t,n,r){if(e>>>=0,n>>>=0,r>>>=0,c===void 0)return 6;var i=[];return s&&i.length===0?Be(e,t>>>=0,n,r):(e={ec:n,Ab:e,Hb:r,Mb:i},s?(e.Bb=`spawnThread`,postMessage(e,i),0):Ce(e))}var Ve=typeof TextDecoder<`u`?new TextDecoder:void 0,He=(e,t=0,n=NaN)=>{var r=(t>>>=0)+n;for(n=t;e[n]&&!(n>=r);)++n;if(16(i=(240&i)==224?(15&i)<<12|a<<6|o:(7&i)<<18|a<<12|o<<6|63&e[t++])?r+=String.fromCharCode(i):(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i))}}else r+=String.fromCharCode(i)}return r},B=(e,t)=>(e>>>=0)?He(ae(),e,t):``;function Ue(e,t,n){return s?Te(3,1,e,t,n):0}function We(e,t){if(s)return Te(4,1,e,t)}var Ge=e=>{for(var t=0,n=0;n=r?t++:2047>=r?t+=2:55296<=r&&57343>=r?(t+=4,++n):t+=3}return t},Ke=(e,t,n)=>{var r=ae();if(t>>>=0,0=o&&(o=65536+((1023&o)<<10)|1023&e.charCodeAt(++a)),127>=o){if(t>=n)break;r[t++>>>0]=o}else{if(2047>=o){if(t+1>=n)break;r[t++>>>0]=192|o>>6}else{if(65535>=o){if(t+2>=n)break;r[t++>>>0]=224|o>>12}else{if(t+3>=n)break;r[t++>>>0]=240|o>>18,r[t++>>>0]=128|o>>12&63}r[t++>>>0]=128|o>>6&63}r[t++>>>0]=128|63&o}}r[t>>>0]=0,e=t-i}else e=0;return e};function qe(e,t){if(s)return Te(5,1,e,t)}function Je(e,t,n){if(s)return Te(6,1,e,t,n)}function Ye(e,t,n){return s?Te(7,1,e,t,n):0}function Xe(e,t){if(s)return Te(8,1,e,t)}function Ze(e,t,n){if(s)return Te(9,1,e,t,n)}function Qe(e,t,n,r){if(s)return Te(10,1,e,t,n,r)}function $e(e,t,n,r){if(s)return Te(11,1,e,t,n,r)}function et(e,t,n,r){if(s)return Te(12,1,e,t,n,r)}function tt(e){if(s)return Te(13,1,e)}function nt(e,t){if(s)return Te(14,1,e,t)}function rt(e,t,n){if(s)return Te(15,1,e,t,n)}var it,at,ot=()=>ge(``),ct=e=>{for(var t=``;ae()[e>>>0];)t+=it[ae()[e++>>>0]];return t},lt={},ut={},dt={};function ft(e,t,n={}){return function(e,t,n={}){var r=t.name;if(!e)throw new at(`type "${r}" must have a positive integer typeid pointer`);if(ut.hasOwnProperty(e)){if(n.Sb)return;throw new at(`Cannot register type '${r}' twice`)}ut[e]=t,delete dt[e],lt.hasOwnProperty(e)&&(t=lt[e],delete lt[e],t.forEach(e=>e()))}(e,t,n)}var pt=(e,t,n)=>{switch(t){case 1:return n?e=>ie()[e>>>0]:e=>ae()[e>>>0];case 2:return n?e=>oe()[e>>>1>>>0]:e=>se()[e>>>1>>>0];case 4:return n?e=>M()[e>>>2>>>0]:e=>N()[e>>>2>>>0];case 8:return n?e=>A[e>>>3]:e=>ee[e>>>3];default:throw TypeError(`invalid integer width (${t}): ${e}`)}};function mt(e,t,n){n>>>=0,ft(e>>>=0,{name:t=ct(t>>>0),fromWireType:e=>e,toWireType:function(e,t){if(typeof t!=`bigint`&&typeof t!=`number`)throw t=t===null?`null`:(e=typeof t)==`object`||e===`array`||e===`function`?t.toString():``+t,TypeError(`Cannot convert "${t}" to ${this.name}`);return typeof t==`number`&&(t=BigInt(t)),t},Cb:ht,readValueFromPointer:pt(t,n,t.indexOf(`u`)==-1),Db:null})}var ht=8;function gt(e,t,n,r){ft(e>>>=0,{name:t=ct(t>>>0),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?n:r},Cb:ht,readValueFromPointer:function(e){return this.fromWireType(ae()[e>>>0])},Db:null})}var _t=[],vt=[];function yt(e){9<(e>>>=0)&&--vt[e+1]==0&&(vt[e]=void 0,_t.push(e))}var bt=e=>{if(!e)throw new at(`Cannot use deleted val. handle = `+e);return vt[e]},xt=e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:let t=_t.pop()||vt.length;return vt[t]=e,vt[t+1]=1,t}};function St(e){return this.fromWireType(N()[e>>>2>>>0])}var Ct={name:`emscripten::val`,fromWireType:e=>{var t=bt(e);return yt(e),t},toWireType:(e,t)=>xt(t),Cb:ht,readValueFromPointer:St,Db:null};function wt(e){return ft(e>>>0,Ct)}var Tt=(e,t)=>{switch(t){case 4:return function(e){return this.fromWireType(ce()[e>>>2>>>0])};case 8:return function(e){return this.fromWireType(le()[e>>>3>>>0])};default:throw TypeError(`invalid float width (${t}): ${e}`)}};function Et(e,t,n){n>>>=0,ft(e>>>=0,{name:t=ct(t>>>0),fromWireType:e=>e,toWireType:(e,t)=>t,Cb:ht,readValueFromPointer:Tt(t,n),Db:null})}function Dt(e,t,n,r,i){if(e>>>=0,n>>>=0,t=ct(t>>>0),i===-1&&(i=4294967295),i=e=>e,r===0){var a=32-8*n;i=e=>e<>>a}var o=t.includes(`unsigned`)?function(e,t){return t>>>0}:function(e,t){return t};ft(e,{name:t,fromWireType:i,toWireType:o,Cb:ht,readValueFromPointer:pt(t,n,r!==0),Db:null})}function Ot(e,t,n){function r(e){var t=N()[e>>>2>>>0];return e=N()[e+4>>>2>>>0],new i(ie().buffer,e,t)}var i=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][t];ft(e>>>=0,{name:n=ct(n>>>0),fromWireType:r,Cb:ht,readValueFromPointer:r},{Sb:!0})}function kt(e,t){ft(e>>>=0,{name:t=ct(t>>>0),fromWireType:function(e){for(var t,n=N()[e>>>2>>>0],r=e+4,i=r,a=0;a<=n;++a){var o=r+a;a!=n&&ae()[o>>>0]!=0||(i=B(i,o-i),t===void 0?t=i:(t+=`\0`,t+=i),i=o+1)}return _r(e),t},toWireType:function(e,t){t instanceof ArrayBuffer&&(t=new Uint8Array(t));var n=typeof t==`string`;if(!(n||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array))throw new at(`Cannot pass non-string to std::string`);var r=n?Ge(t):t.length,i=vr(4+r+1),a=i+4;if(N()[i>>>2>>>0]=r,n)Ke(t,a,r+1);else if(n)for(n=0;n>>0]=o}else for(n=0;n>>0]=t[n];return e!==null&&e.push(_r,i),i},Cb:ht,readValueFromPointer:St,Db(e){_r(e)}})}var At=typeof TextDecoder<`u`?new TextDecoder(`utf-16le`):void 0,jt=(e,t)=>{for(var n=e>>1,r=n+t/2;!(n>=r)&&se()[n>>>0];)++n;if(32<(n<<=1)-e&&At)return At.decode(ae().slice(e,n));for(n=``,r=0;!(r>=t/2);++r){var i=oe()[e+2*r>>>1>>>0];if(i==0)break;n+=String.fromCharCode(i)}return n},Mt=(e,t,n)=>{if(n??=2147483647,2>n)return 0;var r=t;n=(n-=2)<2*e.length?n/2:e.length;for(var i=0;i>>1>>>0]=a,t+=2}return oe()[t>>>1>>>0]=0,t-r},Nt=e=>2*e.length,Pt=(e,t)=>{for(var n=0,r=``;!(n>=t/4);){var i=M()[e+4*n>>>2>>>0];if(i==0)break;++n,65536<=i?(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i)):r+=String.fromCharCode(i)}return r},Ft=(e,t,n)=>{if(t>>>=0,n??=2147483647,4>n)return 0;var r=t;n=r+n-4;for(var i=0;i=a&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++i)),M()[t>>>2>>>0]=a,(t+=4)+4>n)break}return M()[t>>>2>>>0]=0,t-r},It=e=>{for(var t=0,n=0;n=r&&++n,t+=4}return t};function Lt(e,t,n){if(e>>>=0,t>>>=0,n=ct(n>>>=0),t===2)var r=jt,i=Mt,a=Nt,o=e=>se()[e>>>1>>>0];else t===4&&(r=Pt,i=Ft,a=It,o=e=>N()[e>>>2>>>0]);ft(e,{name:n,fromWireType:e=>{for(var n,i=N()[e>>>2>>>0],a=e+4,s=0;s<=i;++s){var c=e+4+s*t;s!=i&&o(c)!=0||(a=r(a,c-a),n===void 0?n=a:(n+=`\0`,n+=a),a=c+t)}return _r(e),n},toWireType:(e,r)=>{if(typeof r!=`string`)throw new at(`Cannot pass non-string to C++ string type ${n}`);var o=a(r),s=vr(4+o+t);return N()[s>>>2>>>0]=o/t,i(r,s+4,o+t),e!==null&&e.push(_r,s),s},Cb:ht,readValueFromPointer:St,Db(e){_r(e)}})}function Rt(e,t){ft(e>>>=0,{Tb:!0,name:t=ct(t>>>0),Cb:0,fromWireType:()=>{},toWireType:()=>{}})}function zt(e){yr(e>>>0,!o,1,!a,131072,!1),R()}var Bt=e=>{if(!j)try{if(e(),!(0>>=0,typeof Atomics.jc==`function`&&(Atomics.jc(M(),e>>>2,e).value.then(Ht),e+=128,Atomics.store(M(),e>>>2,1))}var Ht=()=>{var e=gr();e&&(Vt(e),Bt(Tr))};function Ut(e,t){(e>>>=0)==t>>>0?setTimeout(Ht):s?postMessage({Gb:e,Bb:`checkMailbox`}):(e=Me[e])&&e.postMessage({Bb:`checkMailbox`})}var Wt=[];function Gt(e,t,n,r,i){for(t>>>=0,r/=2,Wt.length=r,n=i>>>0>>>3,i=0;i>>0];return(t?ve[t]:pr[e])(...Wt)}var Kt=()=>{we=0};function qt(e){e>>>=0,s?postMessage({Bb:`cleanupThread`,hc:e}):Ne(Me[e])}function Jt(e){}var Yt=(e,t)=>{var n=ut[e];if(n===void 0)throw e=mr(e),n=ct(e),_r(e),new at(`${t} has unknown type ${n}`);return n},Xt=(e,t,n)=>{var r=[];return e=e.toWireType(r,n),r.length&&(N()[t>>>2>>>0]=xt(r)),e};function Zt(e,t,n){return t>>>=0,n>>>=0,e=bt(e>>>0),t=Yt(t,`emval::as`),Xt(t,n,e)}function Qt(e,t){return t>>>=0,e=bt(e>>>0),(t=Yt(t,`emval::as`)).toWireType(null,e)}var $t=e=>{try{e()}catch(e){ge(e)}},en=0,tn=null,nn=0,rn=[],V={},an={},on=0,sn=null,cn=[];function ln(e){return function(e){if(!j){if(en===0){var t=!1,n=!1;e((e=0)=>{if(!j&&(nn=e,t=!0,n)){en=2,$t(()=>Nr(tn)),typeof MainLoop<`u`&&MainLoop.Pb&&MainLoop.resume(),e=!1;try{var r=function(){var e=M()[tn+8>>>2>>>0];return e=X[an[e]],--we,e()}()}catch(t){r=t,e=!0}var i=!1;if(!tn){var a=sn;a&&(sn=null,(e?a.reject:a.resolve)(r),i=!0)}if(e&&!i)throw r}}),n=!0,t||(en=1,tn=function(){var e=vr(65548),t=e+12;N()[e>>>2>>>0]=t,N()[e+4>>>2>>>0]=t+65536,t=rn[0];var n=V[t];return n===void 0&&(n=on++,V[t]=n,an[n]=t),t=n,M()[e+8>>>2>>>0]=t,e}(),typeof MainLoop<`u`&&MainLoop.Pb&&MainLoop.pause(),$t(()=>jr(tn)))}else en===2?(en=0,$t(Pr),_r(tn),tn=null,cn.forEach(Bt)):ge(`invalid state: ${en}`);return nn}}(t=>{e().then(t)})}function un(e){return e>>>=0,ln(async()=>{var t=await bt(e);return xt(t)})}var dn=[];function fn(e,t,n,r){return n>>>=0,r>>>=0,(e=dn[e>>>0])(null,t=bt(t>>>0),n,r)}var H={},pn=e=>{var t=H[e];return t===void 0?ct(e):t};function mn(e,t,n,r,i){return n>>>=0,r>>>=0,i>>>=0,(e=dn[e>>>0])(t=bt(t>>>0),t[n=pn(n)],r,i)}var hn=()=>typeof globalThis==`object`?globalThis:Function(`return this`)();function U(e){return(e>>>=0)==0?xt(hn()):(e=pn(e),xt(hn()[e]))}var gn=e=>{var t=dn.length;return dn.push(e),t},_n=(e,t)=>{for(var n=Array(e),r=0;r>>2>>>0],`parameter `+r);return n},vn=(e,t)=>Object.defineProperty(t,`name`,{value:e});function yn(e,t,n){var r=(t=_n(e,t>>>0)).shift();e--;var i=`return function (obj, func, destructorsRef, args) { +var re=Object.defineProperty,ie=Object.getOwnPropertyDescriptor,ae=Object.getOwnPropertyNames,oe=Object.prototype.hasOwnProperty,se=(e=>typeof t<`u`?t:typeof Proxy<`u`?new Proxy(e,{get:(e,n)=>(typeof t<`u`?t:e)[n]}):e)(function(e){if(typeof t<`u`)return t.apply(this,arguments);throw Error(`Dynamic require of "`+e+`" is not supported`)}),M=(e,t)=>()=>(e&&(t=e(e=0)),t),N=(e,t)=>{for(var n in t)re(e,n,{get:t[n],enumerable:!0})},ce=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of ae(t))!oe.call(e,i)&&i!==n&&re(e,i,{get:()=>t[i],enumerable:!(r=ie(t,i))||r.enumerable});return e},le=e=>ce(re({},`__esModule`,{value:!0}),e),ue,de,fe,P,pe,F=M(()=>{"use strict";ue=new Map,de=[],fe=(e,t,n)=>{if(t&&typeof t.init==`function`&&typeof t.createInferenceSessionHandler==`function`){let r=ue.get(e);if(r===void 0)ue.set(e,{backend:t,priority:n});else{if(r.priority>n)return;if(r.priority===n&&r.backend!==t)throw Error(`cannot register backend "${e}" using priority ${n}`)}if(n>=0){let t=de.indexOf(e);t!==-1&&de.splice(t,1);for(let t=0;t{let t=ue.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}}},pe=async e=>{let t=e.executionProviders||[],n=t.map(e=>typeof e==`string`?e:e.name),r=n.length===0?de:n,i,a=[],o=new Set;for(let e of r){let t=await P(e);typeof t==`string`?a.push({name:e,err:t}):(i||=t,i===t&&o.add(e))}if(!i)throw Error(`no available backend found. ERR: ${a.map(e=>`[${e.name}] ${e.err}`).join(`, `)}`);for(let{name:e,err:t}of a)n.includes(e)&&console.warn(`removing requested execution provider "${e}" from session options because it is not available: ${t}`);let s=t.filter(e=>o.has(typeof e==`string`?e:e.name));return[i,new Proxy(e,{get:(e,t)=>t===`executionProviders`?s:Reflect.get(e,t)})]}}),me=M(()=>{"use strict";F()}),he,ge=M(()=>{"use strict";he=`1.22.0-dev.20250409-89f8206ba4`}),I,_e,L=M(()=>{"use strict";ge(),I=`warning`,_e={wasm:{},webgl:{},webgpu:{},versions:{common:he},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}`);I=e}},get logLevel(){return I}},Object.defineProperty(_e,`logLevel`,{enumerable:!0})}),R,ve=M(()=>{"use strict";L(),R=_e}),ye,z,be=M(()=>{"use strict";ye=(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?t.format:`RGB`,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{"use strict";Ie(),xe=(e,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?t.tensorFormat:`RGB`,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,xe(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(xe(e.data,s))}});throw Error(`Input data provided is not supported - aborted tensor creation`)}if(o!==void 0)return xe(o,s);throw Error(`Input data provided is not supported - aborted tensor creation`)},B=(e,t)=>{let{width:n,height:r,download:i,dispose:a}=t,o=[1,r,n,4];return new Fe({location:`texture`,type:`float32`,texture:e,dims:o,download:i,dispose:a})},Ce=(e,t)=>{let{dataType:n,dims:r,download:i,dispose:a}=t;return new Fe({location:`gpu-buffer`,type:n??`float32`,gpuBuffer:e,dims:r,download:i,dispose:a})},we=(e,t)=>{let{dataType:n,dims:r,download:i,dispose:a}=t;return new Fe({location:`ml-tensor`,type:n??`float32`,mlTensor:e,dims:r,download:i,dispose:a})},Te=(e,t,n)=>new Fe({location:`cpu-pinned`,type:e,data:t,dims:n??[t.length]})}),De,Oe,ke,Ae,je=M(()=>{"use strict";De=new Map([[`float32`,Float32Array],[`uint8`,Uint8Array],[`int8`,Int8Array],[`uint16`,Uint16Array],[`int16`,Int16Array],[`int32`,Int32Array],[`bool`,Uint8Array],[`float64`,Float64Array],[`uint32`,Uint32Array],[`int4`,Uint8Array],[`uint4`,Uint8Array]]),Oe=new Map([[Float32Array,`float32`],[Uint8Array,`uint8`],[Int8Array,`int8`],[Uint16Array,`uint16`],[Int16Array,`int16`],[Int32Array,`int32`],[Float64Array,`float64`],[Uint32Array,`uint32`]]),ke=!1,Ae=()=>{if(!ke){ke=!0;let e=typeof BigInt64Array<`u`&&BigInt64Array.from,t=typeof BigUint64Array<`u`&&BigUint64Array.from,n=globalThis.Float16Array,r=typeof n<`u`&&n.from;e&&(De.set(`int64`,BigInt64Array),Oe.set(BigInt64Array,`int64`)),t&&(De.set(`uint64`,BigUint64Array),Oe.set(BigUint64Array,`uint64`)),r?(De.set(`float16`,n),Oe.set(n,`float16`)):De.set(`float16`,Uint16Array)}}}),Me,Ne,Pe=M(()=>{"use strict";Ie(),Me=e=>{let t=1;for(let n=0;n{switch(e.location){case`cpu`:return new Fe(e.type,e.data,t);case`cpu-pinned`:return new Fe({location:`cpu-pinned`,data:e.data,type:e.type,dims:t});case`texture`:return new Fe({location:`texture`,texture:e.texture,type:e.type,dims:t});case`gpu-buffer`:return new Fe({location:`gpu-buffer`,gpuBuffer:e.gpuBuffer,type:e.type,dims:t});case`ml-tensor`:return new Fe({location:`ml-tensor`,mlTensor:e.mlTensor,type:e.type,dims:t});default:throw Error(`tensorReshape: tensor location ${e.location} is not supported`)}}}),Fe,Ie=M(()=>{"use strict";be(),Ee(),je(),Pe(),Fe=class{constructor(e,t,n){Ae();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=De.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=De.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=Oe.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=Me(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 Se(e,t)}static fromTexture(e,t){return B(e,t)}static fromGpuBuffer(e,t){return Ce(e,t)}static fromMLTensor(e,t){return we(e,t)}static fromPinnedBuffer(e,t,n){return Te(e,t,n)}toDataURL(e){return ye(this,e)}toImageData(e){return z(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 Ne(this,e)}}}),Le,Re=M(()=>{"use strict";Ie(),Le=Fe}),V,ze,Be,H,Ve=M(()=>{"use strict";L(),V=(e,t)=>{(typeof _e.trace>`u`?!_e.wasm.trace:!_e.trace)||console.timeStamp(`${e}::ORT::${t}`)},ze=(e,t)=>{let n=Error().stack?.split(/\r\n|\r|\n/g)||[],r=!1;for(let i=0;i{(typeof _e.trace>`u`?!_e.wasm.trace:!_e.trace)||ze(`BEGIN`,e)},H=e=>{(typeof _e.trace>`u`?!_e.wasm.trace:!_e.trace)||ze(`END`,e)}}),He,Ue=M(()=>{"use strict";F(),Re(),Ve(),He=class e{constructor(e){this.handler=e}async run(e,t,n){Be();let r={},i={};if(typeof e!=`object`||!e||e instanceof Le||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 Le)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(typeof n<`u`)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 Le)&&(e=!0,a=!1,r[n]=i)}if(e){if(typeof n==`object`&&n)i=n;else if(typeof n<`u`)throw TypeError(`'options' must be an object.`)}else i=t}}else if(typeof t<`u`)throw TypeError(`Unexpected argument[1]: must be 'fetches' or 'options'.`);for(let t of this.inputNames)if(typeof e[t]>`u`)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 Le?s[e]=t:s[e]=new Le(t.type,t.data,t.dims)}return H(),s}async release(){return this.handler.dispose()}static async create(t,n,r,i){Be();let a,o={};if(typeof t==`string`){if(a=t,typeof n==`object`&&n)o=n;else if(typeof n<`u`)throw TypeError(`'options' must be an object.`)}else if(t instanceof Uint8Array){if(a=t,typeof n==`object`&&n)o=n;else if(typeof n<`u`)throw TypeError(`'options' must be an object.`)}else if(t instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&t instanceof SharedArrayBuffer){let e=t,s=0,c=t.byteLength;if(typeof n==`object`&&n)o=n;else if(typeof n==`number`){if(s=n,!Number.isSafeInteger(s))throw RangeError(`'byteOffset' must be an integer.`);if(s<0||s>=e.byteLength)throw RangeError(`'byteOffset' is out of range [0, ${e.byteLength}).`);if(c=t.byteLength-s,typeof r==`number`){if(c=r,!Number.isSafeInteger(c))throw RangeError(`'byteLength' must be an integer.`);if(c<=0||s+c>e.byteLength)throw RangeError(`'byteLength' is out of range (0, ${e.byteLength-s}].`);if(typeof i==`object`&&i)o=i;else if(typeof i<`u`)throw TypeError(`'options' must be an object.`)}else if(typeof r<`u`)throw TypeError(`'byteLength' must be a number.`)}else if(typeof n<`u`)throw TypeError(`'options' must be an object.`);a=new Uint8Array(e,s,c)}else throw TypeError(`Unexpected argument[0]: must be 'path' or 'buffer'.`);let[s,c]=await pe(o),l=await s.createInferenceSessionHandler(a,c);return H(),new e(l)}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}}}),We,Ge=M(()=>{"use strict";Ue(),We=He}),Ke=M(()=>{"use strict";}),qe=M(()=>{"use strict";}),Je=M(()=>{"use strict";}),Ye=M(()=>{"use strict";}),Xe={};N(Xe,{InferenceSession:()=>We,TRACE:()=>V,TRACE_FUNC_BEGIN:()=>Be,TRACE_FUNC_END:()=>H,Tensor:()=>Le,env:()=>R,registerBackend:()=>fe});var Ze=M(()=>{"use strict";me(),ve(),Ge(),Re(),Ke(),qe(),Ve(),Je(),Ye()}),Qe=M(()=>{"use strict";}),$e={};N($e,{default:()=>nt});var et,tt,nt,rt=M(()=>{"use strict";Dd(),Pt(),wt(),et=`ort-wasm-proxy-worker`,tt=globalThis.self?.name===et,tt&&(self.onmessage=e=>{let{type:t,in:n}=e.data;try{switch(t){case`init-wasm`:Mt(n.wasm).then(()=>{hd(n).then(()=>{postMessage({type:t})},e=>{postMessage({type:t,err:e})})},e=>{postMessage({type:t,err:e})});break;case`init-ep`:{let{epName:e,env:r}=n;gd(r,e).then(()=>{postMessage({type:t})},e=>{postMessage({type:t,err:e})});break}case`copy-from`:{let{buffer:e}=n,r=bd(e);postMessage({type:t,out:r});break}case`create`:{let{model:e,options:r}=n;xd(e,r).then(e=>{postMessage({type:t,out:e})},e=>{postMessage({type:t,err:e})});break}case`release`:Sd(n),postMessage({type:t});break;case`run`:{let{sessionId:e,inputIndices:r,inputs:i,outputIndices:a,options:o}=n;wd(e,r,i,a,Array(a.length).fill(null),o).then(e=>{e.some(e=>e[3]!==`cpu`)?postMessage({type:t,err:`Proxy does not support non-cpu tensor location.`}):postMessage({type:t,out:e},Ed([...i,...e]))},e=>{postMessage({type:t,err:e})});break}case`end-profiling`:Td(n),postMessage({type:t});break;default:}}catch(e){postMessage({type:t,err:e})}}),nt=tt?null:e=>new Worker(e??pt,{type:`module`,name:et})}),it={};N(it,{default:()=>st});var at,ot,st,ct,lt=M(()=>{"use strict";ot=(at=import.meta.url,async function(e={}){var t,n,r=e,i=new Promise((e,r)=>{t=e,n=r}),a=typeof window==`object`,o=typeof WorkerGlobalScope<`u`,s=o&&self.name?.startsWith(`em-pthread`);r.mountExternalData=(e,t)=>{e.startsWith(`./`)&&(e=e.substring(2)),(r.Eb||=new Map).set(e,t)},r.unmountExternalData=()=>{delete r.Eb};var c=globalThis.SharedArrayBuffer??new WebAssembly.Memory({initial:0,maximum:0,pc:!0}).buffer.constructor;let l=e=>async(...t)=>{try{if(r.Fb)throw Error(`Session already started`);let n=r.Fb={dc:t[0],errors:[]},i=await e(...t);if(r.Fb!==n)throw Error(`Session mismatch`);r.Jb?.flush();let a=n.errors;if(0e),0{if(e===`webgpu`){[r.Jb,r.Ub,r.Yb,r.Kb,r.Xb,r.jb,r.Zb,r.ac,r.Vb,r.Wb,r.$b]=t;let e=r.Jb;r.jsepRegisterBuffer=(t,n,r,i)=>e.registerBuffer(t,n,r,i),r.jsepGetBuffer=t=>e.getBuffer(t),r.jsepCreateDownloader=(t,n,r)=>e.createDownloader(t,n,r),r.jsepOnCreateSession=t=>{e.onCreateSession(t)},r.jsepOnReleaseSession=t=>{e.onReleaseSession(t)},r.jsepOnRunStart=t=>e.onRunStart(t),r.bc=(t,n)=>{e.upload(t,n)}}else if(e===`webnn`){let e=t[0];[r.nc,r.Nb,r.webnnEnsureTensor,r.Ob,r.webnnDownloadTensor]=t.slice(1),r.webnnReleaseTensorId=r.Nb,r.webnnUploadTensor=r.Ob,r.webnnOnRunStart=t=>e.onRunStart(t),r.webnnOnRunEnd=e.onRunEnd.bind(e),r.webnnRegisterMLContext=(t,n)=>{e.registerMLContext(t,n)},r.webnnOnReleaseSession=t=>{e.onReleaseSession(t)},r.webnnCreateMLTensorDownloader=(t,n)=>e.createMLTensorDownloader(t,n),r.webnnRegisterMLTensor=(t,n,r,i)=>e.registerMLTensor(t,n,r,i),r.webnnCreateMLContext=t=>e.createMLContext(t),r.webnnRegisterMLConstant=(t,n,i,a,o,s)=>e.registerMLConstant(t,n,i,a,o,r.Eb,s),r.webnnRegisterGraphInput=e.registerGraphInput.bind(e),r.webnnIsGraphInput=e.isGraphInput.bind(e),r.webnnCreateTemporaryTensor=e.createTemporaryTensor.bind(e),r.webnnIsInt64Supported=e.isInt64Supported.bind(e)}};let u=()=>{let e=(e,t,n)=>(...r)=>{let i=$t,a=t?.();r=e(...r);let o=t?.();return a!==o&&(e=o,n(a),t=n=null),$t==i?r:new Promise((e,t)=>{an={resolve:e,reject:t}})};(()=>{for(let t of[`_OrtAppendExecutionProvider`,`_OrtCreateSession`,`_OrtRun`,`_OrtRunWithBinding`,`_OrtBindInput`])r[t]=e(r[t],()=>r[t],e=>r[t]=e)})(),l!==void 0&&(r._OrtRun=l(r._OrtRun),r._OrtRunWithBinding=l(r._OrtRunWithBinding)),u=void 0};r.asyncInit=()=>{u?.()};var d,f,p=Object.assign({},r),m=(e,t)=>{throw t},h=``;(a||o)&&(o?h=self.location.href:typeof document<`u`&&document.currentScript&&(h=document.currentScript.src),at&&(h=at),h=h.startsWith(`blob:`)?``:h.slice(0,h.replace(/[?#].*/,``).lastIndexOf(`/`)+1),o&&(f=e=>{var t=new XMLHttpRequest;return t.open(`GET`,e,!1),t.responseType=`arraybuffer`,t.send(null),new Uint8Array(t.response)}),d=async e=>{if(re(e))return new Promise((t,n)=>{var r=new XMLHttpRequest;r.open(`GET`,e,!0),r.responseType=`arraybuffer`,r.onload=()=>{r.status==200||r.status==0&&r.response?t(r.response):n(r.status)},r.onerror=n,r.send(null)});var t=await fetch(e,{credentials:`same-origin`});if(t.ok)return t.arrayBuffer();throw Error(t.status+` : `+t.url)});var g=console.log.bind(console),_=console.error.bind(console),v=g,y=_;Object.assign(r,p),p=null;var b,x,S,C,w,T,E,D,O,k,A,ee,te,ne=r.wasmBinary,j=!1,re=e=>e.startsWith(`file://`);function ie(){return b.buffer!=C.buffer&&P(),C}function ae(){return b.buffer!=C.buffer&&P(),w}function oe(){return b.buffer!=C.buffer&&P(),T}function se(){return b.buffer!=C.buffer&&P(),E}function M(){return b.buffer!=C.buffer&&P(),D}function N(){return b.buffer!=C.buffer&&P(),O}function ce(){return b.buffer!=C.buffer&&P(),k}function le(){return b.buffer!=C.buffer&&P(),te}if(s){let e=function(t){try{var n=t.data,i=n.Bb;if(i===`load`){let t=[];self.onmessage=e=>t.push(e),self.startWorker=()=>{postMessage({Bb:`loaded`});for(let n of t)e(n);self.onmessage=e};for(let e of n.Rb)r[e]&&!r[e].proxy||(r[e]=(...t)=>{postMessage({Bb:`callHandler`,Qb:e,args:t})},e==`print`&&(v=r[e]),e==`printErr`&&(y=r[e]));b=n.kc,P(),de(n.lc)}else if(i===`run`){Pe(n.Ab),vr(n.Ab,0,0,1,0,0),je(),zt(n.Ab),fe||(mr(),fe=!0);try{Fe(n.fc,n.Hb)}catch(e){if(e!=`unwind`)throw e}}else n.target!==`setimmediate`&&(i===`checkMailbox`?fe&&Bt():i&&(y(`worker: received unknown command ${i}`),y(n)))}catch(e){throw yr(),e}};var ue=e,de,fe=!1;y=function(...e){e=e.join(` `),console.error(e)},self.alert=function(...e){postMessage({Bb:`alert`,text:e.join(` `),ic:hr()})},self.onunhandledrejection=e=>{throw e.reason||e},self.onmessage=e}function P(){var e=b.buffer;r.HEAP8=C=new Int8Array(e),r.HEAP16=T=new Int16Array(e),r.HEAPU8=w=new Uint8Array(e),r.HEAPU16=E=new Uint16Array(e),r.HEAP32=D=new Int32Array(e),r.HEAPU32=O=new Uint32Array(e),r.HEAPF32=k=new Float32Array(e),r.HEAPF64=te=new Float64Array(e),r.HEAP64=A=new BigInt64Array(e),r.HEAPU64=ee=new BigUint64Array(e)}function pe(){s?startWorker(r):Z.Ca()}s||(b=new WebAssembly.Memory({initial:256,maximum:65536,shared:!0}),P());var F,me=0,he=null;function ge(){if(--me==0&&he){var e=he;he=null,e()}}function I(e){throw y(e=`Aborted(`+e+`)`),j=!0,e=new WebAssembly.RuntimeError(e+`. Build with -sASSERTIONS for more info.`),n(e),e}function _e(){return{a:{L:ve,Aa:R,b:Le,$:V,A:Ve,pa:He,X:Ge,Z:Ke,qa:qe,na:Je,ga:Ye,ma:Xe,J:Ze,Y:Qe,V:$e,oa:et,W:tt,va:it,E:ft,Q:mt,O:St,D:wt,u:Tt,r:Et,P:Dt,z:Ft,R:It,ja:Lt,T:Vt,aa:Ut,M:Wt,F:Gt,ia:zt,sa:Kt,t:Yt,Ba:Xt,w:cn,o:un,l:pn,c:_t,n:W,j:vn,v:G,p:yn,f:bn,s:xn,m:Sn,e:Cn,k:wn,i:Tn,g:En,d:Dn,da:On,ea:Mn,fa:Nn,ba:Pn,ca:Fn,N:Rn,xa:zn,ua:Hn,h:Gn,C:Kn,G:qn,ta:Bn,x:Jn,ra:Yn,U:Xn,q:Ln,y:Zn,K:Qn,S:$n,za:nr,ya:rr,ka:Y,la:ar,_:Te,B:or,I:sr,ha:cr,H:lr,a:b,wa:Ce}}}var L={829644:(e,t,n,i,a)=>{if(r===void 0||!r.Eb)return 1;if((e=H(Number(e>>>0))).startsWith(`./`)&&(e=e.substring(2)),!(e=r.Eb.get(e)))return 2;if(t=Number(t>>>0),n=Number(n>>>0),i=Number(i>>>0),t+n>e.byteLength)return 3;try{let o=e.subarray(t,t+n);switch(a){case 0:ae().set(o,i>>>0);break;case 1:r.mc?r.mc(i,o):r.bc(i,o);break;default:return 4}return 0}catch{return 4}},830468:(e,t,n)=>{r.Ob(e,ae().subarray(t>>>0,t+n>>>0))},830532:()=>r.nc(),830574:e=>{r.Nb(e)},830611:()=>{r.Vb()},830642:()=>{r.Wb()},830671:()=>{r.$b()},830696:e=>r.Ub(e),830729:e=>r.Yb(e),830761:(e,t,n)=>{r.Kb(Number(e),Number(t),Number(n),!0)},830824:(e,t,n)=>{r.Kb(Number(e),Number(t),Number(n))},830881:()=>typeof wasmOffsetConverter<`u`,830938:e=>{r.jb(`Abs`,e,void 0)},830989:e=>{r.jb(`Neg`,e,void 0)},831040:e=>{r.jb(`Floor`,e,void 0)},831093:e=>{r.jb(`Ceil`,e,void 0)},831145:e=>{r.jb(`Reciprocal`,e,void 0)},831203:e=>{r.jb(`Sqrt`,e,void 0)},831255:e=>{r.jb(`Exp`,e,void 0)},831306:e=>{r.jb(`Erf`,e,void 0)},831357:e=>{r.jb(`Sigmoid`,e,void 0)},831412:(e,t,n)=>{r.jb(`HardSigmoid`,e,{alpha:t,beta:n})},831491:e=>{r.jb(`Log`,e,void 0)},831542:e=>{r.jb(`Sin`,e,void 0)},831593:e=>{r.jb(`Cos`,e,void 0)},831644:e=>{r.jb(`Tan`,e,void 0)},831695:e=>{r.jb(`Asin`,e,void 0)},831747:e=>{r.jb(`Acos`,e,void 0)},831799:e=>{r.jb(`Atan`,e,void 0)},831851:e=>{r.jb(`Sinh`,e,void 0)},831903:e=>{r.jb(`Cosh`,e,void 0)},831955:e=>{r.jb(`Asinh`,e,void 0)},832008:e=>{r.jb(`Acosh`,e,void 0)},832061:e=>{r.jb(`Atanh`,e,void 0)},832114:e=>{r.jb(`Tanh`,e,void 0)},832166:e=>{r.jb(`Not`,e,void 0)},832217:(e,t,n)=>{r.jb(`Clip`,e,{min:t,max:n})},832286:e=>{r.jb(`Clip`,e,void 0)},832338:(e,t)=>{r.jb(`Elu`,e,{alpha:t})},832396:e=>{r.jb(`Gelu`,e,void 0)},832448:e=>{r.jb(`Relu`,e,void 0)},832500:(e,t)=>{r.jb(`LeakyRelu`,e,{alpha:t})},832564:(e,t)=>{r.jb(`ThresholdedRelu`,e,{alpha:t})},832634:(e,t)=>{r.jb(`Cast`,e,{to:t})},832692:e=>{r.jb(`Add`,e,void 0)},832743:e=>{r.jb(`Sub`,e,void 0)},832794:e=>{r.jb(`Mul`,e,void 0)},832845:e=>{r.jb(`Div`,e,void 0)},832896:e=>{r.jb(`Pow`,e,void 0)},832947:e=>{r.jb(`Equal`,e,void 0)},833e3:e=>{r.jb(`Greater`,e,void 0)},833055:e=>{r.jb(`GreaterOrEqual`,e,void 0)},833117:e=>{r.jb(`Less`,e,void 0)},833169:e=>{r.jb(`LessOrEqual`,e,void 0)},833228:(e,t,n,i,a)=>{r.jb(`ReduceMean`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},833403:(e,t,n,i,a)=>{r.jb(`ReduceMax`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},833577:(e,t,n,i,a)=>{r.jb(`ReduceMin`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},833751:(e,t,n,i,a)=>{r.jb(`ReduceProd`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},833926:(e,t,n,i,a)=>{r.jb(`ReduceSum`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},834100:(e,t,n,i,a)=>{r.jb(`ReduceL1`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},834273:(e,t,n,i,a)=>{r.jb(`ReduceL2`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},834446:(e,t,n,i,a)=>{r.jb(`ReduceLogSum`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},834623:(e,t,n,i,a)=>{r.jb(`ReduceSumSquare`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},834803:(e,t,n,i,a)=>{r.jb(`ReduceLogSumExp`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},834983:e=>{r.jb(`Where`,e,void 0)},835036:(e,t,n)=>{r.jb(`Transpose`,e,{perm:t?Array.from(M().subarray(Number(t)>>>0,Number(n)>>>0)):[]})},835160:(e,t,n,i)=>{r.jb(`DepthToSpace`,e,{blocksize:t,mode:H(n),format:i?`NHWC`:`NCHW`})},835293:(e,t,n,i)=>{r.jb(`DepthToSpace`,e,{blocksize:t,mode:H(n),format:i?`NHWC`:`NCHW`})},835426:(e,t,n,i,a,o,s,c,l,u,d,f,p,m,h)=>{r.jb(`ConvTranspose`,e,{format:l?`NHWC`:`NCHW`,autoPad:t,dilations:[n],group:i,kernelShape:[a],pads:[o,s],strides:[c],wIsConst:()=>!!ie()[u>>>0],outputPadding:d?Array.from(M().subarray(Number(d)>>>0,Number(f)>>>0)):[],outputShape:p?Array.from(M().subarray(Number(p)>>>0,Number(m)>>>0)):[],activation:H(h)})},835859:(e,t,n,i,a,o,s,c,l,u,d,f,p,m)=>{r.jb(`ConvTranspose`,e,{format:c?`NHWC`:`NCHW`,autoPad:t,dilations:Array.from(M().subarray(Number(n)>>>0,2+(Number(n)>>>0)>>>0)),group:i,kernelShape:Array.from(M().subarray(Number(a)>>>0,2+(Number(a)>>>0)>>>0)),pads:Array.from(M().subarray(Number(o)>>>0,4+(Number(o)>>>0)>>>0)),strides:Array.from(M().subarray(Number(s)>>>0,2+(Number(s)>>>0)>>>0)),wIsConst:()=>!!ie()[l>>>0],outputPadding:u?Array.from(M().subarray(Number(u)>>>0,Number(d)>>>0)):[],outputShape:f?Array.from(M().subarray(Number(f)>>>0,Number(p)>>>0)):[],activation:H(m)})},836520:(e,t,n,i,a,o,s,c,l,u,d,f,p,m,h)=>{r.jb(`ConvTranspose`,e,{format:l?`NHWC`:`NCHW`,autoPad:t,dilations:[n],group:i,kernelShape:[a],pads:[o,s],strides:[c],wIsConst:()=>!!ie()[u>>>0],outputPadding:d?Array.from(M().subarray(Number(d)>>>0,Number(f)>>>0)):[],outputShape:p?Array.from(M().subarray(Number(p)>>>0,Number(m)>>>0)):[],activation:H(h)})},836953:(e,t,n,i,a,o,s,c,l,u,d,f,p,m)=>{r.jb(`ConvTranspose`,e,{format:c?`NHWC`:`NCHW`,autoPad:t,dilations:Array.from(M().subarray(Number(n)>>>0,2+(Number(n)>>>0)>>>0)),group:i,kernelShape:Array.from(M().subarray(Number(a)>>>0,2+(Number(a)>>>0)>>>0)),pads:Array.from(M().subarray(Number(o)>>>0,4+(Number(o)>>>0)>>>0)),strides:Array.from(M().subarray(Number(s)>>>0,2+(Number(s)>>>0)>>>0)),wIsConst:()=>!!ie()[l>>>0],outputPadding:u?Array.from(M().subarray(Number(u)>>>0,Number(d)>>>0)):[],outputShape:f?Array.from(M().subarray(Number(f)>>>0,Number(p)>>>0)):[],activation:H(m)})},837614:(e,t)=>{r.jb(`GlobalAveragePool`,e,{format:t?`NHWC`:`NCHW`})},837705:(e,t,n,i,a,o,s,c,l,u,d,f,p,m)=>{r.jb(`AveragePool`,e,{format:m?`NHWC`:`NCHW`,auto_pad:t,ceil_mode:n,count_include_pad:i,storage_order:a,dilations:o?Array.from(M().subarray(Number(o)>>>0,Number(s)>>>0)):[],kernel_shape:c?Array.from(M().subarray(Number(c)>>>0,Number(l)>>>0)):[],pads:u?Array.from(M().subarray(Number(u)>>>0,Number(d)>>>0)):[],strides:f?Array.from(M().subarray(Number(f)>>>0,Number(p)>>>0)):[]})},838184:(e,t)=>{r.jb(`GlobalAveragePool`,e,{format:t?`NHWC`:`NCHW`})},838275:(e,t,n,i,a,o,s,c,l,u,d,f,p,m)=>{r.jb(`AveragePool`,e,{format:m?`NHWC`:`NCHW`,auto_pad:t,ceil_mode:n,count_include_pad:i,storage_order:a,dilations:o?Array.from(M().subarray(Number(o)>>>0,Number(s)>>>0)):[],kernel_shape:c?Array.from(M().subarray(Number(c)>>>0,Number(l)>>>0)):[],pads:u?Array.from(M().subarray(Number(u)>>>0,Number(d)>>>0)):[],strides:f?Array.from(M().subarray(Number(f)>>>0,Number(p)>>>0)):[]})},838754:(e,t)=>{r.jb(`GlobalMaxPool`,e,{format:t?`NHWC`:`NCHW`})},838841:(e,t,n,i,a,o,s,c,l,u,d,f,p,m)=>{r.jb(`MaxPool`,e,{format:m?`NHWC`:`NCHW`,auto_pad:t,ceil_mode:n,count_include_pad:i,storage_order:a,dilations:o?Array.from(M().subarray(Number(o)>>>0,Number(s)>>>0)):[],kernel_shape:c?Array.from(M().subarray(Number(c)>>>0,Number(l)>>>0)):[],pads:u?Array.from(M().subarray(Number(u)>>>0,Number(d)>>>0)):[],strides:f?Array.from(M().subarray(Number(f)>>>0,Number(p)>>>0)):[]})},839316:(e,t)=>{r.jb(`GlobalMaxPool`,e,{format:t?`NHWC`:`NCHW`})},839403:(e,t,n,i,a,o,s,c,l,u,d,f,p,m)=>{r.jb(`MaxPool`,e,{format:m?`NHWC`:`NCHW`,auto_pad:t,ceil_mode:n,count_include_pad:i,storage_order:a,dilations:o?Array.from(M().subarray(Number(o)>>>0,Number(s)>>>0)):[],kernel_shape:c?Array.from(M().subarray(Number(c)>>>0,Number(l)>>>0)):[],pads:u?Array.from(M().subarray(Number(u)>>>0,Number(d)>>>0)):[],strides:f?Array.from(M().subarray(Number(f)>>>0,Number(p)>>>0)):[]})},839878:(e,t,n,i,a)=>{r.jb(`Gemm`,e,{alpha:t,beta:n,transA:i,transB:a})},839982:e=>{r.jb(`MatMul`,e,void 0)},840036:(e,t,n,i)=>{r.jb(`ArgMax`,e,{keepDims:!!t,selectLastIndex:!!n,axis:i})},840144:(e,t,n,i)=>{r.jb(`ArgMin`,e,{keepDims:!!t,selectLastIndex:!!n,axis:i})},840252:(e,t)=>{r.jb(`Softmax`,e,{axis:t})},840315:(e,t)=>{r.jb(`Concat`,e,{axis:t})},840375:(e,t,n,i,a)=>{r.jb(`Split`,e,{axis:t,numOutputs:n,splitSizes:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},840531:e=>{r.jb(`Expand`,e,void 0)},840585:(e,t)=>{r.jb(`Gather`,e,{axis:Number(t)})},840656:(e,t)=>{r.jb(`GatherElements`,e,{axis:Number(t)})},840735:(e,t)=>{r.jb(`GatherND`,e,{batch_dims:Number(t)})},840814:(e,t,n,i,a,o,s,c,l,u,d)=>{r.jb(`Resize`,e,{antialias:t,axes:n?Array.from(M().subarray(Number(n)>>>0,Number(i)>>>0)):[],coordinateTransformMode:H(a),cubicCoeffA:o,excludeOutside:s,extrapolationValue:c,keepAspectRatioPolicy:H(l),mode:H(u),nearestMode:H(d)})},841176:(e,t,n,i,a,o,s)=>{r.jb(`Slice`,e,{starts:t?Array.from(M().subarray(Number(t)>>>0,Number(n)>>>0)):[],ends:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[],axes:o?Array.from(M().subarray(Number(o)>>>0,Number(s)>>>0)):[]})},841440:e=>{r.jb(`Tile`,e,void 0)},841492:(e,t,n)=>{r.jb(`InstanceNormalization`,e,{epsilon:t,format:n?`NHWC`:`NCHW`})},841606:(e,t,n)=>{r.jb(`InstanceNormalization`,e,{epsilon:t,format:n?`NHWC`:`NCHW`})},841720:e=>{r.jb(`Range`,e,void 0)},841773:(e,t)=>{r.jb(`Einsum`,e,{equation:H(t)})},841854:(e,t,n,i,a)=>{r.jb(`Pad`,e,{mode:t,value:n,pads:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},841997:(e,t,n,i,a,o)=>{r.jb(`BatchNormalization`,e,{epsilon:t,momentum:n,spatial:!!a,trainingMode:!!i,format:o?`NHWC`:`NCHW`})},842166:(e,t,n,i,a,o)=>{r.jb(`BatchNormalization`,e,{epsilon:t,momentum:n,spatial:!!a,trainingMode:!!i,format:o?`NHWC`:`NCHW`})},842335:(e,t,n)=>{r.jb(`CumSum`,e,{exclusive:Number(t),reverse:Number(n)})},842432:(e,t,n)=>{r.jb(`DequantizeLinear`,e,{axis:t,blockSize:n})},842522:(e,t,n,i,a)=>{r.jb(`GridSample`,e,{align_corners:t,mode:H(n),padding_mode:H(i),format:a?`NHWC`:`NCHW`})},842692:(e,t,n,i,a)=>{r.jb(`GridSample`,e,{align_corners:t,mode:H(n),padding_mode:H(i),format:a?`NHWC`:`NCHW`})},842862:(e,t)=>{r.jb(`ScatterND`,e,{reduction:H(t)})},842947:(e,t,n,i,a,o,s,c,l)=>{r.jb(`Attention`,e,{numHeads:t,isUnidirectional:n,maskFilterValue:i,scale:a,doRotary:o,qkvHiddenSizes:s?Array.from(M().subarray(Number(c)>>>0,Number(c)+s>>>0)):[],pastPresentShareBuffer:!!l})},843219:e=>{r.jb(`BiasAdd`,e,void 0)},843274:e=>{r.jb(`BiasSplitGelu`,e,void 0)},843335:e=>{r.jb(`FastGelu`,e,void 0)},843391:(e,t,n,i,a,o,s,c,l,u,d,f,p,m,h,g)=>{r.jb(`Conv`,e,{format:f?`NHWC`:`NCHW`,auto_pad:t,dilations:n?Array.from(M().subarray(Number(n)>>>0,Number(i)>>>0)):[],group:a,kernel_shape:o?Array.from(M().subarray(Number(o)>>>0,Number(s)>>>0)):[],pads:c?Array.from(M().subarray(Number(c)>>>0,Number(l)>>>0)):[],strides:u?Array.from(M().subarray(Number(u)>>>0,Number(d)>>>0)):[],w_is_const:()=>!!ie()[Number(p)>>>0],activation:H(m),activation_params:h?Array.from(ce().subarray(Number(h)>>>0,Number(g)>>>0)):[]})},843975:e=>{r.jb(`Gelu`,e,void 0)},844027:(e,t,n,i,a,o,s,c,l)=>{r.jb(`GroupQueryAttention`,e,{numHeads:t,kvNumHeads:n,scale:i,softcap:a,doRotary:o,rotaryInterleaved:s,smoothSoftmax:c,localWindowSize:l})},844244:(e,t,n,i)=>{r.jb(`LayerNormalization`,e,{axis:t,epsilon:n,simplified:!!i})},844355:(e,t,n,i)=>{r.jb(`LayerNormalization`,e,{axis:t,epsilon:n,simplified:!!i})},844466:(e,t,n,i,a,o)=>{r.jb(`MatMulNBits`,e,{k:t,n,accuracyLevel:i,bits:a,blockSize:o})},844593:(e,t,n,i,a,o)=>{r.jb(`MultiHeadAttention`,e,{numHeads:t,isUnidirectional:n,maskFilterValue:i,scale:a,doRotary:o})},844752:(e,t)=>{r.jb(`QuickGelu`,e,{alpha:t})},844816:(e,t,n,i,a)=>{r.jb(`RotaryEmbedding`,e,{interleaved:!!t,numHeads:n,rotaryEmbeddingDim:i,scale:a})},844955:(e,t,n)=>{r.jb(`SkipLayerNormalization`,e,{epsilon:t,simplified:!!n})},845057:(e,t,n)=>{r.jb(`SkipLayerNormalization`,e,{epsilon:t,simplified:!!n})},845159:(e,t,n,i)=>{r.jb(`GatherBlockQuantized`,e,{gatherAxis:t,quantizeAxis:n,blockSize:i})},845280:e=>{r.Zb(e)},845314:(e,t)=>r.ac(Number(e),Number(t),r.Fb.dc,r.Fb.errors)};function R(e,t,n){return sn(async()=>{await r.Xb(Number(e),Number(t),Number(n))})}function ve(){return typeof wasmOffsetConverter<`u`}class ye{name=`ExitStatus`;constructor(e){this.message=`Program terminated with exit(${e})`,this.status=e}}var z=e=>{e.terminate(),e.onmessage=()=>{}},be=[],xe=e=>{Ee.length==0&&(Ne(),Me(Ee[0]));var t=Ee.pop();if(!t)return 6;De.push(t),ke[e.Ab]=t,t.Ab=e.Ab;var n={Bb:`run`,fc:e.ec,Hb:e.Hb,Ab:e.Ab};return t.postMessage(n,e.Mb),0},Se=0,B=(e,t,...n)=>{for(var r=2*n.length,i=Or(),a=Dr(8*r),o=a>>>3,s=0;s>>0]=c)}return e=br(e,0,r,a,t),Er(i),e};function Ce(e){if(s)return B(0,1,e);if(S=e,!(0{if(S=e,s)throw we(e),`unwind`;Ce(e)},Ee=[],De=[],Oe=[],ke={},Ae=e=>{var t=e.Ab;delete ke[t],Ee.push(e),De.splice(De.indexOf(e),1),e.Ab=0,xr(t)};function je(){Oe.forEach(e=>e())}var Me=e=>new Promise(t=>{e.onmessage=n=>{var i=(n=n.data).Bb;if(n.Gb&&n.Gb!=hr()){var a=ke[n.Gb];a?a.postMessage(n,n.Mb):y(`Internal error! Worker sent a message "${i}" to target pthread ${n.Gb}, but that thread no longer exists!`)}else i===`checkMailbox`?Bt():i===`spawnThread`?xe(n):i===`cleanupThread`?Ae(ke[n.hc]):i===`loaded`?(e.loaded=!0,t(e)):i===`alert`?alert(`Thread ${n.ic}: ${n.text}`):n.target===`setimmediate`?e.postMessage(n):i===`callHandler`?r[n.Qb](...n.args):i&&y(`worker sent an unknown command ${i}`)},e.onerror=e=>{throw y(`worker sent an error! ${e.filename}:${e.lineno}: ${e.message}`),e};var n,i=[];for(n of[])r.propertyIsEnumerable(n)&&i.push(n);e.postMessage({Bb:`load`,Rb:i,kc:b,lc:x})});function Ne(){var e=new Worker((()=>{let e=URL;return import.meta.url>`file:`&&import.meta.url<`file;`?new e(`ort.bundle.min.mjs`,import.meta.url):new URL(import.meta.url)})(),{type:`module`,workerData:`em-pthread`,name:`em-pthread`});Ee.push(e)}var Pe=e=>{P();var t=N()[e+52>>>2>>>0];e=N()[e+56>>>2>>>0],Tr(t,t-e),Er(t)},Fe=(e,t)=>{Se=0,e=kr(e,t),0>>=0);throw t>>>=0,n>>>=0,N()[r.Ib+16>>>2>>>0]=0,N()[r.Ib+4>>>2>>>0]=t,N()[r.Ib+8>>>2>>>0]=n,e}function Re(e,t,n,r){return s?B(2,1,e,t,n,r):V(e,t,n,r)}function V(e,t,n,r){if(e>>>=0,n>>>=0,r>>>=0,c===void 0)return 6;var i=[];return s&&i.length===0?Re(e,t>>>=0,n,r):(e={ec:n,Ab:e,Hb:r,Mb:i},s?(e.Bb=`spawnThread`,postMessage(e,i),0):xe(e))}var ze=typeof TextDecoder<`u`?new TextDecoder:void 0,Be=(e,t=0,n=NaN)=>{var r=(t>>>=0)+n;for(n=t;e[n]&&!(n>=r);)++n;if(16(i=(240&i)==224?(15&i)<<12|a<<6|o:(7&i)<<18|a<<12|o<<6|63&e[t++])?r+=String.fromCharCode(i):(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i))}}else r+=String.fromCharCode(i)}return r},H=(e,t)=>(e>>>=0)?Be(ae(),e,t):``;function Ve(e,t,n){return s?B(3,1,e,t,n):0}function He(e,t){if(s)return B(4,1,e,t)}var Ue=e=>{for(var t=0,n=0;n=r?t++:2047>=r?t+=2:55296<=r&&57343>=r?(t+=4,++n):t+=3}return t},We=(e,t,n)=>{var r=ae();if(t>>>=0,0=o&&(o=65536+((1023&o)<<10)|1023&e.charCodeAt(++a)),127>=o){if(t>=n)break;r[t++>>>0]=o}else{if(2047>=o){if(t+1>=n)break;r[t++>>>0]=192|o>>6}else{if(65535>=o){if(t+2>=n)break;r[t++>>>0]=224|o>>12}else{if(t+3>=n)break;r[t++>>>0]=240|o>>18,r[t++>>>0]=128|o>>12&63}r[t++>>>0]=128|o>>6&63}r[t++>>>0]=128|63&o}}r[t>>>0]=0,e=t-i}else e=0;return e};function Ge(e,t){if(s)return B(5,1,e,t)}function Ke(e,t,n){if(s)return B(6,1,e,t,n)}function qe(e,t,n){return s?B(7,1,e,t,n):0}function Je(e,t){if(s)return B(8,1,e,t)}function Ye(e,t,n){if(s)return B(9,1,e,t,n)}function Xe(e,t,n,r){if(s)return B(10,1,e,t,n,r)}function Ze(e,t,n,r){if(s)return B(11,1,e,t,n,r)}function Qe(e,t,n,r){if(s)return B(12,1,e,t,n,r)}function $e(e){if(s)return B(13,1,e)}function et(e,t){if(s)return B(14,1,e,t)}function tt(e,t,n){if(s)return B(15,1,e,t,n)}var nt,rt,it=()=>I(``),ot=e=>{for(var t=``;ae()[e>>>0];)t+=nt[ae()[e++>>>0]];return t},st={},ct={},lt={};function ut(e,t,n={}){return function(e,t,n={}){var r=t.name;if(!e)throw new rt(`type "${r}" must have a positive integer typeid pointer`);if(ct.hasOwnProperty(e)){if(n.Sb)return;throw new rt(`Cannot register type '${r}' twice`)}ct[e]=t,delete lt[e],st.hasOwnProperty(e)&&(t=st[e],delete st[e],t.forEach(e=>e()))}(e,t,n)}var dt=(e,t,n)=>{switch(t){case 1:return n?e=>ie()[e>>>0]:e=>ae()[e>>>0];case 2:return n?e=>oe()[e>>>1>>>0]:e=>se()[e>>>1>>>0];case 4:return n?e=>M()[e>>>2>>>0]:e=>N()[e>>>2>>>0];case 8:return n?e=>A[e>>>3]:e=>ee[e>>>3];default:throw TypeError(`invalid integer width (${t}): ${e}`)}};function ft(e,t,n){n>>>=0,ut(e>>>=0,{name:t=ot(t>>>0),fromWireType:e=>e,toWireType:function(e,t){if(typeof t!=`bigint`&&typeof t!=`number`)throw t=t===null?`null`:(e=typeof t)==`object`||e===`array`||e===`function`?t.toString():``+t,TypeError(`Cannot convert "${t}" to ${this.name}`);return typeof t==`number`&&(t=BigInt(t)),t},Cb:pt,readValueFromPointer:dt(t,n,t.indexOf(`u`)==-1),Db:null})}var pt=8;function mt(e,t,n,r){ut(e>>>=0,{name:t=ot(t>>>0),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?n:r},Cb:pt,readValueFromPointer:function(e){return this.fromWireType(ae()[e>>>0])},Db:null})}var ht=[],gt=[];function _t(e){9<(e>>>=0)&&--gt[e+1]==0&&(gt[e]=void 0,ht.push(e))}var vt=e=>{if(!e)throw new rt(`Cannot use deleted val. handle = `+e);return gt[e]},yt=e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:let t=ht.pop()||gt.length;return gt[t]=e,gt[t+1]=1,t}};function bt(e){return this.fromWireType(N()[e>>>2>>>0])}var xt={name:`emscripten::val`,fromWireType:e=>{var t=vt(e);return _t(e),t},toWireType:(e,t)=>yt(t),Cb:pt,readValueFromPointer:bt,Db:null};function St(e){return ut(e>>>0,xt)}var Ct=(e,t)=>{switch(t){case 4:return function(e){return this.fromWireType(ce()[e>>>2>>>0])};case 8:return function(e){return this.fromWireType(le()[e>>>3>>>0])};default:throw TypeError(`invalid float width (${t}): ${e}`)}};function wt(e,t,n){n>>>=0,ut(e>>>=0,{name:t=ot(t>>>0),fromWireType:e=>e,toWireType:(e,t)=>t,Cb:pt,readValueFromPointer:Ct(t,n),Db:null})}function Tt(e,t,n,r,i){if(e>>>=0,n>>>=0,t=ot(t>>>0),i===-1&&(i=4294967295),i=e=>e,r===0){var a=32-8*n;i=e=>e<>>a}var o=t.includes(`unsigned`)?function(e,t){return t>>>0}:function(e,t){return t};ut(e,{name:t,fromWireType:i,toWireType:o,Cb:pt,readValueFromPointer:dt(t,n,r!==0),Db:null})}function Et(e,t,n){function r(e){var t=N()[e>>>2>>>0];return e=N()[e+4>>>2>>>0],new i(ie().buffer,e,t)}var i=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][t];ut(e>>>=0,{name:n=ot(n>>>0),fromWireType:r,Cb:pt,readValueFromPointer:r},{Sb:!0})}function Dt(e,t){ut(e>>>=0,{name:t=ot(t>>>0),fromWireType:function(e){for(var t,n=N()[e>>>2>>>0],r=e+4,i=r,a=0;a<=n;++a){var o=r+a;a!=n&&ae()[o>>>0]!=0||(i=H(i,o-i),t===void 0?t=i:(t+=`\0`,t+=i),i=o+1)}return gr(e),t},toWireType:function(e,t){t instanceof ArrayBuffer&&(t=new Uint8Array(t));var n=typeof t==`string`;if(!(n||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array))throw new rt(`Cannot pass non-string to std::string`);var r=n?Ue(t):t.length,i=_r(4+r+1),a=i+4;if(N()[i>>>2>>>0]=r,n)We(t,a,r+1);else if(n)for(n=0;n>>0]=o}else for(n=0;n>>0]=t[n];return e!==null&&e.push(gr,i),i},Cb:pt,readValueFromPointer:bt,Db(e){gr(e)}})}var Ot=typeof TextDecoder<`u`?new TextDecoder(`utf-16le`):void 0,kt=(e,t)=>{for(var n=e>>1,r=n+t/2;!(n>=r)&&se()[n>>>0];)++n;if(32<(n<<=1)-e&&Ot)return Ot.decode(ae().slice(e,n));for(n=``,r=0;!(r>=t/2);++r){var i=oe()[e+2*r>>>1>>>0];if(i==0)break;n+=String.fromCharCode(i)}return n},At=(e,t,n)=>{if(n??=2147483647,2>n)return 0;var r=t;n=(n-=2)<2*e.length?n/2:e.length;for(var i=0;i>>1>>>0]=a,t+=2}return oe()[t>>>1>>>0]=0,t-r},jt=e=>2*e.length,Mt=(e,t)=>{for(var n=0,r=``;!(n>=t/4);){var i=M()[e+4*n>>>2>>>0];if(i==0)break;++n,65536<=i?(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i)):r+=String.fromCharCode(i)}return r},Nt=(e,t,n)=>{if(t>>>=0,n??=2147483647,4>n)return 0;var r=t;n=r+n-4;for(var i=0;i=a&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++i)),M()[t>>>2>>>0]=a,(t+=4)+4>n)break}return M()[t>>>2>>>0]=0,t-r},Pt=e=>{for(var t=0,n=0;n=r&&++n,t+=4}return t};function Ft(e,t,n){if(e>>>=0,t>>>=0,n=ot(n>>>=0),t===2)var r=kt,i=At,a=jt,o=e=>se()[e>>>1>>>0];else t===4&&(r=Mt,i=Nt,a=Pt,o=e=>N()[e>>>2>>>0]);ut(e,{name:n,fromWireType:e=>{for(var n,i=N()[e>>>2>>>0],a=e+4,s=0;s<=i;++s){var c=e+4+s*t;s!=i&&o(c)!=0||(a=r(a,c-a),n===void 0?n=a:(n+=`\0`,n+=a),a=c+t)}return gr(e),n},toWireType:(e,r)=>{if(typeof r!=`string`)throw new rt(`Cannot pass non-string to C++ string type ${n}`);var o=a(r),s=_r(4+o+t);return N()[s>>>2>>>0]=o/t,i(r,s+4,o+t),e!==null&&e.push(gr,s),s},Cb:pt,readValueFromPointer:bt,Db(e){gr(e)}})}function It(e,t){ut(e>>>=0,{Tb:!0,name:t=ot(t>>>0),Cb:0,fromWireType:()=>{},toWireType:()=>{}})}function Lt(e){vr(e>>>0,!o,1,!a,131072,!1),je()}var Rt=e=>{if(!j)try{if(e(),!(0>>=0,typeof Atomics.jc==`function`&&(Atomics.jc(M(),e>>>2,e).value.then(Bt),e+=128,Atomics.store(M(),e>>>2,1))}var Bt=()=>{var e=hr();e&&(zt(e),Rt(wr))};function Vt(e,t){(e>>>=0)==t>>>0?setTimeout(Bt):s?postMessage({Gb:e,Bb:`checkMailbox`}):(e=ke[e])&&e.postMessage({Bb:`checkMailbox`})}var Ht=[];function Ut(e,t,n,r,i){for(t>>>=0,r/=2,Ht.length=r,n=i>>>0>>>3,i=0;i>>0];return(t?L[t]:fr[e])(...Ht)}var Wt=()=>{Se=0};function Gt(e){e>>>=0,s?postMessage({Bb:`cleanupThread`,hc:e}):Ae(ke[e])}function Kt(e){}var qt=(e,t)=>{var n=ct[e];if(n===void 0)throw e=pr(e),n=ot(e),gr(e),new rt(`${t} has unknown type ${n}`);return n},Jt=(e,t,n)=>{var r=[];return e=e.toWireType(r,n),r.length&&(N()[t>>>2>>>0]=yt(r)),e};function Yt(e,t,n){return t>>>=0,n>>>=0,e=vt(e>>>0),t=qt(t,`emval::as`),Jt(t,n,e)}function Xt(e,t){return t>>>=0,e=vt(e>>>0),(t=qt(t,`emval::as`)).toWireType(null,e)}var Zt=e=>{try{e()}catch(e){I(e)}},Qt=0,$t=null,en=0,tn=[],U={},nn={},rn=0,an=null,on=[];function sn(e){return function(e){if(!j){if(Qt===0){var t=!1,n=!1;e((e=0)=>{if(!j&&(en=e,t=!0,n)){Qt=2,Zt(()=>Mr($t)),typeof MainLoop<`u`&&MainLoop.Pb&&MainLoop.resume(),e=!1;try{var r=function(){var e=M()[$t+8>>>2>>>0];return e=Z[nn[e]],--Se,e()}()}catch(t){r=t,e=!0}var i=!1;if(!$t){var a=an;a&&(an=null,(e?a.reject:a.resolve)(r),i=!0)}if(e&&!i)throw r}}),n=!0,t||(Qt=1,$t=function(){var e=_r(65548),t=e+12;N()[e>>>2>>>0]=t,N()[e+4>>>2>>>0]=t+65536,t=tn[0];var n=U[t];return n===void 0&&(n=rn++,U[t]=n,nn[n]=t),t=n,M()[e+8>>>2>>>0]=t,e}(),typeof MainLoop<`u`&&MainLoop.Pb&&MainLoop.pause(),Zt(()=>Ar($t)))}else Qt===2?(Qt=0,Zt(Nr),gr($t),$t=null,on.forEach(Rt)):I(`invalid state: ${Qt}`);return en}}(t=>{e().then(t)})}function cn(e){return e>>>=0,sn(async()=>{var t=await vt(e);return yt(t)})}var ln=[];function un(e,t,n,r){return n>>>=0,r>>>=0,(e=ln[e>>>0])(null,t=vt(t>>>0),n,r)}var dn={},fn=e=>{var t=dn[e];return t===void 0?ot(e):t};function pn(e,t,n,r,i){return n>>>=0,r>>>=0,i>>>=0,(e=ln[e>>>0])(t=vt(t>>>0),t[n=fn(n)],r,i)}var mn=()=>typeof globalThis==`object`?globalThis:Function(`return this`)();function W(e){return(e>>>=0)==0?yt(mn()):(e=fn(e),yt(mn()[e]))}var hn=e=>{var t=ln.length;return ln.push(e),t},gn=(e,t)=>{for(var n=Array(e),r=0;r>>2>>>0],`parameter `+r);return n},_n=(e,t)=>Object.defineProperty(t,`name`,{value:e});function vn(e,t,n){var r=(t=gn(e,t>>>0)).shift();e--;var i=`return function (obj, func, destructorsRef, args) { `,a=0,o=[];n===0&&o.push(`obj`);for(var s=[`retType`],c=[r],l=0;le.name).join(`, `)}) => ${r.name}>`,gn(vn(n,e))}function W(e){return e=pn(e>>>0),xt(r[e])}function bn(e,t){return t>>>=0,e=bt(e>>>0),t=bt(t),xt(e[t])}function xn(e){9<(e>>>=0)&&(vt[e+1]+=1)}function Sn(){return xt([])}function Cn(e){e=bt(e>>>0);for(var t=Array(e.length),n=0;n>>0))}function Tn(){return xt({})}function En(e){for(var t=bt(e>>>=0);t.length;){var n=t.pop();t.pop()(n)}yt(e)}function Dn(e,t,n){t>>>=0,n>>>=0,e=bt(e>>>0),t=bt(t),n=bt(n),e[t]=n}function On(e,t){return t>>>=0,e=(e=Yt(e>>>0,`_emval_take_value`)).readValueFromPointer(t),xt(e)}function kn(e,t){e=-9007199254740992>e||9007199254740992>>=0,e=new Date(1e3*e),M()[t>>>2>>>0]=e.getUTCSeconds(),M()[t+4>>>2>>>0]=e.getUTCMinutes(),M()[t+8>>>2>>>0]=e.getUTCHours(),M()[t+12>>>2>>>0]=e.getUTCDate(),M()[t+16>>>2>>>0]=e.getUTCMonth(),M()[t+20>>>2>>>0]=e.getUTCFullYear()-1900,M()[t+24>>>2>>>0]=e.getUTCDay(),e=(e.getTime()-Date.UTC(e.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,M()[t+28>>>2>>>0]=e}var An=e=>e%4==0&&(e%100!=0||e%400==0),jn=[0,31,60,91,121,152,182,213,244,274,305,335],Mn=[0,31,59,90,120,151,181,212,243,273,304,334];function Nn(e,t){e=-9007199254740992>e||9007199254740992>>=0,e=new Date(1e3*e),M()[t>>>2>>>0]=e.getSeconds(),M()[t+4>>>2>>>0]=e.getMinutes(),M()[t+8>>>2>>>0]=e.getHours(),M()[t+12>>>2>>>0]=e.getDate(),M()[t+16>>>2>>>0]=e.getMonth(),M()[t+20>>>2>>>0]=e.getFullYear()-1900,M()[t+24>>>2>>>0]=e.getDay();var n=(An(e.getFullYear())?jn:Mn)[e.getMonth()]+e.getDate()-1|0;M()[t+28>>>2>>>0]=n,M()[t+36>>>2>>>0]=-60*e.getTimezoneOffset(),n=new Date(e.getFullYear(),6,1).getTimezoneOffset();var r=new Date(e.getFullYear(),0,1).getTimezoneOffset();e=0|(n!=r&&e.getTimezoneOffset()==Math.min(r,n)),M()[t+32>>>2>>>0]=e}function Pn(e){e>>>=0;var t=new Date(M()[e+20>>>2>>>0]+1900,M()[e+16>>>2>>>0],M()[e+12>>>2>>>0],M()[e+8>>>2>>>0],M()[e+4>>>2>>>0],M()[e>>>2>>>0],0),n=M()[e+32>>>2>>>0],r=t.getTimezoneOffset(),i=new Date(t.getFullYear(),6,1).getTimezoneOffset(),a=new Date(t.getFullYear(),0,1).getTimezoneOffset(),o=Math.min(a,i);return 0>n?M()[e+32>>>2>>>0]=+(i!=a&&o==r):0>>2>>>0]=t.getDay(),n=(An(t.getFullYear())?jn:Mn)[t.getMonth()]+t.getDate()-1|0,M()[e+28>>>2>>>0]=n,M()[e>>>2>>>0]=t.getSeconds(),M()[e+4>>>2>>>0]=t.getMinutes(),M()[e+8>>>2>>>0]=t.getHours(),M()[e+12>>>2>>>0]=t.getDate(),M()[e+16>>>2>>>0]=t.getMonth(),M()[e+20>>>2>>>0]=t.getYear(),e=t.getTime(),BigInt(isNaN(e)?-1:e/1e3)}function Fn(e,t,n,r,i,a,o){return s?Te(16,1,e,t,n,r,i,a,o):-52}function In(e,t,n,r,i,a){if(s)return Te(17,1,e,t,n,r,i,a)}var Ln={},Rn=()=>performance.timeOrigin+performance.now();function zn(e,t){if(s)return Te(18,1,e,t);if(Ln[e]&&(clearTimeout(Ln[e].id),delete Ln[e]),!t)return 0;var n=setTimeout(()=>{delete Ln[e],Bt(()=>wr(e,performance.timeOrigin+performance.now()))},t);return Ln[e]={id:n,qc:t},0}function Bn(e,t,n,r){e>>>=0,t>>>=0,n>>>=0,r>>>=0;var i=new Date().getFullYear(),a=new Date(i,0,1).getTimezoneOffset();i=new Date(i,6,1).getTimezoneOffset();var o=Math.max(a,i);N()[e>>>2>>>0]=60*o,M()[t>>>2>>>0]=+(a!=i),e=(t=e=>{var t=Math.abs(e);return`UTC${0<=e?`-`:`+`}${String(Math.floor(t/60)).padStart(2,`0`)}${String(t%60).padStart(2,`0`)}`})(a),t=t(i),iDate.now(),Hn=1;function Un(e,t,n){if(!(0<=e&&3>=e))return 28;if(e===0)e=Date.now();else{if(!Hn)return 52;e=performance.timeOrigin+performance.now()}return A[n>>>0>>>3]=BigInt(Math.round(1e6*e)),0}var Wn=[],Gn=(e,t)=>{Wn.length=0;for(var n;n=ae()[e++>>>0];){var r=n!=105;t+=(r&=n!=112)&&t%8?4:0,Wn.push(n==112?N()[t>>>2>>>0]:n==106?A[t>>>3]:n==105?M()[t>>>2>>>0]:le()[t>>>3>>>0]),t+=r?8:4}return Wn};function Kn(e,t,n){return e>>>=0,t=Gn(t>>>0,n>>>0),ve[e](...t)}function qn(e,t,n){return e>>>=0,t=Gn(t>>>0,n>>>0),ve[e](...t)}var Jn=()=>{};function Yn(e,t){return y(B(e>>>0,t>>>0))}var Xn=()=>{throw we+=1,`unwind`};function Zn(){return 4294901760}var Qn=()=>navigator.hardwareConcurrency;function $n(){return ge(`Cannot use emscripten_pc_get_function without -sUSE_OFFSET_CONVERTER`),0}function er(e){e>>>=0;var t=ae().length;if(e<=t||4294901760=n;n*=2){var r=t*(1+.2/n);r=Math.min(r,e+100663296);e:{r=(Math.min(4294901760,65536*Math.ceil(Math.max(e,r)/65536))-b.buffer.byteLength+65535)/65536|0;try{b.grow(r),F();var i=1;break e}catch{}i=void 0}if(i)return!0}return!1}var G=()=>(ge(`Cannot use convertFrameToPC (needed by __builtin_return_address) without -sUSE_OFFSET_CONVERTER`),0),tr={},nr=e=>{e.forEach(e=>{var t=G();t&&(tr[t]=e)})};function rr(){var e=Error().stack.toString().split(` -`);return e[0]==`Error`&&e.shift(),nr(e),tr.Lb=G(),tr.cc=e,tr.Lb}function ir(e,t,n){if(e>>>=0,t>>>=0,tr.Lb==e)var r=tr.cc;else (r=Error().stack.toString().split(` -`))[0]==`Error`&&r.shift(),nr(r);for(var i=3;r[i]&&G()!=e;)++i;for(e=0;e>>2>>>0]=G();return e}var K,ar={},q=()=>{if(!K){var e,t={USER:`web_user`,LOGNAME:`web_user`,PATH:`/`,PWD:`/`,HOME:`/home/web_user`,LANG:(typeof navigator==`object`&&navigator.languages&&navigator.languages[0]||`C`).replace(`-`,`_`)+`.UTF-8`,_:`./this.program`};for(e in ar)ar[e]===void 0?delete t[e]:t[e]=ar[e];var n=[];for(e in t)n.push(`${e}=${t[e]}`);K=n}return K};function J(e,t){if(s)return Te(19,1,e,t);e>>>=0,t>>>=0;var n=0;return q().forEach((r,i)=>{var a=t+n;for(i=N()[e+4*i>>>2>>>0]=a,a=0;a>>0]=r.charCodeAt(a);ie()[i>>>0]=0,n+=r.length+1}),0}function or(e,t){if(s)return Te(20,1,e,t);e>>>=0,t>>>=0;var n=q();N()[e>>>2>>>0]=n.length;var r=0;return n.forEach(e=>r+=e.length+1),N()[t>>>2>>>0]=r,0}function sr(e){return s?Te(21,1,e):52}function cr(e,t,n,r){return s?Te(22,1,e,t,n,r):52}function lr(e,t,n,r){return s?Te(23,1,e,t,n,r):70}var Y=[null,[],[]];function ur(e,t,n,r){if(s)return Te(24,1,e,t,n,r);t>>>=0,n>>>=0,r>>>=0;for(var i=0,a=0;a>>2>>>0],c=N()[t+4>>>2>>>0];t+=8;for(var l=0;l>>0],d=Y[e];u===0||u===10?((e===1?v:y)(He(d)),d.length=0):d.push(u)}i+=c}return N()[r>>>2>>>0]=i,0}s||function(){for(var e=r.numThreads-1;e--;)Fe();Se.unshift(()=>{pe++,function(e){s?e():Promise.all(ke.map(Pe)).then(e)}(()=>he())})}();for(var dr=Array(256),fr=0;256>fr;++fr)dr[fr]=String.fromCharCode(fr);it=dr,at=r.BindingError=class extends Error{constructor(e){super(e),this.name=`BindingError`}},r.InternalError=class extends Error{constructor(e){super(e),this.name=`InternalError`}},vt.push(0,1,void 0,1,null,1,!0,1,!1,1),r.count_emval_handles=()=>vt.length/2-5-_t.length;var X,pr=[Ee,De,Be,Ue,We,qe,Je,Ye,Xe,Ze,Qe,$e,et,tt,nt,rt,Fn,In,zn,J,or,sr,cr,lr,ur];(async function(){function e(e,t){return X=e.exports,X=function(){var e=X,t={};for(let[n,r]of Object.entries(e))t[n]=typeof r==`function`?(...e)=>{rn.push(n);try{return r(...e)}finally{j||(rn.pop(),tn&&en===1&&rn.length===0&&(en=0,we+=1,$t(Mr),typeof Fibers<`u`&&Fibers.rc()))}}:r;return t}(),X=function(){var e=X,t=e=>t=>e(t)>>>0,n=e=>()=>e()>>>0;return(e=Object.assign({},e)).Da=t(e.Da),e.fb=n(e.fb),e.hb=t(e.hb),e.tb=t(e.tb),e.ub=n(e.ub),e.__cxa_get_exception_ptr=t(e.__cxa_get_exception_ptr),e}(),je.push(X.ib),x=t,he(),X}pe++;var t=_e();if(r.instantiateWasm)return new Promise(n=>{r.instantiateWasm(t,(t,r)=>{e(t,r),n(t.exports)})});if(s)return new Promise(t=>{de=n=>{var r=new WebAssembly.Instance(n,_e());t(e(r,n))}});I??=r.locateFile?r.locateFile?r.locateFile(`ort-wasm-simd-threaded.jsep.wasm`,h):h+`ort-wasm-simd-threaded.jsep.wasm`:new URL(`/assets/ort-wasm-simd-threaded.jsep-B0T3yYHD.wasm`,``+import.meta.url).href;try{var i=await async function(e){var t=I;if(!ne&&typeof WebAssembly.instantiateStreaming==`function`&&!re(t))try{var n=fetch(t,{credentials:`same-origin`});return await WebAssembly.instantiateStreaming(n,e)}catch(e){y(`wasm streaming compile failed: ${e}`),y(`falling back to ArrayBuffer instantiation`)}return async function(e,t){try{var n=await async function(e){if(!ne)try{var t=await d(e);return new Uint8Array(t)}catch{}if(e==I&&ne)e=new Uint8Array(ne);else{if(!f)throw`both async and sync fetching of the wasm failed`;e=f(e)}return e}(e);return await WebAssembly.instantiate(n,t)}catch(e){y(`failed to asynchronously prepare wasm: ${e}`),ge(e)}}(t,e)}(t);return e(i.instance,i.module)}catch(e){return n(e),Promise.reject(e)}})();var mr=e=>(mr=X.Da)(e),hr=()=>(hr=X.Ea)();r._OrtInit=(e,t)=>(r._OrtInit=X.Fa)(e,t),r._OrtGetLastError=(e,t)=>(r._OrtGetLastError=X.Ga)(e,t),r._OrtCreateSessionOptions=(e,t,n,i,a,o,s,c,l,u)=>(r._OrtCreateSessionOptions=X.Ha)(e,t,n,i,a,o,s,c,l,u),r._OrtAppendExecutionProvider=(e,t,n,i,a)=>(r._OrtAppendExecutionProvider=X.Ia)(e,t,n,i,a),r._OrtAddFreeDimensionOverride=(e,t,n)=>(r._OrtAddFreeDimensionOverride=X.Ja)(e,t,n),r._OrtAddSessionConfigEntry=(e,t,n)=>(r._OrtAddSessionConfigEntry=X.Ka)(e,t,n),r._OrtReleaseSessionOptions=e=>(r._OrtReleaseSessionOptions=X.La)(e),r._OrtCreateSession=(e,t,n)=>(r._OrtCreateSession=X.Ma)(e,t,n),r._OrtReleaseSession=e=>(r._OrtReleaseSession=X.Na)(e),r._OrtGetInputOutputCount=(e,t,n)=>(r._OrtGetInputOutputCount=X.Oa)(e,t,n),r._OrtGetInputOutputMetadata=(e,t,n,i)=>(r._OrtGetInputOutputMetadata=X.Pa)(e,t,n,i),r._OrtFree=e=>(r._OrtFree=X.Qa)(e),r._OrtCreateTensor=(e,t,n,i,a,o)=>(r._OrtCreateTensor=X.Ra)(e,t,n,i,a,o),r._OrtGetTensorData=(e,t,n,i,a)=>(r._OrtGetTensorData=X.Sa)(e,t,n,i,a),r._OrtReleaseTensor=e=>(r._OrtReleaseTensor=X.Ta)(e),r._OrtCreateRunOptions=(e,t,n,i)=>(r._OrtCreateRunOptions=X.Ua)(e,t,n,i),r._OrtAddRunConfigEntry=(e,t,n)=>(r._OrtAddRunConfigEntry=X.Va)(e,t,n),r._OrtReleaseRunOptions=e=>(r._OrtReleaseRunOptions=X.Wa)(e),r._OrtCreateBinding=e=>(r._OrtCreateBinding=X.Xa)(e),r._OrtBindInput=(e,t,n)=>(r._OrtBindInput=X.Ya)(e,t,n),r._OrtBindOutput=(e,t,n,i)=>(r._OrtBindOutput=X.Za)(e,t,n,i),r._OrtClearBoundOutputs=e=>(r._OrtClearBoundOutputs=X._a)(e),r._OrtReleaseBinding=e=>(r._OrtReleaseBinding=X.$a)(e),r._OrtRunWithBinding=(e,t,n,i,a)=>(r._OrtRunWithBinding=X.ab)(e,t,n,i,a),r._OrtRun=(e,t,n,i,a,o,s,c)=>(r._OrtRun=X.bb)(e,t,n,i,a,o,s,c),r._OrtEndProfiling=e=>(r._OrtEndProfiling=X.cb)(e),r._JsepOutput=(e,t,n)=>(r._JsepOutput=X.db)(e,t,n),r._JsepGetNodeName=e=>(r._JsepGetNodeName=X.eb)(e);var gr=()=>(gr=X.fb)(),_r=r._free=e=>(_r=r._free=X.gb)(e),vr=r._malloc=e=>(vr=r._malloc=X.hb)(e),yr=(e,t,n,r,i,a)=>(yr=X.kb)(e,t,n,r,i,a),br=()=>(br=X.lb)(),xr=(e,t,n,r,i)=>(xr=X.mb)(e,t,n,r,i),Sr=e=>(Sr=X.nb)(e),Cr=e=>(Cr=X.ob)(e),wr=(e,t)=>(wr=X.pb)(e,t),Tr=()=>(Tr=X.qb)(),Er=(e,t)=>(Er=X.rb)(e,t),Dr=e=>(Dr=X.sb)(e),Or=e=>(Or=X.tb)(e),kr=()=>(kr=X.ub)(),Ar=r.dynCall_ii=(e,t)=>(Ar=r.dynCall_ii=X.vb)(e,t),jr=e=>(jr=X.wb)(e),Mr=()=>(Mr=X.xb)(),Nr=e=>(Nr=X.yb)(e),Pr=()=>(Pr=X.zb)();return r.stackSave=()=>kr(),r.stackRestore=e=>Dr(e),r.stackAlloc=e=>Or(e),r.setValue=function(e,t,n=`i8`){switch(n.endsWith(`*`)&&(n=`*`),n){case`i1`:case`i8`:ie()[e>>>0]=t;break;case`i16`:oe()[e>>>1>>>0]=t;break;case`i32`:M()[e>>>2>>>0]=t;break;case`i64`:A[e>>>3]=BigInt(t);break;case`float`:ce()[e>>>2>>>0]=t;break;case`double`:le()[e>>>3>>>0]=t;break;case`*`:N()[e>>>2>>>0]=t;break;default:ge(`invalid type for setValue: ${n}`)}},r.getValue=function(e,t=`i8`){switch(t.endsWith(`*`)&&(t=`*`),t){case`i1`:case`i8`:return ie()[e>>>0];case`i16`:return oe()[e>>>1>>>0];case`i32`:return M()[e>>>2>>>0];case`i64`:return A[e>>>3];case`float`:return ce()[e>>>2>>>0];case`double`:return le()[e>>>3>>>0];case`*`:return N()[e>>>2>>>0];default:ge(`invalid type for getValue: ${t}`)}},r.UTF8ToString=B,r.stringToUTF8=Ke,r.lengthBytesUTF8=Ge,function e(){if(0{"use strict";et(),ft=typeof location>`u`?void 0:location.origin,pt=import.meta.url>`file:`&&import.meta.url<`file;`,mt=()=>{if(pt){let e=URL;return new URL(new e(`ort.bundle.min.mjs`,import.meta.url).href,ft).href}return import.meta.url},ht=mt(),gt=()=>{if(ht&&!ht.startsWith(`blob:`))return ht.substring(0,ht.lastIndexOf(`/`)+1)},_t=(e,t)=>{try{let n=t??ht;return(n?new URL(e,n):new URL(e)).origin===ft}catch{return!1}},vt=(e,t)=>{let n=t??ht;try{return(n?new URL(e,n):new URL(e)).href}catch{return}},yt=(e,t)=>`${t??`./`}${e}`,bt=async e=>{let t=await(await fetch(e,{credentials:`same-origin`})).blob();return URL.createObjectURL(t)},xt=async e=>(await import(e)).default,St=(at(),le(tt)).default,Ct=async()=>{if(!ht)throw Error(`Failed to load proxy worker: cannot determine the script source URL.`);if(_t(ht))return[void 0,St()];let e=await bt(ht);return[e,St(e)]},wt=(dt(),le(ot)).default,Tt=async(e,t,n)=>{if(!e&&!t&&wt&&ht&&_t(ht))return[void 0,wt];{let r=`ort-wasm-simd-threaded.jsep.mjs`,i=e??vt(r,t),a=n&&i&&!_t(i,t),o=a?await bt(i):i??yt(r,t);return[a?o:void 0,await xt(o)]}}}),Dt,Ot,kt,At,jt,Mt,Nt,Pt,Ft,It=M(()=>{"use strict";Et(),Ot=!1,kt=!1,At=!1,jt=()=>{if(typeof SharedArrayBuffer>`u`)return!1;try{return typeof MessageChannel<`u`&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(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]))}catch{return!1}},Mt=()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,30,1,28,0,65,0,253,15,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,186,1,26,11]))}catch{return!1}},Nt=()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,19,1,17,0,65,1,253,15,65,2,253,15,65,3,253,15,253,147,2,11]))}catch{return!1}},Pt=async e=>{if(Ot)return Promise.resolve();if(kt)throw Error(`multiple calls to 'initializeWebAssembly()' detected.`);if(At)throw Error(`previous call to 'initializeWebAssembly()' failed.`);kt=!0;let t=e.initTimeout,n=e.numThreads;if(e.simd!==!1){if(e.simd===`relaxed`){if(!Nt())throw Error(`Relaxed WebAssembly SIMD is not supported in the current environment.`)}else if(!Mt())throw Error(`WebAssembly SIMD is not supported in the current environment.`)}let r=jt();n>1&&!r&&(typeof self<`u`&&!self.crossOriginIsolated&&console.warn(`env.wasm.numThreads is set to `+n+`, but this will not work unless you enable crossOriginIsolated mode. See https://web.dev/cross-origin-isolation-guide/ for more info.`),console.warn(`WebAssembly multi-threading is not supported in the current environment. Falling back to single-threading.`),e.numThreads=n=1);let i=e.wasmPaths,a=typeof i==`string`?i:void 0,o=i?.mjs,s=o?.href??o,c=i?.wasm,l=c?.href??c,u=e.wasmBinary,[d,f]=await Tt(s,a,n>1),p=!1,m=[];if(t>0&&m.push(new Promise(e=>{setTimeout(()=>{p=!0,e()},t)})),m.push(new Promise((e,t)=>{let r={numThreads:n};if(u)r.wasmBinary=u;else if(l||a)r.locateFile=e=>l??a+e;else if(s&&s.indexOf(`blob:`)!==0)r.locateFile=e=>new URL(e,s).href;else if(d){let e=gt();e&&(r.locateFile=t=>e+t)}f(r).then(t=>{kt=!1,Ot=!0,Dt=t,e(),d&&URL.revokeObjectURL(d)},e=>{kt=!1,At=!0,t(e)})})),await Promise.race(m),p)throw Error(`WebAssembly backend initializing failed due to timeout: ${t}ms`)},Ft=()=>{if(Ot&&Dt)return Dt;throw Error(`WebAssembly is not initialized yet.`)}}),Lt,Rt,zt,Bt=M(()=>{"use strict";It(),Lt=(e,t)=>{let n=Ft(),r=n.lengthBytesUTF8(e)+1,i=n._malloc(r);return n.stringToUTF8(e,i,r),t.push(i),i},Rt=(e,t,n,r)=>{if(typeof e==`object`&&e){if(n.has(e))throw Error(`Circular reference in options`);n.add(e)}Object.entries(e).forEach(([e,i])=>{let a=t?t+e:e;if(typeof i==`object`)Rt(i,a+`.`,n,r);else if(typeof i==`string`||typeof i==`number`)r(a,i.toString());else if(typeof i==`boolean`)r(a,i?`1`:`0`);else throw Error(`Can't handle extra config type: ${typeof i}`)})},zt=e=>{let t=Ft(),n=t.stackSave();try{let n=t.PTR_SIZE,r=t.stackAlloc(2*n);t._OrtGetLastError(r,r+n);let i=Number(t.getValue(r,n===4?`i32`:`i64`)),a=t.getValue(r+n,`*`),o=a?t.UTF8ToString(a):``;throw Error(`${e} ERROR_CODE: ${i}, ERROR_MESSAGE: ${o}`)}finally{t.stackRestore(n)}}}),Vt,Ht=M(()=>{"use strict";It(),Bt(),Vt=e=>{let t=Ft(),n=0,r=[],i=e||{};try{if(e?.logSeverityLevel===void 0)i.logSeverityLevel=2;else if(typeof e.logSeverityLevel!=`number`||!Number.isInteger(e.logSeverityLevel)||e.logSeverityLevel<0||e.logSeverityLevel>4)throw Error(`log serverity level is not valid: ${e.logSeverityLevel}`);if(e?.logVerbosityLevel===void 0)i.logVerbosityLevel=0;else if(typeof e.logVerbosityLevel!=`number`||!Number.isInteger(e.logVerbosityLevel))throw Error(`log verbosity level is not valid: ${e.logVerbosityLevel}`);e?.terminate===void 0&&(i.terminate=!1);let a=0;return e?.tag!==void 0&&(a=Lt(e.tag,r)),n=t._OrtCreateRunOptions(i.logSeverityLevel,i.logVerbosityLevel,!!i.terminate,a),n===0&&zt(`Can't create run options.`),e?.extra!==void 0&&Rt(e.extra,``,new WeakSet,(e,i)=>{let a=Lt(e,r),o=Lt(i,r);t._OrtAddRunConfigEntry(n,a,o)!==0&&zt(`Can't set a run config entry: ${e} - ${i}.`)}),[n,r]}catch(e){throw n!==0&&t._OrtReleaseRunOptions(n),r.forEach(e=>t._free(e)),e}}}),Ut,Wt,Gt,Kt,qt,Jt,Yt=M(()=>{"use strict";It(),Bt(),Ut=e=>{switch(e){case`disabled`:return 0;case`basic`:return 1;case`extended`:return 2;case`all`:return 99;default:throw Error(`unsupported graph optimization level: ${e}`)}},Wt=e=>{switch(e){case`sequential`:return 0;case`parallel`:return 1;default:throw Error(`unsupported execution mode: ${e}`)}},Gt=e=>{e.extra||={},e.extra.session||(e.extra.session={});let t=e.extra.session;t.use_ort_model_bytes_directly||=`1`,e.executionProviders&&e.executionProviders.some(e=>(typeof e==`string`?e:e.name)===`webgpu`)&&(e.enableMemPattern=!1)},Kt=(e,t,n,r)=>{let i=Lt(t,r),a=Lt(n,r);Ft()._OrtAddSessionConfigEntry(e,i,a)!==0&&zt(`Can't set a session config entry: ${t} - ${n}.`)},qt=async(e,t,n)=>{for(let r of t){let t=typeof r==`string`?r:r.name,i=[];switch(t){case`webnn`:if(t=`WEBNN`,typeof r!=`string`){let t=r?.deviceType;t&&Kt(e,`deviceType`,t,n)}break;case`webgpu`:if(t=`JS`,typeof r!=`string`){let t=r;if(t?.preferredLayout){if(t.preferredLayout!==`NCHW`&&t.preferredLayout!==`NHWC`)throw Error(`preferredLayout must be either 'NCHW' or 'NHWC': ${t.preferredLayout}`);Kt(e,`preferredLayout`,t.preferredLayout,n)}}break;case`wasm`:case`cpu`:continue;default:throw Error(`not supported execution provider: ${t}`)}let a=Lt(t,n),o=i.length,s=0,c=0;if(o>0){s=Ft()._malloc(o*Ft().PTR_SIZE),n.push(s),c=Ft()._malloc(o*Ft().PTR_SIZE),n.push(c);for(let e=0;e{let t=Ft(),n=0,r=[],i=e||{};Gt(i);try{let e=Ut(i.graphOptimizationLevel??`all`),a=Wt(i.executionMode??`sequential`),o=typeof i.logId==`string`?Lt(i.logId,r):0,s=i.logSeverityLevel??2;if(!Number.isInteger(s)||s<0||s>4)throw Error(`log serverity level is not valid: ${s}`);let c=i.logVerbosityLevel??0;if(!Number.isInteger(c)||c<0||c>4)throw Error(`log verbosity level is not valid: ${c}`);let l=typeof i.optimizedModelFilePath==`string`?Lt(i.optimizedModelFilePath,r):0;if(n=t._OrtCreateSessionOptions(e,!!i.enableCpuMemArena,!!i.enableMemPattern,a,!!i.enableProfiling,0,o,s,c,l),n===0&&zt(`Can't create session options.`),i.executionProviders&&await qt(n,i.executionProviders,r),i.enableGraphCapture!==void 0){if(typeof i.enableGraphCapture!=`boolean`)throw Error(`enableGraphCapture must be a boolean value: ${i.enableGraphCapture}`);Kt(n,`enableGraphCapture`,i.enableGraphCapture.toString(),r)}if(i.freeDimensionOverrides)for(let[e,a]of Object.entries(i.freeDimensionOverrides)){if(typeof e!=`string`)throw Error(`free dimension override name must be a string: ${e}`);if(typeof a!=`number`||!Number.isInteger(a)||a<0)throw Error(`free dimension override value must be a non-negative integer: ${a}`);let i=Lt(e,r);t._OrtAddFreeDimensionOverride(n,i,a)!==0&&zt(`Can't set a free dimension override: ${e} - ${a}.`)}return i.extra!==void 0&&Rt(i.extra,``,new WeakSet,(e,t)=>{Kt(n,e,t,r)}),[n,r]}catch(e){throw n!==0&&t._OrtReleaseSessionOptions(n)!==0&&zt(`Can't release session options.`),r.forEach(e=>t._free(e)),e}}}),Xt,Zt,Qt,$t,en,tn,nn,rn,V=M(()=>{"use strict";Xt=e=>{switch(e){case`int8`:return 3;case`uint8`:return 2;case`bool`:return 9;case`int16`:return 5;case`uint16`:return 4;case`int32`:return 6;case`uint32`:return 12;case`float16`:return 10;case`float32`:return 1;case`float64`:return 11;case`string`:return 8;case`int64`:return 7;case`uint64`:return 13;case`int4`:return 22;case`uint4`:return 21;default:throw Error(`unsupported data type: ${e}`)}},Zt=e=>{switch(e){case 3:return`int8`;case 2:return`uint8`;case 9:return`bool`;case 5:return`int16`;case 4:return`uint16`;case 6:return`int32`;case 12:return`uint32`;case 10:return`float16`;case 1:return`float32`;case 11:return`float64`;case 8:return`string`;case 7:return`int64`;case 13:return`uint64`;case 22:return`int4`;case 21:return`uint4`;default:throw Error(`unsupported data type: ${e}`)}},Qt=(e,t)=>{let n=[-1,4,1,1,2,2,4,8,-1,1,2,8,4,8,-1,-1,-1,-1,-1,-1,-1,.5,.5][e],r=typeof t==`number`?t:t.reduce((e,t)=>e*t,1);return n>0?Math.ceil(r*n):void 0},$t=e=>{switch(e){case`float16`:return typeof Float16Array<`u`&&Float16Array.from?Float16Array:Uint16Array;case`float32`:return Float32Array;case`uint8`:return Uint8Array;case`int8`:return Int8Array;case`uint16`:return Uint16Array;case`int16`:return Int16Array;case`int32`:return Int32Array;case`bool`:return Uint8Array;case`float64`:return Float64Array;case`uint32`:return Uint32Array;case`int64`:return BigInt64Array;case`uint64`:return BigUint64Array;default:throw Error(`unsupported type: ${e}`)}},en=e=>{switch(e){case`verbose`:return 0;case`info`:return 1;case`warning`:return 2;case`error`:return 3;case`fatal`:return 4;default:throw Error(`unsupported logging level: ${e}`)}},tn=e=>e===`float32`||e===`float16`||e===`int32`||e===`int64`||e===`uint32`||e===`uint8`||e===`bool`||e===`uint4`||e===`int4`,nn=e=>e===`float32`||e===`float16`||e===`int32`||e===`int64`||e===`uint32`||e===`uint64`||e===`int8`||e===`uint8`||e===`bool`||e===`uint4`||e===`int4`,rn=e=>{switch(e){case`none`:return 0;case`cpu`:return 1;case`cpu-pinned`:return 2;case`texture`:return 3;case`gpu-buffer`:return 4;case`ml-tensor`:return 5;default:throw Error(`unsupported data location: ${e}`)}}}),an,on=M(()=>{"use strict";et(),an=async e=>{if(typeof e==`string`){let t=await fetch(e);if(!t.ok)throw Error(`failed to load external data file: ${e}`);let n=t.headers.get(`Content-Length`),r=n?parseInt(n,10):0;if(r<1073741824)return new Uint8Array(await t.arrayBuffer());{if(!t.body)throw Error(`failed to load external data file: ${e}, no response body.`);let n=t.body.getReader(),i;try{i=new ArrayBuffer(r)}catch(e){if(e instanceof RangeError){let e=Math.ceil(r/65536);i=new WebAssembly.Memory({initial:e,maximum:e}).buffer}else throw e}let a=0;for(;;){let{done:e,value:t}=await n.read();if(e)break;let r=t.byteLength;new Uint8Array(i,a,r).set(t),a+=r}return new Uint8Array(i,0,r)}}else return e instanceof Blob?new Uint8Array(await e.arrayBuffer()):e instanceof Uint8Array?e:new Uint8Array(e)}}),sn,cn,ln,un,dn,fn,H,pn=M(()=>{"use strict";V(),sn=[`V`,`I`,`W`,`E`,`F`],cn=(e,t)=>{console.log(`[${sn[e]},${new Date().toISOString()}]${t}`)},dn=(e,t)=>{ln=e,un=t},fn=(e,t)=>{let n=en(e),r=en(ln);n>=r&&cn(n,typeof t==`function`?t():t)},H=(...e)=>{un&&fn(...e)}}),mn,hn,U,gn,_n,vn,yn,W=M(()=>{"use strict";mn=class{static calcMatMulShape(e,t){return e[1]===t[0]?[e[0],t[1]]:void 0}},hn=class{static calcShape(e,t,n=!1){let r=e.length,i=t.length;if(r===0)return t;if(i===0)return e;let a=Math.max(e.length,t.length),o=Array(a);if(n){if(r<2||i<2)return;let n=mn.calcMatMulShape([e[r-2],e[r-1]],[t[i-2],t[i-1]]);if(n===void 0)return;[o[a-2],o[a-1]]=n}for(let s=n?3:1;s<=a;s++){let n=r-s<0?1:e[r-s],c=i-s<0?1:t[i-s];if(n!==c&&n>1&&c>1)return;let l=Math.max(n,c);if(n&&c)o[a-s]=Math.max(n,c);else{if(l>1)return;o[a-s]=0}}return o}static isValidBroadcast(e,t){let n=e.length,r=t.length;if(n>r)return!1;for(let i=1;i<=n;i++)if(e[n-i]!==1&&e[n-i]!==t[r-i])return!1;return!0}},U=class e{static size(t){return e.getSizeFromDimensionRange(t,0,t.length)}static convertShape(e,t=4){let n=e.length;if(n===0)return[];let r=Array(n),i=n-1;for(;i>=0;){if(e[i]%t===0){r[i]=e[i]/t;break}if(t%e[i]!==0)throw Error(`cannot convert shape`);r[i]=1,t/=e[i],i--}for(i--;i>=0;i--)r[i]=e[i];return r}static sizeFromDimension(t,n){if(n<0||n>t.length)throw Error(`invalid dimension of ${n} for sizeFromDimension as Tensor has ${t.length} dimensions.`);return e.getSizeFromDimensionRange(t,n,t.length)}static sizeToDimension(t,n){if(n<0||n>t.length)throw Error(`invalid dimension of ${n} for sizeToDimension as Tensor has ${t.length} dimensions.`);return e.getSizeFromDimensionRange(t,0,n)}static getSizeFromDimensionRange(e,t,n){let r=1;for(let i=t;i=0;--r)n[r]=n[r+1]*e[r+1];return n}static normalizeAxis(e,t){if(e<-t&&e>=t)throw Error(`unsupported axis for this operation.`);return e<0?e+t:e}static normalizeAxes(e,t){return e.map(n=>this.normalizeAxis(n,t??e.length))}static sortBasedOnPerm(e,t){return t?t.map(t=>e[t]):e.slice().reverse()}static padShape(e,t){let n=e.length;return e.map((e,r)=>e+t[r]+t[r+n])}static areEqual(e,t){return e.length===t.length?e.every((e,n)=>e===t[n]):!1}},gn=class e{static adjustPoolAttributes(e,t,n,r,i,a){if(!e&&n.length!==t.length-2)throw Error(`length of specified kernel shapes should be 2 less than length of input dimensions`);if(e)for(let e=0;e=n.length?n.push(t[e+2]):n[e]=t[e+2];for(let e=0;e=n[e]||a[e+n.length]>=n[e])throw Error(`pads should be smaller than kernel`)}}static adjustPadsBasedOnAutoPad(t,n,r,i,a,o,s){if(s){if(a.length!==2*(t.length-2))throw Error(`length of pads should be twice the length of data dimensions`);if(n.length!==t.length-2)throw Error(`length of strides should be the length of data dimensions`);if(i.length!==t.length-2)throw Error(`length of kernel shapes should be the length of data dimensions`);for(let c=0;c{"use strict";V(),bn=(e,t)=>new($t(t))(e)}),Sn,Cn,wn,Tn,En,Dn,On,kn,An,jn,Mn=M(()=>{"use strict";pn(),Sn=(e,t=!0)=>{if(e.byteLength%8!=0)throw Error(`Invalid Uint8Array length - must be a multiple of 8 (BigInt).`);let n=e.byteLength/8,r=new BigInt64Array(e.buffer,e.byteOffset,n),i=new Int32Array(n);for(let e=0;e2147483647n||t<-2147483648n)throw Error(`Overflow occurred when converting BigInt to Int32 at index ${e}: ${t}`);i[e]=Number(t)}return t?new Uint8Array(i.buffer):i},Cn=(e,t=!0)=>{if(e.byteLength%4!=0)throw Error(`Invalid Uint8Array length - must be a multiple of 4 (Int32).`);let n=e.byteLength/4,r=new Int32Array(e.buffer,e.byteOffset,n),i=BigInt64Array.from(r,BigInt);return t?new Uint8Array(i.buffer):i},wn=1,Tn=()=>wn++,En=new Map([[`float32`,32],[`float16`,16],[`int32`,32],[`uint32`,32],[`int64`,64],[`uint64`,64],[`int8`,8],[`uint8`,8],[`int4`,4],[`uint4`,4]]),Dn=(e,t)=>{let n=En.get(e);if(!n)throw Error(`Unsupported data type.`);return t.length>0?Math.ceil(t.reduce((e,t)=>e*t)*n/8):0},On=class{constructor(e){this.shouldConvertInt64toInt32=!1,this.isInt64ToInt32Converted=!1;let{sessionId:t,context:n,tensor:r,dataType:i,shape:a,shouldConvertInt64toInt32:o=!1}=e;this.sessionId=t,this.mlContext=n,this.mlTensor=r,this.dataType=i,this.tensorShape=a,this.shouldConvertInt64toInt32=o}get tensor(){return this.mlTensor}get type(){return this.dataType}get shape(){return this.tensorShape}get byteLength(){return Dn(this.dataType,this.tensorShape)}destroy(){H(`verbose`,()=>`[WebNN] TensorWrapper.destroy`),this.mlTensor.destroy()}write(e){this.mlContext.writeTensor(this.mlTensor,e)}async read(e,t){if(e){let e=await this.mlContext.readTensor(this.mlTensor),n=Cn(new Uint8Array(e));if(t){(t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)).set(n);return}else return n.buffer}else return t?this.mlContext.readTensor(this.mlTensor,t):this.mlContext.readTensor(this.mlTensor)}canReuseTensor(e,t,n){return this.mlContext===e&&this.dataType===t&&this.tensorShape.length===n.length&&this.tensorShape.every((e,t)=>e===n[t])}setIsInt64ToInt32Converted(e){this.isInt64ToInt32Converted=e}},kn=class{constructor(e,t){this.tensorManager=e,this.wrapper=t}get tensorWrapper(){return this.wrapper}releaseTensor(){this.tensorWrapper&&(this.tensorManager.releaseTensor(this.tensorWrapper),this.wrapper=void 0)}async ensureTensor(e,t,n,r){let i=t,a=this.tensorManager.getMLContext(e),o=i===`int64`&&!a.opSupportLimits().input.dataTypes.includes(`int64`);if(o&&(i=`int32`,H(`verbose`,()=>`[WebNN] TensorIdTracker.ensureTensor: convert dataType from int64 to int32`)),this.wrapper){if(this.wrapper.canReuseTensor(a,i,n))return this.wrapper.tensor;if(r){if(this.wrapper.byteLength!==Dn(i,n))throw Error(`Unable to copy data to tensor with different size.`);this.activeUpload=new Uint8Array(await this.wrapper.read())}this.tensorManager.releaseTensor(this.wrapper)}let s=typeof MLTensorUsage>`u`?void 0:MLTensorUsage.READ|MLTensorUsage.WRITE;return this.wrapper=await this.tensorManager.getCachedTensor(e,i,n,s,!0,!0,o),r&&this.activeUpload&&(this.wrapper.write(this.activeUpload),this.activeUpload=void 0),this.wrapper.tensor}upload(e){let t=e;if(this.wrapper)if(this.wrapper.shouldConvertInt64toInt32&&(t=Sn(e,!0),this.wrapper.setIsInt64ToInt32Converted(!0)),t.byteLength===this.wrapper.byteLength){this.wrapper.write(t);return}else H(`verbose`,()=>`Data size does not match tensor size. Releasing tensor.`),this.releaseTensor();this.activeUpload?this.activeUpload.set(t):this.activeUpload=new Uint8Array(t)}async download(e){if(this.activeUpload){let t=this.wrapper?.isInt64ToInt32Converted?Cn(this.activeUpload):this.activeUpload;if(e){e instanceof ArrayBuffer?new Uint8Array(e).set(t):new Uint8Array(e.buffer,e.byteOffset,e.byteLength).set(t);return}else return t.buffer}if(!this.wrapper)throw Error(`Tensor has not been created.`);return e?this.wrapper.read(this.wrapper?.shouldConvertInt64toInt32,e):this.wrapper.read(this.wrapper?.shouldConvertInt64toInt32)}},An=class{constructor(e){this.backend=e,this.tensorTrackersById=new Map,this.freeTensors=[],this.externalTensors=new Set}getMLContext(e){let t=this.backend.getMLContext(e);if(!t)throw Error(`MLContext not found for session.`);return t}reserveTensorId(){let e=Tn();return this.tensorTrackersById.set(e,new kn(this)),e}releaseTensorId(e){let t=this.tensorTrackersById.get(e);t&&(this.tensorTrackersById.delete(e),t.tensorWrapper&&this.releaseTensor(t.tensorWrapper))}async ensureTensor(e,t,n,r,i){H(`verbose`,()=>`[WebNN] TensorManager.ensureTensor {tensorId: ${t}, dataType: ${n}, shape: ${r}, copyOld: ${i}}`);let a=this.tensorTrackersById.get(t);if(!a)throw Error(`Tensor not found.`);return a.ensureTensor(e,n,r,i)}upload(e,t){let n=this.tensorTrackersById.get(e);if(!n)throw Error(`Tensor not found.`);n.upload(t)}async download(e,t){H(`verbose`,()=>`[WebNN] TensorManager.download {tensorId: ${e}, dstBuffer: ${t?.byteLength}}`);let n=this.tensorTrackersById.get(e);if(!n)throw Error(`Tensor not found.`);return n.download(t)}releaseTensorsForSession(e){for(let t of this.freeTensors)t.sessionId===e&&t.destroy();this.freeTensors=this.freeTensors.filter(t=>t.sessionId!==e)}registerTensor(e,t,n,r){let i=this.getMLContext(e),a=Tn(),o=new On({sessionId:e,context:i,tensor:t,dataType:n,shape:r});return this.tensorTrackersById.set(a,new kn(this,o)),this.externalTensors.add(o),a}async getCachedTensor(e,t,n,r,i,a,o=!1){let s=this.getMLContext(e);for(let[r,i]of this.freeTensors.entries())if(i.canReuseTensor(s,t,n)){H(`verbose`,()=>`[WebNN] Reusing tensor {dataType: ${t}, shape: ${n}}`);let i=this.freeTensors.splice(r,1)[0];return i.sessionId=e,i}H(`verbose`,()=>`[WebNN] MLContext.createTensor {dataType: ${t}, shape: ${n}}`);let c=await s.createTensor({dataType:t,shape:n,dimensions:n,usage:r,writable:i,readable:a});return new On({sessionId:e,context:s,tensor:c,dataType:t,shape:n,shouldConvertInt64toInt32:o})}releaseTensor(e){this.externalTensors.has(e)&&this.externalTensors.delete(e),this.freeTensors.push(e)}},jn=(...e)=>new An(...e)}),Nn,Pn,Fn,In=M(()=>{"use strict";V(),It(),xn(),Mn(),pn(),Nn=new Map([[1,`float32`],[10,`float16`],[6,`int32`],[12,`uint32`],[7,`int64`],[13,`uint64`],[22,`int4`],[21,`uint4`],[3,`int8`],[2,`uint8`],[9,`uint8`]]),Pn=(e,t)=>{if(e===t)return!0;if(e===void 0||t===void 0)return!1;let n=Object.keys(e).sort(),r=Object.keys(t).sort();return n.length===r.length&&n.every((n,i)=>n===r[i]&&e[n]===t[n])},Fn=class{constructor(e){this.tensorManager=jn(this),this.mlContextBySessionId=new Map,this.sessionIdsByMLContext=new Map,this.mlContextCache=[],this.sessionGraphInputs=new Map,this.temporaryGraphInputs=[],this.temporarySessionTensorIds=new Map,dn(e.logLevel,!!e.debug)}get currentSessionId(){if(this.activeSessionId===void 0)throw Error(`No active session`);return this.activeSessionId}onRunStart(e){H(`verbose`,()=>`[WebNN] onRunStart {sessionId: ${e}}`),this.activeSessionId=e}onRunEnd(e){H(`verbose`,()=>`[WebNN] onRunEnd {sessionId: ${e}}`);let t=this.temporarySessionTensorIds.get(e);if(t){for(let e of t)H(`verbose`,()=>`[WebNN] releasing temporary tensor {tensorId: ${e}}`),this.tensorManager.releaseTensorId(e);this.temporarySessionTensorIds.delete(e),this.activeSessionId=void 0}}async createMLContext(e){if(e instanceof GPUDevice){let t=this.mlContextCache.findIndex(t=>t.gpuDevice===e);if(t!==-1)return this.mlContextCache[t].mlContext;{let t=await navigator.ml.createContext(e);return this.mlContextCache.push({gpuDevice:e,mlContext:t}),t}}else if(e===void 0){let e=this.mlContextCache.findIndex(e=>e.options===void 0&&e.gpuDevice===void 0);if(e!==-1)return this.mlContextCache[e].mlContext;{let e=await navigator.ml.createContext();return this.mlContextCache.push({mlContext:e}),e}}let t=this.mlContextCache.findIndex(t=>Pn(t.options,e));if(t!==-1)return this.mlContextCache[t].mlContext;{let t=await navigator.ml.createContext(e);return this.mlContextCache.push({options:e,mlContext:t}),t}}registerMLContext(e,t){this.mlContextBySessionId.set(e,t);let n=this.sessionIdsByMLContext.get(t);n||(n=new Set,this.sessionIdsByMLContext.set(t,n)),n.add(e),this.temporaryGraphInputs.length>0&&(this.sessionGraphInputs.set(e,this.temporaryGraphInputs),this.temporaryGraphInputs=[])}onReleaseSession(e){this.sessionGraphInputs.delete(e);let t=this.mlContextBySessionId.get(e);if(!t)return;this.tensorManager.releaseTensorsForSession(e),this.mlContextBySessionId.delete(e);let n=this.sessionIdsByMLContext.get(t);if(n.delete(e),n.size===0){this.sessionIdsByMLContext.delete(t);let e=this.mlContextCache.findIndex(e=>e.mlContext===t);e!==-1&&this.mlContextCache.splice(e,1)}}getMLContext(e){return this.mlContextBySessionId.get(e)}reserveTensorId(){return this.tensorManager.reserveTensorId()}releaseTensorId(e){H(`verbose`,()=>`[WebNN] releaseTensorId {tensorId: ${e}}`),this.tensorManager.releaseTensorId(e)}async ensureTensor(e,t,n,r,i){let a=Nn.get(n);if(!a)throw Error(`Unsupported ONNX data type: ${n}`);return this.tensorManager.ensureTensor(e??this.currentSessionId,t,a,r,i)}async createTemporaryTensor(e,t,n){H(`verbose`,()=>`[WebNN] createTemporaryTensor {onnxDataType: ${t}, shape: ${n}}`);let r=Nn.get(t);if(!r)throw Error(`Unsupported ONNX data type: ${t}`);let i=this.tensorManager.reserveTensorId();await this.tensorManager.ensureTensor(e,i,r,n,!1);let a=this.temporarySessionTensorIds.get(e);return a?a.push(i):this.temporarySessionTensorIds.set(e,[i]),i}uploadTensor(e,t){if(!Ft().shouldTransferToMLTensor)throw Error(`Trying to upload to a MLTensor while shouldTransferToMLTensor is false`);H(`verbose`,()=>`[WebNN] uploadTensor {tensorId: ${e}, data: ${t.byteLength}}`),this.tensorManager.upload(e,t)}async downloadTensor(e,t){return this.tensorManager.download(e,t)}createMLTensorDownloader(e,t){return async()=>{let n=await this.tensorManager.download(e);return bn(n,t)}}registerMLTensor(e,t,n,r){let i=Nn.get(n);if(!i)throw Error(`Unsupported ONNX data type: ${n}`);let a=this.tensorManager.registerTensor(e,t,i,r);return H(`verbose`,()=>`[WebNN] registerMLTensor {tensor: ${t}, dataType: ${i}, dimensions: ${r}} -> {tensorId: ${a}}`),a}registerMLConstant(e,t,n,r,i,a,o=!1){if(!a)throw Error(`External mounted files are not available.`);let s=e;e.startsWith(`./`)&&(s=e.substring(2));let c=a.get(s);if(!c)throw Error(`File with name ${s} not found in preloaded files.`);if(t+n>c.byteLength)throw Error(`Out of bounds: data offset and length exceed the external file data size.`);let l=c.slice(t,t+n).buffer,u;switch(i.dataType){case`float32`:u=new Float32Array(l);break;case`float16`:u=typeof Float16Array<`u`&&Float16Array.from?new Float16Array(l):new Uint16Array(l);break;case`int32`:u=new Int32Array(l);break;case`uint32`:u=new Uint32Array(l);break;case`int64`:o?(u=Sn(new Uint8Array(l),!1),i.dataType=`int32`):u=new BigInt64Array(l);break;case`uint64`:u=new BigUint64Array(l);break;case`int8`:u=new Int8Array(l);break;case`int4`:case`uint4`:case`uint8`:u=new Uint8Array(l);break;default:throw Error(`Unsupported data type: ${i.dataType} in creating WebNN Constant from external data.`)}return H(`verbose`,()=>`[WebNN] registerMLConstant {dataType: ${i.dataType}, shape: ${i.shape}}} ${o?`(Note: it was int64 data type and registered to int32 as workaround)`:``}`),r.constant(i,u)}registerGraphInput(e){this.temporaryGraphInputs.push(e)}isGraphInput(e,t){let n=this.sessionGraphInputs.get(e);return n?n.includes(t):!1}isInt64Supported(e){return!!this.mlContextBySessionId.get(e)?.opSupportLimits().input.dataTypes.includes(`int64`)}flush(){}}}),Ln=M(()=>{"use strict";}),Rn,zn,Bn,Vn,Hn,Un,Wn,Gn,Kn,qn=M(()=>{"use strict";pn(),Ln(),Rn=new Map([[64,250],[128,200],[256,200],[512,200],[2048,230],[4096,200],[8192,50],[16384,50],[32768,50],[65536,50],[131072,50],[262144,50],[524288,50],[1048576,50],[2097152,30],[4194304,20],[8388608,10],[12582912,10],[16777216,10],[26214400,15],[33554432,22],[44236800,2],[58982400,6],[67108864,6],[134217728,6],[167772160,6]]),zn=[],Bn=e=>Math.ceil(Number(e)/16)*16,Vn=e=>{for(let t=0;tHn++,Wn=async(e,t,n,r)=>{let i=Bn(n),a=e.device.createBuffer({size:i,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ});try{let o=e.getCommandEncoder();e.endComputePass(),o.copyBufferToBuffer(t,0,a,0,i),e.flush(),await a.mapAsync(GPUMapMode.READ);let s=a.getMappedRange();if(r){let e=r();return e.set(new Uint8Array(s,0,n)),e}else return new Uint8Array(s.slice(0,n))}finally{a.destroy()}},Gn=class{constructor(e){this.backend=e,this.storageCache=new Map,this.freeBuffers=new Map,this.freeUniformBuffers=new Map,this.buffersPending=[],this.capturedPendingBuffers=new Map;for(let[e]of Rn)zn.push(e),this.freeBuffers.set(e,[]),this.freeUniformBuffers.set(e,[]);this.sessionCount=0}upload(e,t){let n=t.buffer,r=t.byteOffset,i=t.byteLength,a=Bn(i),o=this.storageCache.get(e);if(!o)throw Error(`gpu data for uploading does not exist`);if(Number(o.originalSize)!==i)throw Error(`inconsistent data size. gpu data size=${o.originalSize}, data size=${i}`);let s=this.backend.device.createBuffer({mappedAtCreation:!0,size:a,usage:GPUBufferUsage.MAP_WRITE|GPUBufferUsage.COPY_SRC}),c=s.getMappedRange();new Uint8Array(c).set(new Uint8Array(n,r,i)),s.unmap();let l=this.backend.device.createCommandEncoder();l.copyBufferToBuffer(s,0,o.gpuData.buffer,0,a),this.backend.device.queue.submit([l.finish()]),s.destroy(),H(`verbose`,()=>`[WebGPU] GpuDataManager.upload(id=${e})`)}memcpy(e,t){let n=this.storageCache.get(e);if(!n)throw Error(`source gpu data for memcpy does not exist`);let r=this.storageCache.get(t);if(!r)throw Error(`destination gpu data for memcpy does not exist`);if(n.originalSize!==r.originalSize)throw Error(`inconsistent source and destination gpu data size`);let i=Bn(n.originalSize),a=this.backend.getCommandEncoder();this.backend.endComputePass(),a.copyBufferToBuffer(n.gpuData.buffer,0,r.gpuData.buffer,0,i)}registerExternalBuffer(e,t,n){let r;if(n){if(r=n[0],e===n[1])return H(`verbose`,()=>`[WebGPU] GpuDataManager.registerExternalBuffer(size=${t}) => id=${r}, buffer is the same, skip.`),r;if(this.backend.capturedCommandList.has(this.backend.currentSessionId))throw Error(`Registering a different external buffer under graph capture mode is not supported yet. - Please use the previous external buffer!`)}else r=Un();return this.storageCache.set(r,{gpuData:{id:r,type:0,buffer:e},originalSize:t}),H(`verbose`,()=>`[WebGPU] GpuDataManager.registerExternalBuffer(size=${t}) => id=${r}, registered.`),r}unregisterExternalBuffer(e){e!==void 0&&(this.storageCache.delete(e),H(`verbose`,()=>`[WebGPU] GpuDataManager.unregisterExternalBuffer() => id=${e}`))}create(e,t=GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST){let n=Vn(e),r,i=(t&GPUBufferUsage.STORAGE)===GPUBufferUsage.STORAGE,a=(t&GPUBufferUsage.UNIFORM)===GPUBufferUsage.UNIFORM;if(i||a){let e=(i?this.freeBuffers:this.freeUniformBuffers).get(n);r=e&&e.length>0?e.pop():this.backend.device.createBuffer({size:n,usage:t})}else r=this.backend.device.createBuffer({size:n,usage:t});let o={id:Un(),type:0,buffer:r};return this.storageCache.set(o.id,{gpuData:o,originalSize:Number(e)}),H(`verbose`,()=>`[WebGPU] GpuDataManager.create(size=${e}) => id=${o.id}`),o}get(e){return this.storageCache.get(e)?.gpuData}release(e){let t=typeof e==`bigint`?Number(e):e,n=this.storageCache.get(t);if(!n){if(this.storageCache.size===0)return 0;throw Error(`releasing data does not exist`)}return H(`verbose`,()=>`[WebGPU] GpuDataManager.release(id=${t}), gpuDataId=${n.gpuData.id}`),this.storageCache.delete(t),this.buffersPending.push(n.gpuData.buffer),n.originalSize}async download(e,t){let n=this.storageCache.get(Number(e));if(!n)throw Error(`data does not exist`);await Wn(this.backend,n.gpuData.buffer,n.originalSize,t)}refreshPendingBuffers(){if(this.buffersPending.length!==0)if(this.backend.sessionStatus===`default`){for(let e of this.buffersPending){let t=Rn.get(e.size);if((e.usage&GPUBufferUsage.STORAGE)===GPUBufferUsage.STORAGE){let n=this.freeBuffers.get(e.size)||[];t===void 0||n.length>=t?e.destroy():n.push(e)}else if((e.usage&GPUBufferUsage.UNIFORM)===GPUBufferUsage.UNIFORM){let n=this.freeUniformBuffers.get(e.size)||[];t===void 0||n.length>=t?e.destroy():n.push(e)}else e.destroy()}this.buffersPending=[]}else{let e=this.capturedPendingBuffers.get(this.backend.currentSessionId);e||(e=[],this.capturedPendingBuffers.set(this.backend.currentSessionId,e));for(let t of this.buffersPending)e.push(t);this.buffersPending=[]}}dispose(){this.freeBuffers.forEach(e=>{e.forEach(e=>{e.destroy()})}),this.freeUniformBuffers.forEach(e=>{e.forEach(e=>{e.destroy()})}),this.storageCache.forEach(e=>{e.gpuData.buffer.destroy()}),this.capturedPendingBuffers.forEach(e=>{e.forEach(e=>{e.destroy()})}),this.storageCache=new Map,this.freeBuffers=new Map,this.freeUniformBuffers=new Map,this.capturedPendingBuffers=new Map}onCreateSession(){this.sessionCount+=1}onReleaseSession(e){let t=this.capturedPendingBuffers.get(e);t&&(t.forEach(e=>{e.destroy()}),this.capturedPendingBuffers.delete(e)),--this.sessionCount,this.sessionCount===0&&(H(`warning`,()=>`[WebGPU] Clearing webgpu buffer cache`),this.storageCache.forEach(e=>{e.gpuData.buffer.destroy()}),this.storageCache=new Map)}},Kn=(...e)=>new Gn(...e)}),Jn,Yn,Xn=M(()=>{"use strict";Jn=class{constructor(e){Object.assign(this,e)}get cacheKey(){return this.key||=Object.getOwnPropertyNames(this).sort().map(e=>`${this[e]}`).join(`;`),this.key}},Yn=e=>new Jn(e)}),Zn,Qn,$n,er,G,tr,nr,rr,ir,K,ar,q,J,or,sr,cr,lr,Y=M(()=>{"use strict";V(),W(),Zn=64,Qn=(e,t)=>{if(t===3)throw Error(`vec3 has same alignment as vec4, use vec4 instead`);switch(Number(e)){case 10:return t>1?`vec${t}`:`f16`;case 1:return t>1?`vec${t}`:`f32`;case 6:return t>1?`vec${t}`:`i32`;case 12:return t>1?`vec${t}`:`u32`;case 7:if(t>1)throw Error(`currently not supported vecX of uint64 yet`);return[`vec2`,`i32`];case 13:if(t>1)throw Error(`currently not supported vecX of uint64 yet`);return[`vec2`,`u32`];case 9:if(t!==4)throw Error(`bool must be vec4`);return[`u32`,`vec4`];case 22:return`i32`;case 21:return`u32`;default:throw Error(`Unknown data type: ${e}`)}},$n=(e,t=1)=>{let n=Qn(e,t);return typeof n==`string`?n:n[0]},er=(e,t=1)=>{let n=Qn(e,t);return typeof n==`string`?n:n[1]},G=(...e)=>{let t=[];return e.forEach(e=>{e.length!==0&&t.push({type:12,data:e},{type:12,data:U.computeStrides(e)})}),t},tr=e=>e%4==0?4:e%2==0?2:1,nr=(e=`f32`,t,n=`0`)=>!t||t===1?`${e}(${n})`:`vec${t}<${e}>(${n})`,rr=(e,t,n)=>e===`f32`?n:t===1?`f32(${n})`:`vec${t}(${n})`,ir=(e,t)=>t===4?`(${e}.x + ${e}.y + ${e}.z + ${e}.w)`:t===2?`(${e}.x + ${e}.y)`:t===3?`(${e}.x + ${e}.y + ${e}.z)`:e,K=(e,t,n,r)=>e.startsWith(`uniforms.`)&&n>4?typeof t==`string`?r===`f16`?`${e}[(${t}) / 8][(${t}) % 8 / 4][(${t}) % 8 % 4]`:`${e}[(${t}) / 4][(${t}) % 4]`:r===`f16`?`${e}[${Math.floor(t/8)}][${Math.floor(t%8/4)}][${t%8%4}]`:`${e}[${Math.floor(t/4)}][${t%4}]`:n>1?`${e}[${t}]`:e,ar=(e,t,n,r,i)=>{let a=typeof n==`number`,o=a?n:n.length,s=[...Array(o).keys()],c=o<2?`u32`:o<=4?`vec${o}`:`array`,l=Qn(t,i),u=typeof l==`string`?l:l[1],d=typeof l==`string`?l:l[0],f={indices:c,value:u,storage:d,tensor:t},p=e=>typeof e==`string`?e:`${e}u`,m={offsetToIndices:!1,indicesToOffset:!1,broadcastedIndicesToOffset:!1,set:!1,setByIndices:!1,get:!1,getByIndices:!1},h=a?`uniforms.`:``,g=`${h}${e}_shape`,_=`${h}${e}_strides`,v=``;for(let e=0;ee.name).join(`, `)}) => ${r.name}>`,hn(_n(n,e))}function G(e){return e=fn(e>>>0),yt(r[e])}function yn(e,t){return t>>>=0,e=vt(e>>>0),t=vt(t),yt(e[t])}function bn(e){9<(e>>>=0)&&(gt[e+1]+=1)}function xn(){return yt([])}function Sn(e){e=vt(e>>>0);for(var t=Array(e.length),n=0;n>>0))}function wn(){return yt({})}function Tn(e){for(var t=vt(e>>>=0);t.length;){var n=t.pop();t.pop()(n)}_t(e)}function En(e,t,n){t>>>=0,n>>>=0,e=vt(e>>>0),t=vt(t),n=vt(n),e[t]=n}function Dn(e,t){return t>>>=0,e=(e=qt(e>>>0,`_emval_take_value`)).readValueFromPointer(t),yt(e)}function On(e,t){e=-9007199254740992>e||9007199254740992>>=0,e=new Date(1e3*e),M()[t>>>2>>>0]=e.getUTCSeconds(),M()[t+4>>>2>>>0]=e.getUTCMinutes(),M()[t+8>>>2>>>0]=e.getUTCHours(),M()[t+12>>>2>>>0]=e.getUTCDate(),M()[t+16>>>2>>>0]=e.getUTCMonth(),M()[t+20>>>2>>>0]=e.getUTCFullYear()-1900,M()[t+24>>>2>>>0]=e.getUTCDay(),e=(e.getTime()-Date.UTC(e.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,M()[t+28>>>2>>>0]=e}var kn=e=>e%4==0&&(e%100!=0||e%400==0),An=[0,31,60,91,121,152,182,213,244,274,305,335],jn=[0,31,59,90,120,151,181,212,243,273,304,334];function Mn(e,t){e=-9007199254740992>e||9007199254740992>>=0,e=new Date(1e3*e),M()[t>>>2>>>0]=e.getSeconds(),M()[t+4>>>2>>>0]=e.getMinutes(),M()[t+8>>>2>>>0]=e.getHours(),M()[t+12>>>2>>>0]=e.getDate(),M()[t+16>>>2>>>0]=e.getMonth(),M()[t+20>>>2>>>0]=e.getFullYear()-1900,M()[t+24>>>2>>>0]=e.getDay();var n=(kn(e.getFullYear())?An:jn)[e.getMonth()]+e.getDate()-1|0;M()[t+28>>>2>>>0]=n,M()[t+36>>>2>>>0]=-60*e.getTimezoneOffset(),n=new Date(e.getFullYear(),6,1).getTimezoneOffset();var r=new Date(e.getFullYear(),0,1).getTimezoneOffset();e=0|(n!=r&&e.getTimezoneOffset()==Math.min(r,n)),M()[t+32>>>2>>>0]=e}function Nn(e){e>>>=0;var t=new Date(M()[e+20>>>2>>>0]+1900,M()[e+16>>>2>>>0],M()[e+12>>>2>>>0],M()[e+8>>>2>>>0],M()[e+4>>>2>>>0],M()[e>>>2>>>0],0),n=M()[e+32>>>2>>>0],r=t.getTimezoneOffset(),i=new Date(t.getFullYear(),6,1).getTimezoneOffset(),a=new Date(t.getFullYear(),0,1).getTimezoneOffset(),o=Math.min(a,i);return 0>n?M()[e+32>>>2>>>0]=+(i!=a&&o==r):0>>2>>>0]=t.getDay(),n=(kn(t.getFullYear())?An:jn)[t.getMonth()]+t.getDate()-1|0,M()[e+28>>>2>>>0]=n,M()[e>>>2>>>0]=t.getSeconds(),M()[e+4>>>2>>>0]=t.getMinutes(),M()[e+8>>>2>>>0]=t.getHours(),M()[e+12>>>2>>>0]=t.getDate(),M()[e+16>>>2>>>0]=t.getMonth(),M()[e+20>>>2>>>0]=t.getYear(),e=t.getTime(),BigInt(isNaN(e)?-1:e/1e3)}function Pn(e,t,n,r,i,a,o){return s?B(16,1,e,t,n,r,i,a,o):-52}function Fn(e,t,n,r,i,a){if(s)return B(17,1,e,t,n,r,i,a)}var In={},Ln=()=>performance.timeOrigin+performance.now();function Rn(e,t){if(s)return B(18,1,e,t);if(In[e]&&(clearTimeout(In[e].id),delete In[e]),!t)return 0;var n=setTimeout(()=>{delete In[e],Rt(()=>Cr(e,performance.timeOrigin+performance.now()))},t);return In[e]={id:n,qc:t},0}function zn(e,t,n,r){e>>>=0,t>>>=0,n>>>=0,r>>>=0;var i=new Date().getFullYear(),a=new Date(i,0,1).getTimezoneOffset();i=new Date(i,6,1).getTimezoneOffset();var o=Math.max(a,i);N()[e>>>2>>>0]=60*o,M()[t>>>2>>>0]=+(a!=i),e=(t=e=>{var t=Math.abs(e);return`UTC${0<=e?`-`:`+`}${String(Math.floor(t/60)).padStart(2,`0`)}${String(t%60).padStart(2,`0`)}`})(a),t=t(i),iDate.now(),Vn=1;function Hn(e,t,n){if(!(0<=e&&3>=e))return 28;if(e===0)e=Date.now();else{if(!Vn)return 52;e=performance.timeOrigin+performance.now()}return A[n>>>0>>>3]=BigInt(Math.round(1e6*e)),0}var Un=[],Wn=(e,t)=>{Un.length=0;for(var n;n=ae()[e++>>>0];){var r=n!=105;t+=(r&=n!=112)&&t%8?4:0,Un.push(n==112?N()[t>>>2>>>0]:n==106?A[t>>>3]:n==105?M()[t>>>2>>>0]:le()[t>>>3>>>0]),t+=r?8:4}return Un};function Gn(e,t,n){return e>>>=0,t=Wn(t>>>0,n>>>0),L[e](...t)}function Kn(e,t,n){return e>>>=0,t=Wn(t>>>0,n>>>0),L[e](...t)}var qn=()=>{};function Jn(e,t){return y(H(e>>>0,t>>>0))}var Yn=()=>{throw Se+=1,`unwind`};function Xn(){return 4294901760}var Zn=()=>navigator.hardwareConcurrency;function Qn(){return I(`Cannot use emscripten_pc_get_function without -sUSE_OFFSET_CONVERTER`),0}function $n(e){e>>>=0;var t=ae().length;if(e<=t||4294901760=n;n*=2){var r=t*(1+.2/n);r=Math.min(r,e+100663296);e:{r=(Math.min(4294901760,65536*Math.ceil(Math.max(e,r)/65536))-b.buffer.byteLength+65535)/65536|0;try{b.grow(r),P();var i=1;break e}catch{}i=void 0}if(i)return!0}return!1}var K=()=>(I(`Cannot use convertFrameToPC (needed by __builtin_return_address) without -sUSE_OFFSET_CONVERTER`),0),er={},tr=e=>{e.forEach(e=>{var t=K();t&&(er[t]=e)})};function nr(){var e=Error().stack.toString().split(` +`);return e[0]==`Error`&&e.shift(),tr(e),er.Lb=K(),er.cc=e,er.Lb}function rr(e,t,n){if(e>>>=0,t>>>=0,er.Lb==e)var r=er.cc;else (r=Error().stack.toString().split(` +`))[0]==`Error`&&r.shift(),tr(r);for(var i=3;r[i]&&K()!=e;)++i;for(e=0;e>>2>>>0]=K();return e}var q,ir={},J=()=>{if(!q){var e,t={USER:`web_user`,LOGNAME:`web_user`,PATH:`/`,PWD:`/`,HOME:`/home/web_user`,LANG:(typeof navigator==`object`&&navigator.languages&&navigator.languages[0]||`C`).replace(`-`,`_`)+`.UTF-8`,_:`./this.program`};for(e in ir)ir[e]===void 0?delete t[e]:t[e]=ir[e];var n=[];for(e in t)n.push(`${e}=${t[e]}`);q=n}return q};function Y(e,t){if(s)return B(19,1,e,t);e>>>=0,t>>>=0;var n=0;return J().forEach((r,i)=>{var a=t+n;for(i=N()[e+4*i>>>2>>>0]=a,a=0;a>>0]=r.charCodeAt(a);ie()[i>>>0]=0,n+=r.length+1}),0}function ar(e,t){if(s)return B(20,1,e,t);e>>>=0,t>>>=0;var n=J();N()[e>>>2>>>0]=n.length;var r=0;return n.forEach(e=>r+=e.length+1),N()[t>>>2>>>0]=r,0}function or(e){return s?B(21,1,e):52}function sr(e,t,n,r){return s?B(22,1,e,t,n,r):52}function cr(e,t,n,r){return s?B(23,1,e,t,n,r):70}var X=[null,[],[]];function lr(e,t,n,r){if(s)return B(24,1,e,t,n,r);t>>>=0,n>>>=0,r>>>=0;for(var i=0,a=0;a>>2>>>0],c=N()[t+4>>>2>>>0];t+=8;for(var l=0;l>>0],d=X[e];u===0||u===10?((e===1?v:y)(Be(d)),d.length=0):d.push(u)}i+=c}return N()[r>>>2>>>0]=i,0}s||function(){for(var e=r.numThreads-1;e--;)Ne();be.unshift(()=>{me++,function(e){s?e():Promise.all(Ee.map(Me)).then(e)}(()=>ge())})}();for(var ur=Array(256),dr=0;256>dr;++dr)ur[dr]=String.fromCharCode(dr);nt=ur,rt=r.BindingError=class extends Error{constructor(e){super(e),this.name=`BindingError`}},r.InternalError=class extends Error{constructor(e){super(e),this.name=`InternalError`}},gt.push(0,1,void 0,1,null,1,!0,1,!1,1),r.count_emval_handles=()=>gt.length/2-5-ht.length;var Z,fr=[Ce,we,Re,Ve,He,Ge,Ke,qe,Je,Ye,Xe,Ze,Qe,$e,et,tt,Pn,Fn,Rn,Y,ar,or,sr,cr,lr];(async function(){function e(e,t){return Z=e.exports,Z=function(){var e=Z,t={};for(let[n,r]of Object.entries(e))t[n]=typeof r==`function`?(...e)=>{tn.push(n);try{return r(...e)}finally{j||(tn.pop(),$t&&Qt===1&&tn.length===0&&(Qt=0,Se+=1,Zt(jr),typeof Fibers<`u`&&Fibers.rc()))}}:r;return t}(),Z=function(){var e=Z,t=e=>t=>e(t)>>>0,n=e=>()=>e()>>>0;return(e=Object.assign({},e)).Da=t(e.Da),e.fb=n(e.fb),e.hb=t(e.hb),e.tb=t(e.tb),e.ub=n(e.ub),e.__cxa_get_exception_ptr=t(e.__cxa_get_exception_ptr),e}(),Oe.push(Z.ib),x=t,ge(),Z}me++;var t=_e();if(r.instantiateWasm)return new Promise(n=>{r.instantiateWasm(t,(t,r)=>{e(t,r),n(t.exports)})});if(s)return new Promise(t=>{de=n=>{var r=new WebAssembly.Instance(n,_e());t(e(r,n))}});F??=r.locateFile?r.locateFile?r.locateFile(`ort-wasm-simd-threaded.jsep.wasm`,h):h+`ort-wasm-simd-threaded.jsep.wasm`:new URL(`/assets/ort-wasm-simd-threaded.jsep-B0T3yYHD.wasm`,``+import.meta.url).href;try{var i=await async function(e){var t=F;if(!ne&&typeof WebAssembly.instantiateStreaming==`function`&&!re(t))try{var n=fetch(t,{credentials:`same-origin`});return await WebAssembly.instantiateStreaming(n,e)}catch(e){y(`wasm streaming compile failed: ${e}`),y(`falling back to ArrayBuffer instantiation`)}return async function(e,t){try{var n=await async function(e){if(!ne)try{var t=await d(e);return new Uint8Array(t)}catch{}if(e==F&&ne)e=new Uint8Array(ne);else{if(!f)throw`both async and sync fetching of the wasm failed`;e=f(e)}return e}(e);return await WebAssembly.instantiate(n,t)}catch(e){y(`failed to asynchronously prepare wasm: ${e}`),I(e)}}(t,e)}(t);return e(i.instance,i.module)}catch(e){return n(e),Promise.reject(e)}})();var pr=e=>(pr=Z.Da)(e),mr=()=>(mr=Z.Ea)();r._OrtInit=(e,t)=>(r._OrtInit=Z.Fa)(e,t),r._OrtGetLastError=(e,t)=>(r._OrtGetLastError=Z.Ga)(e,t),r._OrtCreateSessionOptions=(e,t,n,i,a,o,s,c,l,u)=>(r._OrtCreateSessionOptions=Z.Ha)(e,t,n,i,a,o,s,c,l,u),r._OrtAppendExecutionProvider=(e,t,n,i,a)=>(r._OrtAppendExecutionProvider=Z.Ia)(e,t,n,i,a),r._OrtAddFreeDimensionOverride=(e,t,n)=>(r._OrtAddFreeDimensionOverride=Z.Ja)(e,t,n),r._OrtAddSessionConfigEntry=(e,t,n)=>(r._OrtAddSessionConfigEntry=Z.Ka)(e,t,n),r._OrtReleaseSessionOptions=e=>(r._OrtReleaseSessionOptions=Z.La)(e),r._OrtCreateSession=(e,t,n)=>(r._OrtCreateSession=Z.Ma)(e,t,n),r._OrtReleaseSession=e=>(r._OrtReleaseSession=Z.Na)(e),r._OrtGetInputOutputCount=(e,t,n)=>(r._OrtGetInputOutputCount=Z.Oa)(e,t,n),r._OrtGetInputOutputMetadata=(e,t,n,i)=>(r._OrtGetInputOutputMetadata=Z.Pa)(e,t,n,i),r._OrtFree=e=>(r._OrtFree=Z.Qa)(e),r._OrtCreateTensor=(e,t,n,i,a,o)=>(r._OrtCreateTensor=Z.Ra)(e,t,n,i,a,o),r._OrtGetTensorData=(e,t,n,i,a)=>(r._OrtGetTensorData=Z.Sa)(e,t,n,i,a),r._OrtReleaseTensor=e=>(r._OrtReleaseTensor=Z.Ta)(e),r._OrtCreateRunOptions=(e,t,n,i)=>(r._OrtCreateRunOptions=Z.Ua)(e,t,n,i),r._OrtAddRunConfigEntry=(e,t,n)=>(r._OrtAddRunConfigEntry=Z.Va)(e,t,n),r._OrtReleaseRunOptions=e=>(r._OrtReleaseRunOptions=Z.Wa)(e),r._OrtCreateBinding=e=>(r._OrtCreateBinding=Z.Xa)(e),r._OrtBindInput=(e,t,n)=>(r._OrtBindInput=Z.Ya)(e,t,n),r._OrtBindOutput=(e,t,n,i)=>(r._OrtBindOutput=Z.Za)(e,t,n,i),r._OrtClearBoundOutputs=e=>(r._OrtClearBoundOutputs=Z._a)(e),r._OrtReleaseBinding=e=>(r._OrtReleaseBinding=Z.$a)(e),r._OrtRunWithBinding=(e,t,n,i,a)=>(r._OrtRunWithBinding=Z.ab)(e,t,n,i,a),r._OrtRun=(e,t,n,i,a,o,s,c)=>(r._OrtRun=Z.bb)(e,t,n,i,a,o,s,c),r._OrtEndProfiling=e=>(r._OrtEndProfiling=Z.cb)(e),r._JsepOutput=(e,t,n)=>(r._JsepOutput=Z.db)(e,t,n),r._JsepGetNodeName=e=>(r._JsepGetNodeName=Z.eb)(e);var hr=()=>(hr=Z.fb)(),gr=r._free=e=>(gr=r._free=Z.gb)(e),_r=r._malloc=e=>(_r=r._malloc=Z.hb)(e),vr=(e,t,n,r,i,a)=>(vr=Z.kb)(e,t,n,r,i,a),yr=()=>(yr=Z.lb)(),br=(e,t,n,r,i)=>(br=Z.mb)(e,t,n,r,i),xr=e=>(xr=Z.nb)(e),Sr=e=>(Sr=Z.ob)(e),Cr=(e,t)=>(Cr=Z.pb)(e,t),wr=()=>(wr=Z.qb)(),Tr=(e,t)=>(Tr=Z.rb)(e,t),Er=e=>(Er=Z.sb)(e),Dr=e=>(Dr=Z.tb)(e),Or=()=>(Or=Z.ub)(),kr=r.dynCall_ii=(e,t)=>(kr=r.dynCall_ii=Z.vb)(e,t),Ar=e=>(Ar=Z.wb)(e),jr=()=>(jr=Z.xb)(),Mr=e=>(Mr=Z.yb)(e),Nr=()=>(Nr=Z.zb)();return r.stackSave=()=>Or(),r.stackRestore=e=>Er(e),r.stackAlloc=e=>Dr(e),r.setValue=function(e,t,n=`i8`){switch(n.endsWith(`*`)&&(n=`*`),n){case`i1`:case`i8`:ie()[e>>>0]=t;break;case`i16`:oe()[e>>>1>>>0]=t;break;case`i32`:M()[e>>>2>>>0]=t;break;case`i64`:A[e>>>3]=BigInt(t);break;case`float`:ce()[e>>>2>>>0]=t;break;case`double`:le()[e>>>3>>>0]=t;break;case`*`:N()[e>>>2>>>0]=t;break;default:I(`invalid type for setValue: ${n}`)}},r.getValue=function(e,t=`i8`){switch(t.endsWith(`*`)&&(t=`*`),t){case`i1`:case`i8`:return ie()[e>>>0];case`i16`:return oe()[e>>>1>>>0];case`i32`:return M()[e>>>2>>>0];case`i64`:return A[e>>>3];case`float`:return ce()[e>>>2>>>0];case`double`:return le()[e>>>3>>>0];case`*`:return N()[e>>>2>>>0];default:I(`invalid type for getValue: ${t}`)}},r.UTF8ToString=H,r.stringToUTF8=We,r.lengthBytesUTF8=Ue,function e(){if(0{"use strict";Qe(),ut=typeof location>`u`?void 0:location.origin,dt=import.meta.url>`file:`&&import.meta.url<`file;`,ft=()=>{if(dt){let e=URL;return new URL(new e(`ort.bundle.min.mjs`,import.meta.url).href,ut).href}return import.meta.url},pt=ft(),mt=()=>{if(pt&&!pt.startsWith(`blob:`))return pt.substring(0,pt.lastIndexOf(`/`)+1)},ht=(e,t)=>{try{let n=t??pt;return(n?new URL(e,n):new URL(e)).origin===ut}catch{return!1}},gt=(e,t)=>{let n=t??pt;try{return(n?new URL(e,n):new URL(e)).href}catch{return}},_t=(e,t)=>`${t??`./`}${e}`,vt=async e=>{let t=await(await fetch(e,{credentials:`same-origin`})).blob();return URL.createObjectURL(t)},yt=async e=>(await import(e)).default,bt=(rt(),le($e)).default,xt=async()=>{if(!pt)throw Error(`Failed to load proxy worker: cannot determine the script source URL.`);if(ht(pt))return[void 0,bt()];let e=await vt(pt);return[e,bt(e)]},St=(lt(),le(it)).default,Ct=async(e,t,n)=>{if(!e&&!t&&St&&pt&&ht(pt))return[void 0,St];{let r=`ort-wasm-simd-threaded.jsep.mjs`,i=e??gt(r,t),a=n&&i&&!ht(i,t),o=a?await vt(i):i??_t(r,t);return[a?o:void 0,await yt(o)]}}}),Tt,Et,Dt,Ot,kt,At,jt,Mt,Nt,Pt=M(()=>{"use strict";wt(),Et=!1,Dt=!1,Ot=!1,kt=()=>{if(typeof SharedArrayBuffer>`u`)return!1;try{return typeof MessageChannel<`u`&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(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]))}catch{return!1}},At=()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,30,1,28,0,65,0,253,15,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,186,1,26,11]))}catch{return!1}},jt=()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,19,1,17,0,65,1,253,15,65,2,253,15,65,3,253,15,253,147,2,11]))}catch{return!1}},Mt=async e=>{if(Et)return Promise.resolve();if(Dt)throw Error(`multiple calls to 'initializeWebAssembly()' detected.`);if(Ot)throw Error(`previous call to 'initializeWebAssembly()' failed.`);Dt=!0;let t=e.initTimeout,n=e.numThreads;if(e.simd!==!1){if(e.simd===`relaxed`){if(!jt())throw Error(`Relaxed WebAssembly SIMD is not supported in the current environment.`)}else if(!At())throw Error(`WebAssembly SIMD is not supported in the current environment.`)}let r=kt();n>1&&!r&&(typeof self<`u`&&!self.crossOriginIsolated&&console.warn(`env.wasm.numThreads is set to `+n+`, but this will not work unless you enable crossOriginIsolated mode. See https://web.dev/cross-origin-isolation-guide/ for more info.`),console.warn(`WebAssembly multi-threading is not supported in the current environment. Falling back to single-threading.`),e.numThreads=n=1);let i=e.wasmPaths,a=typeof i==`string`?i:void 0,o=i?.mjs,s=o?.href??o,c=i?.wasm,l=c?.href??c,u=e.wasmBinary,[d,f]=await Ct(s,a,n>1),p=!1,m=[];if(t>0&&m.push(new Promise(e=>{setTimeout(()=>{p=!0,e()},t)})),m.push(new Promise((e,t)=>{let r={numThreads:n};if(u)r.wasmBinary=u;else if(l||a)r.locateFile=e=>l??a+e;else if(s&&s.indexOf(`blob:`)!==0)r.locateFile=e=>new URL(e,s).href;else if(d){let e=mt();e&&(r.locateFile=t=>e+t)}f(r).then(t=>{Dt=!1,Et=!0,Tt=t,e(),d&&URL.revokeObjectURL(d)},e=>{Dt=!1,Ot=!0,t(e)})})),await Promise.race(m),p)throw Error(`WebAssembly backend initializing failed due to timeout: ${t}ms`)},Nt=()=>{if(Et&&Tt)return Tt;throw Error(`WebAssembly is not initialized yet.`)}}),Ft,It,Lt,Rt=M(()=>{"use strict";Pt(),Ft=(e,t)=>{let n=Nt(),r=n.lengthBytesUTF8(e)+1,i=n._malloc(r);return n.stringToUTF8(e,i,r),t.push(i),i},It=(e,t,n,r)=>{if(typeof e==`object`&&e){if(n.has(e))throw Error(`Circular reference in options`);n.add(e)}Object.entries(e).forEach(([e,i])=>{let a=t?t+e:e;if(typeof i==`object`)It(i,a+`.`,n,r);else if(typeof i==`string`||typeof i==`number`)r(a,i.toString());else if(typeof i==`boolean`)r(a,i?`1`:`0`);else throw Error(`Can't handle extra config type: ${typeof i}`)})},Lt=e=>{let t=Nt(),n=t.stackSave();try{let n=t.PTR_SIZE,r=t.stackAlloc(2*n);t._OrtGetLastError(r,r+n);let i=Number(t.getValue(r,n===4?`i32`:`i64`)),a=t.getValue(r+n,`*`),o=a?t.UTF8ToString(a):``;throw Error(`${e} ERROR_CODE: ${i}, ERROR_MESSAGE: ${o}`)}finally{t.stackRestore(n)}}}),zt,Bt=M(()=>{"use strict";Pt(),Rt(),zt=e=>{let t=Nt(),n=0,r=[],i=e||{};try{if(e?.logSeverityLevel===void 0)i.logSeverityLevel=2;else if(typeof e.logSeverityLevel!=`number`||!Number.isInteger(e.logSeverityLevel)||e.logSeverityLevel<0||e.logSeverityLevel>4)throw Error(`log serverity level is not valid: ${e.logSeverityLevel}`);if(e?.logVerbosityLevel===void 0)i.logVerbosityLevel=0;else if(typeof e.logVerbosityLevel!=`number`||!Number.isInteger(e.logVerbosityLevel))throw Error(`log verbosity level is not valid: ${e.logVerbosityLevel}`);e?.terminate===void 0&&(i.terminate=!1);let a=0;return e?.tag!==void 0&&(a=Ft(e.tag,r)),n=t._OrtCreateRunOptions(i.logSeverityLevel,i.logVerbosityLevel,!!i.terminate,a),n===0&&Lt(`Can't create run options.`),e?.extra!==void 0&&It(e.extra,``,new WeakSet,(e,i)=>{let a=Ft(e,r),o=Ft(i,r);t._OrtAddRunConfigEntry(n,a,o)!==0&&Lt(`Can't set a run config entry: ${e} - ${i}.`)}),[n,r]}catch(e){throw n!==0&&t._OrtReleaseRunOptions(n),r.forEach(e=>t._free(e)),e}}}),Vt,Ht,Ut,Wt,Gt,Kt,qt=M(()=>{"use strict";Pt(),Rt(),Vt=e=>{switch(e){case`disabled`:return 0;case`basic`:return 1;case`extended`:return 2;case`all`:return 99;default:throw Error(`unsupported graph optimization level: ${e}`)}},Ht=e=>{switch(e){case`sequential`:return 0;case`parallel`:return 1;default:throw Error(`unsupported execution mode: ${e}`)}},Ut=e=>{e.extra||={},e.extra.session||(e.extra.session={});let t=e.extra.session;t.use_ort_model_bytes_directly||=`1`,e.executionProviders&&e.executionProviders.some(e=>(typeof e==`string`?e:e.name)===`webgpu`)&&(e.enableMemPattern=!1)},Wt=(e,t,n,r)=>{let i=Ft(t,r),a=Ft(n,r);Nt()._OrtAddSessionConfigEntry(e,i,a)!==0&&Lt(`Can't set a session config entry: ${t} - ${n}.`)},Gt=async(e,t,n)=>{for(let r of t){let t=typeof r==`string`?r:r.name,i=[];switch(t){case`webnn`:if(t=`WEBNN`,typeof r!=`string`){let t=r?.deviceType;t&&Wt(e,`deviceType`,t,n)}break;case`webgpu`:if(t=`JS`,typeof r!=`string`){let t=r;if(t?.preferredLayout){if(t.preferredLayout!==`NCHW`&&t.preferredLayout!==`NHWC`)throw Error(`preferredLayout must be either 'NCHW' or 'NHWC': ${t.preferredLayout}`);Wt(e,`preferredLayout`,t.preferredLayout,n)}}break;case`wasm`:case`cpu`:continue;default:throw Error(`not supported execution provider: ${t}`)}let a=Ft(t,n),o=i.length,s=0,c=0;if(o>0){s=Nt()._malloc(o*Nt().PTR_SIZE),n.push(s),c=Nt()._malloc(o*Nt().PTR_SIZE),n.push(c);for(let e=0;e{let t=Nt(),n=0,r=[],i=e||{};Ut(i);try{let e=Vt(i.graphOptimizationLevel??`all`),a=Ht(i.executionMode??`sequential`),o=typeof i.logId==`string`?Ft(i.logId,r):0,s=i.logSeverityLevel??2;if(!Number.isInteger(s)||s<0||s>4)throw Error(`log serverity level is not valid: ${s}`);let c=i.logVerbosityLevel??0;if(!Number.isInteger(c)||c<0||c>4)throw Error(`log verbosity level is not valid: ${c}`);let l=typeof i.optimizedModelFilePath==`string`?Ft(i.optimizedModelFilePath,r):0;if(n=t._OrtCreateSessionOptions(e,!!i.enableCpuMemArena,!!i.enableMemPattern,a,!!i.enableProfiling,0,o,s,c,l),n===0&&Lt(`Can't create session options.`),i.executionProviders&&await Gt(n,i.executionProviders,r),i.enableGraphCapture!==void 0){if(typeof i.enableGraphCapture!=`boolean`)throw Error(`enableGraphCapture must be a boolean value: ${i.enableGraphCapture}`);Wt(n,`enableGraphCapture`,i.enableGraphCapture.toString(),r)}if(i.freeDimensionOverrides)for(let[e,a]of Object.entries(i.freeDimensionOverrides)){if(typeof e!=`string`)throw Error(`free dimension override name must be a string: ${e}`);if(typeof a!=`number`||!Number.isInteger(a)||a<0)throw Error(`free dimension override value must be a non-negative integer: ${a}`);let i=Ft(e,r);t._OrtAddFreeDimensionOverride(n,i,a)!==0&&Lt(`Can't set a free dimension override: ${e} - ${a}.`)}return i.extra!==void 0&&It(i.extra,``,new WeakSet,(e,t)=>{Wt(n,e,t,r)}),[n,r]}catch(e){throw n!==0&&t._OrtReleaseSessionOptions(n)!==0&&Lt(`Can't release session options.`),r.forEach(e=>t._free(e)),e}}}),Jt,Yt,Xt,Zt,Qt,$t,en,tn,U=M(()=>{"use strict";Jt=e=>{switch(e){case`int8`:return 3;case`uint8`:return 2;case`bool`:return 9;case`int16`:return 5;case`uint16`:return 4;case`int32`:return 6;case`uint32`:return 12;case`float16`:return 10;case`float32`:return 1;case`float64`:return 11;case`string`:return 8;case`int64`:return 7;case`uint64`:return 13;case`int4`:return 22;case`uint4`:return 21;default:throw Error(`unsupported data type: ${e}`)}},Yt=e=>{switch(e){case 3:return`int8`;case 2:return`uint8`;case 9:return`bool`;case 5:return`int16`;case 4:return`uint16`;case 6:return`int32`;case 12:return`uint32`;case 10:return`float16`;case 1:return`float32`;case 11:return`float64`;case 8:return`string`;case 7:return`int64`;case 13:return`uint64`;case 22:return`int4`;case 21:return`uint4`;default:throw Error(`unsupported data type: ${e}`)}},Xt=(e,t)=>{let n=[-1,4,1,1,2,2,4,8,-1,1,2,8,4,8,-1,-1,-1,-1,-1,-1,-1,.5,.5][e],r=typeof t==`number`?t:t.reduce((e,t)=>e*t,1);return n>0?Math.ceil(r*n):void 0},Zt=e=>{switch(e){case`float16`:return typeof Float16Array<`u`&&Float16Array.from?Float16Array:Uint16Array;case`float32`:return Float32Array;case`uint8`:return Uint8Array;case`int8`:return Int8Array;case`uint16`:return Uint16Array;case`int16`:return Int16Array;case`int32`:return Int32Array;case`bool`:return Uint8Array;case`float64`:return Float64Array;case`uint32`:return Uint32Array;case`int64`:return BigInt64Array;case`uint64`:return BigUint64Array;default:throw Error(`unsupported type: ${e}`)}},Qt=e=>{switch(e){case`verbose`:return 0;case`info`:return 1;case`warning`:return 2;case`error`:return 3;case`fatal`:return 4;default:throw Error(`unsupported logging level: ${e}`)}},$t=e=>e===`float32`||e===`float16`||e===`int32`||e===`int64`||e===`uint32`||e===`uint8`||e===`bool`||e===`uint4`||e===`int4`,en=e=>e===`float32`||e===`float16`||e===`int32`||e===`int64`||e===`uint32`||e===`uint64`||e===`int8`||e===`uint8`||e===`bool`||e===`uint4`||e===`int4`,tn=e=>{switch(e){case`none`:return 0;case`cpu`:return 1;case`cpu-pinned`:return 2;case`texture`:return 3;case`gpu-buffer`:return 4;case`ml-tensor`:return 5;default:throw Error(`unsupported data location: ${e}`)}}}),nn,rn=M(()=>{"use strict";Qe(),nn=async e=>{if(typeof e==`string`){let t=await fetch(e);if(!t.ok)throw Error(`failed to load external data file: ${e}`);let n=t.headers.get(`Content-Length`),r=n?parseInt(n,10):0;if(r<1073741824)return new Uint8Array(await t.arrayBuffer());{if(!t.body)throw Error(`failed to load external data file: ${e}, no response body.`);let n=t.body.getReader(),i;try{i=new ArrayBuffer(r)}catch(e){if(e instanceof RangeError){let e=Math.ceil(r/65536);i=new WebAssembly.Memory({initial:e,maximum:e}).buffer}else throw e}let a=0;for(;;){let{done:e,value:t}=await n.read();if(e)break;let r=t.byteLength;new Uint8Array(i,a,r).set(t),a+=r}return new Uint8Array(i,0,r)}}else return e instanceof Blob?new Uint8Array(await e.arrayBuffer()):e instanceof Uint8Array?e:new Uint8Array(e)}}),an,on,sn,cn,ln,un,dn,fn=M(()=>{"use strict";U(),an=[`V`,`I`,`W`,`E`,`F`],on=(e,t)=>{console.log(`[${an[e]},${new Date().toISOString()}]${t}`)},ln=(e,t)=>{sn=e,cn=t},un=(e,t)=>{let n=Qt(e),r=Qt(sn);n>=r&&on(n,typeof t==`function`?t():t)},dn=(...e)=>{cn&&un(...e)}}),pn,mn,W,hn,gn,_n,vn,G=M(()=>{"use strict";pn=class{static calcMatMulShape(e,t){return e[1]===t[0]?[e[0],t[1]]:void 0}},mn=class{static calcShape(e,t,n=!1){let r=e.length,i=t.length;if(r===0)return t;if(i===0)return e;let a=Math.max(e.length,t.length),o=Array(a);if(n){if(r<2||i<2)return;let n=pn.calcMatMulShape([e[r-2],e[r-1]],[t[i-2],t[i-1]]);if(n===void 0)return;[o[a-2],o[a-1]]=n}for(let s=n?3:1;s<=a;s++){let n=r-s<0?1:e[r-s],c=i-s<0?1:t[i-s];if(n!==c&&n>1&&c>1)return;let l=Math.max(n,c);if(n&&c)o[a-s]=Math.max(n,c);else{if(l>1)return;o[a-s]=0}}return o}static isValidBroadcast(e,t){let n=e.length,r=t.length;if(n>r)return!1;for(let i=1;i<=n;i++)if(e[n-i]!==1&&e[n-i]!==t[r-i])return!1;return!0}},W=class e{static size(t){return e.getSizeFromDimensionRange(t,0,t.length)}static convertShape(e,t=4){let n=e.length;if(n===0)return[];let r=Array(n),i=n-1;for(;i>=0;){if(e[i]%t===0){r[i]=e[i]/t;break}if(t%e[i]!==0)throw Error(`cannot convert shape`);r[i]=1,t/=e[i],i--}for(i--;i>=0;i--)r[i]=e[i];return r}static sizeFromDimension(t,n){if(n<0||n>t.length)throw Error(`invalid dimension of ${n} for sizeFromDimension as Tensor has ${t.length} dimensions.`);return e.getSizeFromDimensionRange(t,n,t.length)}static sizeToDimension(t,n){if(n<0||n>t.length)throw Error(`invalid dimension of ${n} for sizeToDimension as Tensor has ${t.length} dimensions.`);return e.getSizeFromDimensionRange(t,0,n)}static getSizeFromDimensionRange(e,t,n){let r=1;for(let i=t;i=0;--r)n[r]=n[r+1]*e[r+1];return n}static normalizeAxis(e,t){if(e<-t&&e>=t)throw Error(`unsupported axis for this operation.`);return e<0?e+t:e}static normalizeAxes(e,t){return e.map(n=>this.normalizeAxis(n,t??e.length))}static sortBasedOnPerm(e,t){return t?t.map(t=>e[t]):e.slice().reverse()}static padShape(e,t){let n=e.length;return e.map((e,r)=>e+t[r]+t[r+n])}static areEqual(e,t){return e.length===t.length?e.every((e,n)=>e===t[n]):!1}},hn=class e{static adjustPoolAttributes(e,t,n,r,i,a){if(!e&&n.length!==t.length-2)throw Error(`length of specified kernel shapes should be 2 less than length of input dimensions`);if(e)for(let e=0;e=n.length?n.push(t[e+2]):n[e]=t[e+2];for(let e=0;e=n[e]||a[e+n.length]>=n[e])throw Error(`pads should be smaller than kernel`)}}static adjustPadsBasedOnAutoPad(t,n,r,i,a,o,s){if(s){if(a.length!==2*(t.length-2))throw Error(`length of pads should be twice the length of data dimensions`);if(n.length!==t.length-2)throw Error(`length of strides should be the length of data dimensions`);if(i.length!==t.length-2)throw Error(`length of kernel shapes should be the length of data dimensions`);for(let c=0;c{"use strict";U(),yn=(e,t)=>new(Zt(t))(e)}),xn,Sn,Cn,wn,Tn,En,Dn,On,kn,An,jn=M(()=>{"use strict";fn(),xn=(e,t=!0)=>{if(e.byteLength%8!=0)throw Error(`Invalid Uint8Array length - must be a multiple of 8 (BigInt).`);let n=e.byteLength/8,r=new BigInt64Array(e.buffer,e.byteOffset,n),i=new Int32Array(n);for(let e=0;e2147483647n||t<-2147483648n)throw Error(`Overflow occurred when converting BigInt to Int32 at index ${e}: ${t}`);i[e]=Number(t)}return t?new Uint8Array(i.buffer):i},Sn=(e,t=!0)=>{if(e.byteLength%4!=0)throw Error(`Invalid Uint8Array length - must be a multiple of 4 (Int32).`);let n=e.byteLength/4,r=new Int32Array(e.buffer,e.byteOffset,n),i=BigInt64Array.from(r,BigInt);return t?new Uint8Array(i.buffer):i},Cn=1,wn=()=>Cn++,Tn=new Map([[`float32`,32],[`float16`,16],[`int32`,32],[`uint32`,32],[`int64`,64],[`uint64`,64],[`int8`,8],[`uint8`,8],[`int4`,4],[`uint4`,4]]),En=(e,t)=>{let n=Tn.get(e);if(!n)throw Error(`Unsupported data type.`);return t.length>0?Math.ceil(t.reduce((e,t)=>e*t)*n/8):0},Dn=class{constructor(e){this.shouldConvertInt64toInt32=!1,this.isInt64ToInt32Converted=!1;let{sessionId:t,context:n,tensor:r,dataType:i,shape:a,shouldConvertInt64toInt32:o=!1}=e;this.sessionId=t,this.mlContext=n,this.mlTensor=r,this.dataType=i,this.tensorShape=a,this.shouldConvertInt64toInt32=o}get tensor(){return this.mlTensor}get type(){return this.dataType}get shape(){return this.tensorShape}get byteLength(){return En(this.dataType,this.tensorShape)}destroy(){dn(`verbose`,()=>`[WebNN] TensorWrapper.destroy`),this.mlTensor.destroy()}write(e){this.mlContext.writeTensor(this.mlTensor,e)}async read(e,t){if(e){let e=await this.mlContext.readTensor(this.mlTensor),n=Sn(new Uint8Array(e));if(t){(t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)).set(n);return}else return n.buffer}else return t?this.mlContext.readTensor(this.mlTensor,t):this.mlContext.readTensor(this.mlTensor)}canReuseTensor(e,t,n){return this.mlContext===e&&this.dataType===t&&this.tensorShape.length===n.length&&this.tensorShape.every((e,t)=>e===n[t])}setIsInt64ToInt32Converted(e){this.isInt64ToInt32Converted=e}},On=class{constructor(e,t){this.tensorManager=e,this.wrapper=t}get tensorWrapper(){return this.wrapper}releaseTensor(){this.tensorWrapper&&(this.tensorManager.releaseTensor(this.tensorWrapper),this.wrapper=void 0)}async ensureTensor(e,t,n,r){let i=t,a=this.tensorManager.getMLContext(e),o=i===`int64`&&!a.opSupportLimits().input.dataTypes.includes(`int64`);if(o&&(i=`int32`,dn(`verbose`,()=>`[WebNN] TensorIdTracker.ensureTensor: convert dataType from int64 to int32`)),this.wrapper){if(this.wrapper.canReuseTensor(a,i,n))return this.wrapper.tensor;if(r){if(this.wrapper.byteLength!==En(i,n))throw Error(`Unable to copy data to tensor with different size.`);this.activeUpload=new Uint8Array(await this.wrapper.read())}this.tensorManager.releaseTensor(this.wrapper)}let s=typeof MLTensorUsage>`u`?void 0:MLTensorUsage.READ|MLTensorUsage.WRITE;return this.wrapper=await this.tensorManager.getCachedTensor(e,i,n,s,!0,!0,o),r&&this.activeUpload&&(this.wrapper.write(this.activeUpload),this.activeUpload=void 0),this.wrapper.tensor}upload(e){let t=e;if(this.wrapper)if(this.wrapper.shouldConvertInt64toInt32&&(t=xn(e,!0),this.wrapper.setIsInt64ToInt32Converted(!0)),t.byteLength===this.wrapper.byteLength){this.wrapper.write(t);return}else dn(`verbose`,()=>`Data size does not match tensor size. Releasing tensor.`),this.releaseTensor();this.activeUpload?this.activeUpload.set(t):this.activeUpload=new Uint8Array(t)}async download(e){if(this.activeUpload){let t=this.wrapper?.isInt64ToInt32Converted?Sn(this.activeUpload):this.activeUpload;if(e){e instanceof ArrayBuffer?new Uint8Array(e).set(t):new Uint8Array(e.buffer,e.byteOffset,e.byteLength).set(t);return}else return t.buffer}if(!this.wrapper)throw Error(`Tensor has not been created.`);return e?this.wrapper.read(this.wrapper?.shouldConvertInt64toInt32,e):this.wrapper.read(this.wrapper?.shouldConvertInt64toInt32)}},kn=class{constructor(e){this.backend=e,this.tensorTrackersById=new Map,this.freeTensors=[],this.externalTensors=new Set}getMLContext(e){let t=this.backend.getMLContext(e);if(!t)throw Error(`MLContext not found for session.`);return t}reserveTensorId(){let e=wn();return this.tensorTrackersById.set(e,new On(this)),e}releaseTensorId(e){let t=this.tensorTrackersById.get(e);t&&(this.tensorTrackersById.delete(e),t.tensorWrapper&&this.releaseTensor(t.tensorWrapper))}async ensureTensor(e,t,n,r,i){dn(`verbose`,()=>`[WebNN] TensorManager.ensureTensor {tensorId: ${t}, dataType: ${n}, shape: ${r}, copyOld: ${i}}`);let a=this.tensorTrackersById.get(t);if(!a)throw Error(`Tensor not found.`);return a.ensureTensor(e,n,r,i)}upload(e,t){let n=this.tensorTrackersById.get(e);if(!n)throw Error(`Tensor not found.`);n.upload(t)}async download(e,t){dn(`verbose`,()=>`[WebNN] TensorManager.download {tensorId: ${e}, dstBuffer: ${t?.byteLength}}`);let n=this.tensorTrackersById.get(e);if(!n)throw Error(`Tensor not found.`);return n.download(t)}releaseTensorsForSession(e){for(let t of this.freeTensors)t.sessionId===e&&t.destroy();this.freeTensors=this.freeTensors.filter(t=>t.sessionId!==e)}registerTensor(e,t,n,r){let i=this.getMLContext(e),a=wn(),o=new Dn({sessionId:e,context:i,tensor:t,dataType:n,shape:r});return this.tensorTrackersById.set(a,new On(this,o)),this.externalTensors.add(o),a}async getCachedTensor(e,t,n,r,i,a,o=!1){let s=this.getMLContext(e);for(let[r,i]of this.freeTensors.entries())if(i.canReuseTensor(s,t,n)){dn(`verbose`,()=>`[WebNN] Reusing tensor {dataType: ${t}, shape: ${n}}`);let i=this.freeTensors.splice(r,1)[0];return i.sessionId=e,i}dn(`verbose`,()=>`[WebNN] MLContext.createTensor {dataType: ${t}, shape: ${n}}`);let c=await s.createTensor({dataType:t,shape:n,dimensions:n,usage:r,writable:i,readable:a});return new Dn({sessionId:e,context:s,tensor:c,dataType:t,shape:n,shouldConvertInt64toInt32:o})}releaseTensor(e){this.externalTensors.has(e)&&this.externalTensors.delete(e),this.freeTensors.push(e)}},An=(...e)=>new kn(...e)}),Mn,Nn,Pn,Fn=M(()=>{"use strict";U(),Pt(),bn(),jn(),fn(),Mn=new Map([[1,`float32`],[10,`float16`],[6,`int32`],[12,`uint32`],[7,`int64`],[13,`uint64`],[22,`int4`],[21,`uint4`],[3,`int8`],[2,`uint8`],[9,`uint8`]]),Nn=(e,t)=>{if(e===t)return!0;if(e===void 0||t===void 0)return!1;let n=Object.keys(e).sort(),r=Object.keys(t).sort();return n.length===r.length&&n.every((n,i)=>n===r[i]&&e[n]===t[n])},Pn=class{constructor(e){this.tensorManager=An(this),this.mlContextBySessionId=new Map,this.sessionIdsByMLContext=new Map,this.mlContextCache=[],this.sessionGraphInputs=new Map,this.temporaryGraphInputs=[],this.temporarySessionTensorIds=new Map,ln(e.logLevel,!!e.debug)}get currentSessionId(){if(this.activeSessionId===void 0)throw Error(`No active session`);return this.activeSessionId}onRunStart(e){dn(`verbose`,()=>`[WebNN] onRunStart {sessionId: ${e}}`),this.activeSessionId=e}onRunEnd(e){dn(`verbose`,()=>`[WebNN] onRunEnd {sessionId: ${e}}`);let t=this.temporarySessionTensorIds.get(e);if(t){for(let e of t)dn(`verbose`,()=>`[WebNN] releasing temporary tensor {tensorId: ${e}}`),this.tensorManager.releaseTensorId(e);this.temporarySessionTensorIds.delete(e),this.activeSessionId=void 0}}async createMLContext(e){if(e instanceof GPUDevice){let t=this.mlContextCache.findIndex(t=>t.gpuDevice===e);if(t!==-1)return this.mlContextCache[t].mlContext;{let t=await navigator.ml.createContext(e);return this.mlContextCache.push({gpuDevice:e,mlContext:t}),t}}else if(e===void 0){let e=this.mlContextCache.findIndex(e=>e.options===void 0&&e.gpuDevice===void 0);if(e!==-1)return this.mlContextCache[e].mlContext;{let e=await navigator.ml.createContext();return this.mlContextCache.push({mlContext:e}),e}}let t=this.mlContextCache.findIndex(t=>Nn(t.options,e));if(t!==-1)return this.mlContextCache[t].mlContext;{let t=await navigator.ml.createContext(e);return this.mlContextCache.push({options:e,mlContext:t}),t}}registerMLContext(e,t){this.mlContextBySessionId.set(e,t);let n=this.sessionIdsByMLContext.get(t);n||(n=new Set,this.sessionIdsByMLContext.set(t,n)),n.add(e),this.temporaryGraphInputs.length>0&&(this.sessionGraphInputs.set(e,this.temporaryGraphInputs),this.temporaryGraphInputs=[])}onReleaseSession(e){this.sessionGraphInputs.delete(e);let t=this.mlContextBySessionId.get(e);if(!t)return;this.tensorManager.releaseTensorsForSession(e),this.mlContextBySessionId.delete(e);let n=this.sessionIdsByMLContext.get(t);if(n.delete(e),n.size===0){this.sessionIdsByMLContext.delete(t);let e=this.mlContextCache.findIndex(e=>e.mlContext===t);e!==-1&&this.mlContextCache.splice(e,1)}}getMLContext(e){return this.mlContextBySessionId.get(e)}reserveTensorId(){return this.tensorManager.reserveTensorId()}releaseTensorId(e){dn(`verbose`,()=>`[WebNN] releaseTensorId {tensorId: ${e}}`),this.tensorManager.releaseTensorId(e)}async ensureTensor(e,t,n,r,i){let a=Mn.get(n);if(!a)throw Error(`Unsupported ONNX data type: ${n}`);return this.tensorManager.ensureTensor(e??this.currentSessionId,t,a,r,i)}async createTemporaryTensor(e,t,n){dn(`verbose`,()=>`[WebNN] createTemporaryTensor {onnxDataType: ${t}, shape: ${n}}`);let r=Mn.get(t);if(!r)throw Error(`Unsupported ONNX data type: ${t}`);let i=this.tensorManager.reserveTensorId();await this.tensorManager.ensureTensor(e,i,r,n,!1);let a=this.temporarySessionTensorIds.get(e);return a?a.push(i):this.temporarySessionTensorIds.set(e,[i]),i}uploadTensor(e,t){if(!Nt().shouldTransferToMLTensor)throw Error(`Trying to upload to a MLTensor while shouldTransferToMLTensor is false`);dn(`verbose`,()=>`[WebNN] uploadTensor {tensorId: ${e}, data: ${t.byteLength}}`),this.tensorManager.upload(e,t)}async downloadTensor(e,t){return this.tensorManager.download(e,t)}createMLTensorDownloader(e,t){return async()=>{let n=await this.tensorManager.download(e);return yn(n,t)}}registerMLTensor(e,t,n,r){let i=Mn.get(n);if(!i)throw Error(`Unsupported ONNX data type: ${n}`);let a=this.tensorManager.registerTensor(e,t,i,r);return dn(`verbose`,()=>`[WebNN] registerMLTensor {tensor: ${t}, dataType: ${i}, dimensions: ${r}} -> {tensorId: ${a}}`),a}registerMLConstant(e,t,n,r,i,a,o=!1){if(!a)throw Error(`External mounted files are not available.`);let s=e;e.startsWith(`./`)&&(s=e.substring(2));let c=a.get(s);if(!c)throw Error(`File with name ${s} not found in preloaded files.`);if(t+n>c.byteLength)throw Error(`Out of bounds: data offset and length exceed the external file data size.`);let l=c.slice(t,t+n).buffer,u;switch(i.dataType){case`float32`:u=new Float32Array(l);break;case`float16`:u=typeof Float16Array<`u`&&Float16Array.from?new Float16Array(l):new Uint16Array(l);break;case`int32`:u=new Int32Array(l);break;case`uint32`:u=new Uint32Array(l);break;case`int64`:o?(u=xn(new Uint8Array(l),!1),i.dataType=`int32`):u=new BigInt64Array(l);break;case`uint64`:u=new BigUint64Array(l);break;case`int8`:u=new Int8Array(l);break;case`int4`:case`uint4`:case`uint8`:u=new Uint8Array(l);break;default:throw Error(`Unsupported data type: ${i.dataType} in creating WebNN Constant from external data.`)}return dn(`verbose`,()=>`[WebNN] registerMLConstant {dataType: ${i.dataType}, shape: ${i.shape}}} ${o?`(Note: it was int64 data type and registered to int32 as workaround)`:``}`),r.constant(i,u)}registerGraphInput(e){this.temporaryGraphInputs.push(e)}isGraphInput(e,t){let n=this.sessionGraphInputs.get(e);return n?n.includes(t):!1}isInt64Supported(e){return!!this.mlContextBySessionId.get(e)?.opSupportLimits().input.dataTypes.includes(`int64`)}flush(){}}}),In=M(()=>{"use strict";}),Ln,Rn,zn,Bn,Vn,Hn,Un,Wn,Gn,Kn=M(()=>{"use strict";fn(),In(),Ln=new Map([[64,250],[128,200],[256,200],[512,200],[2048,230],[4096,200],[8192,50],[16384,50],[32768,50],[65536,50],[131072,50],[262144,50],[524288,50],[1048576,50],[2097152,30],[4194304,20],[8388608,10],[12582912,10],[16777216,10],[26214400,15],[33554432,22],[44236800,2],[58982400,6],[67108864,6],[134217728,6],[167772160,6]]),Rn=[],zn=e=>Math.ceil(Number(e)/16)*16,Bn=e=>{for(let t=0;tVn++,Un=async(e,t,n,r)=>{let i=zn(n),a=e.device.createBuffer({size:i,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ});try{let o=e.getCommandEncoder();e.endComputePass(),o.copyBufferToBuffer(t,0,a,0,i),e.flush(),await a.mapAsync(GPUMapMode.READ);let s=a.getMappedRange();if(r){let e=r();return e.set(new Uint8Array(s,0,n)),e}else return new Uint8Array(s.slice(0,n))}finally{a.destroy()}},Wn=class{constructor(e){this.backend=e,this.storageCache=new Map,this.freeBuffers=new Map,this.freeUniformBuffers=new Map,this.buffersPending=[],this.capturedPendingBuffers=new Map;for(let[e]of Ln)Rn.push(e),this.freeBuffers.set(e,[]),this.freeUniformBuffers.set(e,[]);this.sessionCount=0}upload(e,t){let n=t.buffer,r=t.byteOffset,i=t.byteLength,a=zn(i),o=this.storageCache.get(e);if(!o)throw Error(`gpu data for uploading does not exist`);if(Number(o.originalSize)!==i)throw Error(`inconsistent data size. gpu data size=${o.originalSize}, data size=${i}`);let s=this.backend.device.createBuffer({mappedAtCreation:!0,size:a,usage:GPUBufferUsage.MAP_WRITE|GPUBufferUsage.COPY_SRC}),c=s.getMappedRange();new Uint8Array(c).set(new Uint8Array(n,r,i)),s.unmap();let l=this.backend.device.createCommandEncoder();l.copyBufferToBuffer(s,0,o.gpuData.buffer,0,a),this.backend.device.queue.submit([l.finish()]),s.destroy(),dn(`verbose`,()=>`[WebGPU] GpuDataManager.upload(id=${e})`)}memcpy(e,t){let n=this.storageCache.get(e);if(!n)throw Error(`source gpu data for memcpy does not exist`);let r=this.storageCache.get(t);if(!r)throw Error(`destination gpu data for memcpy does not exist`);if(n.originalSize!==r.originalSize)throw Error(`inconsistent source and destination gpu data size`);let i=zn(n.originalSize),a=this.backend.getCommandEncoder();this.backend.endComputePass(),a.copyBufferToBuffer(n.gpuData.buffer,0,r.gpuData.buffer,0,i)}registerExternalBuffer(e,t,n){let r;if(n){if(r=n[0],e===n[1])return dn(`verbose`,()=>`[WebGPU] GpuDataManager.registerExternalBuffer(size=${t}) => id=${r}, buffer is the same, skip.`),r;if(this.backend.capturedCommandList.has(this.backend.currentSessionId))throw Error(`Registering a different external buffer under graph capture mode is not supported yet. + Please use the previous external buffer!`)}else r=Hn();return this.storageCache.set(r,{gpuData:{id:r,type:0,buffer:e},originalSize:t}),dn(`verbose`,()=>`[WebGPU] GpuDataManager.registerExternalBuffer(size=${t}) => id=${r}, registered.`),r}unregisterExternalBuffer(e){e!==void 0&&(this.storageCache.delete(e),dn(`verbose`,()=>`[WebGPU] GpuDataManager.unregisterExternalBuffer() => id=${e}`))}create(e,t=GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST){let n=Bn(e),r,i=(t&GPUBufferUsage.STORAGE)===GPUBufferUsage.STORAGE,a=(t&GPUBufferUsage.UNIFORM)===GPUBufferUsage.UNIFORM;if(i||a){let e=(i?this.freeBuffers:this.freeUniformBuffers).get(n);r=e&&e.length>0?e.pop():this.backend.device.createBuffer({size:n,usage:t})}else r=this.backend.device.createBuffer({size:n,usage:t});let o={id:Hn(),type:0,buffer:r};return this.storageCache.set(o.id,{gpuData:o,originalSize:Number(e)}),dn(`verbose`,()=>`[WebGPU] GpuDataManager.create(size=${e}) => id=${o.id}`),o}get(e){return this.storageCache.get(e)?.gpuData}release(e){let t=typeof e==`bigint`?Number(e):e,n=this.storageCache.get(t);if(!n){if(this.storageCache.size===0)return 0;throw Error(`releasing data does not exist`)}return dn(`verbose`,()=>`[WebGPU] GpuDataManager.release(id=${t}), gpuDataId=${n.gpuData.id}`),this.storageCache.delete(t),this.buffersPending.push(n.gpuData.buffer),n.originalSize}async download(e,t){let n=this.storageCache.get(Number(e));if(!n)throw Error(`data does not exist`);await Un(this.backend,n.gpuData.buffer,n.originalSize,t)}refreshPendingBuffers(){if(this.buffersPending.length!==0)if(this.backend.sessionStatus===`default`){for(let e of this.buffersPending){let t=Ln.get(e.size);if((e.usage&GPUBufferUsage.STORAGE)===GPUBufferUsage.STORAGE){let n=this.freeBuffers.get(e.size)||[];t===void 0||n.length>=t?e.destroy():n.push(e)}else if((e.usage&GPUBufferUsage.UNIFORM)===GPUBufferUsage.UNIFORM){let n=this.freeUniformBuffers.get(e.size)||[];t===void 0||n.length>=t?e.destroy():n.push(e)}else e.destroy()}this.buffersPending=[]}else{let e=this.capturedPendingBuffers.get(this.backend.currentSessionId);e||(e=[],this.capturedPendingBuffers.set(this.backend.currentSessionId,e));for(let t of this.buffersPending)e.push(t);this.buffersPending=[]}}dispose(){this.freeBuffers.forEach(e=>{e.forEach(e=>{e.destroy()})}),this.freeUniformBuffers.forEach(e=>{e.forEach(e=>{e.destroy()})}),this.storageCache.forEach(e=>{e.gpuData.buffer.destroy()}),this.capturedPendingBuffers.forEach(e=>{e.forEach(e=>{e.destroy()})}),this.storageCache=new Map,this.freeBuffers=new Map,this.freeUniformBuffers=new Map,this.capturedPendingBuffers=new Map}onCreateSession(){this.sessionCount+=1}onReleaseSession(e){let t=this.capturedPendingBuffers.get(e);t&&(t.forEach(e=>{e.destroy()}),this.capturedPendingBuffers.delete(e)),--this.sessionCount,this.sessionCount===0&&(dn(`warning`,()=>`[WebGPU] Clearing webgpu buffer cache`),this.storageCache.forEach(e=>{e.gpuData.buffer.destroy()}),this.storageCache=new Map)}},Gn=(...e)=>new Wn(...e)}),qn,Jn,Yn=M(()=>{"use strict";qn=class{constructor(e){Object.assign(this,e)}get cacheKey(){return this.key||=Object.getOwnPropertyNames(this).sort().map(e=>`${this[e]}`).join(`;`),this.key}},Jn=e=>new qn(e)}),Xn,Zn,Qn,$n,K,er,tr,nr,rr,q,ir,J,Y,ar,or,sr,cr,X=M(()=>{"use strict";U(),G(),Xn=64,Zn=(e,t)=>{if(t===3)throw Error(`vec3 has same alignment as vec4, use vec4 instead`);switch(Number(e)){case 10:return t>1?`vec${t}`:`f16`;case 1:return t>1?`vec${t}`:`f32`;case 6:return t>1?`vec${t}`:`i32`;case 12:return t>1?`vec${t}`:`u32`;case 7:if(t>1)throw Error(`currently not supported vecX of uint64 yet`);return[`vec2`,`i32`];case 13:if(t>1)throw Error(`currently not supported vecX of uint64 yet`);return[`vec2`,`u32`];case 9:if(t!==4)throw Error(`bool must be vec4`);return[`u32`,`vec4`];case 22:return`i32`;case 21:return`u32`;default:throw Error(`Unknown data type: ${e}`)}},Qn=(e,t=1)=>{let n=Zn(e,t);return typeof n==`string`?n:n[0]},$n=(e,t=1)=>{let n=Zn(e,t);return typeof n==`string`?n:n[1]},K=(...e)=>{let t=[];return e.forEach(e=>{e.length!==0&&t.push({type:12,data:e},{type:12,data:W.computeStrides(e)})}),t},er=e=>e%4==0?4:e%2==0?2:1,tr=(e=`f32`,t,n=`0`)=>!t||t===1?`${e}(${n})`:`vec${t}<${e}>(${n})`,nr=(e,t,n)=>e===`f32`?n:t===1?`f32(${n})`:`vec${t}(${n})`,rr=(e,t)=>t===4?`(${e}.x + ${e}.y + ${e}.z + ${e}.w)`:t===2?`(${e}.x + ${e}.y)`:t===3?`(${e}.x + ${e}.y + ${e}.z)`:e,q=(e,t,n,r)=>e.startsWith(`uniforms.`)&&n>4?typeof t==`string`?r===`f16`?`${e}[(${t}) / 8][(${t}) % 8 / 4][(${t}) % 8 % 4]`:`${e}[(${t}) / 4][(${t}) % 4]`:r===`f16`?`${e}[${Math.floor(t/8)}][${Math.floor(t%8/4)}][${t%8%4}]`:`${e}[${Math.floor(t/4)}][${t%4}]`:n>1?`${e}[${t}]`:e,ir=(e,t,n,r,i)=>{let a=typeof n==`number`,o=a?n:n.length,s=[...Array(o).keys()],c=o<2?`u32`:o<=4?`vec${o}`:`array`,l=Zn(t,i),u=typeof l==`string`?l:l[1],d=typeof l==`string`?l:l[0],f={indices:c,value:u,storage:d,tensor:t},p=e=>typeof e==`string`?e:`${e}u`,m={offsetToIndices:!1,indicesToOffset:!1,broadcastedIndicesToOffset:!1,set:!1,setByIndices:!1,get:!1,getByIndices:!1},h=a?`uniforms.`:``,g=`${h}${e}_shape`,_=`${h}${e}_strides`,v=``;for(let e=0;e(m.offsetToIndices=!0,o<2?t:`o2i_${e}(${t})`),x=[];if(o>=2)for(let e=o-1;e>=0;e--)x.push(`${K(_,e,o)} * (indices[${e}])`);let S=o<2?``:` + }`,b=t=>(m.offsetToIndices=!0,o<2?t:`o2i_${e}(${t})`),x=[];if(o>=2)for(let e=o-1;e>=0;e--)x.push(`${q(_,e,o)} * (indices[${e}])`);let S=o<2?``:` fn i2o_${e}(indices: ${f.indices}) -> u32 { return ${x.join(`+`)}; - }`,C=t=>(m.indicesToOffset=!0,o<2?t:`i2o_${e}(${t})`),w=(...e)=>o===0?`0u`:`${f.indices}(${e.map(p).join(`,`)})`,T=(e,t)=>o<2?`${e}`:`${K(e,t,o)}`,E=(e,t,n)=>o<2?`${e}=${n};`:`${K(e,t,o)}=${n};`,D={},O=(t,n)=>{m.broadcastedIndicesToOffset=!0;let r=`${n.name}broadcastedIndicesTo${e}Offset`;if(r in D)return`${r}(${t})`;let i=[];for(let e=o-1;e>=0;e--){let t=n.indicesGet(`outputIndices`,e+n.rank-o);i.push(`${T(_,e)} * (${t} % ${T(g,e)})`)}return D[r]=`fn ${r}(outputIndices: ${n.type.indices}) -> u32 { + }`,C=t=>(m.indicesToOffset=!0,o<2?t:`i2o_${e}(${t})`),w=(...e)=>o===0?`0u`:`${f.indices}(${e.map(p).join(`,`)})`,T=(e,t)=>o<2?`${e}`:`${q(e,t,o)}`,E=(e,t,n)=>o<2?`${e}=${n};`:`${q(e,t,o)}=${n};`,D={},O=(t,n)=>{m.broadcastedIndicesToOffset=!0;let r=`${n.name}broadcastedIndicesTo${e}Offset`;if(r in D)return`${r}(${t})`;let i=[];for(let e=o-1;e>=0;e--){let t=n.indicesGet(`outputIndices`,e+n.rank-o);i.push(`${T(_,e)} * (${t} % ${T(g,e)})`)}return D[r]=`fn ${r}(outputIndices: ${n.type.indices}) -> u32 { return ${i.length>0?i.join(`+`):`0u`}; }`,`${r}(${t})`},k=(t,n)=>(()=>{if(f.storage===f.value)return`${e}[${t}]=${n};`;if(f.storage===`vec2`&&f.value===`i32`)return`${e}[${t}]=vec2(u32(${n}), select(0u, 0xFFFFFFFFu, ${n} < 0));`;if(f.storage===`vec2`&&f.value===`u32`)return`${e}[${t}]=vec2(u32(${n}), 0u);`;if(f.storage===`u32`&&f.value===`vec4`)return`${e}[${t}]=dot(vec4(0x1, 0x100, 0x10000, 0x1000000), vec4(${n}));`;throw Error(`not supported combination of storage type ${f.storage} and value type ${f.value} yet`)})(),A=t=>(()=>{if(f.storage===f.value)return`${e}[${t}]`;if(f.storage===`vec2`&&f.value===`i32`)return`i32(${e}[${t}].x)`;if(f.storage===`vec2`&&f.value===`u32`)return`u32(${e}[${t}].x)`;if(f.storage===`u32`&&f.value===`vec4`)return`vec4(bool(${e}[${t}] & 0xFFu), bool(${e}[${t}] & 0xFF00u), bool(${e}[${t}] & 0xFF0000u), bool(${e}[${t}] & 0xFF000000u))`;throw Error(`not supported combination of storage type ${f.storage} and value type ${f.value} yet`)})(),ee=o<2?``:` fn get_${e}ByIndices(indices: ${f.indices}) -> ${u} { @@ -41,8 +41,8 @@ var re=Object.defineProperty,ie=Object.getOwnPropertyDescriptor,ae=Object.getOwn }`,ie=o<2?``:(()=>{let t=s.map(e=>`d${e}: u32`).join(`, `),n=s.map(e=>`d${e}`).join(`, `);return` fn set_${e}(${t}, value: ${u}) { set_${e}ByIndices(${w(n)}, value); - }`})();return{impl:()=>{let e=[],t=!1;return m.offsetToIndices&&(e.push(y),t=!0),m.indicesToOffset&&(e.push(S),t=!0),m.broadcastedIndicesToOffset&&(Object.values(D).forEach(t=>e.push(t)),t=!0),m.set&&(e.push(ie),t=!0),m.setByIndices&&(e.push(re),t=!0),m.get&&(e.push(te),t=!0),m.getByIndices&&(e.push(ee),t=!0),!a&&t&&e.unshift(`const ${g} = ${f.indices}(${n.join(`,`)});`,`const ${_} = ${f.indices}(${U.computeStrides(n).join(`,`)});`),e.join(` -`)},type:f,offsetToIndices:b,indicesToOffset:C,broadcastedIndicesToOffset:O,indices:w,indicesGet:T,indicesSet:E,set:(...t)=>{if(t.length!==o+1)throw Error(`indices length must be ${o}`);let n=t[o];if(typeof n!=`string`)throw Error(`value must be string`);let r=t.slice(0,o).map(p).join(`,`);return o===0?k(`0u`,n):o===1?k(r[0],n):(m.set=!0,m.setByIndices=!0,m.indicesToOffset=!0,`set_${e}(${r}, ${n})`)},setByOffset:k,setByIndices:(t,n)=>o<2?k(t,n):(m.setByIndices=!0,m.indicesToOffset=!0,`set_${e}ByIndices(${t}, ${n});`),get:ne,getByOffset:A,getByIndices:j,usage:r,name:e,strides:_,shape:g,rank:o}},q=(e,t,n,r=1)=>ar(e,t,n,`input`,r),J=(e,t,n,r=1)=>ar(e,t,n,`output`,r),or=(e,t,n)=>ar(e,t,n,`atomicOutput`,1),sr=(e,t,n,r=1)=>ar(e,t,n,`internal`,r),cr=class{constructor(e,t){this.normalizedDispatchGroup=e,this.limits=t,this.internalVariables=[],this.variables=[],this.uniforms=[],this.variableIndex=0}guardAgainstOutOfBoundsWorkgroupSizes(e){return`if (global_idx >= ${typeof e==`number`?`${e}u`:e}) { return; }`}mainStart(e=Zn){let t=typeof e==`number`?e:e[0],n=typeof e==`number`?1:e[1],r=typeof e==`number`?1:e[2];if(t>this.limits.maxComputeWorkgroupSizeX||n>this.limits.maxComputeWorkgroupSizeY||r>this.limits.maxComputeWorkgroupSizeZ)throw Error(`workgroup size [${t}, ${n}, ${r}] exceeds the maximum workgroup size [${this.limits.maxComputeWorkgroupSizeX}, ${this.limits.maxComputeWorkgroupSizeY}, ${this.limits.maxComputeWorkgroupSizeZ}].`);if(t*n*r>this.limits.maxComputeInvocationsPerWorkgroup)throw Error(`workgroup size [${t}, ${n}, ${r}] exceeds the maximum workgroup invocations ${this.limits.maxComputeInvocationsPerWorkgroup}.`);let i=this.normalizedDispatchGroup[1]===1&&this.normalizedDispatchGroup[2]===1,a=i?`@builtin(global_invocation_id) global_id : vec3, + }`})();return{impl:()=>{let e=[],t=!1;return m.offsetToIndices&&(e.push(y),t=!0),m.indicesToOffset&&(e.push(S),t=!0),m.broadcastedIndicesToOffset&&(Object.values(D).forEach(t=>e.push(t)),t=!0),m.set&&(e.push(ie),t=!0),m.setByIndices&&(e.push(re),t=!0),m.get&&(e.push(te),t=!0),m.getByIndices&&(e.push(ee),t=!0),!a&&t&&e.unshift(`const ${g} = ${f.indices}(${n.join(`,`)});`,`const ${_} = ${f.indices}(${W.computeStrides(n).join(`,`)});`),e.join(` +`)},type:f,offsetToIndices:b,indicesToOffset:C,broadcastedIndicesToOffset:O,indices:w,indicesGet:T,indicesSet:E,set:(...t)=>{if(t.length!==o+1)throw Error(`indices length must be ${o}`);let n=t[o];if(typeof n!=`string`)throw Error(`value must be string`);let r=t.slice(0,o).map(p).join(`,`);return o===0?k(`0u`,n):o===1?k(r[0],n):(m.set=!0,m.setByIndices=!0,m.indicesToOffset=!0,`set_${e}(${r}, ${n})`)},setByOffset:k,setByIndices:(t,n)=>o<2?k(t,n):(m.setByIndices=!0,m.indicesToOffset=!0,`set_${e}ByIndices(${t}, ${n});`),get:ne,getByOffset:A,getByIndices:j,usage:r,name:e,strides:_,shape:g,rank:o}},J=(e,t,n,r=1)=>ir(e,t,n,`input`,r),Y=(e,t,n,r=1)=>ir(e,t,n,`output`,r),ar=(e,t,n)=>ir(e,t,n,`atomicOutput`,1),or=(e,t,n,r=1)=>ir(e,t,n,`internal`,r),sr=class{constructor(e,t){this.normalizedDispatchGroup=e,this.limits=t,this.internalVariables=[],this.variables=[],this.uniforms=[],this.variableIndex=0}guardAgainstOutOfBoundsWorkgroupSizes(e){return`if (global_idx >= ${typeof e==`number`?`${e}u`:e}) { return; }`}mainStart(e=Xn){let t=typeof e==`number`?e:e[0],n=typeof e==`number`?1:e[1],r=typeof e==`number`?1:e[2];if(t>this.limits.maxComputeWorkgroupSizeX||n>this.limits.maxComputeWorkgroupSizeY||r>this.limits.maxComputeWorkgroupSizeZ)throw Error(`workgroup size [${t}, ${n}, ${r}] exceeds the maximum workgroup size [${this.limits.maxComputeWorkgroupSizeX}, ${this.limits.maxComputeWorkgroupSizeY}, ${this.limits.maxComputeWorkgroupSizeZ}].`);if(t*n*r>this.limits.maxComputeInvocationsPerWorkgroup)throw Error(`workgroup size [${t}, ${n}, ${r}] exceeds the maximum workgroup invocations ${this.limits.maxComputeInvocationsPerWorkgroup}.`);let i=this.normalizedDispatchGroup[1]===1&&this.normalizedDispatchGroup[2]===1,a=i?`@builtin(global_invocation_id) global_id : vec3, @builtin(workgroup_id) workgroup_id : vec3, @builtin(local_invocation_index) local_idx : u32, @builtin(local_invocation_id) local_id : vec3`:`@builtin(global_invocation_id) global_id : vec3, @@ -60,13 +60,13 @@ var re=Object.defineProperty,ie=Object.getOwnPropertyDescriptor,ae=Object.getOwn struct Uniforms { ${e.join(`, `)} }; @group(0) @binding(${this.variableIndex}) var uniforms: Uniforms;`}get additionalImplementations(){return this.uniformDeclaration()+this.variables.map(e=>e.impl()).join(` `)+this.internalVariables.map(e=>e.impl()).join(` -`)}get variablesInfo(){if(this.uniforms.length===0)return;let e=e=>[12,10,1,6][[`u32`,`f16`,`f32`,`i32`].indexOf(e)];return this.uniforms.map(t=>[e(t.type),t.length??1])}},lr=(e,t)=>new cr(e,t)}),ur,dr,fr,X,pr,mr,hr,gr,_r,vr=M(()=>{"use strict";V(),W(),Xn(),Y(),ur=(e,t)=>{if(!e||e.length!==1)throw Error(`Transpose requires 1 input.`);if(t.length!==0&&t.length!==e[0].dims.length)throw Error(`perm size ${t.length} does not match input rank ${e[0].dims.length}`)},dr=(e,t)=>t.length===0?[...Array(e).keys()].reverse():t,fr=(e,t)=>U.sortBasedOnPerm(e,dr(e.length,t)),X=(e,t,n,r)=>{let i=`fn perm(i: ${r.type.indices}) -> ${n.type.indices} { - var a: ${n.type.indices};`;for(let n=0;n{let n=[],r=[];for(let i=0;i{let n=0;for(let r=0;r{let n=e.dataType,r=e.dims.length,i=dr(r,t),a=fr(e.dims,i),o=e.dims,s=a,c=r<2||mr(i,e.dims),l;if(c)return l=e=>{let t=q(`input`,n,o,4),r=J(`output`,n,s,4);return` +`)}get variablesInfo(){if(this.uniforms.length===0)return;let e=e=>[12,10,1,6][[`u32`,`f16`,`f32`,`i32`].indexOf(e)];return this.uniforms.map(t=>[e(t.type),t.length??1])}},cr=(e,t)=>new sr(e,t)}),lr,ur,dr,Z,fr,pr,mr,hr,gr,_r=M(()=>{"use strict";U(),G(),Yn(),X(),lr=(e,t)=>{if(!e||e.length!==1)throw Error(`Transpose requires 1 input.`);if(t.length!==0&&t.length!==e[0].dims.length)throw Error(`perm size ${t.length} does not match input rank ${e[0].dims.length}`)},ur=(e,t)=>t.length===0?[...Array(e).keys()].reverse():t,dr=(e,t)=>W.sortBasedOnPerm(e,ur(e.length,t)),Z=(e,t,n,r)=>{let i=`fn perm(i: ${r.type.indices}) -> ${n.type.indices} { + var a: ${n.type.indices};`;for(let n=0;n{let n=[],r=[];for(let i=0;i{let n=0;for(let r=0;r{let n=e.dataType,r=e.dims.length,i=ur(r,t),a=dr(e.dims,i),o=e.dims,s=a,c=r<2||pr(i,e.dims),l;if(c)return l=e=>{let t=J(`input`,n,o,4),r=Y(`output`,n,s,4);return` ${e.registerUniform(`output_size`,`u32`).declareVariables(t,r)} ${e.mainStart()} ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} output[global_idx] = input[global_idx]; - }`},{name:`TransposeCopy`,shaderCache:{inputDependencies:[`type`]},getRunData:()=>{let t=U.size(a);return{outputs:[{dims:a,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(t/64/4)},programUniforms:[{type:12,data:Math.ceil(t/4)}]}},getShaderSource:l};let{newShape:u,newPerm:d}=pr(e.dims,i),f=U.areEqual(d,[2,3,1]),p=U.areEqual(d,[3,1,2]);if(u.length===2||f||p){o=f?[u[0],u[1]*u[2]]:p?[u[0]*u[1],u[2]]:u,s=[o[1],o[0]];let t=16;return l=e=>{let r=q(`a`,n,o.length),i=J(`output`,n,s.length);return` + }`},{name:`TransposeCopy`,shaderCache:{inputDependencies:[`type`]},getRunData:()=>{let t=W.size(a);return{outputs:[{dims:a,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(t/64/4)},programUniforms:[{type:12,data:Math.ceil(t/4)}]}},getShaderSource:l};let{newShape:u,newPerm:d}=fr(e.dims,i),f=W.areEqual(d,[2,3,1]),p=W.areEqual(d,[3,1,2]);if(u.length===2||f||p){o=f?[u[0],u[1]*u[2]]:p?[u[0]*u[1],u[2]]:u,s=[o[1],o[0]];let t=16;return l=e=>{let r=J(`a`,n,o.length),i=Y(`output`,n,s.length);return` ${e.registerUniform(`output_size`,`u32`).declareVariables(r,i)} var tile : array, ${t}>; ${e.mainStart([t,t,1])} @@ -85,10 +85,10 @@ var re=Object.defineProperty,ie=Object.getOwnPropertyDescriptor,ae=Object.getOwn if (output_row < uniforms.output_shape[0] && output_col < uniforms.output_shape[1]) { ${i.setByIndices(`${i.type.indices}(output_row, output_col)`,`tile[local_id.x][local_id.y]`)} } - }`},{name:`TransposeShared`,shaderCache:{inputDependencies:[`type`]},getRunData:()=>{let n=U.size(a);return{outputs:[{dims:a,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(s[1]/t),y:Math.ceil(s[0]/t)},programUniforms:[{type:12,data:n},...G(o,s)]}},getShaderSource:l}}return l=e=>{let t=q(`a`,n,o.length),a=J(`output`,n,s.length);return` + }`},{name:`TransposeShared`,shaderCache:{inputDependencies:[`type`]},getRunData:()=>{let n=W.size(a);return{outputs:[{dims:a,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(s[1]/t),y:Math.ceil(s[0]/t)},programUniforms:[{type:12,data:n},...K(o,s)]}},getShaderSource:l}}return l=e=>{let t=J(`a`,n,o.length),a=Y(`output`,n,s.length);return` ${e.registerUniform(`output_size`,`u32`).declareVariables(t,a)} - ${X(i,r,t,a)} + ${Z(i,r,t,a)} ${e.mainStart()} ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} @@ -97,7 +97,7 @@ var re=Object.defineProperty,ie=Object.getOwnPropertyDescriptor,ae=Object.getOwn let aIndices = perm(indices); ${a.setByOffset(`global_idx`,t.getByIndices(`aIndices`))} - }`},{name:`Transpose`,shaderCache:{hint:`${t}`,inputDependencies:[`rank`]},getRunData:()=>{let t=U.size(a);return{outputs:[{dims:a,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(t/64)},programUniforms:[{type:12,data:t},...G(o,s)]}},getShaderSource:l}},gr=(e,t)=>{ur(e.inputs,t.perm),e.compute(hr(e.inputs[0],t.perm))},_r=e=>Yn({perm:e.perm})}),yr,br,xr,Sr,Cr,wr,Tr,Er,Dr,Or,kr,Ar,jr,Mr,Nr,Pr,Fr,Ir,Lr,Rr,zr,Br=M(()=>{"use strict";V(),W(),Y(),pi(),vr(),yr={max:`select(bestValue, candidate, candidate > bestValue)`,min:`select(bestValue, candidate, candidate < bestValue)`,mean:`bestValue + candidate`,sum:`bestValue + candidate`,prod:`bestValue * candidate`,sumSquare:`bestValue + candidate * candidate`,logSumExp:`bestValue + exp(candidate)`,l1:`bestValue + abs(candidate)`,l2:`bestValue + candidate * candidate`,logSum:`bestValue + candidate`},br={max:`select(bestValue, candidate, candidate > bestValue)`,min:`select(bestValue, candidate, candidate < bestValue)`,mean:`bestValue + candidate`,sum:`bestValue + candidate`,prod:`bestValue * candidate`,sumSquare:`bestValue + candidate`,logSumExp:`bestValue + candidate`,l1:`bestValue + candidate`,l2:`bestValue + candidate`,logSum:`bestValue + candidate`},xr={max:`_A[offset]`,min:`_A[offset]`,mean:`0`,sum:`0`,prod:`1`,sumSquare:`0`,logSumExp:`0`,l1:`0`,l2:`0`,logSum:`0`},Sr={max:`bestValue`,min:`bestValue`,sum:`bestValue`,prod:`bestValue`,sumSquare:`bestValue`,logSumExp:`log(bestValue)`,l1:`bestValue`,l2:`sqrt(bestValue)`,logSum:`log(bestValue)`},Cr=(e,t)=>{let n=[];for(let r=t-e;r{let n=[],r=e.length;for(let i=0;ie[t]);return[n,i]},Tr=(e,t)=>{let n=e.length+t.length,r=[],i=0;for(let a=0;a{for(let n=0;n{let n=[];if(!Er(e,t)){for(let r=0;rn.push(e))}return n},Or=(e,t,n,r,i,a,o)=>{let s=n[0].dims,c=U.size(a),l=U.size(o),u=q(`_A`,n[0].dataType,s),d=J(`output`,i,a),f=64;c===1&&(f=256);let p=` + }`},{name:`Transpose`,shaderCache:{hint:`${t}`,inputDependencies:[`rank`]},getRunData:()=>{let t=W.size(a);return{outputs:[{dims:a,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(t/64)},programUniforms:[{type:12,data:t},...K(o,s)]}},getShaderSource:l}},hr=(e,t)=>{lr(e.inputs,t.perm),e.compute(mr(e.inputs[0],t.perm))},gr=e=>Jn({perm:e.perm})}),vr,yr,br,xr,Sr,Cr,wr,Tr,Er,Dr,Or,kr,Ar,jr,Mr,Nr,Pr,Fr,Ir,Lr,Rr,zr=M(()=>{"use strict";U(),G(),X(),fi(),_r(),vr={max:`select(bestValue, candidate, candidate > bestValue)`,min:`select(bestValue, candidate, candidate < bestValue)`,mean:`bestValue + candidate`,sum:`bestValue + candidate`,prod:`bestValue * candidate`,sumSquare:`bestValue + candidate * candidate`,logSumExp:`bestValue + exp(candidate)`,l1:`bestValue + abs(candidate)`,l2:`bestValue + candidate * candidate`,logSum:`bestValue + candidate`},yr={max:`select(bestValue, candidate, candidate > bestValue)`,min:`select(bestValue, candidate, candidate < bestValue)`,mean:`bestValue + candidate`,sum:`bestValue + candidate`,prod:`bestValue * candidate`,sumSquare:`bestValue + candidate`,logSumExp:`bestValue + candidate`,l1:`bestValue + candidate`,l2:`bestValue + candidate`,logSum:`bestValue + candidate`},br={max:`_A[offset]`,min:`_A[offset]`,mean:`0`,sum:`0`,prod:`1`,sumSquare:`0`,logSumExp:`0`,l1:`0`,l2:`0`,logSum:`0`},xr={max:`bestValue`,min:`bestValue`,sum:`bestValue`,prod:`bestValue`,sumSquare:`bestValue`,logSumExp:`log(bestValue)`,l1:`bestValue`,l2:`sqrt(bestValue)`,logSum:`log(bestValue)`},Sr=(e,t)=>{let n=[];for(let r=t-e;r{let n=[],r=e.length;for(let i=0;ie[t]);return[n,i]},wr=(e,t)=>{let n=e.length+t.length,r=[],i=0;for(let a=0;a{for(let n=0;n{let n=[];if(!Tr(e,t)){for(let r=0;rn.push(e))}return n},Dr=(e,t,n,r,i,a,o)=>{let s=n[0].dims,c=W.size(a),l=W.size(o),u=J(`_A`,n[0].dataType,s),d=Y(`output`,i,a),f=64;c===1&&(f=256);let p=` var aBestValues : array; `,m=e=>` ${e.registerUniform(`reduceSize`,`u32`).declareVariables(u,d)} @@ -110,11 +110,11 @@ var re=Object.defineProperty,ie=Object.getOwnPropertyDescriptor,ae=Object.getOwn let outputIndex = global_idx / ${f}; let offset = outputIndex * uniforms.reduceSize; - var bestValue = f32(${xr[r]}); + var bestValue = f32(${br[r]}); let Length = uniforms.reduceSize; for (var k = local_idx; k < Length; k = k + ${f}) { let candidate = f32(${u.getByOffset(`offset + k`)}); - bestValue = ${yr[r]}; + bestValue = ${vr[r]}; } aBestValues[local_idx] = bestValue; workgroupBarrier(); @@ -125,7 +125,7 @@ var re=Object.defineProperty,ie=Object.getOwnPropertyDescriptor,ae=Object.getOwn let interval = DIV_CEIL(reduceSize, 2u); if (local_idx < currentSize) { let candidate = aBestValues[local_idx + interval]; - bestValue = ${br[r]}; + bestValue = ${yr[r]}; aBestValues[local_idx] = bestValue; } reduceSize = interval; @@ -133,9 +133,9 @@ var re=Object.defineProperty,ie=Object.getOwnPropertyDescriptor,ae=Object.getOwn } if (local_idx == 0u) { - ${d.setByOffset(`outputIndex`,`${r===`mean`?`${d.type.storage}(bestValue / f32(uniforms.reduceSize))`:`${d.type.storage}(${Sr[r]})`}`)}; + ${d.setByOffset(`outputIndex`,`${r===`mean`?`${d.type.storage}(bestValue / f32(uniforms.reduceSize))`:`${d.type.storage}(${xr[r]})`}`)}; } - }`;return{name:e,shaderCache:{hint:`${t};${f}`,inputDependencies:[`type`]},getShaderSource:m,getRunData:()=>({outputs:[{dims:a,dataType:i}],dispatchGroup:{x:c},programUniforms:[{type:12,data:l}]})}},kr=(e,t,n,r)=>{let i=e.inputs.length===1?n:Wr(e.inputs,n),a=i.axes;a.length===0&&!i.noopWithEmptyAxes&&(a=e.inputs[0].dims.map((e,t)=>t));let o=U.normalizeAxes(a,e.inputs[0].dims.length),s=o,c=e.inputs[0],l=Dr(s,e.inputs[0].dims.length);l.length>0&&(c=e.compute(hr(e.inputs[0],l),{inputs:[0],outputs:[-1]})[0],s=Cr(s.length,c.dims.length));let[u,d]=wr(c.dims,s),f=u;i.keepDims&&(f=Tr(u,o)),e.compute(Or(t,i.cacheKey,[c],r,e.inputs[0].dataType,f,d),{inputs:[c]})},Ar=(e,t)=>{kr(e,`ReduceMeanShared`,t,`mean`)},jr=(e,t)=>{kr(e,`ReduceL1Shared`,t,`l1`)},Mr=(e,t)=>{kr(e,`ReduceL2Shared`,t,`l2`)},Nr=(e,t)=>{kr(e,`ReduceLogSumExpShared`,t,`logSumExp`)},Pr=(e,t)=>{kr(e,`ReduceMaxShared`,t,`max`)},Fr=(e,t)=>{kr(e,`ReduceMinShared`,t,`min`)},Ir=(e,t)=>{kr(e,`ReduceProdShared`,t,`prod`)},Lr=(e,t)=>{kr(e,`ReduceSumShared`,t,`sum`)},Rr=(e,t)=>{kr(e,`ReduceSumSquareShared`,t,`sumSquare`)},zr=(e,t)=>{kr(e,`ReduceLogSumShared`,t,`logSum`)}}),Vr,Hr,Ur,Wr,Gr,Kr,qr,Jr,Yr,Xr,Zr,Qr,$r,ei,ti,ni,ri,ii,ai,oi,si,ci,li,ui,di,fi,pi=M(()=>{"use strict";V(),W(),Xn(),Y(),Br(),Vr=e=>{if(!e||e.length===0||e.length>2)throw Error(`Reduce op requires 1 or 2 inputs.`);if(e.length===2&&e[1].dims.length!==1)throw Error(`Invalid axes input dims.`)},Hr=e=>[``,``,`var value = ${e.getByIndices(`input_indices`)};`,``],Ur=(e,t,n,r,i,a,o=!1,s=!1)=>{let c=[],l=n[0].dims,u=l.length,d=U.normalizeAxes(i,u),f=!s&&d.length===0;l.forEach((e,t)=>{f||d.indexOf(t)>=0?o&&c.push(1):c.push(e)});let p=c.length,m=U.size(c);return{name:e,shaderCache:t,getShaderSource:e=>{let t=[],i=q(`_A`,n[0].dataType,u),s=J(`output`,a,p),c=r(i,s,d),m=c[2];for(let e=0,n=0;e=0?(o&&n++,m=`for(var j${e}: u32 = 0; j${e} < ${l[e]}; j${e}++) { + }`;return{name:e,shaderCache:{hint:`${t};${f}`,inputDependencies:[`type`]},getShaderSource:m,getRunData:()=>({outputs:[{dims:a,dataType:i}],dispatchGroup:{x:c},programUniforms:[{type:12,data:l}]})}},Or=(e,t,n,r)=>{let i=e.inputs.length===1?n:Ur(e.inputs,n),a=i.axes;a.length===0&&!i.noopWithEmptyAxes&&(a=e.inputs[0].dims.map((e,t)=>t));let o=W.normalizeAxes(a,e.inputs[0].dims.length),s=o,c=e.inputs[0],l=Er(s,e.inputs[0].dims.length);l.length>0&&(c=e.compute(mr(e.inputs[0],l),{inputs:[0],outputs:[-1]})[0],s=Sr(s.length,c.dims.length));let[u,d]=Cr(c.dims,s),f=u;i.keepDims&&(f=wr(u,o)),e.compute(Dr(t,i.cacheKey,[c],r,e.inputs[0].dataType,f,d),{inputs:[c]})},kr=(e,t)=>{Or(e,`ReduceMeanShared`,t,`mean`)},Ar=(e,t)=>{Or(e,`ReduceL1Shared`,t,`l1`)},jr=(e,t)=>{Or(e,`ReduceL2Shared`,t,`l2`)},Mr=(e,t)=>{Or(e,`ReduceLogSumExpShared`,t,`logSumExp`)},Nr=(e,t)=>{Or(e,`ReduceMaxShared`,t,`max`)},Pr=(e,t)=>{Or(e,`ReduceMinShared`,t,`min`)},Fr=(e,t)=>{Or(e,`ReduceProdShared`,t,`prod`)},Ir=(e,t)=>{Or(e,`ReduceSumShared`,t,`sum`)},Lr=(e,t)=>{Or(e,`ReduceSumSquareShared`,t,`sumSquare`)},Rr=(e,t)=>{Or(e,`ReduceLogSumShared`,t,`logSum`)}}),Br,Vr,Hr,Ur,Wr,Gr,Kr,qr,Jr,Yr,Xr,Zr,Qr,$r,ei,ti,ni,ri,ii,ai,oi,si,ci,li,ui,di,fi=M(()=>{"use strict";U(),G(),Yn(),X(),zr(),Br=e=>{if(!e||e.length===0||e.length>2)throw Error(`Reduce op requires 1 or 2 inputs.`);if(e.length===2&&e[1].dims.length!==1)throw Error(`Invalid axes input dims.`)},Vr=e=>[``,``,`var value = ${e.getByIndices(`input_indices`)};`,``],Hr=(e,t,n,r,i,a,o=!1,s=!1)=>{let c=[],l=n[0].dims,u=l.length,d=W.normalizeAxes(i,u),f=!s&&d.length===0;l.forEach((e,t)=>{f||d.indexOf(t)>=0?o&&c.push(1):c.push(e)});let p=c.length,m=W.size(c);return{name:e,shaderCache:t,getShaderSource:e=>{let t=[],i=J(`_A`,n[0].dataType,u),s=Y(`output`,a,p),c=r(i,s,d),m=c[2];for(let e=0,n=0;e=0?(o&&n++,m=`for(var j${e}: u32 = 0; j${e} < ${l[e]}; j${e}++) { ${c[2].includes(`last_index`)?`let last_index = j${e};`:``} ${i.indicesSet(`input_indices`,e,`j${e}`)} ${m} @@ -156,19 +156,19 @@ var re=Object.defineProperty,ie=Object.getOwnPropertyDescriptor,ae=Object.getOwn ${c[3]} ${c.length===4?s.setByOffset(`global_idx`,`value`):c.slice(4).join(` `)} - }`},getRunData:()=>({outputs:[{dims:c,dataType:a}],dispatchGroup:{x:Math.ceil(m/64)},programUniforms:[{type:12,data:m},...G(l,c)]})}},Wr=(e,t)=>{let n=[];return e[1].dims[0]>0&&e[1].getBigInt64Array().forEach(e=>n.push(Number(e))),Yn({axes:n,keepDims:t.keepDims,noopWithEmptyAxes:t.noopWithEmptyAxes})},Gr=(e,t,n,r)=>{let i=e.inputs,a=i.length===1?n:Wr(i,n);e.compute(Ur(t,{hint:a.cacheKey,inputDependencies:[`rank`]},[i[0]],a.noopWithEmptyAxes&&a.axes.length===0?Hr:r,a.axes,i[0].dataType,a.keepDims,a.noopWithEmptyAxes),{inputs:[0]})},Kr=(e,t)=>{Vr(e.inputs),Gr(e,`ReduceLogSum`,t,(e,t)=>[`var value = ${t.type.storage}(0);`,``,`value += ${e.getByIndices(`input_indices`)};`,`value = log(value);`])},qr=(e,t)=>{Vr(e.inputs),Gr(e,`ReduceL1`,t,(e,t)=>[`var value = ${t.type.storage}(0);`,``,`value += abs(${e.getByIndices(`input_indices`)});`,``])},Jr=(e,t)=>{Vr(e.inputs),Gr(e,`ReduceL2`,t,(e,t)=>[`var t = ${t.type.value}(0); var value = ${t.type.value}(0);`,``,`t = ${e.getByIndices(`input_indices`)}; value += (t * t);`,`value = sqrt(value);`])},Yr=(e,t)=>{Vr(e.inputs),Gr(e,`ReduceLogSumExp`,t,(e,t)=>[`var value = ${t.type.storage}(0);`,``,`value += exp(${e.getByIndices(`input_indices`)});`,`value = log(value);`])},Xr=(e,t)=>{Vr(e.inputs),Gr(e,`ReduceMax`,t,(e,t,n)=>{let r=[];for(let t=0;t=0||n.length===0)&&r.push(e.indicesSet(`input_indices`,t,0));return[`${r.join(` -`)}`,`var value = ${e.getByIndices(`input_indices`)};`,`value = max(value, ${e.getByIndices(`input_indices`)});`,``]})},Zr=(e,t)=>{Vr(e.inputs),Gr(e,`ReduceMean`,t,(t,n,r)=>{let i=1;for(let n=0;n=0||r.length===0)&&(i*=e.inputs[0].dims[n]);return[`var sum = f32(0);`,``,`sum += f32(${t.getByIndices(`input_indices`)});`,`let value = ${n.type.value}(sum / ${i});`]})},Qr=(e,t)=>{Vr(e.inputs),Gr(e,`ReduceMin`,t,(e,t,n)=>{let r=[];for(let t=0;t=0||n.length===0)&&r.push(`input_indices[${t}] = 0;`);return[`${r.join(` -`)}`,`var value = ${e.getByIndices(`input_indices`)};`,`value = min(value, ${e.getByIndices(`input_indices`)});`,``]})},$r=(e,t)=>{Vr(e.inputs),Gr(e,`ReduceProd`,t,(e,t)=>[`var value = ${t.type.storage}(1);`,``,`value *= ${e.getByIndices(`input_indices`)};`,``])},ei=(e,t)=>{Vr(e.inputs),Gr(e,`ReduceSum`,t,(e,t)=>[`var value = ${t.type.storage}(0);`,``,`value += ${e.getByIndices(`input_indices`)};`,``])},ti=(e,t)=>{Vr(e.inputs),Gr(e,`ReduceSumSquare`,t,(e,t)=>[`var t = ${t.type.value}(0); var value = ${t.type.value}(0);`,``,`t = ${e.getByIndices(`input_indices`)}; value += t * t;`,``])},ni=(e,t,n)=>{if(t.length===0)return n;let r=1,i=1;for(let n=0;n1024},ri=(e,t)=>{ni(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Zr(e,t):Ar(e,t)},ii=(e,t)=>{ni(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?qr(e,t):jr(e,t)},ai=(e,t)=>{ni(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Jr(e,t):Mr(e,t)},oi=(e,t)=>{ni(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Yr(e,t):Nr(e,t)},si=(e,t)=>{ni(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Xr(e,t):Pr(e,t)},ci=(e,t)=>{ni(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Qr(e,t):Fr(e,t)},li=(e,t)=>{ni(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?$r(e,t):Ir(e,t)},ui=(e,t)=>{ni(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?ei(e,t):Lr(e,t)},di=(e,t)=>{ni(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?ti(e,t):Rr(e,t)},fi=(e,t)=>{ni(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Kr(e,t):zr(e,t)}}),mi,hi,gi,_i,vi=M(()=>{"use strict";V(),Xn(),pi(),mi=e=>{if(!e||e.length===0||e.length>2)throw Error(`ArgMinMaxOp op requires 1 or 2 inputs.`);if(e[0].dataType!==1)throw Error(`Invalid input type.`)},hi=(e,t)=>{mi(e.inputs);let n=(e,n,r)=>{let i=[];for(let t=0;t=0||r.length===0)&&i.push(`input_indices[${t}] = 0;`);return[`${i.join(` + }`},getRunData:()=>({outputs:[{dims:c,dataType:a}],dispatchGroup:{x:Math.ceil(m/64)},programUniforms:[{type:12,data:m},...K(l,c)]})}},Ur=(e,t)=>{let n=[];return e[1].dims[0]>0&&e[1].getBigInt64Array().forEach(e=>n.push(Number(e))),Jn({axes:n,keepDims:t.keepDims,noopWithEmptyAxes:t.noopWithEmptyAxes})},Wr=(e,t,n,r)=>{let i=e.inputs,a=i.length===1?n:Ur(i,n);e.compute(Hr(t,{hint:a.cacheKey,inputDependencies:[`rank`]},[i[0]],a.noopWithEmptyAxes&&a.axes.length===0?Vr:r,a.axes,i[0].dataType,a.keepDims,a.noopWithEmptyAxes),{inputs:[0]})},Gr=(e,t)=>{Br(e.inputs),Wr(e,`ReduceLogSum`,t,(e,t)=>[`var value = ${t.type.storage}(0);`,``,`value += ${e.getByIndices(`input_indices`)};`,`value = log(value);`])},Kr=(e,t)=>{Br(e.inputs),Wr(e,`ReduceL1`,t,(e,t)=>[`var value = ${t.type.storage}(0);`,``,`value += abs(${e.getByIndices(`input_indices`)});`,``])},qr=(e,t)=>{Br(e.inputs),Wr(e,`ReduceL2`,t,(e,t)=>[`var t = ${t.type.value}(0); var value = ${t.type.value}(0);`,``,`t = ${e.getByIndices(`input_indices`)}; value += (t * t);`,`value = sqrt(value);`])},Jr=(e,t)=>{Br(e.inputs),Wr(e,`ReduceLogSumExp`,t,(e,t)=>[`var value = ${t.type.storage}(0);`,``,`value += exp(${e.getByIndices(`input_indices`)});`,`value = log(value);`])},Yr=(e,t)=>{Br(e.inputs),Wr(e,`ReduceMax`,t,(e,t,n)=>{let r=[];for(let t=0;t=0||n.length===0)&&r.push(e.indicesSet(`input_indices`,t,0));return[`${r.join(` +`)}`,`var value = ${e.getByIndices(`input_indices`)};`,`value = max(value, ${e.getByIndices(`input_indices`)});`,``]})},Xr=(e,t)=>{Br(e.inputs),Wr(e,`ReduceMean`,t,(t,n,r)=>{let i=1;for(let n=0;n=0||r.length===0)&&(i*=e.inputs[0].dims[n]);return[`var sum = f32(0);`,``,`sum += f32(${t.getByIndices(`input_indices`)});`,`let value = ${n.type.value}(sum / ${i});`]})},Zr=(e,t)=>{Br(e.inputs),Wr(e,`ReduceMin`,t,(e,t,n)=>{let r=[];for(let t=0;t=0||n.length===0)&&r.push(`input_indices[${t}] = 0;`);return[`${r.join(` +`)}`,`var value = ${e.getByIndices(`input_indices`)};`,`value = min(value, ${e.getByIndices(`input_indices`)});`,``]})},Qr=(e,t)=>{Br(e.inputs),Wr(e,`ReduceProd`,t,(e,t)=>[`var value = ${t.type.storage}(1);`,``,`value *= ${e.getByIndices(`input_indices`)};`,``])},$r=(e,t)=>{Br(e.inputs),Wr(e,`ReduceSum`,t,(e,t)=>[`var value = ${t.type.storage}(0);`,``,`value += ${e.getByIndices(`input_indices`)};`,``])},ei=(e,t)=>{Br(e.inputs),Wr(e,`ReduceSumSquare`,t,(e,t)=>[`var t = ${t.type.value}(0); var value = ${t.type.value}(0);`,``,`t = ${e.getByIndices(`input_indices`)}; value += t * t;`,``])},ti=(e,t,n)=>{if(t.length===0)return n;let r=1,i=1;for(let n=0;n1024},ni=(e,t)=>{ti(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Xr(e,t):kr(e,t)},ri=(e,t)=>{ti(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Kr(e,t):Ar(e,t)},ii=(e,t)=>{ti(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?qr(e,t):jr(e,t)},ai=(e,t)=>{ti(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Jr(e,t):Mr(e,t)},oi=(e,t)=>{ti(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Yr(e,t):Nr(e,t)},si=(e,t)=>{ti(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Zr(e,t):Pr(e,t)},ci=(e,t)=>{ti(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Qr(e,t):Fr(e,t)},li=(e,t)=>{ti(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?$r(e,t):Ir(e,t)},ui=(e,t)=>{ti(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?ei(e,t):Lr(e,t)},di=(e,t)=>{ti(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Gr(e,t):Rr(e,t)}}),pi,mi,hi,gi,_i=M(()=>{"use strict";U(),Yn(),fi(),pi=e=>{if(!e||e.length===0||e.length>2)throw Error(`ArgMinMaxOp op requires 1 or 2 inputs.`);if(e[0].dataType!==1)throw Error(`Invalid input type.`)},mi=(e,t)=>{pi(e.inputs);let n=(e,n,r)=>{let i=[];for(let t=0;t=0||r.length===0)&&i.push(`input_indices[${t}] = 0;`);return[`${i.join(` `)}`,`var value = ${e.getByIndices(`input_indices`)}; var best_index : i32 = 0;`,`if (${e.getByIndices(`input_indices`)} ${t.selectLastIndex>0?`<=`:`<`} value) { value = ${e.getByIndices(`input_indices`)}; best_index = i32(last_index); - }`,``,n.setByOffset(`global_idx`,`best_index`)]};e.compute(Ur(`ArgMin`,{hint:t.cacheKey,inputDependencies:[`rank`]},[e.inputs[0]],n,[t.axis],7,t.keepDims),{inputs:[0]})},gi=(e,t)=>{mi(e.inputs);let n=(e,n,r)=>{let i=[];for(let t=0;t=0||r.length===0)&&i.push(`input_indices[${t}] = 0;`);return[`${i.join(` + }`,``,n.setByOffset(`global_idx`,`best_index`)]};e.compute(Hr(`ArgMin`,{hint:t.cacheKey,inputDependencies:[`rank`]},[e.inputs[0]],n,[t.axis],7,t.keepDims),{inputs:[0]})},hi=(e,t)=>{pi(e.inputs);let n=(e,n,r)=>{let i=[];for(let t=0;t=0||r.length===0)&&i.push(`input_indices[${t}] = 0;`);return[`${i.join(` `)}`,`var value = ${e.getByIndices(`input_indices`)}; var best_index : i32 = 0;`,`if (${e.getByIndices(`input_indices`)} ${t.selectLastIndex>0?`>=`:`>`} value) { value = ${e.getByIndices(`input_indices`)}; best_index = i32(last_index); - }`,``,n.setByOffset(`global_idx`,`best_index`)]};e.compute(Ur(`argMax`,{hint:t.cacheKey,inputDependencies:[`rank`]},[e.inputs[0]],n,[t.axis],7,t.keepDims),{inputs:[0]})},_i=e=>Yn(e)}),yi,bi,xi,Si,Ci,wi,Ti,Ei,Di=M(()=>{"use strict";V(),W(),Ln(),Y(),yi=(e,t)=>{let n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5];if(o&&s)throw Error(`Attention cannot have both past and attention_bias`);if(n.dims.length!==3)throw Error(`Input "input" must have 3 dimensions`);let c=n.dims[0],l=n.dims[1],u=n.dims[2];if(i.dims.length!==1)throw Error(`Input "bias" is expected to have 1 dimensions`);if(r.dims.length!==2)throw Error(`Input "weights" is expected to have 2 dimensions`);if(r.dims[0]!==u)throw Error(`Input 1 dimension 0 should have same length as dimension 2 of input 0`);if(i.dims[0]!==r.dims[1])throw Error(`Input "bias" dimension 0 should have same length as dimension 1 of input "weights"`);let d=i.dims[0]/3,f=d,p=f;if(t.qkvHiddenSizes.length>0){if(t.qkvHiddenSizes.length!==3)throw Error(`qkv_hidden_sizes attribute should have 3 elements`);for(let e of t.qkvHiddenSizes)if(e%t.numHeads!==0)throw Error(`qkv_hidden_sizes should be divisible by num_heads`);d=t.qkvHiddenSizes[0],f=t.qkvHiddenSizes[1],p=t.qkvHiddenSizes[2]}let m=l;if(d!==f)throw Error(`qkv_hidden_sizes first element should be same as the second`);if(i.dims[0]!==d+f+p)throw Error(`Input "bias" dimension 0 should have same length as sum of Q/K/V hidden sizes`);let h=0;if(o){if(f!==p)throw Error(`Input "past" expect k_hidden_size == v_hidden_size`);if(o.dims.length!==5)throw Error(`Input "past" must have 5 dimensions`);if(o.dims[0]!==2)throw Error(`Input "past" first dimension must be 2`);if(o.dims[1]!==c)throw Error(`Input "past" second dimension must be batch_size`);if(o.dims[2]!==t.numHeads)throw Error(`Input "past" third dimension must be num_heads`);if(o.dims[4]!==f/t.numHeads)throw Error(`Input "past" fifth dimension must be k_hidden_size / num_heads`);t.pastPresentShareBuffer||(h=o.dims[3])}let g=m+h,_=-1,v=0;if(a)throw Error(`Mask not supported`);if(o)throw Error(`past is not supported`);if(s){if(s.dims.length!==4)throw Error(`Input "attention_bias" must have 4 dimensions`);if(s.dims[0]!==c||s.dims[1]!==t.numHeads||s.dims[2]!==l||s.dims[3]!==g)throw Error(`Expect "attention_bias" shape (batch_size, num_heads, sequence_length, total_sequence_length)`)}return{batchSize:c,sequenceLength:l,pastSequenceLength:h,kvSequenceLength:m,totalSequenceLength:g,maxSequenceLength:_,inputHiddenSize:u,hiddenSize:d,vHiddenSize:p,headSize:Math.floor(d/t.numHeads),vHeadSize:Math.floor(p/t.numHeads),numHeads:t.numHeads,isUnidirectional:!1,pastPresentShareBuffer:!1,maskFilterValue:t.maskFilterValue,maskType:v,scale:t.scale,broadcastResPosBias:!1,passPastInKv:!1,qkvFormat:1}},bi=(e,t,n)=>t&&e?` + }`,``,n.setByOffset(`global_idx`,`best_index`)]};e.compute(Hr(`argMax`,{hint:t.cacheKey,inputDependencies:[`rank`]},[e.inputs[0]],n,[t.axis],7,t.keepDims),{inputs:[0]})},gi=e=>Jn(e)}),vi,yi,bi,xi,Si,Ci,wi,Ti,Ei=M(()=>{"use strict";U(),G(),In(),X(),vi=(e,t)=>{let n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5];if(o&&s)throw Error(`Attention cannot have both past and attention_bias`);if(n.dims.length!==3)throw Error(`Input "input" must have 3 dimensions`);let c=n.dims[0],l=n.dims[1],u=n.dims[2];if(i.dims.length!==1)throw Error(`Input "bias" is expected to have 1 dimensions`);if(r.dims.length!==2)throw Error(`Input "weights" is expected to have 2 dimensions`);if(r.dims[0]!==u)throw Error(`Input 1 dimension 0 should have same length as dimension 2 of input 0`);if(i.dims[0]!==r.dims[1])throw Error(`Input "bias" dimension 0 should have same length as dimension 1 of input "weights"`);let d=i.dims[0]/3,f=d,p=f;if(t.qkvHiddenSizes.length>0){if(t.qkvHiddenSizes.length!==3)throw Error(`qkv_hidden_sizes attribute should have 3 elements`);for(let e of t.qkvHiddenSizes)if(e%t.numHeads!==0)throw Error(`qkv_hidden_sizes should be divisible by num_heads`);d=t.qkvHiddenSizes[0],f=t.qkvHiddenSizes[1],p=t.qkvHiddenSizes[2]}let m=l;if(d!==f)throw Error(`qkv_hidden_sizes first element should be same as the second`);if(i.dims[0]!==d+f+p)throw Error(`Input "bias" dimension 0 should have same length as sum of Q/K/V hidden sizes`);let h=0;if(o){if(f!==p)throw Error(`Input "past" expect k_hidden_size == v_hidden_size`);if(o.dims.length!==5)throw Error(`Input "past" must have 5 dimensions`);if(o.dims[0]!==2)throw Error(`Input "past" first dimension must be 2`);if(o.dims[1]!==c)throw Error(`Input "past" second dimension must be batch_size`);if(o.dims[2]!==t.numHeads)throw Error(`Input "past" third dimension must be num_heads`);if(o.dims[4]!==f/t.numHeads)throw Error(`Input "past" fifth dimension must be k_hidden_size / num_heads`);t.pastPresentShareBuffer||(h=o.dims[3])}let g=m+h,_=-1,v=0;if(a)throw Error(`Mask not supported`);if(o)throw Error(`past is not supported`);if(s){if(s.dims.length!==4)throw Error(`Input "attention_bias" must have 4 dimensions`);if(s.dims[0]!==c||s.dims[1]!==t.numHeads||s.dims[2]!==l||s.dims[3]!==g)throw Error(`Expect "attention_bias" shape (batch_size, num_heads, sequence_length, total_sequence_length)`)}return{batchSize:c,sequenceLength:l,pastSequenceLength:h,kvSequenceLength:m,totalSequenceLength:g,maxSequenceLength:_,inputHiddenSize:u,hiddenSize:d,vHiddenSize:p,headSize:Math.floor(d/t.numHeads),vHeadSize:Math.floor(p/t.numHeads),numHeads:t.numHeads,isUnidirectional:!1,pastPresentShareBuffer:!1,maskFilterValue:t.maskFilterValue,maskType:v,scale:t.scale,broadcastResPosBias:!1,passPastInKv:!1,qkvFormat:1}},yi=(e,t,n)=>t&&e?` let total_sequence_length_input = u32(${t.getByOffset(`0`)}); let present_sequence_length = max(total_sequence_length_input, uniforms.past_sequence_length); let is_subsequent_prompt: bool = sequence_length > 1 && sequence_length != total_sequence_length_input; @@ -181,7 +181,7 @@ var best_index : i32 = 0;`,`if (${e.getByIndices(`input_indices`)} ${t.selectLas `:` ${n?`let past_sequence_length = uniforms.past_sequence_length`:``}; let present_sequence_length = total_sequence_length; - `,xi=(e,t,n,r,i,a,o,s)=>{let c=tr(o?1:a),l=64,u=a/c;u{let n=J(`x`,e.dataType,e.dims,c),r=[n],i=o?q(`seq_lens`,o.dataType,o.dims):void 0;i&&r.push(i);let a=s?q(`total_sequence_length_input`,s.dataType,s.dims):void 0;a&&r.push(a);let u=er(e.dataType),d=[{name:`batch_size`,type:`u32`},{name:`num_heads`,type:`u32`},{name:`past_sequence_length`,type:`u32`},{name:`sequence_length`,type:`u32`},{name:`total_sequence_length`,type:`u32`},{name:`elements_per_thread`,type:`u32`}];return` + `,bi=(e,t,n,r,i,a,o,s)=>{let c=er(o?1:a),l=64,u=a/c;u{let n=Y(`x`,e.dataType,e.dims,c),r=[n],i=o?J(`seq_lens`,o.dataType,o.dims):void 0;i&&r.push(i);let a=s?J(`total_sequence_length_input`,s.dataType,s.dims):void 0;a&&r.push(a);let u=$n(e.dataType),d=[{name:`batch_size`,type:`u32`},{name:`num_heads`,type:`u32`},{name:`past_sequence_length`,type:`u32`},{name:`sequence_length`,type:`u32`},{name:`total_sequence_length`,type:`u32`},{name:`elements_per_thread`,type:`u32`}];return` var thread_max: array; var thread_sum: array; ${t.registerUniforms(d).declareVariables(...r)} @@ -190,7 +190,7 @@ var best_index : i32 = 0;`,`if (${e.getByIndices(`input_indices`)} ${t.selectLas let headIdx = workgroup_id.z % uniforms.num_heads; let sequence_length = uniforms.sequence_length; var total_sequence_length = uniforms.total_sequence_length; - ${bi(i,a,!1)} + ${yi(i,a,!1)} let local_offset = local_idx * uniforms.elements_per_thread; let offset = (global_idx / ${l}) * uniforms.total_sequence_length + local_offset; let seq_causal_length = ${o?`u32(past_sequence_length + workgroup_id.y + 1)`:`total_sequence_length`}; @@ -232,7 +232,7 @@ var best_index : i32 = 0;`,`if (${e.getByIndices(`input_indices`)} ${t.selectLas for (var total_seq_id: u32 = seq_causal_length; total_seq_id + local_offset < uniforms.total_sequence_length; total_seq_id++) { x[offset + total_seq_id] = ${n.type.value}(${u}(0)); }`:``}; - }`};return{name:`AttentionProbsSoftmax`,shaderCache:{hint:`${l};${p};${c}`,inputDependencies:h},getShaderSource:g,getRunData:()=>({outputs:[],dispatchGroup:{x:1,y:i,z:t*n},programUniforms:f})}},Si=(e,t,n,r,i,a,o,s,c)=>{let l=o+a.kvSequenceLength,u=[a.batchSize,a.numHeads,a.sequenceLength,l],d=e>1&&r,f=a.kvNumHeads?a.kvNumHeads:a.numHeads,p=d?[a.batchSize,f,l,a.headSize]:void 0,m=a.nReps?a.nReps:1,h=a.scale===0?1/Math.sqrt(a.headSize):a.scale,g=tr(a.headSize),_=a.headSize/g,v=12,y={x:Math.ceil(l/v),y:Math.ceil(a.sequenceLength/v),z:a.batchSize*a.numHeads},b=[{type:12,data:a.sequenceLength},{type:12,data:_},{type:12,data:l},{type:12,data:a.numHeads},{type:12,data:a.headSize},{type:1,data:h},{type:12,data:o},{type:12,data:a.kvSequenceLength},{type:12,data:m}],x=d&&r&&U.size(r.dims)>0,S=[`type`,`type`];x&&S.push(`type`),i&&S.push(`type`),s&&S.push(`type`),c&&S.push(`type`);let C=[{dims:u,dataType:t.dataType,gpuDataType:0}];d&&C.push({dims:p,dataType:t.dataType,gpuDataType:0});let w=e=>{let a=q(`q`,t.dataType,t.dims,g),o=q(`key`,n.dataType,n.dims,g),l=[a,o];if(x){let e=q(`past_key`,r.dataType,r.dims,g);l.push(e)}i&&l.push(q(`attention_bias`,i.dataType,i.dims));let f=s?q(`seq_lens`,s.dataType,s.dims):void 0;f&&l.push(f);let h=c?q(`total_sequence_length_input`,c.dataType,c.dims):void 0;h&&l.push(h);let _=J(`output`,t.dataType,u),y=[_];d&&y.push(J(`present_key`,t.dataType,p,g));let b=er(1,g),S=[{name:`M`,type:`u32`},{name:`K`,type:`u32`},{name:`N`,type:`u32`},{name:`num_heads`,type:`u32`},{name:`head_size`,type:`u32`},{name:`alpha`,type:`f32`},{name:`past_sequence_length`,type:`u32`},{name:`kv_sequence_length`,type:`u32`},{name:`n_reps`,type:`u32`}];return` + }`};return{name:`AttentionProbsSoftmax`,shaderCache:{hint:`${l};${p};${c}`,inputDependencies:h},getShaderSource:g,getRunData:()=>({outputs:[],dispatchGroup:{x:1,y:i,z:t*n},programUniforms:f})}},xi=(e,t,n,r,i,a,o,s,c)=>{let l=o+a.kvSequenceLength,u=[a.batchSize,a.numHeads,a.sequenceLength,l],d=e>1&&r,f=a.kvNumHeads?a.kvNumHeads:a.numHeads,p=d?[a.batchSize,f,l,a.headSize]:void 0,m=a.nReps?a.nReps:1,h=a.scale===0?1/Math.sqrt(a.headSize):a.scale,g=er(a.headSize),_=a.headSize/g,v=12,y={x:Math.ceil(l/v),y:Math.ceil(a.sequenceLength/v),z:a.batchSize*a.numHeads},b=[{type:12,data:a.sequenceLength},{type:12,data:_},{type:12,data:l},{type:12,data:a.numHeads},{type:12,data:a.headSize},{type:1,data:h},{type:12,data:o},{type:12,data:a.kvSequenceLength},{type:12,data:m}],x=d&&r&&W.size(r.dims)>0,S=[`type`,`type`];x&&S.push(`type`),i&&S.push(`type`),s&&S.push(`type`),c&&S.push(`type`);let C=[{dims:u,dataType:t.dataType,gpuDataType:0}];d&&C.push({dims:p,dataType:t.dataType,gpuDataType:0});let w=e=>{let a=J(`q`,t.dataType,t.dims,g),o=J(`key`,n.dataType,n.dims,g),l=[a,o];if(x){let e=J(`past_key`,r.dataType,r.dims,g);l.push(e)}i&&l.push(J(`attention_bias`,i.dataType,i.dims));let f=s?J(`seq_lens`,s.dataType,s.dims):void 0;f&&l.push(f);let h=c?J(`total_sequence_length_input`,c.dataType,c.dims):void 0;h&&l.push(h);let _=Y(`output`,t.dataType,u),y=[_];d&&y.push(Y(`present_key`,t.dataType,p,g));let b=$n(1,g),S=[{name:`M`,type:`u32`},{name:`K`,type:`u32`},{name:`N`,type:`u32`},{name:`num_heads`,type:`u32`},{name:`head_size`,type:`u32`},{name:`alpha`,type:`f32`},{name:`past_sequence_length`,type:`u32`},{name:`kv_sequence_length`,type:`u32`},{name:`n_reps`,type:`u32`}];return` const TILE_SIZE = ${v}u; var tileQ: array<${a.type.storage}, ${v*v}>; @@ -248,7 +248,7 @@ var best_index : i32 = 0;`,`if (${e.getByIndices(`input_indices`)} ${t.selectLas let n = workgroup_id.x * TILE_SIZE; let sequence_length = uniforms.M; var total_sequence_length = uniforms.N; - ${bi(f,h,!0)} + ${yi(f,h,!0)} let absKvHeadIdx = batchIdx * kv_num_heads + kvHeadIdx; let qOffset = workgroup_id.z * uniforms.M * uniforms.K + m * uniforms.K; ${x&&d?`let pastKeyOffset = absKvHeadIdx * uniforms.past_sequence_length * uniforms.K;`:``}; @@ -289,7 +289,7 @@ var best_index : i32 = 0;`,`if (${e.getByIndices(`input_indices`)} ${t.selectLas var sum: f32 = ${(()=>{switch(g){case 1:return`value`;case 2:return`value.x + value.y`;case 4:return`value.x + value.y + value.z + value.w`;default:throw Error(`Unsupported components: ${g}`)}})()}; output[outputIdx] = ${_.type.value} (sum * uniforms.alpha) + ${i?`attention_bias[outputIdx]`:`0.0`}; } - }`};return{name:`AttentionProbs`,shaderCache:{hint:`${g};${i!==void 0};${r!==void 0};${e}`,inputDependencies:S},getRunData:()=>({outputs:C,dispatchGroup:y,programUniforms:b}),getShaderSource:w}},Ci=(e,t,n,r,i,a,o=void 0,s=void 0)=>{let c=a+i.kvSequenceLength,l=i.nReps?i.nReps:1,u=i.vHiddenSize*l,d=e>1&&r,f=i.kvNumHeads?i.kvNumHeads:i.numHeads,p=d?[i.batchSize,f,c,i.headSize]:void 0,m=[i.batchSize,i.sequenceLength,u],h=12,g={x:Math.ceil(i.vHeadSize/h),y:Math.ceil(i.sequenceLength/h),z:i.batchSize*i.numHeads},_=[{type:12,data:i.sequenceLength},{type:12,data:c},{type:12,data:i.vHeadSize},{type:12,data:i.numHeads},{type:12,data:i.headSize},{type:12,data:u},{type:12,data:a},{type:12,data:i.kvSequenceLength},{type:12,data:l}],v=d&&r&&U.size(r.dims)>0,y=[`type`,`type`];v&&y.push(`type`),o&&y.push(`type`),s&&y.push(`type`);let b=[{dims:m,dataType:t.dataType,gpuDataType:0}];d&&b.push({dims:p,dataType:t.dataType,gpuDataType:0});let x=e=>{let i=q(`probs`,t.dataType,t.dims),a=q(`v`,n.dataType,n.dims),c=[i,a];v&&c.push(q(`past_value`,r.dataType,r.dims));let u=o?q(`seq_lens`,o.dataType,o.dims):void 0;o&&c.push(u);let f=s?q(`total_sequence_length_input`,s.dataType,s.dims):void 0;s&&c.push(f);let g=[J(`output`,t.dataType,m)];d&&g.push(J(`present_value`,t.dataType,p));let _=[{name:`M`,type:`u32`},{name:`K`,type:`u32`},{name:`N`,type:`u32`},{name:`num_heads`,type:`u32`},{name:`head_size`,type:`u32`},{name:`v_hidden_size`,type:`u32`},{name:`past_sequence_length`,type:`u32`},{name:`kv_sequence_length`,type:`u32`},{name:`n_reps`,type:`u32`}];return` + }`};return{name:`AttentionProbs`,shaderCache:{hint:`${g};${i!==void 0};${r!==void 0};${e}`,inputDependencies:S},getRunData:()=>({outputs:C,dispatchGroup:y,programUniforms:b}),getShaderSource:w}},Si=(e,t,n,r,i,a,o=void 0,s=void 0)=>{let c=a+i.kvSequenceLength,l=i.nReps?i.nReps:1,u=i.vHiddenSize*l,d=e>1&&r,f=i.kvNumHeads?i.kvNumHeads:i.numHeads,p=d?[i.batchSize,f,c,i.headSize]:void 0,m=[i.batchSize,i.sequenceLength,u],h=12,g={x:Math.ceil(i.vHeadSize/h),y:Math.ceil(i.sequenceLength/h),z:i.batchSize*i.numHeads},_=[{type:12,data:i.sequenceLength},{type:12,data:c},{type:12,data:i.vHeadSize},{type:12,data:i.numHeads},{type:12,data:i.headSize},{type:12,data:u},{type:12,data:a},{type:12,data:i.kvSequenceLength},{type:12,data:l}],v=d&&r&&W.size(r.dims)>0,y=[`type`,`type`];v&&y.push(`type`),o&&y.push(`type`),s&&y.push(`type`);let b=[{dims:m,dataType:t.dataType,gpuDataType:0}];d&&b.push({dims:p,dataType:t.dataType,gpuDataType:0});let x=e=>{let i=J(`probs`,t.dataType,t.dims),a=J(`v`,n.dataType,n.dims),c=[i,a];v&&c.push(J(`past_value`,r.dataType,r.dims));let u=o?J(`seq_lens`,o.dataType,o.dims):void 0;o&&c.push(u);let f=s?J(`total_sequence_length_input`,s.dataType,s.dims):void 0;s&&c.push(f);let g=[Y(`output`,t.dataType,m)];d&&g.push(Y(`present_value`,t.dataType,p));let _=[{name:`M`,type:`u32`},{name:`K`,type:`u32`},{name:`N`,type:`u32`},{name:`num_heads`,type:`u32`},{name:`head_size`,type:`u32`},{name:`v_hidden_size`,type:`u32`},{name:`past_sequence_length`,type:`u32`},{name:`kv_sequence_length`,type:`u32`},{name:`n_reps`,type:`u32`}];return` const TILE_SIZE = ${h}u; var tileQ: array<${i.type.value}, ${h*h}>; var tileV: array<${i.type.value}, ${h*h}>; @@ -303,7 +303,7 @@ var best_index : i32 = 0;`,`if (${e.getByIndices(`input_indices`)} ${t.selectLas let n = global_id.x; let sequence_length = uniforms.M; var total_sequence_length = uniforms.K; - ${bi(u,f,!0)} + ${yi(u,f,!0)} let offsetA = workgroup_id.z * uniforms.M * uniforms.K + m * uniforms.K; let absKvHeadIdx = batchIdx * kv_num_heads + kvHeadIdx; // kvHeadIdx is relative to the batch ${v&&d?`let pastValueOffset = absKvHeadIdx * uniforms.N * uniforms.past_sequence_length + n;`:``}; @@ -344,7 +344,7 @@ var best_index : i32 = 0;`,`if (${e.getByIndices(`input_indices`)} ${t.selectLas + headIdx * uniforms.N + n; output[outputIdx] = value; } - }`};return{name:`AttentionScore`,shaderCache:{hint:`${r!==void 0};${e}`,inputDependencies:y},getRunData:()=>({outputs:b,dispatchGroup:g,programUniforms:_}),getShaderSource:x}},wi=(e,t,n,r,i,a,o,s,c,l,u=void 0,d=void 0)=>{let f=Math.min(e.outputCount,1+(o?1:0)+(s?1:0)),p=f>1?l.pastSequenceLength:0,m=p+l.kvSequenceLength,h=c&&U.size(c.dims)>0?c:void 0,g=[t,n];f>1&&o&&U.size(o.dims)>0&&g.push(o),h&&g.push(h),u&&g.push(u),d&&g.push(d);let _=e.compute(Si(f,t,n,o,h,l,p,u,d),{inputs:g,outputs:f>1?[-1,1]:[-1]})[0];e.compute(xi(_,l.batchSize,l.numHeads,p,l.sequenceLength,m,u,d),{inputs:u&&d?[_,u,d]:[_],outputs:[]});let v=[_,r];f>1&&s&&U.size(s.dims)>0&&v.push(s),u&&v.push(u),d&&v.push(d),e.compute(Ci(f,_,r,s,l,p,u,d),{inputs:v,outputs:f>1?[0,2]:[0]})},Ti=(e,t)=>{let n=[t.batchSize,t.numHeads,t.sequenceLength,t.headSize],r=t.sequenceLength,i=t.inputHiddenSize,a=t.headSize,o=12,s={x:Math.ceil(t.headSize/o),y:Math.ceil(t.sequenceLength/o),z:t.batchSize*t.numHeads},c=[e.inputs[0],e.inputs[1],e.inputs[2]],l=[{type:12,data:r},{type:12,data:i},{type:12,data:a},{type:12,data:t.numHeads},{type:12,data:t.headSize},{type:12,data:t.hiddenSize},{type:12,data:t.hiddenSize+t.hiddenSize+t.vHiddenSize}],u=e=>{let t=J(`output_q`,c[0].dataType,n),r=J(`output_k`,c[0].dataType,n),i=J(`output_v`,c[0].dataType,n),a=q(`input`,c[0].dataType,c[0].dims),s=q(`weight`,c[1].dataType,c[1].dims),l=q(`bias`,c[2].dataType,c[2].dims),u=a.type.storage,d=[{name:`M`,type:`u32`},{name:`K`,type:`u32`},{name:`N`,type:`u32`},{name:`num_heads`,type:`u32`},{name:`head_size`,type:`u32`},{name:`hidden_size`,type:`u32`},{name:`ldb`,type:`u32`}];return` + }`};return{name:`AttentionScore`,shaderCache:{hint:`${r!==void 0};${e}`,inputDependencies:y},getRunData:()=>({outputs:b,dispatchGroup:g,programUniforms:_}),getShaderSource:x}},Ci=(e,t,n,r,i,a,o,s,c,l,u=void 0,d=void 0)=>{let f=Math.min(e.outputCount,1+(o?1:0)+(s?1:0)),p=f>1?l.pastSequenceLength:0,m=p+l.kvSequenceLength,h=c&&W.size(c.dims)>0?c:void 0,g=[t,n];f>1&&o&&W.size(o.dims)>0&&g.push(o),h&&g.push(h),u&&g.push(u),d&&g.push(d);let _=e.compute(xi(f,t,n,o,h,l,p,u,d),{inputs:g,outputs:f>1?[-1,1]:[-1]})[0];e.compute(bi(_,l.batchSize,l.numHeads,p,l.sequenceLength,m,u,d),{inputs:u&&d?[_,u,d]:[_],outputs:[]});let v=[_,r];f>1&&s&&W.size(s.dims)>0&&v.push(s),u&&v.push(u),d&&v.push(d),e.compute(Si(f,_,r,s,l,p,u,d),{inputs:v,outputs:f>1?[0,2]:[0]})},wi=(e,t)=>{let n=[t.batchSize,t.numHeads,t.sequenceLength,t.headSize],r=t.sequenceLength,i=t.inputHiddenSize,a=t.headSize,o=12,s={x:Math.ceil(t.headSize/o),y:Math.ceil(t.sequenceLength/o),z:t.batchSize*t.numHeads},c=[e.inputs[0],e.inputs[1],e.inputs[2]],l=[{type:12,data:r},{type:12,data:i},{type:12,data:a},{type:12,data:t.numHeads},{type:12,data:t.headSize},{type:12,data:t.hiddenSize},{type:12,data:t.hiddenSize+t.hiddenSize+t.vHiddenSize}],u=e=>{let t=Y(`output_q`,c[0].dataType,n),r=Y(`output_k`,c[0].dataType,n),i=Y(`output_v`,c[0].dataType,n),a=J(`input`,c[0].dataType,c[0].dims),s=J(`weight`,c[1].dataType,c[1].dims),l=J(`bias`,c[2].dataType,c[2].dims),u=a.type.storage,d=[{name:`M`,type:`u32`},{name:`K`,type:`u32`},{name:`N`,type:`u32`},{name:`num_heads`,type:`u32`},{name:`head_size`,type:`u32`},{name:`hidden_size`,type:`u32`},{name:`ldb`,type:`u32`}];return` const TILE_SIZE = ${o}u; var tileInput: array<${u}, ${o*o}>; var tileWeightQ: array<${u}, ${o*o}>; @@ -399,7 +399,7 @@ var best_index : i32 = 0;`,`if (${e.getByIndices(`input_indices`)} ${t.selectLas output_k[outputIdx] = valueK; output_v[outputIdx] = valueV; } - }`};return e.compute({name:`AttentionPrepare`,shaderCache:{inputDependencies:[`type`,`type`,`type`]},getRunData:()=>({outputs:[{dims:n,dataType:e.inputs[0].dataType,gpuDataType:0},{dims:n,dataType:e.inputs[0].dataType,gpuDataType:0},{dims:n,dataType:e.inputs[0].dataType,gpuDataType:0}],dispatchGroup:s,programUniforms:l}),getShaderSource:u},{inputs:c,outputs:[-1,-1,-1]})},Ei=(e,t)=>{let n=yi(e.inputs,t),[r,i,a]=Ti(e,n);return wi(e,r,i,a,e.inputs[4],void 0,void 0,void 0,e.inputs[5],n)}}),Oi,ki,Ai,ji,Mi=M(()=>{"use strict";$e(),V(),W(),Xn(),Y(),Oi=(e,t)=>{if(!e||e.length!==5)throw Error(`BatchNormalization requires 5 inputs`);let n=(e,t,n)=>{let r=t.length;if(r!==e.length)throw Error(`${n}: num dimensions != ${r}`);t.forEach((t,r)=>{if(t!==e[r])throw Error(`${n}: dim[${r}] do not match`)})};if(e[0].dims.length>1){let r=t.format===`NHWC`?t.spatial?e[0].dims.slice(-1):e[0].dims.slice(-1).concat(e[0].dims.slice(1,e[0].dims.length-1)):e[0].dims.slice(1,t.spatial?2:void 0);n(e[1].dims,r,`Invalid input scale`),n(e[2].dims,r,`Invalid input B`),n(e[3].dims,r,`Invalid input mean`),n(e[4].dims,r,`Invalid input var`)}else n(e[1].dims,[1],`Invalid input scale`),n(e[2].dims,[1],`Invalid input B`),n(e[3].dims,[1],`Invalid input mean`),n(e[4].dims,[1],`Invalid input var`)},ki=(e,t)=>{let{epsilon:n,spatial:r,format:i}=t,a=e[0].dims,o=r?tr(a[a.length-1]):1,s=i===`NHWC`&&a.length>1?o:1,c=U.size(a)/o,l=r,u=l?a.length:a,d=q(`x`,e[0].dataType,e[0].dims,o),f=q(`scale`,e[1].dataType,e[1].dims,s),p=q(`bias`,e[2].dataType,e[2].dims,s),m=q(`inputMean`,e[3].dataType,e[3].dims,s),h=q(`inputVar`,e[4].dataType,e[4].dims,s),g=J(`y`,e[0].dataType,u,o),_=()=>{let e=``;if(r)e=`let cOffset = ${a.length===1?`0u`:i===`NHWC`?`outputIndices[${a.length-1}] / ${o}`:`outputIndices[1]`};`;else if(i===`NCHW`)e=` + }`};return e.compute({name:`AttentionPrepare`,shaderCache:{inputDependencies:[`type`,`type`,`type`]},getRunData:()=>({outputs:[{dims:n,dataType:e.inputs[0].dataType,gpuDataType:0},{dims:n,dataType:e.inputs[0].dataType,gpuDataType:0},{dims:n,dataType:e.inputs[0].dataType,gpuDataType:0}],dispatchGroup:s,programUniforms:l}),getShaderSource:u},{inputs:c,outputs:[-1,-1,-1]})},Ti=(e,t)=>{let n=vi(e.inputs,t),[r,i,a]=wi(e,n);return Ci(e,r,i,a,e.inputs[4],void 0,void 0,void 0,e.inputs[5],n)}}),Di,Oi,ki,Ai,ji=M(()=>{"use strict";Ze(),U(),G(),Yn(),X(),Di=(e,t)=>{if(!e||e.length!==5)throw Error(`BatchNormalization requires 5 inputs`);let n=(e,t,n)=>{let r=t.length;if(r!==e.length)throw Error(`${n}: num dimensions != ${r}`);t.forEach((t,r)=>{if(t!==e[r])throw Error(`${n}: dim[${r}] do not match`)})};if(e[0].dims.length>1){let r=t.format===`NHWC`?t.spatial?e[0].dims.slice(-1):e[0].dims.slice(-1).concat(e[0].dims.slice(1,e[0].dims.length-1)):e[0].dims.slice(1,t.spatial?2:void 0);n(e[1].dims,r,`Invalid input scale`),n(e[2].dims,r,`Invalid input B`),n(e[3].dims,r,`Invalid input mean`),n(e[4].dims,r,`Invalid input var`)}else n(e[1].dims,[1],`Invalid input scale`),n(e[2].dims,[1],`Invalid input B`),n(e[3].dims,[1],`Invalid input mean`),n(e[4].dims,[1],`Invalid input var`)},Oi=(e,t)=>{let{epsilon:n,spatial:r,format:i}=t,a=e[0].dims,o=r?er(a[a.length-1]):1,s=i===`NHWC`&&a.length>1?o:1,c=W.size(a)/o,l=r,u=l?a.length:a,d=J(`x`,e[0].dataType,e[0].dims,o),f=J(`scale`,e[1].dataType,e[1].dims,s),p=J(`bias`,e[2].dataType,e[2].dims,s),m=J(`inputMean`,e[3].dataType,e[3].dims,s),h=J(`inputVar`,e[4].dataType,e[4].dims,s),g=Y(`y`,e[0].dataType,u,o),_=()=>{let e=``;if(r)e=`let cOffset = ${a.length===1?`0u`:i===`NHWC`?`outputIndices[${a.length-1}] / ${o}`:`outputIndices[1]`};`;else if(i===`NCHW`)e=` ${g.indicesSet(`outputIndices`,`0`,`0`)} let cOffset = ${g.indicesToOffset(`outputIndices`)};`;else{e=`var cIndices = ${f.type.indices}(0); cIndices[0] = outputIndices[${a.length-1}];`;for(let t=1;t` @@ -416,7 +416,7 @@ var best_index : i32 = 0;`,`if (${e.getByIndices(`input_indices`)} ${t.selectLas let x = ${d.getByOffset(`global_idx`)}; let value = (x - inputMean) * inverseSqrt(inputVar + epsilon) * scale + bias; ${g.setByOffset(`global_idx`,`value`)} - }`;return{name:`BatchNormalization`,shaderCache:{hint:`${t.epsilon}_${t.format}_${r}_${o}`,inputDependencies:l?[`rank`,`type`,`type`,`type`,`type`]:void 0},getShaderSource:v,getRunData:()=>({outputs:[{dims:e[0].dims,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(c/64)},programUniforms:l?[{type:12,data:c},...G(a)]:[{type:12,data:c}]})}},Ai=e=>Yn(e),ji=(e,t)=>{let{inputs:n,outputCount:r}=e,i=Ai({...t,outputCount:r});if(L.webgpu.validateInputContent&&Oi(n,i),t.trainingMode)throw Error(`BatchNormalization trainingMode is not supported yet.`);e.compute(ki(n,i))}}),Ni,Pi,Fi,Ii=M(()=>{"use strict";W(),Y(),Ni=e=>{if(e[0].dims.length!==3)throw Error(`input should have 3 dimensions`);if(![320,640,1280].includes(e[0].dims[2]))throw Error(`number of channels should be 320, 640 or 1280`);if(e[1].dims.length!==1)throw Error(`bias is expected to have 1 dimensions`);if(e[0].dims[2]!==e[1].dims[0])throw Error(`last dimension of input and bias are not the same`)},Pi=e=>{let t=e[0].dims,n=e[0].dims[2],r=U.size(t)/4,i=e[0].dataType,a=q(`input`,i,t,4),o=q(`bias`,i,[n],4),s=q(`residual`,i,t,4),c=J(`output`,i,t,4);return{name:`BiasAdd`,getRunData:()=>({outputs:[{dims:t,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(r/64)}}),getShaderSource:e=>` + }`;return{name:`BatchNormalization`,shaderCache:{hint:`${t.epsilon}_${t.format}_${r}_${o}`,inputDependencies:l?[`rank`,`type`,`type`,`type`,`type`]:void 0},getShaderSource:v,getRunData:()=>({outputs:[{dims:e[0].dims,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(c/64)},programUniforms:l?[{type:12,data:c},...K(a)]:[{type:12,data:c}]})}},ki=e=>Jn(e),Ai=(e,t)=>{let{inputs:n,outputCount:r}=e,i=ki({...t,outputCount:r});if(R.webgpu.validateInputContent&&Di(n,i),t.trainingMode)throw Error(`BatchNormalization trainingMode is not supported yet.`);e.compute(Oi(n,i))}}),Mi,Ni,Pi,Fi=M(()=>{"use strict";G(),X(),Mi=e=>{if(e[0].dims.length!==3)throw Error(`input should have 3 dimensions`);if(![320,640,1280].includes(e[0].dims[2]))throw Error(`number of channels should be 320, 640 or 1280`);if(e[1].dims.length!==1)throw Error(`bias is expected to have 1 dimensions`);if(e[0].dims[2]!==e[1].dims[0])throw Error(`last dimension of input and bias are not the same`)},Ni=e=>{let t=e[0].dims,n=e[0].dims[2],r=W.size(t)/4,i=e[0].dataType,a=J(`input`,i,t,4),o=J(`bias`,i,[n],4),s=J(`residual`,i,t,4),c=Y(`output`,i,t,4);return{name:`BiasAdd`,getRunData:()=>({outputs:[{dims:t,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(r/64)}}),getShaderSource:e=>` const channels = ${n}u / 4; ${e.declareVariables(a,o,s,c)} @@ -425,7 +425,7 @@ var best_index : i32 = 0;`,`if (${e.getByIndices(`input_indices`)} ${t.selectLas let value = ${a.getByOffset(`global_idx`)} + ${o.getByOffset(`global_idx % channels`)} + ${s.getByOffset(`global_idx`)}; ${c.setByOffset(`global_idx`,`value`)} - }`}},Fi=e=>{Ni(e.inputs),e.compute(Pi(e.inputs))}}),Li,Ri,zi,Bi,Vi,Hi,Ui,Wi,Gi,Ki,qi,Ji,Yi,Xi,Zi,Qi,$i,ea,ta,na,ra,ia,aa,oa,sa,ca,la,ua,da,fa,pa,ma,ha,ga,_a,va,ya,ba,xa,Sa,Ca,wa,Ta,Ea,Da,Oa=M(()=>{"use strict";V(),W(),Xn(),Y(),Li=(e,t,n,r,i,a,o)=>{let s=Math.ceil(t/4),c=``;c=typeof i==`string`?`${i}(a)`:i(`a`);let l=q(`inputData`,n,[s],4),u=J(`outputData`,r,[s],4),d=[{name:`vec_size`,type:`u32`}];return o&&d.push(...o),` + }`}},Pi=e=>{Mi(e.inputs),e.compute(Ni(e.inputs))}}),Ii,Li,Ri,zi,Bi,Vi,Hi,Ui,Wi,Gi,Ki,qi,Ji,Yi,Xi,Zi,Qi,$i,ea,ta,na,ra,ia,aa,oa,sa,ca,la,ua,da,fa,pa,ma,ha,ga,_a,va,ya,ba,xa,Sa,Ca,wa,Ta,Ea,Da=M(()=>{"use strict";U(),G(),Yn(),X(),Ii=(e,t,n,r,i,a,o)=>{let s=Math.ceil(t/4),c=``;c=typeof i==`string`?`${i}(a)`:i(`a`);let l=J(`inputData`,n,[s],4),u=Y(`outputData`,r,[s],4),d=[{name:`vec_size`,type:`u32`}];return o&&d.push(...o),` ${e.registerUniforms(d).declareVariables(l,u)} ${a??``} @@ -435,7 +435,7 @@ var best_index : i32 = 0;`,`if (${e.getByIndices(`input_indices`)} ${t.selectLas let a = ${l.getByOffset(`global_idx`)}; ${u.setByOffset(`global_idx`,c)} - }`},Ri=(e,t,n,r,i,a=e.dataType,o,s)=>{let c=[{type:12,data:Math.ceil(U.size(e.dims)/4)}];return o&&c.push(...o),{name:t,shaderCache:{hint:i,inputDependencies:[`type`]},getShaderSource:t=>Li(t,U.size(e.dims),e.dataType,a,n,r,s),getRunData:t=>({outputs:[{dims:e.dims,dataType:a}],dispatchGroup:{x:Math.ceil(U.size(t[0].dims)/64/4)},programUniforms:c})}},zi=e=>{e.compute(Ri(e.inputs[0],`Abs`,`abs`))},Bi=e=>{e.compute(Ri(e.inputs[0],`Acos`,`acos`))},Vi=e=>{e.compute(Ri(e.inputs[0],`Acosh`,`acosh`))},Hi=e=>{e.compute(Ri(e.inputs[0],`Asin`,`asin`))},Ui=e=>{e.compute(Ri(e.inputs[0],`Asinh`,`asinh`))},Wi=e=>{e.compute(Ri(e.inputs[0],`Atan`,`atan`))},Gi=e=>{e.compute(Ri(e.inputs[0],`Atanh`,`atanh`))},Ki=e=>Yn(e),qi=(e,t)=>{let n;switch(t.to){case 10:n=`vec4`;break;case 1:n=`vec4`;break;case 12:n=`vec4`;break;case 6:n=`vec4`;break;case 9:n=`vec4`;break;default:throw RangeError(`not supported type (specified in attribute 'to' from 'Cast' operator): ${t.to}`)}e.compute(Ri(e.inputs[0],`Cast`,n,void 0,t.cacheKey,t.to))},Ji=e=>{let t,n,r=e.length>=2&&e[1].data!==0,i=e.length>=3&&e[2].data!==0;switch(e[0].dataType){case 1:t=r?e[1].getFloat32Array()[0]:-34028234663852886e22,n=i?e[2].getFloat32Array()[0]:34028234663852886e22;break;case 10:t=r?e[1].getUint16Array()[0]:64511,n=i?e[2].getUint16Array()[0]:31743;break;default:throw Error(`Unsupport data type`)}return Yn({min:t,max:n})},Yi=(e,t)=>{let n=t||Ji(e.inputs),r=er(e.inputs[0].dataType);e.compute(Ri(e.inputs[0],`Clip`,e=>`clamp(${e}, vec4<${r}>(uniforms.min), vec4<${r}>(uniforms.max))`,void 0,n.cacheKey,void 0,[{type:e.inputs[0].dataType,data:n.min},{type:e.inputs[0].dataType,data:n.max}],[{name:`min`,type:r},{name:`max`,type:r}]),{inputs:[0]})},Xi=e=>{e.compute(Ri(e.inputs[0],`Ceil`,`ceil`))},Zi=e=>{e.compute(Ri(e.inputs[0],`Cos`,`cos`))},Qi=e=>{e.compute(Ri(e.inputs[0],`Cosh`,`cosh`))},$i=e=>Yn(e),ea=(e,t)=>{let n=er(e.inputs[0].dataType);e.compute(Ri(e.inputs[0],`Elu`,e=>`elu_vf32(${e})`,` + }`},Li=(e,t,n,r,i,a=e.dataType,o,s)=>{let c=[{type:12,data:Math.ceil(W.size(e.dims)/4)}];return o&&c.push(...o),{name:t,shaderCache:{hint:i,inputDependencies:[`type`]},getShaderSource:t=>Ii(t,W.size(e.dims),e.dataType,a,n,r,s),getRunData:t=>({outputs:[{dims:e.dims,dataType:a}],dispatchGroup:{x:Math.ceil(W.size(t[0].dims)/64/4)},programUniforms:c})}},Ri=e=>{e.compute(Li(e.inputs[0],`Abs`,`abs`))},zi=e=>{e.compute(Li(e.inputs[0],`Acos`,`acos`))},Bi=e=>{e.compute(Li(e.inputs[0],`Acosh`,`acosh`))},Vi=e=>{e.compute(Li(e.inputs[0],`Asin`,`asin`))},Hi=e=>{e.compute(Li(e.inputs[0],`Asinh`,`asinh`))},Ui=e=>{e.compute(Li(e.inputs[0],`Atan`,`atan`))},Wi=e=>{e.compute(Li(e.inputs[0],`Atanh`,`atanh`))},Gi=e=>Jn(e),Ki=(e,t)=>{let n;switch(t.to){case 10:n=`vec4`;break;case 1:n=`vec4`;break;case 12:n=`vec4`;break;case 6:n=`vec4`;break;case 9:n=`vec4`;break;default:throw RangeError(`not supported type (specified in attribute 'to' from 'Cast' operator): ${t.to}`)}e.compute(Li(e.inputs[0],`Cast`,n,void 0,t.cacheKey,t.to))},qi=e=>{let t,n,r=e.length>=2&&e[1].data!==0,i=e.length>=3&&e[2].data!==0;switch(e[0].dataType){case 1:t=r?e[1].getFloat32Array()[0]:-34028234663852886e22,n=i?e[2].getFloat32Array()[0]:34028234663852886e22;break;case 10:t=r?e[1].getUint16Array()[0]:64511,n=i?e[2].getUint16Array()[0]:31743;break;default:throw Error(`Unsupport data type`)}return Jn({min:t,max:n})},Ji=(e,t)=>{let n=t||qi(e.inputs),r=$n(e.inputs[0].dataType);e.compute(Li(e.inputs[0],`Clip`,e=>`clamp(${e}, vec4<${r}>(uniforms.min), vec4<${r}>(uniforms.max))`,void 0,n.cacheKey,void 0,[{type:e.inputs[0].dataType,data:n.min},{type:e.inputs[0].dataType,data:n.max}],[{name:`min`,type:r},{name:`max`,type:r}]),{inputs:[0]})},Yi=e=>{e.compute(Li(e.inputs[0],`Ceil`,`ceil`))},Xi=e=>{e.compute(Li(e.inputs[0],`Cos`,`cos`))},Zi=e=>{e.compute(Li(e.inputs[0],`Cosh`,`cosh`))},Qi=e=>Jn(e),$i=(e,t)=>{let n=$n(e.inputs[0].dataType);e.compute(Li(e.inputs[0],`Elu`,e=>`elu_vf32(${e})`,` const elu_alpha_ = ${n}(${t.alpha}); fn elu_f32(a: ${n}) -> ${n} { @@ -444,7 +444,7 @@ var best_index : i32 = 0;`,`if (${e.getByIndices(`input_indices`)} ${t.selectLas fn elu_vf32(v: vec4<${n}>) -> vec4<${n}> { return vec4(elu_f32(v.x), elu_f32(v.y), elu_f32(v.z), elu_f32(v.w)); - }`,t.cacheKey))},ta=(e=`f32`)=>` + }`,t.cacheKey))},ea=(e=`f32`)=>` const r0: ${e} = 0.3275911; const r1: ${e} = 0.254829592; const r2: ${e} = -0.284496736; @@ -456,15 +456,15 @@ fn erf_vf32(v: vec4<${e}>) -> vec4<${e}> { let absv = abs(v); let x = 1.0 / (1.0 + r0 * absv); return sign(v) * (1.0 - ((((r5 * x + r4) * x + r3) * x + r2) * x + r1) * x * exp(-absv * absv)); -}`,na=e=>{let t=er(e.inputs[0].dataType);e.compute(Ri(e.inputs[0],`Erf`,e=>`erf_vf32(${e})`,ta(t)))},ra=e=>{e.compute(Ri(e.inputs[0],`Exp`,`exp`))},ia=e=>{e.compute(Ri(e.inputs[0],`Floor`,`floor`))},aa=e=>{let t=er(e.inputs[0].dataType);e.compute(Ri(e.inputs[0],`Gelu`,e=>`0.5 * ${e} * (1.0 + erf_vf32(${e} * 0.7071067811865475))`,ta(t)))},oa=(e,t)=>{let n=er(e.inputs[0].dataType);e.compute(Ri(e.inputs[0],`LeakyRelu`,e=>`select(leaky_relu_alpha_ * ${e}, ${e}, ${e} >= vec4<${n}>(0.0))`,`const leaky_relu_alpha_ = ${n}(${t.alpha});`,t.cacheKey))},sa=e=>{e.compute(Ri(e.inputs[0],`Not`,e=>`!${e}`))},ca=e=>{e.compute(Ri(e.inputs[0],`Neg`,e=>`-${e}`))},la=e=>{e.compute(Ri(e.inputs[0],`Reciprocal`,e=>`1.0/${e}`))},ua=e=>{let t=er(e.inputs[0].dataType);e.compute(Ri(e.inputs[0],`Relu`,e=>`select(vec4<${t}>(0.0), ${e}, ${e} > vec4<${t}>(0.0))`))},da=e=>{e.compute(Ri(e.inputs[0],`Sigmoid`,e=>`(1.0 / (1.0 + exp(-${e})))`))},fa=e=>Yn(e),pa=(e,t)=>{let n=er(e.inputs[0].dataType);e.compute(Ri(e.inputs[0],`HardSigmoid`,e=>`max(vec4<${n}>(0.0), min(vec4<${n}>(1.0), ${t.alpha} * ${e} + vec4<${n}>(${t.beta})))`,void 0,t.cacheKey))},ma=e=>{e.compute(Ri(e.inputs[0],`Sin`,`sin`))},ha=e=>{e.compute(Ri(e.inputs[0],`Sinh`,`sinh`))},ga=e=>{e.compute(Ri(e.inputs[0],`Sqrt`,`sqrt`))},_a=e=>{e.compute(Ri(e.inputs[0],`Tan`,`tan`))},va=e=>`sign(${e}) * (1 - exp(-2 * abs(${e}))) / (1 + exp(-2 * abs(${e})))`,ya=e=>{e.compute(Ri(e.inputs[0],`Tanh`,va))},ba=(e=`f32`)=>` +}`,ta=e=>{let t=$n(e.inputs[0].dataType);e.compute(Li(e.inputs[0],`Erf`,e=>`erf_vf32(${e})`,ea(t)))},na=e=>{e.compute(Li(e.inputs[0],`Exp`,`exp`))},ra=e=>{e.compute(Li(e.inputs[0],`Floor`,`floor`))},ia=e=>{let t=$n(e.inputs[0].dataType);e.compute(Li(e.inputs[0],`Gelu`,e=>`0.5 * ${e} * (1.0 + erf_vf32(${e} * 0.7071067811865475))`,ea(t)))},aa=(e,t)=>{let n=$n(e.inputs[0].dataType);e.compute(Li(e.inputs[0],`LeakyRelu`,e=>`select(leaky_relu_alpha_ * ${e}, ${e}, ${e} >= vec4<${n}>(0.0))`,`const leaky_relu_alpha_ = ${n}(${t.alpha});`,t.cacheKey))},oa=e=>{e.compute(Li(e.inputs[0],`Not`,e=>`!${e}`))},sa=e=>{e.compute(Li(e.inputs[0],`Neg`,e=>`-${e}`))},ca=e=>{e.compute(Li(e.inputs[0],`Reciprocal`,e=>`1.0/${e}`))},la=e=>{let t=$n(e.inputs[0].dataType);e.compute(Li(e.inputs[0],`Relu`,e=>`select(vec4<${t}>(0.0), ${e}, ${e} > vec4<${t}>(0.0))`))},ua=e=>{e.compute(Li(e.inputs[0],`Sigmoid`,e=>`(1.0 / (1.0 + exp(-${e})))`))},da=e=>Jn(e),fa=(e,t)=>{let n=$n(e.inputs[0].dataType);e.compute(Li(e.inputs[0],`HardSigmoid`,e=>`max(vec4<${n}>(0.0), min(vec4<${n}>(1.0), ${t.alpha} * ${e} + vec4<${n}>(${t.beta})))`,void 0,t.cacheKey))},pa=e=>{e.compute(Li(e.inputs[0],`Sin`,`sin`))},ma=e=>{e.compute(Li(e.inputs[0],`Sinh`,`sinh`))},ha=e=>{e.compute(Li(e.inputs[0],`Sqrt`,`sqrt`))},ga=e=>{e.compute(Li(e.inputs[0],`Tan`,`tan`))},_a=e=>`sign(${e}) * (1 - exp(-2 * abs(${e}))) / (1 + exp(-2 * abs(${e})))`,va=e=>{e.compute(Li(e.inputs[0],`Tanh`,_a))},ya=(e=`f32`)=>` const fast_gelu_a: ${e} = 0.5; const fast_gelu_b: ${e} = 0.7978845608028654; const fast_gelu_c: ${e} = 0.035677408136300125; fn tanh_v(v: vec4<${e}>) -> vec4<${e}> { - return ${va(`v`)}; + return ${_a(`v`)}; } -`,xa=e=>`(fast_gelu_a + fast_gelu_a * tanh_v(${e} * (fast_gelu_c * ${e} * ${e} + fast_gelu_b))) * ${e}`,Sa=e=>{let t=er(e.inputs[0].dataType);e.compute(Ri(e.inputs[0],`FastGelu`,xa,ba(t),void 0,e.inputs[0].dataType))},Ca=(e,t)=>{let n=er(e.inputs[0].dataType);return e.compute(Ri(e.inputs[0],`ThresholdedRelu`,e=>`select(vec4<${n}>(0.0), ${e}, ${e} > thresholded_relu_alpha_)`,`const thresholded_relu_alpha_ = vec4<${n}>(${t.alpha});`,t.cacheKey)),0},wa=e=>{e.compute(Ri(e.inputs[0],`Log`,`log`))},Ta=(e,t)=>` +`,ba=e=>`(fast_gelu_a + fast_gelu_a * tanh_v(${e} * (fast_gelu_c * ${e} * ${e} + fast_gelu_b))) * ${e}`,xa=e=>{let t=$n(e.inputs[0].dataType);e.compute(Li(e.inputs[0],`FastGelu`,ba,ya(t),void 0,e.inputs[0].dataType))},Sa=(e,t)=>{let n=$n(e.inputs[0].dataType);return e.compute(Li(e.inputs[0],`ThresholdedRelu`,e=>`select(vec4<${n}>(0.0), ${e}, ${e} > thresholded_relu_alpha_)`,`const thresholded_relu_alpha_ = vec4<${n}>(${t.alpha});`,t.cacheKey)),0},Ca=e=>{e.compute(Li(e.inputs[0],`Log`,`log`))},wa=(e,t)=>` const alpha = vec4<${e}>(${t}); const one = ${e}(1.0); const zero = ${e}(0.0); @@ -481,13 +481,13 @@ fn quick_gelu_impl(x: vec4<${e}>) -> vec4<${e}> { } return x * x1; } -`,Ea=e=>`quick_gelu_impl(${e})`,Da=(e,t)=>{let n=er(e.inputs[0].dataType);e.compute(Ri(e.inputs[0],`QuickGelu`,Ea,Ta(n,t.alpha),t.cacheKey,e.inputs[0].dataType))}}),ka,Aa,ja,Ma=M(()=>{"use strict";W(),Y(),Oa(),ka=e=>{if(e[0].dims.length!==3)throw Error(`input should have 3 dimensions`);if(![2560,5120,10240].includes(e[0].dims[2]))throw Error(`hidden state should be 2560, 5120 or 10240`);if(e[1].dims.length!==1)throw Error(`bias is expected to have 1 dimensions`);if(e[0].dims[2]!==e[1].dims[0])throw Error(`last dimension of input and bias are not the same`)},Aa=e=>{let t=e[0].dims.slice();t[2]/=2;let n=q(`input`,e[0].dataType,e[0].dims,4),r=q(`bias`,e[0].dataType,[e[0].dims[2]],4),i=J(`output`,e[0].dataType,t,4),a=U.size(t)/4,o=$n(e[0].dataType);return{name:`BiasSplitGelu`,getRunData:()=>({outputs:[{dims:t,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(a/64)}}),getShaderSource:t=>` +`,Ta=e=>`quick_gelu_impl(${e})`,Ea=(e,t)=>{let n=$n(e.inputs[0].dataType);e.compute(Li(e.inputs[0],`QuickGelu`,Ta,wa(n,t.alpha),t.cacheKey,e.inputs[0].dataType))}}),Oa,ka,Aa,ja=M(()=>{"use strict";G(),X(),Da(),Oa=e=>{if(e[0].dims.length!==3)throw Error(`input should have 3 dimensions`);if(![2560,5120,10240].includes(e[0].dims[2]))throw Error(`hidden state should be 2560, 5120 or 10240`);if(e[1].dims.length!==1)throw Error(`bias is expected to have 1 dimensions`);if(e[0].dims[2]!==e[1].dims[0])throw Error(`last dimension of input and bias are not the same`)},ka=e=>{let t=e[0].dims.slice();t[2]/=2;let n=J(`input`,e[0].dataType,e[0].dims,4),r=J(`bias`,e[0].dataType,[e[0].dims[2]],4),i=Y(`output`,e[0].dataType,t,4),a=W.size(t)/4,o=Qn(e[0].dataType);return{name:`BiasSplitGelu`,getRunData:()=>({outputs:[{dims:t,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(a/64)}}),getShaderSource:t=>` const M_SQRT2 = sqrt(2.0); const halfChannels = ${e[0].dims[2]/4/2}u; ${t.declareVariables(n,r,i)} - ${ta(o)} + ${ea(o)} ${t.mainStart()} ${t.guardAgainstOutOfBoundsWorkgroupSizes(a)} @@ -499,7 +499,7 @@ fn quick_gelu_impl(x: vec4<${e}>) -> vec4<${e}> { let geluRight = valueRight * 0.5 * (erf_vf32(valueRight / M_SQRT2) + 1); ${i.setByOffset(`global_idx`,`valueLeft * geluRight`)} - }`}},ja=e=>{ka(e.inputs),e.compute(Aa(e.inputs))}}),Na,Pa,Fa,Ia,La,Ra,za,Ba,Va,Ha,Ua,Wa,Ga,Ka=M(()=>{"use strict";V(),W(),Y(),Na=(e,t,n,r,i,a,o,s,c,l,u,d)=>{let f,p;typeof s==`string`?f=p=(e,t)=>`${s}((${e}),(${t}))`:typeof s==`function`?f=p=s:(f=s.scalar,p=s.vector);let m=J(`outputData`,u,r.length,4),h=q(`aData`,c,t.length,4),g=q(`bData`,l,n.length,4),_;if(i)if(a){let e=U.size(t)===1,r=U.size(n)===1,i=t.length>0&&t[t.length-1]%4==0,a=n.length>0&&n[n.length-1]%4==0;_=e||r?m.setByOffset(`global_idx`,p(e?`${h.type.value}(${h.getByOffset(`0`)}.x)`:h.getByOffset(`global_idx`),r?`${g.type.value}(${g.getByOffset(`0`)}.x)`:g.getByOffset(`global_idx`))):` + }`}},Aa=e=>{Oa(e.inputs),e.compute(ka(e.inputs))}}),Ma,Na,Pa,Fa,Ia,La,Ra,za,Ba,Va,Ha,Ua,Wa,Ga=M(()=>{"use strict";U(),G(),X(),Ma=(e,t,n,r,i,a,o,s,c,l,u,d)=>{let f,p;typeof s==`string`?f=p=(e,t)=>`${s}((${e}),(${t}))`:typeof s==`function`?f=p=s:(f=s.scalar,p=s.vector);let m=Y(`outputData`,u,r.length,4),h=J(`aData`,c,t.length,4),g=J(`bData`,l,n.length,4),_;if(i)if(a){let e=W.size(t)===1,r=W.size(n)===1,i=t.length>0&&t[t.length-1]%4==0,a=n.length>0&&n[n.length-1]%4==0;_=e||r?m.setByOffset(`global_idx`,p(e?`${h.type.value}(${h.getByOffset(`0`)}.x)`:h.getByOffset(`global_idx`),r?`${g.type.value}(${g.getByOffset(`0`)}.x)`:g.getByOffset(`global_idx`))):` let outputIndices = ${m.offsetToIndices(`global_idx * 4u`)}; let offsetA = ${h.broadcastedIndicesToOffset(`outputIndices`,m)}; let offsetB = ${g.broadcastedIndicesToOffset(`outputIndices`,m)}; @@ -532,7 +532,7 @@ fn quick_gelu_impl(x: vec4<${e}>) -> vec4<${e}> { ${e.mainStart()} ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.vec_size`)} ${_} - }`},Pa=(e,t,n,r,i,a,o=n.dataType)=>{let s=n.dims.map(e=>Number(e)??1),c=r.dims.map(e=>Number(e)??1),l=!U.areEqual(s,c),u=s,d=U.size(s),f=!1,p=!1,m=[l];if(l){let e=hn.calcShape(s,c,!1);if(!e)throw Error(`Can't perform binary op on the given tensors`);u=e.slice(),d=U.size(u);let t=U.size(s)===1,n=U.size(c)===1,r=s.length>0&&s[s.length-1]%4==0,i=c.length>0&&c[c.length-1]%4==0;m.push(t),m.push(n),m.push(r),m.push(i);let a=1;for(let e=1;ee.toString()).join(`_`),inputDependencies:[`rank`,`rank`]},getShaderSource:e=>Na(e,s,c,u,f,l,p,i,n.dataType,r.dataType,o,a),getRunData:()=>({outputs:[{dims:u,dataType:o}],dispatchGroup:{x:Math.ceil(d/64/4)},programUniforms:[{type:12,data:Math.ceil(U.size(u)/4)},...G(s,c,u)]})}},Fa=(e,t,n,r,i,a)=>{e.compute(Pa(t,i??``,e.inputs[0],e.inputs[1],n,r,a))},Ia=e=>{Fa(e,`Add`,(e,t)=>`${e}+${t}`)},La=e=>{Fa(e,`Div`,(e,t)=>`${e}/${t}`)},Ra=e=>{Fa(e,`Equal`,{scalar:(e,t)=>`u32(${e}==${t})`,vector:(e,t)=>`vec4(${e}==${t})`},void 0,void 0,9)},za=e=>{Fa(e,`Mul`,(e,t)=>`${e}*${t}`)},Ba=e=>{let t=q(`input`,e.inputs[0].dataType,e.inputs[0].dims).type.value;Fa(e,`Pow`,{scalar:(e,t)=>`pow_custom(${e},${t})`,vector:(e,t)=>`pow_vector_custom(${e},${t})`},` + }`},Na=(e,t,n,r,i,a,o=n.dataType)=>{let s=n.dims.map(e=>Number(e)??1),c=r.dims.map(e=>Number(e)??1),l=!W.areEqual(s,c),u=s,d=W.size(s),f=!1,p=!1,m=[l];if(l){let e=mn.calcShape(s,c,!1);if(!e)throw Error(`Can't perform binary op on the given tensors`);u=e.slice(),d=W.size(u);let t=W.size(s)===1,n=W.size(c)===1,r=s.length>0&&s[s.length-1]%4==0,i=c.length>0&&c[c.length-1]%4==0;m.push(t),m.push(n),m.push(r),m.push(i);let a=1;for(let e=1;ee.toString()).join(`_`),inputDependencies:[`rank`,`rank`]},getShaderSource:e=>Ma(e,s,c,u,f,l,p,i,n.dataType,r.dataType,o,a),getRunData:()=>({outputs:[{dims:u,dataType:o}],dispatchGroup:{x:Math.ceil(d/64/4)},programUniforms:[{type:12,data:Math.ceil(W.size(u)/4)},...K(s,c,u)]})}},Pa=(e,t,n,r,i,a)=>{e.compute(Na(t,i??``,e.inputs[0],e.inputs[1],n,r,a))},Fa=e=>{Pa(e,`Add`,(e,t)=>`${e}+${t}`)},Ia=e=>{Pa(e,`Div`,(e,t)=>`${e}/${t}`)},La=e=>{Pa(e,`Equal`,{scalar:(e,t)=>`u32(${e}==${t})`,vector:(e,t)=>`vec4(${e}==${t})`},void 0,void 0,9)},Ra=e=>{Pa(e,`Mul`,(e,t)=>`${e}*${t}`)},za=e=>{let t=J(`input`,e.inputs[0].dataType,e.inputs[0].dims).type.value;Pa(e,`Pow`,{scalar:(e,t)=>`pow_custom(${e},${t})`,vector:(e,t)=>`pow_vector_custom(${e},${t})`},` fn pow_custom(a : ${t}, b : ${t}) -> ${t} { if (b == ${t}(0.0)) { return ${t}(1.0); @@ -545,7 +545,7 @@ fn quick_gelu_impl(x: vec4<${e}>) -> vec4<${e}> { // TODO: implement vectorized pow return vec4<${t}>(pow_custom(a.x, b.x), pow_custom(a.y, b.y), pow_custom(a.z, b.z), pow_custom(a.w, b.w)); } - `)},Va=e=>{Fa(e,`Sub`,(e,t)=>`${e}-${t}`)},Ha=e=>{Fa(e,`Greater`,{scalar:(e,t)=>`u32(${e}>${t})`,vector:(e,t)=>`vec4(${e}>${t})`},void 0,void 0,9)},Ua=e=>{Fa(e,`Less`,{scalar:(e,t)=>`u32(${e}<${t})`,vector:(e,t)=>`vec4(${e}<${t})`},void 0,void 0,9)},Wa=e=>{Fa(e,`GreaterOrEqual`,{scalar:(e,t)=>`u32(${e}>=${t})`,vector:(e,t)=>`vec4(${e}>=${t})`},void 0,void 0,9)},Ga=e=>{Fa(e,`LessOrEqual`,{scalar:(e,t)=>`u32(${e}<=${t})`,vector:(e,t)=>`vec4(${e}<=${t})`},void 0,void 0,9)}}),qa,Ja,Ya,Xa,Za,Qa,$a=M(()=>{"use strict";V(),W(),Xn(),Y(),qa=(e,t)=>{if(!e||e.length<1)throw Error(`too few inputs`);let n=0,r=e[n],i=r.dataType,a=r.dims.length;e.forEach((e,o)=>{if(o!==n){if(e.dataType!==i)throw Error(`input tensors should be one type`);if(e.dims.length!==a)throw Error(`input tensors should have the same shape`);e.dims.forEach((e,n)=>{if(n!==t&&e!==r.dims[n])throw Error(`non concat dimensions must match`)})}})},Ja=(e,t)=>` + `)},Ba=e=>{Pa(e,`Sub`,(e,t)=>`${e}-${t}`)},Va=e=>{Pa(e,`Greater`,{scalar:(e,t)=>`u32(${e}>${t})`,vector:(e,t)=>`vec4(${e}>${t})`},void 0,void 0,9)},Ha=e=>{Pa(e,`Less`,{scalar:(e,t)=>`u32(${e}<${t})`,vector:(e,t)=>`vec4(${e}<${t})`},void 0,void 0,9)},Ua=e=>{Pa(e,`GreaterOrEqual`,{scalar:(e,t)=>`u32(${e}>=${t})`,vector:(e,t)=>`vec4(${e}>=${t})`},void 0,void 0,9)},Wa=e=>{Pa(e,`LessOrEqual`,{scalar:(e,t)=>`u32(${e}<=${t})`,vector:(e,t)=>`vec4(${e}<=${t})`},void 0,void 0,9)}}),Ka,qa,Ja,Ya,Xa,Za,Qa=M(()=>{"use strict";U(),G(),Yn(),X(),Ka=(e,t)=>{if(!e||e.length<1)throw Error(`too few inputs`);let n=0,r=e[n],i=r.dataType,a=r.dims.length;e.forEach((e,o)=>{if(o!==n){if(e.dataType!==i)throw Error(`input tensors should be one type`);if(e.dims.length!==a)throw Error(`input tensors should have the same shape`);e.dims.forEach((e,n)=>{if(n!==t&&e!==r.dims[n])throw Error(`non concat dimensions must match`)})}})},qa=(e,t)=>` fn calculateInputIndex(index: u32) -> u32 { let sizeInConcatAxis = array(${t}); for (var i: u32 = 0u; i < ${e}; i += 1u ) { @@ -554,12 +554,12 @@ fn quick_gelu_impl(x: vec4<${e}>) -> vec4<${e}> { } } return ${e}u; - }`,Ya=(e,t)=>{let n=e.length,r=[];for(let i=0;i{let i=U.size(n),a=Array(e.length),o=Array(e.length),s=0,c=[],l=[],u=[{type:12,data:i}];for(let n=0;n`uniforms.sizeInConcatAxis${e}`).join(`,`),m=t=>` + }`,Ja=(e,t)=>{let n=e.length,r=[];for(let i=0;i{let i=W.size(n),a=Array(e.length),o=Array(e.length),s=0,c=[],l=[],u=[{type:12,data:i}];for(let n=0;n`uniforms.sizeInConcatAxis${e}`).join(`,`),m=t=>` ${(()=>{t.registerUniform(`outputSize`,`u32`);for(let n=0;n) -> vec4<${e}> { ${f} -= sizeInConcatAxis[inputIndex - 1u]; } - ${Ya(o,d)} - }`;return{name:`Concat`,shaderCache:{hint:`${t}`,inputDependencies:c},getRunData:()=>({outputs:[{dims:n,dataType:r}],dispatchGroup:{x:Math.ceil(i/64)},programUniforms:u}),getShaderSource:m}},Za=(e,t)=>{let n=e.inputs,r=n[0].dims,i=U.normalizeAxis(t.axis,r.length);qa(n,i);let a=r.slice();a[i]=n.reduce((e,t)=>e+(t.dims.length>i?t.dims[i]:0),0);let o=n.filter(e=>U.size(e.dims)>0);e.compute(Xa(o,i,a,n[0].dataType),{inputs:o})},Qa=e=>Yn({axis:e.axis})}),eo,to,no,ro,io=M(()=>{"use strict";V(),W(),eo=(e,t,n=`f32`)=>{switch(e.activation){case`Relu`:return`value = max(value, ${t}(0.0));`;case`Sigmoid`:return`value = (${t}(1.0) / (${t}(1.0) + exp(-value)));`;case`Clip`:return`value = clamp(value, ${t}(${n}(uniforms.clip_min)), ${t}(${n}(uniforms.clip_max)));`;case`HardSigmoid`:return`value = max(${t}(0.0), min(${t}(1.0), ${n}(uniforms.alpha) * value + ${n}(uniforms.beta)));`;case`LeakyRelu`:return`value = select(${n}(uniforms.alpha) * value, value, value >= ${t}(0.0));`;case`Tanh`:return`let e2x = exp(-2.0 * abs(value)); + ${Ja(o,d)} + }`;return{name:`Concat`,shaderCache:{hint:`${t}`,inputDependencies:c},getRunData:()=>({outputs:[{dims:n,dataType:r}],dispatchGroup:{x:Math.ceil(i/64)},programUniforms:u}),getShaderSource:m}},Xa=(e,t)=>{let n=e.inputs,r=n[0].dims,i=W.normalizeAxis(t.axis,r.length);Ka(n,i);let a=r.slice();a[i]=n.reduce((e,t)=>e+(t.dims.length>i?t.dims[i]:0),0);let o=n.filter(e=>W.size(e.dims)>0);e.compute(Ya(o,i,a,n[0].dataType),{inputs:o})},Za=e=>Jn({axis:e.axis})}),$a,eo,to,no,ro=M(()=>{"use strict";U(),G(),$a=(e,t,n=`f32`)=>{switch(e.activation){case`Relu`:return`value = max(value, ${t}(0.0));`;case`Sigmoid`:return`value = (${t}(1.0) / (${t}(1.0) + exp(-value)));`;case`Clip`:return`value = clamp(value, ${t}(${n}(uniforms.clip_min)), ${t}(${n}(uniforms.clip_max)));`;case`HardSigmoid`:return`value = max(${t}(0.0), min(${t}(1.0), ${n}(uniforms.alpha) * value + ${n}(uniforms.beta)));`;case`LeakyRelu`:return`value = select(${n}(uniforms.alpha) * value, value, value >= ${t}(0.0));`;case`Tanh`:return`let e2x = exp(-2.0 * abs(value)); value = sign(value) * (1.0 - e2x) / (1.0 + e2x); - `;case``:return``;default:throw Error(`Unsupported activation ${e.activation}`)}},to=(e,t)=>{e.activation===`Clip`?t.push({type:1,data:e.clipMax},{type:1,data:e.clipMin}):e.activation===`HardSigmoid`?t.push({type:1,data:e.alpha},{type:1,data:e.beta}):e.activation===`LeakyRelu`&&t.push({type:1,data:e.alpha})},no=(e,t)=>{e.activation===`Clip`?t.push({name:`clip_max`,type:`f32`},{name:`clip_min`,type:`f32`}):e.activation===`HardSigmoid`?t.push({name:`alpha`,type:`f32`},{name:`beta`,type:`f32`}):e.activation===`LeakyRelu`&&t.push({name:`alpha`,type:`f32`})},ro=e=>{let t=e?.activation||``;if(t===`HardSigmoid`){let[n,r]=e?.activation_params||[.2,.5];return{activation:t,alpha:n,beta:r}}else if(t===`Clip`){let[n,r]=e?.activation_params||[vn,yn];return{activation:t,clipMax:r,clipMin:n}}else if(t===`LeakyRelu`){let[n]=e?.activation_params||[.01];return{activation:t,alpha:n}}return{activation:t}}}),ao,oo,so=M(()=>{"use strict";ao=(e,t)=>{switch(e){case 1:return t;case 2:return`vec2<${t}>`;case 3:return`vec3<${t}>`;case 4:return`vec4<${t}>`;default:throw Error(`${e}-component is not supported.`)}},oo=e=>` + `;case``:return``;default:throw Error(`Unsupported activation ${e.activation}`)}},eo=(e,t)=>{e.activation===`Clip`?t.push({type:1,data:e.clipMax},{type:1,data:e.clipMin}):e.activation===`HardSigmoid`?t.push({type:1,data:e.alpha},{type:1,data:e.beta}):e.activation===`LeakyRelu`&&t.push({type:1,data:e.alpha})},to=(e,t)=>{e.activation===`Clip`?t.push({name:`clip_max`,type:`f32`},{name:`clip_min`,type:`f32`}):e.activation===`HardSigmoid`?t.push({name:`alpha`,type:`f32`},{name:`beta`,type:`f32`}):e.activation===`LeakyRelu`&&t.push({name:`alpha`,type:`f32`})},no=e=>{let t=e?.activation||``;if(t===`HardSigmoid`){let[n,r]=e?.activation_params||[.2,.5];return{activation:t,alpha:n,beta:r}}else if(t===`Clip`){let[n,r]=e?.activation_params||[_n,vn];return{activation:t,clipMax:r,clipMin:n}}else if(t===`LeakyRelu`){let[n]=e?.activation_params||[.01];return{activation:t,alpha:n}}return{activation:t}}}),io,ao,oo=M(()=>{"use strict";io=(e,t)=>{switch(e){case 1:return t;case 2:return`vec2<${t}>`;case 3:return`vec3<${t}>`;case 4:return`vec4<${t}>`;default:throw Error(`${e}-component is not supported.`)}},ao=e=>` ${e?`value = value + getBiasByOutputCoords(coords);`:``} - `}),co,lo=M(()=>{"use strict";co=e=>` + `}),so,co=M(()=>{"use strict";so=e=>` fn getIndexFromCoords4D(coords : vec4, shape : vec4) -> i32 { return dot(coords, vec4( shape.y * shape.z * shape.w, shape.z * shape.w, shape.w, 1)); @@ -586,14 +586,14 @@ fn getOutputIndexFromCoords(coords : vec4) -> i32 { return dot(coords, vec4( i32(${e}.x), i32(${e}.y), i32(${e}.z), 1)); } -`}),uo,fo,po=M(()=>{"use strict";V(),W(),Y(),io(),uo=(e,t,n,r,i)=>{let a=r-n;return` +`}),lo,uo,fo=M(()=>{"use strict";U(),G(),X(),ro(),lo=(e,t,n,r,i)=>{let a=r-n;return` ${Array.from({length:n}).map((n,o)=>` - if (${K(t.shape,o,t.rank)} != 1) { - ${t.indicesSet(e,o,K(i,o+a,r))} + if (${q(t.shape,o,t.rank)} != 1) { + ${t.indicesSet(e,o,q(i,o+a,r))} } else { ${t.indicesSet(e,o,0)} }`).join(``)} -`},fo=(e,t,n,r,i=!1,a)=>{let o=e[0].dims,s=e[1].dims,c=o[o.length-2],l=s[s.length-1],u=o[o.length-1],d=tr(l),f=tr(u),p=tr(c),m=U.size(n)/d/p,h=e.length>2,g=r?r.slice(0,-2):n.slice(0,-2),_=[U.size(g),c,l],v=[{type:12,data:m},{type:12,data:c},{type:12,data:l},{type:12,data:u}];to(t,v),v.push(...G(g,o,s)),h&&v.push(...G(e[2].dims)),v.push(...G(_));let y=r=>{let a=sr(`batch_dims`,e[0].dataType,g.length),c=q(`a`,e[0].dataType,o.length,f),l=q(`b`,e[1].dataType,s.length,d),u=J(`output`,e[0].dataType,_.length,d),m=$n(u.type.tensor),v=eo(t,u.type.value,m),y=[c,l],b=``;if(h){let t=i?d:1;y.push(q(`bias`,e[2].dataType,e[2].dims.length,t)),b=`${i?`value += bias[col / ${t}];`:`value += ${u.type.value}(bias[row + i]);`}`}let x=[{name:`output_size`,type:`u32`},{name:`M`,type:`u32`},{name:`N`,type:`u32`},{name:`K`,type:`u32`}];no(t,x);let S=()=>{let e=`var a_data: ${c.type.value};`;for(let t=0;t{let o=e[0].dims,s=e[1].dims,c=o[o.length-2],l=s[s.length-1],u=o[o.length-1],d=er(l),f=er(u),p=er(c),m=W.size(n)/d/p,h=e.length>2,g=r?r.slice(0,-2):n.slice(0,-2),_=[W.size(g),c,l],v=[{type:12,data:m},{type:12,data:c},{type:12,data:l},{type:12,data:u}];eo(t,v),v.push(...K(g,o,s)),h&&v.push(...K(e[2].dims)),v.push(...K(_));let y=r=>{let a=or(`batch_dims`,e[0].dataType,g.length),c=J(`a`,e[0].dataType,o.length,f),l=J(`b`,e[1].dataType,s.length,d),u=Y(`output`,e[0].dataType,_.length,d),m=Qn(u.type.tensor),v=$a(t,u.type.value,m),y=[c,l],b=``;if(h){let t=i?d:1;y.push(J(`bias`,e[2].dataType,e[2].dims.length,t)),b=`${i?`value += bias[col / ${t}];`:`value += ${u.type.value}(bias[row + i]);`}`}let x=[{name:`output_size`,type:`u32`},{name:`M`,type:`u32`},{name:`N`,type:`u32`},{name:`K`,type:`u32`}];to(t,x);let S=()=>{let e=`var a_data: ${c.type.value};`;for(let t=0;t) -> i32 { ${n.length===2?``:`let batch_indices = ${a.offsetToIndices(`batch`)};`} var a_indices: ${c.type.indices}; - ${uo(`a_indices`,c,c.rank-2,a.rank,`batch_indices`)} + ${lo(`a_indices`,c,c.rank-2,a.rank,`batch_indices`)} ${c.indicesSet(`a_indices`,c.rank-2,0)} ${c.indicesSet(`a_indices`,c.rank-1,0)} let a_offset = ${c.indicesToOffset(`a_indices`)}; var b_indices: ${l.type.indices}; - ${uo(`b_indices`,l,l.rank-2,a.rank,`batch_indices`)} + ${lo(`b_indices`,l,l.rank-2,a.rank,`batch_indices`)} ${l.indicesSet(`b_indices`,l.rank-2,0)} ${l.indicesSet(`b_indices`,l.rank-1,0)} let b_offset = ${l.indicesToOffset(`b_indices`)}; @@ -632,7 +632,7 @@ fn getOutputIndexFromCoords(coords : vec4) -> i32 { ${u.setByOffset(`offset / ${d}`,`value`)}; } } - `};return{name:`MatMulNaive`,shaderCache:{hint:`${t.activation};${d};${f};${p};${i}`,inputDependencies:h?[`rank`,`rank`,`rank`]:[`rank`,`rank`]},getRunData:()=>({outputs:[{dims:a?a(n):n,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(m/64)},programUniforms:v}),getShaderSource:y}}}),mo,ho,go,_o,vo,yo,bo,xo,So=M(()=>{"use strict";V(),W(),Y(),io(),po(),so(),mo=(e,t)=>e?` + `};return{name:`MatMulNaive`,shaderCache:{hint:`${t.activation};${d};${f};${p};${i}`,inputDependencies:h?[`rank`,`rank`,`rank`]:[`rank`,`rank`]},getRunData:()=>({outputs:[{dims:a?a(n):n,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(m/64)},programUniforms:v}),getShaderSource:y}}}),po,mo,ho,go,_o,vo,yo,bo,xo=M(()=>{"use strict";U(),G(),X(),ro(),fo(),oo(),po=(e,t)=>e?` mm_Asub[inputRow][inputCol] = mm_readA(batch, kStart + inputRow, globalRowStart / innerElementSize + inputCol${t?`, batchIndices`:``}); @@ -640,7 +640,7 @@ fn getOutputIndexFromCoords(coords : vec4) -> i32 { mm_Asub[inputRow][inputCol] = mm_readA(batch, globalRow + innerRow, kStart / innerElementSize + inputCol${t?`, batchIndices`:``}); - `,ho=(e,t)=>e?` + `,mo=(e,t)=>e?` let ACached0 = mm_Asub[k * innerElementSize][localRow]; let ACached1 = mm_Asub[k * innerElementSize + 1][localRow]; let ACached2 = mm_Asub[k * innerElementSize + 2][localRow]; @@ -657,7 +657,7 @@ fn getOutputIndexFromCoords(coords : vec4) -> i32 { acc[i] = BCached1 * ACached.y + acc[i]; acc[i] = BCached2 * ACached.z + acc[i]; ${t===3?``:`acc[i] = BCached3 * ACached.w + acc[i];`} - }`,go=(e,t,n=`f32`,r,i=!1,a=32,o=!1,s=32)=>{let c=t[1]*e[1],l=t[0]*e[0],u=i?c:a,d=i?a:c,f=u/t[0],p=a/t[1];if(!((i&&f===4&&e[1]===4||!i&&(f===3||f===4))&&u%t[0]===0&&a%t[1]===0&&e[0]===4))throw Error(`If transposeA ${i} is true, innerElementSize ${f} and workPerThread[1] ${e[1]} must be 4. + }`,ho=(e,t,n=`f32`,r,i=!1,a=32,o=!1,s=32)=>{let c=t[1]*e[1],l=t[0]*e[0],u=i?c:a,d=i?a:c,f=u/t[0],p=a/t[1];if(!((i&&f===4&&e[1]===4||!i&&(f===3||f===4))&&u%t[0]===0&&a%t[1]===0&&e[0]===4))throw Error(`If transposeA ${i} is true, innerElementSize ${f} and workPerThread[1] ${e[1]} must be 4. Otherwise, innerElementSize ${f} must be 3 or 4. tileAWidth ${u} must be divisible by workgroupSize[0]${t[0]}. tileInner ${a} must be divisible by workgroupSize[1] ${t[1]}. colPerThread ${e[0]} must be 4.`);return` var mm_Asub: array, ${u/f}>, ${d}>; @@ -694,7 +694,7 @@ fn main(@builtin(local_invocation_id) localId : vec3, for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) { let inputRow = tileRow + innerRow; let inputCol = tileCol; - ${mo(i,r)} + ${po(i,r)} } // Load one tile of B into local memory. @@ -713,7 +713,7 @@ fn main(@builtin(local_invocation_id) localId : vec3, let BCached2 = mm_Bsub[k * innerElementSize + 2][tileCol]; ${f===3?``:`let BCached3 = mm_Bsub[k * innerElementSize + 3][tileCol];`} - ${ho(i,f)} + ${mo(i,f)} } workgroupBarrier(); @@ -722,7 +722,7 @@ fn main(@builtin(local_invocation_id) localId : vec3, for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) { mm_write(batch, globalRow + innerRow, globalCol, acc[innerRow]); } -}`},_o=(e,t)=>e?` +}`},go=(e,t)=>e?` mm_Asub[inputRow][inputCol] = mm_readA(batch, kStart + inputRow, globalRowStart + inputCol${t?`, batchIndices`:``}); @@ -730,7 +730,7 @@ fn main(@builtin(local_invocation_id) localId : vec3, mm_Asub[inputRow][inputCol] = mm_readA(batch, globalRowStart + inputRow, kStart + inputCol${t?`, batchIndices`:``}); - `,vo=e=>e?`let ACached = mm_Asub[k][tileRow + innerRow];`:`let ACached = mm_Asub[tileRow + innerRow][k];`,yo=(e,t,n=`f32`,r,i=!1,a=32,o=!1,s=32,c=!1)=>{let l=e[1]*t[1],u=e[0]*t[0],d=i?l:a,f=i?a:l;if(!(f%t[1]===0&&d%t[0]===0&&a%t[1]===0))throw Error(`tileAHight ${f} must be divisible by workgroupSize[1]${t[1]}, tileAWidth ${d} must be divisible by workgroupSize[0]${t[0]}, tileInner ${a} must be divisible by workgroupSize[1]${t[1]}`);let p=f/t[1],m=d/t[0],h=a/t[1],g=c?` + `,_o=e=>e?`let ACached = mm_Asub[k][tileRow + innerRow];`:`let ACached = mm_Asub[tileRow + innerRow][k];`,vo=(e,t,n=`f32`,r,i=!1,a=32,o=!1,s=32,c=!1)=>{let l=e[1]*t[1],u=e[0]*t[0],d=i?l:a,f=i?a:l;if(!(f%t[1]===0&&d%t[0]===0&&a%t[1]===0))throw Error(`tileAHight ${f} must be divisible by workgroupSize[1]${t[1]}, tileAWidth ${d} must be divisible by workgroupSize[0]${t[0]}, tileInner ${a} must be divisible by workgroupSize[1]${t[1]}`);let p=f/t[1],m=d/t[0],h=a/t[1],g=c?` let localRow = i32(localId.y); let localCol = i32(localId.x); let globalRowStart = i32(workgroupId.y) * ${l}; @@ -741,7 +741,7 @@ fn main(@builtin(local_invocation_id) localId : vec3, // Load one tile of A into local memory. for (var inputRow = localRow; inputRow < ${f}; inputRow = inputRow + ${t[1]}) { for (var inputCol = localCol; inputCol < ${d}; inputCol = inputCol + ${t[0]}) { - ${_o(i,r)} + ${go(i,r)} } } // Load one tile of B into local memory. @@ -796,7 +796,7 @@ for (var t = 0; t < num_tiles; t = t + 1) { for (var innerCol = 0; innerCol < ${m}; innerCol = innerCol + 1) { let inputRow = tileRowA + innerRow; let inputCol = tileColA + innerCol; - ${_o(i,r)} + ${go(i,r)} } } @@ -821,7 +821,7 @@ for (var t = 0; t < num_tiles; t = t + 1) { } for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) { - ${vo(i)} + ${_o(i)} for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) { acc[innerRow][innerCol] = acc[innerRow][innerCol] + ACached * BCached[innerCol]; } @@ -856,14 +856,14 @@ fn main(@builtin(local_invocation_id) localId : vec3, var acc : array, rowPerThread>; ${g} } -`},bo=(e,t,n,r,i=!1)=>{let[a,o,s,c]=r,l=$n(r[0].type.tensor);return` - fn mm_readA(batch: i32, row: i32, colIn: i32, batchIndices: ${a.type.indices}) -> ${ao(e,l)} { - var value = ${ao(e,l)}(0.0); +`},yo=(e,t,n,r,i=!1)=>{let[a,o,s,c]=r,l=Qn(r[0].type.tensor);return` + fn mm_readA(batch: i32, row: i32, colIn: i32, batchIndices: ${a.type.indices}) -> ${io(e,l)} { + var value = ${io(e,l)}(0.0); let col = colIn * ${e}; if(row < uniforms.dim_a_outer && col < uniforms.dim_inner) { var aIndices: ${o.type.indices}; - ${uo(`aIndices`,o,o.rank-2,a.rank,`batchIndices`)} + ${lo(`aIndices`,o,o.rank-2,a.rank,`batchIndices`)} ${o.indicesSet(`aIndices`,o.rank-2,`u32(row)`)} ${o.indicesSet(`aIndices`,o.rank-1,`u32(colIn)`)} value = ${o.getByIndices(`aIndices`)}; @@ -871,13 +871,13 @@ fn main(@builtin(local_invocation_id) localId : vec3, return value; } - fn mm_readB(batch: i32, row: i32, colIn: i32, batchIndices: ${a.type.indices}) -> ${ao(e,l)} { - var value = ${ao(e,l)}(0.0); + fn mm_readB(batch: i32, row: i32, colIn: i32, batchIndices: ${a.type.indices}) -> ${io(e,l)} { + var value = ${io(e,l)}(0.0); let col = colIn * ${e}; if(row < uniforms.dim_inner && col < uniforms.dim_b_outer) { var bIndices: ${s.type.indices}; - ${uo(`bIndices`,s,s.rank-2,a.rank,`batchIndices`)} + ${lo(`bIndices`,s,s.rank-2,a.rank,`batchIndices`)} ${s.indicesSet(`bIndices`,s.rank-2,`u32(row)`)} ${s.indicesSet(`bIndices`,s.rank-1,`u32(colIn)`)} value = ${s.getByIndices(`bIndices`)}; @@ -885,21 +885,21 @@ fn main(@builtin(local_invocation_id) localId : vec3, return value; } - fn mm_write(batch: i32, row: i32, colIn: i32, valueIn: ${ao(e,l)}) { + fn mm_write(batch: i32, row: i32, colIn: i32, valueIn: ${io(e,l)}) { let col = colIn * ${e}; if (row < uniforms.dim_a_outer && col < uniforms.dim_b_outer) { var value = valueIn; let coords = vec3(batch, row, colIn); - ${t?`value = value + ${i?`bias[colIn]`:`${ao(e,l)}(bias[row])`};`:``} + ${t?`value = value + ${i?`bias[colIn]`:`${io(e,l)}(bias[row])`};`:``} ${n} ${c.setByIndices(`vec3(coords)`,`value`)} } } - `},xo=(e,t,n,r,i=!1,a)=>{let o=e[0].dims,s=e[1].dims,c=o.slice(0,-2),l=s.slice(0,-2),u=r?r.slice(0,-2):n.slice(0,-2),d=U.size(u),f=o[o.length-2],p=o[o.length-1],m=s[s.length-1],h=p%4==0&&m%4==0,g=f<=8?[4,1,1]:[4,4,1],_=[8,8,1],v=[Math.ceil(m/_[0]/g[0]),Math.ceil(f/_[1]/g[1]),Math.ceil(d/_[2]/g[2])],y=h?4:1,b=[...c,f,p/y],x=b.length,S=[...l,p,m/y],C=S.length,w=[d,f,m/y],T=[{type:6,data:f},{type:6,data:m},{type:6,data:p}];to(t,T),T.push(...G(u,b,S));let E=[`rank`,`rank`],D=e.length>2;D&&(T.push(...G(e[2].dims)),E.push(`rank`)),T.push(...G(w));let O=n=>{let r=u.length,a=sr(`batchDims`,e[0].dataType,r,1),o=$n(e[0].dataType),s=q(`a`,e[0].dataType,x,y),c=q(`b`,e[1].dataType,C,y),l=J(`result`,e[0].dataType,w.length,y),d=[s,c];if(D){let t=i?y:1;d.push(q(`bias`,e[2].dataType,e[2].dims.length,t))}let f=[{name:`dim_a_outer`,type:`i32`},{name:`dim_b_outer`,type:`i32`},{name:`dim_inner`,type:`i32`}];no(t,f);let p=$n(l.type.tensor),m=eo(t,l.type.value,p),v=bo(y,D,m,[a,s,c,l],i);return` + `},bo=(e,t,n,r,i=!1,a)=>{let o=e[0].dims,s=e[1].dims,c=o.slice(0,-2),l=s.slice(0,-2),u=r?r.slice(0,-2):n.slice(0,-2),d=W.size(u),f=o[o.length-2],p=o[o.length-1],m=s[s.length-1],h=p%4==0&&m%4==0,g=f<=8?[4,1,1]:[4,4,1],_=[8,8,1],v=[Math.ceil(m/_[0]/g[0]),Math.ceil(f/_[1]/g[1]),Math.ceil(d/_[2]/g[2])],y=h?4:1,b=[...c,f,p/y],x=b.length,S=[...l,p,m/y],C=S.length,w=[d,f,m/y],T=[{type:6,data:f},{type:6,data:m},{type:6,data:p}];eo(t,T),T.push(...K(u,b,S));let E=[`rank`,`rank`],D=e.length>2;D&&(T.push(...K(e[2].dims)),E.push(`rank`)),T.push(...K(w));let O=n=>{let r=u.length,a=or(`batchDims`,e[0].dataType,r,1),o=Qn(e[0].dataType),s=J(`a`,e[0].dataType,x,y),c=J(`b`,e[1].dataType,C,y),l=Y(`result`,e[0].dataType,w.length,y),d=[s,c];if(D){let t=i?y:1;d.push(J(`bias`,e[2].dataType,e[2].dims.length,t))}let f=[{name:`dim_a_outer`,type:`i32`},{name:`dim_b_outer`,type:`i32`},{name:`dim_inner`,type:`i32`}];to(t,f);let p=Qn(l.type.tensor),m=$a(t,l.type.value,p),v=yo(y,D,m,[a,s,c,l],i);return` ${n.registerUniforms(f).registerInternalVariables(a).declareVariables(...d,l)} ${v} - ${h?go(g,_,o,a):yo(g,_,o,a)} - `};return{name:`MatMul`,shaderCache:{hint:`${g};${t.activation};${h};${i}`,inputDependencies:E},getRunData:()=>({outputs:[{dims:a?a(n):n,dataType:e[0].dataType}],dispatchGroup:{x:v[0],y:v[1],z:v[2]},programUniforms:T}),getShaderSource:O}}}),Co,wo,To=M(()=>{"use strict";V(),pn(),Y(),io(),so(),lo(),So(),Co=(e,t,n,r,i=!1,a,o=4,s=4,c=4,l=`f32`)=>{let u=e=>{switch(e){case 1:return`resData = x[xIndex];`;case 3:return`resData = vec3<${l}>(x[xIndex], x[xIndex + 1], x[xIndex + 2]);`;case 4:return`resData = x[xIndex / 4];`;default:throw Error(`innerElementSize ${e} is not supported.`)}},d=e=>{switch(e){case 1:return`return w[row * i32(uniforms.w_shape[3]) + colIn];`;case 4:return`return w[row * i32(uniforms.w_shape[3]) / 4 + colIn];`;default:throw Error(`innerElementSize ${e} is not supported.`)}},f=e?` + ${h?ho(g,_,o,a):vo(g,_,o,a)} + `};return{name:`MatMul`,shaderCache:{hint:`${g};${t.activation};${h};${i}`,inputDependencies:E},getRunData:()=>({outputs:[{dims:a?a(n):n,dataType:e[0].dataType}],dispatchGroup:{x:v[0],y:v[1],z:v[2]},programUniforms:T}),getShaderSource:O}}}),So,Co,wo=M(()=>{"use strict";U(),fn(),X(),ro(),oo(),co(),xo(),So=(e,t,n,r,i=!1,a,o=4,s=4,c=4,l=`f32`)=>{let u=e=>{switch(e){case 1:return`resData = x[xIndex];`;case 3:return`resData = vec3<${l}>(x[xIndex], x[xIndex + 1], x[xIndex + 2]);`;case 4:return`resData = x[xIndex / 4];`;default:throw Error(`innerElementSize ${e} is not supported.`)}},d=e=>{switch(e){case 1:return`return w[row * i32(uniforms.w_shape[3]) + colIn];`;case 4:return`return w[row * i32(uniforms.w_shape[3]) / 4 + colIn];`;default:throw Error(`innerElementSize ${e} is not supported.`)}},f=e?` let coord = vec4(batch, xRow, xCol, xCh); `:` let coord = vec4(batch, xCh, xRow, xCol); @@ -926,7 +926,7 @@ fn main(@builtin(local_invocation_id) localId : vec3, let xRow = outRow * uniforms.stride[0] + uniforms.dilation[0] * WRow - uniforms.pad[0]; let xCol = outCol * uniforms.stride[1] + uniforms.dilation[1] * WCol - uniforms.pad[1]; let xCh = ${_} % inChannels; - var resData = ${ao(o,l)}(0.0); + var resData = ${io(o,l)}(0.0); // The bounds checking is always needed since we use it to pad zero for // the 'same' padding type. if (xRow >= 0 && xRow < ${m} && xCol >= 0 && xCol < ${h}) { @@ -941,24 +941,24 @@ fn main(@builtin(local_invocation_id) localId : vec3, if (row < uniforms.dim_a_outer && col < uniforms.dim_inner) { ${v} } - return ${ao(o,l)}(0.0);`:r&&n?` + return ${io(o,l)}(0.0);`:r&&n?` let col = colIn * ${o}; ${v}`:` let col = colIn * ${o}; if (row < uniforms.dim_inner && col < uniforms.dim_b_outer) { ${v} } - return ${ao(o,l)}(0.0);`,b=e?r&&n?d(s):` + return ${io(o,l)}(0.0);`,b=e?r&&n?d(s):` let col = colIn * ${s}; if (row < uniforms.dim_inner && col < uniforms.dim_b_outer) { ${d(s)} } - return ${ao(s,l)}(0.0);`:` + return ${io(s,l)}(0.0);`:` let col = colIn * ${s}; if (row < uniforms.dim_inner && col < uniforms.dim_a_outer) { ${d(s)} } - return ${ao(s,l)}(0.0);`,x=ao(c,l),S=ao(e?o:s,l),C=ao(e?s:o,l),w=eo(a,x,l);return` + return ${io(s,l)}(0.0);`,x=io(c,l),S=io(e?o:s,l),C=io(e?s:o,l),w=$a(a,x,l);return` fn mm_readA(batch: i32, row : i32, colIn : i32) -> ${S} { ${e?y:b} } @@ -974,32 +974,32 @@ fn main(@builtin(local_invocation_id) localId : vec3, var value = valueIn; let outWidth = ${e?`i32(uniforms.result_shape[2])`:`i32(uniforms.result_shape[3])`}; ${p} - ${oo(i)} + ${ao(i)} ${w} setOutputAtCoords(coords[0], coords[1], coords[2], coords[3], value); } - }`},wo=(e,t,n,r,i,a,o,s,c)=>{let l=t.format===`NHWC`,u=l?e[0].dims[3]:e[0].dims[1],d=n[0],f=l?n[2]:n[3],p=l?n[1]:n[2],m=l?n[3]:n[1],h=l&&(u%4==0||u%3==0)&&m%4==0,g=l?m:f*p,_=l?f*p:m,v=[8,8,1],y=r<=8?[4,1,1]:[4,4,1],b=[Math.ceil(g/v[0]/y[0]),Math.ceil(_/v[1]/y[1]),Math.ceil(d/v[2]/y[2])];H(`verbose`,()=>`[conv2d_mm_webgpu] dispatch = ${b}`);let x=h?l&&u%4!=0?3:4:1,S=v[1]*y[1],C=v[0]*y[0],w=Math.max(v[0]*x,v[1]),T=r%S===0,E=i%C===0,D=a%w===0,O=h?[x,4,4]:[1,1,1],k=[{type:6,data:r},{type:6,data:i},{type:6,data:a},{type:6,data:[t.pads[0],t.pads[1]]},{type:6,data:t.strides},{type:6,data:t.dilations}];to(t,k),k.push(...G(e[0].dims,e[1].dims));let A=[`rank`,`rank`];o&&(k.push(...G(e[2].dims)),A.push(`rank`)),k.push(...G(n));let ee=r=>{let i=[{name:`dim_a_outer`,type:`i32`},{name:`dim_b_outer`,type:`i32`},{name:`dim_inner`,type:`i32`},{name:`pad`,type:`i32`,length:2},{name:`stride`,type:`i32`,length:2},{name:`dilation`,type:`i32`,length:2}];no(t,i);let a=h?4:1,c=$n(e[0].dataType),u=` + }`},Co=(e,t,n,r,i,a,o,s,c)=>{let l=t.format===`NHWC`,u=l?e[0].dims[3]:e[0].dims[1],d=n[0],f=l?n[2]:n[3],p=l?n[1]:n[2],m=l?n[3]:n[1],h=l&&(u%4==0||u%3==0)&&m%4==0,g=l?m:f*p,_=l?f*p:m,v=[8,8,1],y=r<=8?[4,1,1]:[4,4,1],b=[Math.ceil(g/v[0]/y[0]),Math.ceil(_/v[1]/y[1]),Math.ceil(d/v[2]/y[2])];dn(`verbose`,()=>`[conv2d_mm_webgpu] dispatch = ${b}`);let x=h?l&&u%4!=0?3:4:1,S=v[1]*y[1],C=v[0]*y[0],w=Math.max(v[0]*x,v[1]),T=r%S===0,E=i%C===0,D=a%w===0,O=h?[x,4,4]:[1,1,1],k=[{type:6,data:r},{type:6,data:i},{type:6,data:a},{type:6,data:[t.pads[0],t.pads[1]]},{type:6,data:t.strides},{type:6,data:t.dilations}];eo(t,k),k.push(...K(e[0].dims,e[1].dims));let A=[`rank`,`rank`];o&&(k.push(...K(e[2].dims)),A.push(`rank`)),k.push(...K(n));let ee=r=>{let i=[{name:`dim_a_outer`,type:`i32`},{name:`dim_b_outer`,type:`i32`},{name:`dim_inner`,type:`i32`},{name:`pad`,type:`i32`,length:2},{name:`stride`,type:`i32`,length:2},{name:`dilation`,type:`i32`,length:2}];to(t,i);let a=h?4:1,c=Qn(e[0].dataType),u=` fn setOutputAtIndex(flatIndex : i32, value : ${h?`vec4<${c}>`:c}) { result[flatIndex] = ${h?`vec4<${c}>`:c}(value); } fn setOutputAtCoords(d0 : i32, d1 : i32, d2 : i32, d3 : i32, value : ${h?`vec4<${c}>`:c}) { let flatIndex = getOutputIndexFromCoords(vec4(d0, d1, d2, d3)); setOutputAtIndex(flatIndex ${h?`/ 4`:``}, value); - }`,d=q(`x`,e[0].dataType,e[0].dims.length,x===3?1:x),f=q(`w`,e[1].dataType,e[1].dims.length,a),p=[d,f],m=J(`result`,e[0].dataType,n.length,a);if(o){let t=q(`bias`,e[2].dataType,e[2].dims.length,a);p.push(t),u+=` + }`,d=J(`x`,e[0].dataType,e[0].dims.length,x===3?1:x),f=J(`w`,e[1].dataType,e[1].dims.length,a),p=[d,f],m=Y(`result`,e[0].dataType,n.length,a);if(o){let t=J(`bias`,e[2].dataType,e[2].dims.length,a);p.push(t),u+=` fn getBiasByOutputCoords(coords : vec4) -> ${h?`vec4<${c}>`:c} { return bias[coords.${l?`w`:`y`}${h?`/ 4`:``}]; }`}return` - ${co(`uniforms.result_strides`)} + ${so(`uniforms.result_strides`)} //struct Uniforms { xShape : vec4, wShape : vec4, outShape : vec4, // outShapeStrides: vec3, filterDims : vec2, pad : vec2, stride : vec2, // dilation : vec2, dimAOuter : i32, dimBOuter : i32, dimInner : i32 }; ${r.registerUniforms(i).declareVariables(...p,m)} ${u} - ${Co(l,T,E,D,o,t,O[0],O[1],O[2],c)} - ${h?go(y,v,c,void 0,!l,w):yo(y,v,c,void 0,!l,w,!1,void 0,s)}`};return{name:`Conv2DMatMul`,shaderCache:{hint:`${t.cacheKey};${x};${h};${T};${E};${D};${S};${C};${w}`,inputDependencies:A},getRunData:()=>({outputs:[{dims:c?c(n):n,dataType:e[0].dataType}],dispatchGroup:{x:b[0],y:b[1],z:b[2]},programUniforms:k}),getShaderSource:ee}}}),Eo,Do,Oo,ko,Ao,jo,Mo,No,Po=M(()=>{"use strict";V(),pn(),W(),Y(),io(),so(),Eo=e=>{let t=1;for(let n=0;ntypeof e==`number`?[e,e,e]:e,Oo=(e,t)=>t<=1?e:e+(e-1)*(t-1),ko=(e,t,n,r=1)=>{let i=Oo(t,r);return Math.floor((e[0]*(n-1)-n+i)/2)},Ao=(e,t,n,r,i)=>{i??=ko(e,t[0],r[0]);let a=[0,0,0,n];for(let n=0;n<3;n++)e[n]+2*i>=t[n]&&(a[n]=Math.trunc((e[n]-t[n]+2*i)/r[n]+1));return a},jo=(e,t,n,r,i,a,o,s,c,l)=>{let u,d,f,p;if(e===`VALID`&&(e=0),typeof e==`number`){u={top:e,bottom:e,left:e,right:e,front:e,back:e};let m=Ao([t,n,r,1],[s,c,l],1,[i,a,o],e);d=m[0],f=m[1],p=m[2]}else if(Array.isArray(e)){if(!e.every((e,t,n)=>e===n[0]))throw Error(`Unsupported padding parameter: ${e}`);u={top:e[0],bottom:e[1],left:e[2],right:e[3],front:e[4],back:e[5]};let m=Ao([t,n,r,1],[s,c,l],1,[i,a,o],e[0]);d=m[0],f=m[1],p=m[2]}else if(e===`SAME_UPPER`){d=Math.ceil(t/i),f=Math.ceil(n/a),p=Math.ceil(r/o);let e=(d-1)*i+s-t,m=(f-1)*a+c-n,h=(p-1)*o+l-r,g=Math.floor(e/2),_=e-g,v=Math.floor(m/2),y=m-v,b=Math.floor(h/2),x=h-b;u={top:v,bottom:y,left:b,right:x,front:g,back:_}}else throw Error(`Unknown padding parameter: ${e}`);return{padInfo:u,outDepth:d,outHeight:f,outWidth:p}},Mo=(e,t,n,r,i,a=!1,o=`channelsLast`)=>{let s,c,l,u,d;if(o===`channelsLast`)[s,c,l,u,d]=e;else if(o===`channelsFirst`)[s,d,c,l,u]=e;else throw Error(`Unknown dataFormat ${o}`);let[f,,p,m,h]=t,[g,_,v]=Do(n),[y,b,x]=Do(r),S=Oo(p,y),C=Oo(m,b),w=Oo(h,x),{padInfo:T,outDepth:E,outHeight:D,outWidth:O}=jo(i,c,l,u,g,_,v,S,C,w),k=a?f*d:f,A=[0,0,0,0,0];return o===`channelsFirst`?A=[s,k,E,D,O]:o===`channelsLast`&&(A=[s,E,D,O,k]),{batchSize:s,dataFormat:o,inDepth:c,inHeight:l,inWidth:u,inChannels:d,outDepth:E,outHeight:D,outWidth:O,outChannels:k,padInfo:T,strideDepth:g,strideHeight:_,strideWidth:v,filterDepth:p,filterHeight:m,filterWidth:h,effectiveFilterDepth:S,effectiveFilterHeight:C,effectiveFilterWidth:w,dilationDepth:y,dilationHeight:b,dilationWidth:x,inShape:e,outShape:A,filterShape:t}},No=(e,t,n,r,i,a)=>{let o=a===`channelsLast`,s=o?e[0].dims[3]:e[0].dims[1],c=!1,l=[64,1,1],u={x:n.map((e,t)=>t)},d=[Math.ceil(Eo(u.x.map(e=>n[e]))/l[0]),1,1];H(`verbose`,()=>`[conv3d_naive_webgpu] dispatch = ${d}`);let f=c?o&&s%4!=0?3:4:1,p=U.size(n),m=[{type:12,data:p},{type:12,data:r},{type:12,data:i},{type:12,data:t.strides},{type:12,data:t.dilations}];to(t,m),m.push(...G(e[0].dims,e[1].dims));let h=[`rank`,`rank`],g=e.length===3;g&&(m.push(...G(e[2].dims)),h.push(`rank`)),m.push(...G(n));let _=a=>{let s=[{name:`output_size`,type:`u32`},{name:`filter_dims`,type:`u32`,length:r.length},{name:`pads`,type:`u32`,length:i.length},{name:`strides`,type:`u32`,length:t.strides.length},{name:`dilations`,type:`u32`,length:t.dilations.length}];no(t,s);let l=c?4:1,u=$n(e[0].dataType),d=q(`x`,e[0].dataType,e[0].dims.length,f===3?1:f),p=q(`W`,e[1].dataType,e[1].dims.length,l),m=[d,p],h=J(`result`,e[0].dataType,n.length,l),_=``;if(g){let t=q(`bias`,e[2].dataType,e[2].dims.length,l);m.push(t),_+=` + ${So(l,T,E,D,o,t,O[0],O[1],O[2],c)} + ${h?ho(y,v,c,void 0,!l,w):vo(y,v,c,void 0,!l,w,!1,void 0,s)}`};return{name:`Conv2DMatMul`,shaderCache:{hint:`${t.cacheKey};${x};${h};${T};${E};${D};${S};${C};${w}`,inputDependencies:A},getRunData:()=>({outputs:[{dims:c?c(n):n,dataType:e[0].dataType}],dispatchGroup:{x:b[0],y:b[1],z:b[2]},programUniforms:k}),getShaderSource:ee}}}),To,Eo,Do,Oo,ko,Ao,jo,Mo,No=M(()=>{"use strict";U(),fn(),G(),X(),ro(),oo(),To=e=>{let t=1;for(let n=0;ntypeof e==`number`?[e,e,e]:e,Do=(e,t)=>t<=1?e:e+(e-1)*(t-1),Oo=(e,t,n,r=1)=>{let i=Do(t,r);return Math.floor((e[0]*(n-1)-n+i)/2)},ko=(e,t,n,r,i)=>{i??=Oo(e,t[0],r[0]);let a=[0,0,0,n];for(let n=0;n<3;n++)e[n]+2*i>=t[n]&&(a[n]=Math.trunc((e[n]-t[n]+2*i)/r[n]+1));return a},Ao=(e,t,n,r,i,a,o,s,c,l)=>{let u,d,f,p;if(e===`VALID`&&(e=0),typeof e==`number`){u={top:e,bottom:e,left:e,right:e,front:e,back:e};let m=ko([t,n,r,1],[s,c,l],1,[i,a,o],e);d=m[0],f=m[1],p=m[2]}else if(Array.isArray(e)){if(!e.every((e,t,n)=>e===n[0]))throw Error(`Unsupported padding parameter: ${e}`);u={top:e[0],bottom:e[1],left:e[2],right:e[3],front:e[4],back:e[5]};let m=ko([t,n,r,1],[s,c,l],1,[i,a,o],e[0]);d=m[0],f=m[1],p=m[2]}else if(e===`SAME_UPPER`){d=Math.ceil(t/i),f=Math.ceil(n/a),p=Math.ceil(r/o);let e=(d-1)*i+s-t,m=(f-1)*a+c-n,h=(p-1)*o+l-r,g=Math.floor(e/2),_=e-g,v=Math.floor(m/2),y=m-v,b=Math.floor(h/2),x=h-b;u={top:v,bottom:y,left:b,right:x,front:g,back:_}}else throw Error(`Unknown padding parameter: ${e}`);return{padInfo:u,outDepth:d,outHeight:f,outWidth:p}},jo=(e,t,n,r,i,a=!1,o=`channelsLast`)=>{let s,c,l,u,d;if(o===`channelsLast`)[s,c,l,u,d]=e;else if(o===`channelsFirst`)[s,d,c,l,u]=e;else throw Error(`Unknown dataFormat ${o}`);let[f,,p,m,h]=t,[g,_,v]=Eo(n),[y,b,x]=Eo(r),S=Do(p,y),C=Do(m,b),w=Do(h,x),{padInfo:T,outDepth:E,outHeight:D,outWidth:O}=Ao(i,c,l,u,g,_,v,S,C,w),k=a?f*d:f,A=[0,0,0,0,0];return o===`channelsFirst`?A=[s,k,E,D,O]:o===`channelsLast`&&(A=[s,E,D,O,k]),{batchSize:s,dataFormat:o,inDepth:c,inHeight:l,inWidth:u,inChannels:d,outDepth:E,outHeight:D,outWidth:O,outChannels:k,padInfo:T,strideDepth:g,strideHeight:_,strideWidth:v,filterDepth:p,filterHeight:m,filterWidth:h,effectiveFilterDepth:S,effectiveFilterHeight:C,effectiveFilterWidth:w,dilationDepth:y,dilationHeight:b,dilationWidth:x,inShape:e,outShape:A,filterShape:t}},Mo=(e,t,n,r,i,a)=>{let o=a===`channelsLast`,s=o?e[0].dims[3]:e[0].dims[1],c=!1,l=[64,1,1],u={x:n.map((e,t)=>t)},d=[Math.ceil(To(u.x.map(e=>n[e]))/l[0]),1,1];dn(`verbose`,()=>`[conv3d_naive_webgpu] dispatch = ${d}`);let f=c?o&&s%4!=0?3:4:1,p=W.size(n),m=[{type:12,data:p},{type:12,data:r},{type:12,data:i},{type:12,data:t.strides},{type:12,data:t.dilations}];eo(t,m),m.push(...K(e[0].dims,e[1].dims));let h=[`rank`,`rank`],g=e.length===3;g&&(m.push(...K(e[2].dims)),h.push(`rank`)),m.push(...K(n));let _=a=>{let s=[{name:`output_size`,type:`u32`},{name:`filter_dims`,type:`u32`,length:r.length},{name:`pads`,type:`u32`,length:i.length},{name:`strides`,type:`u32`,length:t.strides.length},{name:`dilations`,type:`u32`,length:t.dilations.length}];to(t,s);let l=c?4:1,u=Qn(e[0].dataType),d=J(`x`,e[0].dataType,e[0].dims.length,f===3?1:f),p=J(`W`,e[1].dataType,e[1].dims.length,l),m=[d,p],h=Y(`result`,e[0].dataType,n.length,l),_=``;if(g){let t=J(`bias`,e[2].dataType,e[2].dims.length,l);m.push(t),_+=` fn getBiasByOutputCoords(coords : array) -> ${c?`vec4<${u}>`:u} { - return bias[${o?K(`coords`,4,5):K(`coords`,1,5)}${c?`/ 4`:``}]; - }`}let v=ao(f,u),y=eo(t,v,u);return` + return bias[${o?q(`coords`,4,5):q(`coords`,1,5)}${c?`/ 4`:``}]; + }`}let v=io(f,u),y=$a(t,v,u);return` ${_} fn getX(d0 : u32, d1 : u32, d2 : u32, d3 : u32, d4 : u32) -> f32 { let aIndices = array(d0, d1, d2, d3, d4); @@ -1013,18 +1013,18 @@ fn main(@builtin(local_invocation_id) localId : vec3, ${a.mainStart()} ${a.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} let coords = ${h.offsetToIndices(`global_idx`)}; - let batch = ${K(`coords`,0,d.rank)}; - let d2 = ${o?K(`coords`,d.rank-1,d.rank):K(`coords`,1,d.rank)}; - let xFRCCorner = vec3(${o?K(`coords`,1,d.rank):K(`coords`,2,d.rank)}, - ${o?K(`coords`,2,d.rank):K(`coords`,3,d.rank)}, - ${o?K(`coords`,3,d.rank):K(`coords`,4,d.rank)}) * uniforms.strides - uniforms.pads; + let batch = ${q(`coords`,0,d.rank)}; + let d2 = ${o?q(`coords`,d.rank-1,d.rank):q(`coords`,1,d.rank)}; + let xFRCCorner = vec3(${o?q(`coords`,1,d.rank):q(`coords`,2,d.rank)}, + ${o?q(`coords`,2,d.rank):q(`coords`,3,d.rank)}, + ${o?q(`coords`,3,d.rank):q(`coords`,4,d.rank)}) * uniforms.strides - uniforms.pads; let xFCorner = xFRCCorner.x; let xRCorner = xFRCCorner.y; let xCCorner = xFRCCorner.z; - let xShapeY = ${o?K(`uniforms.x_shape`,1,d.rank):K(`uniforms.x_shape`,2,d.rank)}; - let xShapeZ = ${o?K(`uniforms.x_shape`,2,d.rank):K(`uniforms.x_shape`,3,d.rank)}; - let xShapeW = ${o?K(`uniforms.x_shape`,3,d.rank):K(`uniforms.x_shape`,4,d.rank)}; - let xShapeU = ${o?K(`uniforms.x_shape`,4,d.rank):K(`uniforms.x_shape`,1,d.rank)}; + let xShapeY = ${o?q(`uniforms.x_shape`,1,d.rank):q(`uniforms.x_shape`,2,d.rank)}; + let xShapeZ = ${o?q(`uniforms.x_shape`,2,d.rank):q(`uniforms.x_shape`,3,d.rank)}; + let xShapeW = ${o?q(`uniforms.x_shape`,3,d.rank):q(`uniforms.x_shape`,4,d.rank)}; + let xShapeU = ${o?q(`uniforms.x_shape`,4,d.rank):q(`uniforms.x_shape`,1,d.rank)}; let inputDepthNearestVec4 = (xShapeU / 4) * 4; let inputDepthVec4Remainder = xShapeU % 4; @@ -1104,7 +1104,7 @@ fn main(@builtin(local_invocation_id) localId : vec3, ${g?`value = value + getBiasByOutputCoords(coords)`:``}; ${y} result[global_idx] = f32(value); - }`};return{name:`Conv3DNaive`,shaderCache:{hint:`${t.cacheKey};${o};${f};${g}`,inputDependencies:h},getRunData:()=>({outputs:[{dims:n,dataType:e[0].dataType}],dispatchGroup:{x:d[0],y:d[1],z:d[2]},programUniforms:m}),getShaderSource:_}}}),Fo,Io,Lo=M(()=>{"use strict";V(),W(),Y(),io(),Fo=(e,t,n,r)=>{let i=e.length>2,a=i?`value += b[output_channel];`:``,o=e[0].dims,s=e[1].dims,c=t.format===`NHWC`,l=c?n[3]:n[1],u=l/t.group,d=c&&u>=4?tr(l):1,f=U.size(n)/d,p=[{type:12,data:f},{type:12,data:t.dilations},{type:12,data:[t.strides[0],t.strides[1]]},{type:12,data:[t.pads[0],t.pads[1]]},{type:12,data:u}];to(t,p),p.push(...G(o,[s[0],s[1],s[2],s[3]/d]));let m=i?[`rank`,`rank`,`rank`]:[`rank`,`rank`];p.push(...G([n[0],n[1],n[2],n[3]/d]));let h=r=>{let l=J(`output`,e[0].dataType,n.length,d),u=$n(l.type.tensor),f=eo(t,l.type.value,u),p=q(`x`,e[0].dataType,o.length),m=q(`w`,e[1].dataType,s.length,d),h=[p,m];i&&h.push(q(`b`,e[2].dataType,e[2].dims,d));let g=[{name:`output_size`,type:`u32`},{name:`dilations`,type:`u32`,length:t.dilations.length},{name:`strides`,type:`u32`,length:2},{name:`pads`,type:`u32`,length:2},{name:`output_channels_per_group`,type:`u32`}];no(t,g);let _=c?` + }`};return{name:`Conv3DNaive`,shaderCache:{hint:`${t.cacheKey};${o};${f};${g}`,inputDependencies:h},getRunData:()=>({outputs:[{dims:n,dataType:e[0].dataType}],dispatchGroup:{x:d[0],y:d[1],z:d[2]},programUniforms:m}),getShaderSource:_}}}),Po,Fo,Io=M(()=>{"use strict";U(),G(),X(),ro(),Po=(e,t,n,r)=>{let i=e.length>2,a=i?`value += b[output_channel];`:``,o=e[0].dims,s=e[1].dims,c=t.format===`NHWC`,l=c?n[3]:n[1],u=l/t.group,d=c&&u>=4?er(l):1,f=W.size(n)/d,p=[{type:12,data:f},{type:12,data:t.dilations},{type:12,data:[t.strides[0],t.strides[1]]},{type:12,data:[t.pads[0],t.pads[1]]},{type:12,data:u}];eo(t,p),p.push(...K(o,[s[0],s[1],s[2],s[3]/d]));let m=i?[`rank`,`rank`,`rank`]:[`rank`,`rank`];p.push(...K([n[0],n[1],n[2],n[3]/d]));let h=r=>{let l=Y(`output`,e[0].dataType,n.length,d),u=Qn(l.type.tensor),f=$a(t,l.type.value,u),p=J(`x`,e[0].dataType,o.length),m=J(`w`,e[1].dataType,s.length,d),h=[p,m];i&&h.push(J(`b`,e[2].dataType,e[2].dims,d));let g=[{name:`output_size`,type:`u32`},{name:`dilations`,type:`u32`,length:t.dilations.length},{name:`strides`,type:`u32`,length:2},{name:`pads`,type:`u32`,length:2},{name:`output_channels_per_group`,type:`u32`}];to(t,g);let _=c?` for (var wHeight: u32 = 0u; wHeight < uniforms.w_shape[0]; wHeight++) { let xHeight = xRCCorner.x + wHeight * uniforms.dilations[0]; @@ -1166,7 +1166,7 @@ fn main(@builtin(local_invocation_id) localId : vec3, ${a} ${f} ${l.setByOffset(`global_idx`,`value`)} - }`};return{name:`GroupedConv`,shaderCache:{hint:`${t.cacheKey}_${d}`,inputDependencies:m},getRunData:()=>({outputs:[{dims:r?r(n):n,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(f/64)},programUniforms:p}),getShaderSource:h}},Io=(e,t,n,r)=>{let i=e.length>2,a=tr(n[3]),o=tr(n[2]),s=U.size(n)/a/o,c=[e[0].dims[0],e[0].dims[1],e[0].dims[2],e[0].dims[3]/a],l=[e[1].dims[0],e[1].dims[1],e[1].dims[2],e[1].dims[3]/a],u=[n[0],n[1],n[2],n[3]/a],d=[{type:12,data:s},{type:6,data:[t.strides[0],t.strides[1]]},{type:6,data:[t.pads[0],t.pads[1]]}];to(t,d),d.push(...G(c,l,u));let f=(o-1)*t.strides[1]+l[1],p=n=>{let r=J(`output`,e[0].dataType,u.length,a),s=$n(r.type.tensor),d=eo(t,r.type.value,s),p=q(`x`,e[0].dataType,c.length,a),m=q(`w`,e[1].dataType,l.length,a),h=[p,m];i&&h.push(q(`b`,e[2].dataType,e[2].dims,a));let g=i?`value += b[output_channel];`:``,_=[{name:`output_size`,type:`u32`},{name:`strides`,type:`i32`,length:2},{name:`pads`,type:`i32`,length:2}];return no(t,_),` + }`};return{name:`GroupedConv`,shaderCache:{hint:`${t.cacheKey}_${d}`,inputDependencies:m},getRunData:()=>({outputs:[{dims:r?r(n):n,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(f/64)},programUniforms:p}),getShaderSource:h}},Fo=(e,t,n,r)=>{let i=e.length>2,a=er(n[3]),o=er(n[2]),s=W.size(n)/a/o,c=[e[0].dims[0],e[0].dims[1],e[0].dims[2],e[0].dims[3]/a],l=[e[1].dims[0],e[1].dims[1],e[1].dims[2],e[1].dims[3]/a],u=[n[0],n[1],n[2],n[3]/a],d=[{type:12,data:s},{type:6,data:[t.strides[0],t.strides[1]]},{type:6,data:[t.pads[0],t.pads[1]]}];eo(t,d),d.push(...K(c,l,u));let f=(o-1)*t.strides[1]+l[1],p=n=>{let r=Y(`output`,e[0].dataType,u.length,a),s=Qn(r.type.tensor),d=$a(t,r.type.value,s),p=J(`x`,e[0].dataType,c.length,a),m=J(`w`,e[1].dataType,l.length,a),h=[p,m];i&&h.push(J(`b`,e[2].dataType,e[2].dims,a));let g=i?`value += b[output_channel];`:``,_=[{name:`output_size`,type:`u32`},{name:`strides`,type:`i32`,length:2},{name:`pads`,type:`i32`,length:2}];return to(t,_),` ${n.registerUniforms(_).declareVariables(...h,r)} ${n.mainStart()} ${n.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} @@ -1211,7 +1211,7 @@ fn main(@builtin(local_invocation_id) localId : vec3, ${d} ${r.set(`batch`,`row`,`col + i`,`output_channel`,`value`)}; } - }`};return{name:`GroupedConv-Vectorize`,shaderCache:{hint:`${t.cacheKey};${a};${o};${f};${l[0]};${l[1]}`,inputDependencies:i?[`rank`,`rank`,`type`]:[`rank`,`rank`]},getRunData:()=>({outputs:[{dims:r?r(n):n,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(s/64)},programUniforms:d}),getShaderSource:p}}}),Ro,zo,Bo,Vo,Ho,Uo,Wo,Go,Ko,qo=M(()=>{"use strict";W(),To(),Po(),So(),Lo(),io(),po(),vr(),Ro=(e,t,n,r,i,a)=>{let o=e[0],s=e.slice(a?1:2,a?3:4),c=s.length,l=t[0],u=t.slice(2).map((e,t)=>e+(e-1)*(n[t]-1)),d=s.map((e,t)=>e+r[t]+r[t+c]).map((e,t)=>Math.floor((e-u[t]+i[t])/i[t]));return d.splice(0,0,o),d.splice(a?3:1,0,l),d},zo=[2,3,1,0],Bo=(e,t)=>{if(!e||e.length!==2&&e.length!==3)throw Error(`Conv requires 2 or 3 inputs`);if(e[0].dims.length>5)throw Error(`greater than 5D is not supported`);if(e[0].dims.length!==e[1].dims.length)throw Error(`filter does not have same dimension as input`);let n=e[0].dims[t.format===`NHWC`?e[0].dims.length-1:1],r=e[1].dims[1]*t.group;if(n!==r)throw Error(`FILTER_IN_CHANNEL should be equal to DATA_CHANNEL`);if(e.length===3&&(e[2].dims.length!==1||e[1].dims[0]!==e[2].dims[0]))throw Error(`invalid bias`);let i=e[0].dims.length-2;if(t.dilations.length!==i)throw Error(`dilations should be ${i}D`);if(t.strides.length!==i)throw Error(`strides should be ${i}D`);if(t.pads.length!==i*2)throw Error(`pads should be ${i*2}D`);if(t.kernelShape.length!==0&&t.kernelShape.length!==e[1].dims.length-2)throw Error(`invalid kernel shape`)},Vo=(e,t)=>{let n=e.kernelShape.slice();n.length{let t=ro(e),n=e.format,r=[`NOTSET`,`VALID`,`SAME_UPPER`,`SAME_LOWER`][e.auto_pad],i=e.dilations,a=e.group,o=e.kernel_shape,s=e.pads,c=e.strides,l=e.w_is_const();return{autoPad:r,format:n,dilations:i,group:a,kernelShape:o,pads:s,strides:c,wIsConst:l,...t,cacheKey:`${e.format};${t.activation};`}},Uo=(e,t,n,r)=>{let i=n.format===`NHWC`,a=Ro(t[0].dims,t[1].dims,n.dilations,n.pads,n.strides,i);if(n.group!==1){let o=[t[0]];if(i){let r=e.kernelCustomData.wT??e.compute(hr(t[1],zo),{inputs:[1],outputs:[n.wIsConst?-2:-1]})[0];n.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=r),o.push(r)}else o.push(t[1]);t.length===3&&o.push(t[2]),!e.adapterInfo.isArchitecture(`ampere`)&&i&&t[1].dims[0]===n.group&&t[1].dims[1]===1&&n.dilations[0]===1&&n.dilations[1]===1?e.compute(Io(o,n,a,r),{inputs:o}):e.compute(Fo(o,n,a,r),{inputs:o});return}let o=t.length===3,s=t[0].dims[i?1:2],c=t[0].dims[i?2:3],l=t[0].dims[i?3:1],u=t[1].dims[2],d=t[1].dims[3],f=a[i?1:2],p=a[i?2:3],m=a[i?3:1],h=i&&u===s&&d===c&&n.pads[0]===0&&n.pads[1]===0;if(h||u===1&&d===1&&n.dilations[0]===1&&n.dilations[1]===1&&n.strides[0]===1&&n.strides[1]===1&&n.pads[0]===0&&n.pads[1]===0){let u=a[0],d,g,_,v=[];if(i){let r=e.kernelCustomData.wT??e.compute(hr(t[1],zo),{inputs:[1],outputs:[n.wIsConst?-2:-1]})[0];if(n.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=r),h){let e=s*c*l;d=t[0].reshape([1,u,e]),g=r.reshape([1,e,m]),_=[1,u,m]}else d=t[0].reshape([u,s*c,l]),g=r.reshape([1,l,m]),_=[u,f*p,m];v.push(d),v.push(g)}else d=t[0].reshape([u,l,s*c]),g=t[1].reshape([1,m,l]),_=[u,m,f*p],v.push(g),v.push(d);o&&v.push(t[2]);let y=_[2],b=v[0].dims[v[0].dims.length-1];y<8&&b<8?e.compute(fo(v,n,a,_,i,r),{inputs:v}):e.compute(xo(v,n,a,_,i,r),{inputs:v});return}let g=!0,_=e.kernelCustomData.wT??e.compute(hr(t[1],zo),{inputs:[1],outputs:[n.wIsConst?-2:-1]})[0];n.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=_);let v=[t[0],_];o&&v.push(t[2]);let y=i?f*p:m,b=i?m:f*p,x=u*d*l;e.compute(wo(v,n,a,y,b,x,o,g,r),{inputs:v})},Wo=(e,t)=>{let n=t.format===`NHWC`,r=[e.inputs[0].reshape(n?[e.inputs[0].dims[0],1,e.inputs[0].dims[1],e.inputs[0].dims[2]]:[e.inputs[0].dims[0],e.inputs[0].dims[1],1,e.inputs[0].dims[2]]),e.inputs[1].reshape([e.inputs[1].dims[0],e.inputs[1].dims[1],1,e.inputs[1].dims[2]])];e.inputs.length===3&&r.push(e.inputs[2]);let i=[0,t.pads[0],0,t.pads[1]],a=[1].concat(t.strides),o=[1].concat(t.dilations),s=[1].concat(t.kernelShape),c=Vo({...t,pads:i,strides:a,dilations:o,kernelShape:s},r);Uo(e,r,c,e=>n?[e[0],e[2],e[3]]:[e[0],e[1],e[3]])},Go=(e,t,n)=>{let r=n.format===`NHWC`?`channelsLast`:`channelsFirst`,i=Vo(n,t),a=n.autoPad===`NOTSET`?n.pads:n.autoPad,o=Mo(t[0].dims,t[1].dims,n.strides,n.dilations,a,!1,r);e.compute(No(t,i,o.outShape,[o.filterDepth,o.filterHeight,o.filterWidth],[o.padInfo.front,o.padInfo.top,o.padInfo.left],r))},Ko=(e,t)=>{if(Bo(e.inputs,t),e.inputs[0].dims.length===3)Wo(e,t);else if(e.inputs[0].dims.length===5)Go(e,e.inputs,t);else{let n=Vo(t,e.inputs);Uo(e,e.inputs,n)}}}),Jo,Yo=M(()=>{"use strict";V(),pn(),W(),Y(),Jo=(e,t,n)=>{let r=e.length>2,i=t.outputShape,a=t.format===`NHWC`,o=t.group,s=e[1].dims,c=s[2]/o,l=s[3],u=a?tr(c):1,d=a&&l===1&&c>=4,f=d?Math.floor(c/4)*4:Math.floor(c/u)*u,p=c-f,m=a?tr(l):1,h=a?l===1?u:m:1,g=U.size(i)/m,_=[Math.ceil(g/64),1,1];H(`verbose`,()=>`[conv2d_backprop_webgpu] dispatch = ${_}`);let v=[`rank`,`rank`],y=[t.strides[0],t.strides[1]],b=[t.kernelShape[a?1:2],t.kernelShape[a?2:3]],x=[t.dilations[0],t.dilations[1]],S=[b[0]+(t.dilations[0]<=1?0:(t.kernelShape[a?1:2]-1)*(t.dilations[0]-1)),b[1]+(t.dilations[1]<=1?0:(t.kernelShape[a?2:3]-1)*(t.dilations[1]-1))],C=[S[0]-1-Math.floor((t.pads[0]+t.pads[2])/2),S[1]-1-Math.floor((t.pads[1]+t.pads[3])/2)],w=[{type:12,data:g},{type:12,data:y},{type:12,data:b},{type:12,data:x},{type:12,data:S},{type:6,data:C},{type:12,data:f},{type:12,data:c},{type:12,data:l},...G(e[0].dims,e[1].dims)];r&&(w.push(...G(e[2].dims)),v.push(`rank`)),w.push(...G(i));let T=t=>{let n=[{name:`output_size`,type:`u32`},{name:`strides`,type:`u32`,length:y.length},{name:`filter_dims`,type:`u32`,length:b.length},{name:`dilations`,type:`u32`,length:b.length},{name:`effective_filter_dims`,type:`u32`,length:S.length},{name:`pads`,type:`i32`,length:C.length},{name:`input_channels_per_group_int`,type:`u32`},{name:`input_channels_per_group`,type:`u32`},{name:`output_channels_per_group`,type:`u32`}],o=$n(e[0].dataType),s=a?1:2,c=a?2:3,l=a?3:1,f=q(`W`,e[1].dataType,e[1].dims.length,h),g=q(`Dy`,e[0].dataType,e[0].dims.length,u),_=[g,f];r&&_.push(q(`bias`,e[2].dataType,[i[l]].length,m));let v=J(`result`,e[0].dataType,i.length,m),x=()=>{let e=``;if(d)u===4?e+=` + }`};return{name:`GroupedConv-Vectorize`,shaderCache:{hint:`${t.cacheKey};${a};${o};${f};${l[0]};${l[1]}`,inputDependencies:i?[`rank`,`rank`,`type`]:[`rank`,`rank`]},getRunData:()=>({outputs:[{dims:r?r(n):n,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(s/64)},programUniforms:d}),getShaderSource:p}}}),Lo,Ro,zo,Bo,Vo,Ho,Uo,Wo,Go,Ko=M(()=>{"use strict";G(),wo(),No(),xo(),Io(),ro(),fo(),_r(),Lo=(e,t,n,r,i,a)=>{let o=e[0],s=e.slice(a?1:2,a?3:4),c=s.length,l=t[0],u=t.slice(2).map((e,t)=>e+(e-1)*(n[t]-1)),d=s.map((e,t)=>e+r[t]+r[t+c]).map((e,t)=>Math.floor((e-u[t]+i[t])/i[t]));return d.splice(0,0,o),d.splice(a?3:1,0,l),d},Ro=[2,3,1,0],zo=(e,t)=>{if(!e||e.length!==2&&e.length!==3)throw Error(`Conv requires 2 or 3 inputs`);if(e[0].dims.length>5)throw Error(`greater than 5D is not supported`);if(e[0].dims.length!==e[1].dims.length)throw Error(`filter does not have same dimension as input`);let n=e[0].dims[t.format===`NHWC`?e[0].dims.length-1:1],r=e[1].dims[1]*t.group;if(n!==r)throw Error(`FILTER_IN_CHANNEL should be equal to DATA_CHANNEL`);if(e.length===3&&(e[2].dims.length!==1||e[1].dims[0]!==e[2].dims[0]))throw Error(`invalid bias`);let i=e[0].dims.length-2;if(t.dilations.length!==i)throw Error(`dilations should be ${i}D`);if(t.strides.length!==i)throw Error(`strides should be ${i}D`);if(t.pads.length!==i*2)throw Error(`pads should be ${i*2}D`);if(t.kernelShape.length!==0&&t.kernelShape.length!==e[1].dims.length-2)throw Error(`invalid kernel shape`)},Bo=(e,t)=>{let n=e.kernelShape.slice();n.length{let t=no(e),n=e.format,r=[`NOTSET`,`VALID`,`SAME_UPPER`,`SAME_LOWER`][e.auto_pad],i=e.dilations,a=e.group,o=e.kernel_shape,s=e.pads,c=e.strides,l=e.w_is_const();return{autoPad:r,format:n,dilations:i,group:a,kernelShape:o,pads:s,strides:c,wIsConst:l,...t,cacheKey:`${e.format};${t.activation};`}},Ho=(e,t,n,r)=>{let i=n.format===`NHWC`,a=Lo(t[0].dims,t[1].dims,n.dilations,n.pads,n.strides,i);if(n.group!==1){let o=[t[0]];if(i){let r=e.kernelCustomData.wT??e.compute(mr(t[1],Ro),{inputs:[1],outputs:[n.wIsConst?-2:-1]})[0];n.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=r),o.push(r)}else o.push(t[1]);t.length===3&&o.push(t[2]),!e.adapterInfo.isArchitecture(`ampere`)&&i&&t[1].dims[0]===n.group&&t[1].dims[1]===1&&n.dilations[0]===1&&n.dilations[1]===1?e.compute(Fo(o,n,a,r),{inputs:o}):e.compute(Po(o,n,a,r),{inputs:o});return}let o=t.length===3,s=t[0].dims[i?1:2],c=t[0].dims[i?2:3],l=t[0].dims[i?3:1],u=t[1].dims[2],d=t[1].dims[3],f=a[i?1:2],p=a[i?2:3],m=a[i?3:1],h=i&&u===s&&d===c&&n.pads[0]===0&&n.pads[1]===0;if(h||u===1&&d===1&&n.dilations[0]===1&&n.dilations[1]===1&&n.strides[0]===1&&n.strides[1]===1&&n.pads[0]===0&&n.pads[1]===0){let u=a[0],d,g,_,v=[];if(i){let r=e.kernelCustomData.wT??e.compute(mr(t[1],Ro),{inputs:[1],outputs:[n.wIsConst?-2:-1]})[0];if(n.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=r),h){let e=s*c*l;d=t[0].reshape([1,u,e]),g=r.reshape([1,e,m]),_=[1,u,m]}else d=t[0].reshape([u,s*c,l]),g=r.reshape([1,l,m]),_=[u,f*p,m];v.push(d),v.push(g)}else d=t[0].reshape([u,l,s*c]),g=t[1].reshape([1,m,l]),_=[u,m,f*p],v.push(g),v.push(d);o&&v.push(t[2]);let y=_[2],b=v[0].dims[v[0].dims.length-1];y<8&&b<8?e.compute(uo(v,n,a,_,i,r),{inputs:v}):e.compute(bo(v,n,a,_,i,r),{inputs:v});return}let g=!0,_=e.kernelCustomData.wT??e.compute(mr(t[1],Ro),{inputs:[1],outputs:[n.wIsConst?-2:-1]})[0];n.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=_);let v=[t[0],_];o&&v.push(t[2]);let y=i?f*p:m,b=i?m:f*p,x=u*d*l;e.compute(Co(v,n,a,y,b,x,o,g,r),{inputs:v})},Uo=(e,t)=>{let n=t.format===`NHWC`,r=[e.inputs[0].reshape(n?[e.inputs[0].dims[0],1,e.inputs[0].dims[1],e.inputs[0].dims[2]]:[e.inputs[0].dims[0],e.inputs[0].dims[1],1,e.inputs[0].dims[2]]),e.inputs[1].reshape([e.inputs[1].dims[0],e.inputs[1].dims[1],1,e.inputs[1].dims[2]])];e.inputs.length===3&&r.push(e.inputs[2]);let i=[0,t.pads[0],0,t.pads[1]],a=[1].concat(t.strides),o=[1].concat(t.dilations),s=[1].concat(t.kernelShape),c=Bo({...t,pads:i,strides:a,dilations:o,kernelShape:s},r);Ho(e,r,c,e=>n?[e[0],e[2],e[3]]:[e[0],e[1],e[3]])},Wo=(e,t,n)=>{let r=n.format===`NHWC`?`channelsLast`:`channelsFirst`,i=Bo(n,t),a=n.autoPad===`NOTSET`?n.pads:n.autoPad,o=jo(t[0].dims,t[1].dims,n.strides,n.dilations,a,!1,r);e.compute(Mo(t,i,o.outShape,[o.filterDepth,o.filterHeight,o.filterWidth],[o.padInfo.front,o.padInfo.top,o.padInfo.left],r))},Go=(e,t)=>{if(zo(e.inputs,t),e.inputs[0].dims.length===3)Uo(e,t);else if(e.inputs[0].dims.length===5)Wo(e,e.inputs,t);else{let n=Bo(t,e.inputs);Ho(e,e.inputs,n)}}}),qo,Jo=M(()=>{"use strict";U(),fn(),G(),X(),qo=(e,t,n)=>{let r=e.length>2,i=t.outputShape,a=t.format===`NHWC`,o=t.group,s=e[1].dims,c=s[2]/o,l=s[3],u=a?er(c):1,d=a&&l===1&&c>=4,f=d?Math.floor(c/4)*4:Math.floor(c/u)*u,p=c-f,m=a?er(l):1,h=a?l===1?u:m:1,g=W.size(i)/m,_=[Math.ceil(g/64),1,1];dn(`verbose`,()=>`[conv2d_backprop_webgpu] dispatch = ${_}`);let v=[`rank`,`rank`],y=[t.strides[0],t.strides[1]],b=[t.kernelShape[a?1:2],t.kernelShape[a?2:3]],x=[t.dilations[0],t.dilations[1]],S=[b[0]+(t.dilations[0]<=1?0:(t.kernelShape[a?1:2]-1)*(t.dilations[0]-1)),b[1]+(t.dilations[1]<=1?0:(t.kernelShape[a?2:3]-1)*(t.dilations[1]-1))],C=[S[0]-1-Math.floor((t.pads[0]+t.pads[2])/2),S[1]-1-Math.floor((t.pads[1]+t.pads[3])/2)],w=[{type:12,data:g},{type:12,data:y},{type:12,data:b},{type:12,data:x},{type:12,data:S},{type:6,data:C},{type:12,data:f},{type:12,data:c},{type:12,data:l},...K(e[0].dims,e[1].dims)];r&&(w.push(...K(e[2].dims)),v.push(`rank`)),w.push(...K(i));let T=t=>{let n=[{name:`output_size`,type:`u32`},{name:`strides`,type:`u32`,length:y.length},{name:`filter_dims`,type:`u32`,length:b.length},{name:`dilations`,type:`u32`,length:b.length},{name:`effective_filter_dims`,type:`u32`,length:S.length},{name:`pads`,type:`i32`,length:C.length},{name:`input_channels_per_group_int`,type:`u32`},{name:`input_channels_per_group`,type:`u32`},{name:`output_channels_per_group`,type:`u32`}],o=Qn(e[0].dataType),s=a?1:2,c=a?2:3,l=a?3:1,f=J(`W`,e[1].dataType,e[1].dims.length,h),g=J(`Dy`,e[0].dataType,e[0].dims.length,u),_=[g,f];r&&_.push(J(`bias`,e[2].dataType,[i[l]].length,m));let v=Y(`result`,e[0].dataType,i.length,m),x=()=>{let e=``;if(d)u===4?e+=` let xValue = ${g.getByOffset(`x_offset`)}; let wValue = ${f.getByOffset(`w_offset`)}; dotProd = dotProd + dot(xValue, wValue); @@ -1299,7 +1299,7 @@ fn main(@builtin(local_invocation_id) localId : vec3, ${t.registerUniforms(n).declareVariables(..._,v)} ${t.mainStart()} ${t.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)}; - ${T}}`};return{name:`ConvTranspose2D`,shaderCache:{hint:`${t.cacheKey};${u}${h}${m}${d}${p}`,inputDependencies:v},getRunData:()=>({dispatchGroup:{x:_[0],y:_[1],z:_[2]},outputs:[{dims:n?n(i):i,dataType:e[0].dataType}],programUniforms:w}),getShaderSource:T}}}),Xo,Zo,Qo,$o,es,ts,ns,rs,os,ss=M(()=>{"use strict";Yo(),io(),vr(),Xo=(e,t,n,r,i,a)=>(e-1)*t+n+(r-1)*i+1-a,Zo=(e,t,n,r,i)=>{let a=Math.floor(e/2);t===`SAME_UPPER`?(n[r]=a,n[i]=e-a):t===`SAME_LOWER`&&(n[r]=e-a,n[i]=a)},Qo=(e,t,n,r,i,a,o,s,c,l)=>{let u=e.length-2,d=l.length===0;c.length{let n=e.kernelShape.slice();if(e.kernelShape.length===0||e.kernelShape.reduce((e,t)=>e*t,1)===0){n.length=0;for(let e=2;ee+t,0)===0){let e=t[0].dims.length-2;c=Array(e).fill(1)}let l=e.strides.slice();if(l.reduce((e,t)=>e+t,0)===0){let e=t[0].dims.length-2;l=Array(e).fill(1)}Qo(s,n,c,e.autoPad,e.group,i,l,r,o,a);let u=Object.assign({},e);return Object.assign(u,{kernelShape:n,pads:i,outputPadding:o,outputShape:a,dilations:c,strides:l}),u},es=e=>{let t=ro(e),n=e.format,r=[`NOTSET`,`VALID`,`SAME_UPPER`,`SAME_LOWER`][typeof e.autoPad>`u`?0:e.autoPad],i=e.dilations,a=e.group,o=e.kernelShape,s=e.pads,c=e.strides,l=e.wIsConst(),u=e.outputPadding,d=e.outputShape;return{autoPad:r,format:n,dilations:i,group:a,kernelShape:o,outputPadding:u,outputShape:d,pads:s,strides:c,wIsConst:l,...t,cacheKey:`${e.format};${t.activation};`}},ts=(e,t)=>{if(!e||e.length!==2&&e.length!==3)throw Error(`Conv requires 2 or 3 inputs`);if(e[0].dims.length!==4&&e[0].dims.length!==3)throw Error(`currently only support 2-dimensional conv`);if(e[0].dims.length!==e[1].dims.length)throw Error(`filter does not have same dimension as input`);let n=e[0].dims[t.format===`NHWC`?e[0].dims.length-1:1],r=e[1].dims[0];if(n!==r)throw Error(`FILTER_IN_CHANNEL should be equal to DATA_CHANNEL`);let i=e[1].dims[1]*t.group;if(e.length===3&&(e[2].dims.length!==1||e[2].dims[0]!==i))throw Error(`invalid bias`);let a=e[0].dims.length-2;if(t.dilations.reduce((e,t)=>e+t,0)>0&&t.dilations.length!==a)throw Error(`dilations should be ${a}D`);if(t.strides.reduce((e,t)=>e+t,0)>0&&t.strides.length!==a)throw Error(`strides should be ${a}D`);if(t.pads.reduce((e,t)=>e+t,0)>0&&t.pads.length!==a*2)throw Error(`pads should be ${a*2}D`);if(t.outputPadding.length!==a&&t.outputPadding.length!==0)throw Error(`output_padding should be ${a}D`);if(t.kernelShape.reduce((e,t)=>e+t,0)>0&&t.kernelShape.length!==0&&t.kernelShape.length!==e[1].dims.length-2)throw Error(`invalid kernel shape`);if(t.outputShape.length!==0&&t.outputShape.length!==e[0].dims.length-2)throw Error(`invalid output shape`)},ns=(e,t,n,r)=>{let i=e.kernelCustomData.wT??e.compute(hr(t[1],[2,3,0,1]),{inputs:[1],outputs:[n.wIsConst?-2:-1]})[0];n.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=i);let a=[t[0],i];t.length===3&&a.push(t[2]),e.compute(Jo(a,n,r),{inputs:a})},rs=(e,t)=>{let n=t.format===`NHWC`,r=[e.inputs[0].reshape(n?[e.inputs[0].dims[0],1,e.inputs[0].dims[1],e.inputs[0].dims[2]]:[e.inputs[0].dims[0],e.inputs[0].dims[1],1,e.inputs[0].dims[2]]),e.inputs[1].reshape([e.inputs[1].dims[0],e.inputs[1].dims[1],1,e.inputs[1].dims[2]])];e.inputs.length===3&&r.push(e.inputs[2]);let i=t.kernelShape;(i.length===0||i[0]===0)&&(i=[e.inputs[1].dims[2]]);let a=t.dilations;(a.length===0||a[0]===0)&&(a=[1]);let o=t.strides;(o.length===0||o[0]===0)&&(o=[1]);let s=t.pads;s.length===0&&(s=[0,0]),s=[0,s[0],0,s[1]],o=[1].concat(o),a=[1].concat(a),i=[1].concat(i);let c=t.outputPadding;c=[0].concat(c);let l=$o({...t,pads:s,strides:o,dilations:a,kernelShape:i,outputPadding:c},r);ns(e,r,l,e=>n?[e[0],e[2],e[3]]:[e[0],e[1],e[3]])},os=(e,t)=>{if(ts(e.inputs,t),e.inputs[0].dims.length===3)rs(e,t);else{let n=$o(t,e.inputs);ns(e,e.inputs,n)}}}),cs,ls,us,ds=M(()=>{"use strict";V(),W(),Xn(),Y(),cs=(e,t,n,r)=>{let i=U.size(t),a=t.length,o=q(`input`,e,a),s=J(`output`,e,a),c=n.dataType===6?n.getInt32Array()[0]:Number(n.getBigInt64Array()[0]),l=U.normalizeAxis(c,a),u=e=>{let t=` i32(${o.indicesGet(`inputIndices`,`uniforms.axis`)}) `,n=K(`uniforms.input_shape`,`uniforms.axis`,a),i=r.reverse?t+(r.exclusive?` + 1`:``):`0`,c=r.reverse?n:t+(r.exclusive?``:` + 1`);return` + ${T}}`};return{name:`ConvTranspose2D`,shaderCache:{hint:`${t.cacheKey};${u}${h}${m}${d}${p}`,inputDependencies:v},getRunData:()=>({dispatchGroup:{x:_[0],y:_[1],z:_[2]},outputs:[{dims:n?n(i):i,dataType:e[0].dataType}],programUniforms:w}),getShaderSource:T}}}),Yo,Xo,Zo,Qo,$o,es,ts,ns,rs,os=M(()=>{"use strict";Jo(),ro(),_r(),Yo=(e,t,n,r,i,a)=>(e-1)*t+n+(r-1)*i+1-a,Xo=(e,t,n,r,i)=>{let a=Math.floor(e/2);t===`SAME_UPPER`?(n[r]=a,n[i]=e-a):t===`SAME_LOWER`&&(n[r]=e-a,n[i]=a)},Zo=(e,t,n,r,i,a,o,s,c,l)=>{let u=e.length-2,d=l.length===0;c.length{let n=e.kernelShape.slice();if(e.kernelShape.length===0||e.kernelShape.reduce((e,t)=>e*t,1)===0){n.length=0;for(let e=2;ee+t,0)===0){let e=t[0].dims.length-2;c=Array(e).fill(1)}let l=e.strides.slice();if(l.reduce((e,t)=>e+t,0)===0){let e=t[0].dims.length-2;l=Array(e).fill(1)}Zo(s,n,c,e.autoPad,e.group,i,l,r,o,a);let u=Object.assign({},e);return Object.assign(u,{kernelShape:n,pads:i,outputPadding:o,outputShape:a,dilations:c,strides:l}),u},$o=e=>{let t=no(e),n=e.format,r=[`NOTSET`,`VALID`,`SAME_UPPER`,`SAME_LOWER`][typeof e.autoPad>`u`?0:e.autoPad],i=e.dilations,a=e.group,o=e.kernelShape,s=e.pads,c=e.strides,l=e.wIsConst(),u=e.outputPadding,d=e.outputShape;return{autoPad:r,format:n,dilations:i,group:a,kernelShape:o,outputPadding:u,outputShape:d,pads:s,strides:c,wIsConst:l,...t,cacheKey:`${e.format};${t.activation};`}},es=(e,t)=>{if(!e||e.length!==2&&e.length!==3)throw Error(`Conv requires 2 or 3 inputs`);if(e[0].dims.length!==4&&e[0].dims.length!==3)throw Error(`currently only support 2-dimensional conv`);if(e[0].dims.length!==e[1].dims.length)throw Error(`filter does not have same dimension as input`);let n=e[0].dims[t.format===`NHWC`?e[0].dims.length-1:1],r=e[1].dims[0];if(n!==r)throw Error(`FILTER_IN_CHANNEL should be equal to DATA_CHANNEL`);let i=e[1].dims[1]*t.group;if(e.length===3&&(e[2].dims.length!==1||e[2].dims[0]!==i))throw Error(`invalid bias`);let a=e[0].dims.length-2;if(t.dilations.reduce((e,t)=>e+t,0)>0&&t.dilations.length!==a)throw Error(`dilations should be ${a}D`);if(t.strides.reduce((e,t)=>e+t,0)>0&&t.strides.length!==a)throw Error(`strides should be ${a}D`);if(t.pads.reduce((e,t)=>e+t,0)>0&&t.pads.length!==a*2)throw Error(`pads should be ${a*2}D`);if(t.outputPadding.length!==a&&t.outputPadding.length!==0)throw Error(`output_padding should be ${a}D`);if(t.kernelShape.reduce((e,t)=>e+t,0)>0&&t.kernelShape.length!==0&&t.kernelShape.length!==e[1].dims.length-2)throw Error(`invalid kernel shape`);if(t.outputShape.length!==0&&t.outputShape.length!==e[0].dims.length-2)throw Error(`invalid output shape`)},ts=(e,t,n,r)=>{let i=e.kernelCustomData.wT??e.compute(mr(t[1],[2,3,0,1]),{inputs:[1],outputs:[n.wIsConst?-2:-1]})[0];n.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=i);let a=[t[0],i];t.length===3&&a.push(t[2]),e.compute(qo(a,n,r),{inputs:a})},ns=(e,t)=>{let n=t.format===`NHWC`,r=[e.inputs[0].reshape(n?[e.inputs[0].dims[0],1,e.inputs[0].dims[1],e.inputs[0].dims[2]]:[e.inputs[0].dims[0],e.inputs[0].dims[1],1,e.inputs[0].dims[2]]),e.inputs[1].reshape([e.inputs[1].dims[0],e.inputs[1].dims[1],1,e.inputs[1].dims[2]])];e.inputs.length===3&&r.push(e.inputs[2]);let i=t.kernelShape;(i.length===0||i[0]===0)&&(i=[e.inputs[1].dims[2]]);let a=t.dilations;(a.length===0||a[0]===0)&&(a=[1]);let o=t.strides;(o.length===0||o[0]===0)&&(o=[1]);let s=t.pads;s.length===0&&(s=[0,0]),s=[0,s[0],0,s[1]],o=[1].concat(o),a=[1].concat(a),i=[1].concat(i);let c=t.outputPadding;c=[0].concat(c);let l=Qo({...t,pads:s,strides:o,dilations:a,kernelShape:i,outputPadding:c},r);ts(e,r,l,e=>n?[e[0],e[2],e[3]]:[e[0],e[1],e[3]])},rs=(e,t)=>{if(es(e.inputs,t),e.inputs[0].dims.length===3)ns(e,t);else{let n=Qo(t,e.inputs);ts(e,e.inputs,n)}}}),ss,cs,ls,us=M(()=>{"use strict";U(),G(),Yn(),X(),ss=(e,t,n,r)=>{let i=W.size(t),a=t.length,o=J(`input`,e,a),s=Y(`output`,e,a),c=n.dataType===6?n.getInt32Array()[0]:Number(n.getBigInt64Array()[0]),l=W.normalizeAxis(c,a),u=e=>{let t=` i32(${o.indicesGet(`inputIndices`,`uniforms.axis`)}) `,n=q(`uniforms.input_shape`,`uniforms.axis`,a),i=r.reverse?t+(r.exclusive?` + 1`:``):`0`,c=r.reverse?n:t+(r.exclusive?``:` + 1`);return` ${e.registerUniform(`outputSize`,`u32`).registerUniform(`axis`,`u32`).declareVariables(o,s)} ${e.mainStart()} ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.outputSize`)} @@ -1312,12 +1312,12 @@ fn main(@builtin(local_invocation_id) localId : vec3, sum = sum + ${o.getByIndices(`inputIndices`)}; } ${s.setByOffset(`global_idx`,`sum`)}; - }`};return{name:`CumSum`,shaderCache:{hint:r.cacheKey,inputDependencies:[`rank`]},getRunData:()=>({outputs:[{dims:t,dataType:e}],dispatchGroup:{x:Math.ceil(i/64)},programUniforms:[{type:12,data:i},{type:12,data:l},...G(t,t)]}),getShaderSource:u}},ls=(e,t)=>{let n=e.inputs[0].dims,r=e.inputs[0].dataType,i=e.inputs[1];e.compute(cs(r,n,i,t),{inputs:[0]})},us=e=>{let t=e.exclusive===1,n=e.reverse===1;return Yn({exclusive:t,reverse:n})}}),fs,ps,ms,hs,gs,_s=M(()=>{"use strict";V(),W(),Xn(),Y(),fs=e=>{if(!e||e.length!==1)throw Error(`DepthToSpace requires 1 input.`);if(e[0].dims.length!==4)throw Error(`DepthToSpace requires 4D input.`)},ps=(e,t,n,r)=>{let i=[];i.push(`fn perm(i: ${r.type.indices}) -> ${n.type.indices} { + }`};return{name:`CumSum`,shaderCache:{hint:r.cacheKey,inputDependencies:[`rank`]},getRunData:()=>({outputs:[{dims:t,dataType:e}],dispatchGroup:{x:Math.ceil(i/64)},programUniforms:[{type:12,data:i},{type:12,data:l},...K(t,t)]}),getShaderSource:u}},cs=(e,t)=>{let n=e.inputs[0].dims,r=e.inputs[0].dataType,i=e.inputs[1];e.compute(ss(r,n,i,t),{inputs:[0]})},ls=e=>{let t=e.exclusive===1,n=e.reverse===1;return Jn({exclusive:t,reverse:n})}}),ds,fs,ps,ms,hs,gs=M(()=>{"use strict";U(),G(),Yn(),X(),ds=e=>{if(!e||e.length!==1)throw Error(`DepthToSpace requires 1 input.`);if(e[0].dims.length!==4)throw Error(`DepthToSpace requires 4D input.`)},fs=(e,t,n,r)=>{let i=[];i.push(`fn perm(i: ${r.type.indices}) -> ${n.type.indices} { var a: ${n.type.indices};`);for(let r=0;r{let n,r,i,a,o,s,c=t.format===`NHWC`,l=t.blocksize,u=t.mode===`DCR`;c?([n,r,i,a]=e.dims,o=u?[n,r,i,l,l,a/l**2]:[n,r,i,a/l**2,l,l],s=u?[0,1,3,2,4,5]:[0,1,4,2,5,3]):([n,r,i,a]=[e.dims[0],e.dims[2],e.dims[3],e.dims[1]],o=u?[n,l,l,a/l**2,r,i]:[n,a/l**2,l,l,r,i],s=u?[0,3,4,1,5,2]:[0,1,4,2,5,3]);let d=e.reshape(o),f=d.dims.length,p=e.dataType,m=q(`a`,p,f),h=J(`output`,p,f),g=e=>` +`)},ps=(e,t)=>{let n,r,i,a,o,s,c=t.format===`NHWC`,l=t.blocksize,u=t.mode===`DCR`;c?([n,r,i,a]=e.dims,o=u?[n,r,i,l,l,a/l**2]:[n,r,i,a/l**2,l,l],s=u?[0,1,3,2,4,5]:[0,1,4,2,5,3]):([n,r,i,a]=[e.dims[0],e.dims[2],e.dims[3],e.dims[1]],o=u?[n,l,l,a/l**2,r,i]:[n,a/l**2,l,l,r,i],s=u?[0,3,4,1,5,2]:[0,1,4,2,5,3]);let d=e.reshape(o),f=d.dims.length,p=e.dataType,m=J(`a`,p,f),h=Y(`output`,p,f),g=e=>` ${e.registerUniform(`output_size`,`u32`).declareVariables(m,h)} - ${ps(s,f,m,h)} + ${fs(s,f,m,h)} ${e.mainStart()} ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} @@ -1326,8 +1326,8 @@ fn main(@builtin(local_invocation_id) localId : vec3, let aIndices = perm(indices); ${h.setByOffset(`global_idx`,m.getByIndices(`aIndices`))} - }`;return{name:`DepthToSpace`,shaderCache:{hint:`${e.dims};${t.blocksize};${t.mode}`,inputDependencies:[`rank`]},getRunData:e=>{let t=c?[n,r*l,i*l,a/l**2]:[n,a/l**2,r*l,i*l],o=U.size(t),u=d.dims,f=U.sortBasedOnPerm(u,s);return{outputs:[{dims:t,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(o/64)},programUniforms:[{type:12,data:o},...G(u,f)]}},getShaderSource:g}},hs=(e,t)=>{fs(e.inputs),e.compute(ms(e.inputs[0],t))},gs=e=>Yn({blocksize:e.blocksize,mode:e.mode,format:e.format})}),vs,ys,bs,xs,Ss,Cs,ws,Ts,Es,Ds,Os,ks=M(()=>{"use strict";V(),W(),Xn(),Y(),vs=`[a-zA-Z]|\\.\\.\\.`,ys=`(`+vs+`)+`,bs=`^`+ys+`$`,xs=`(`+ys+`,)*`+ys,Ss=`^`+xs+`$`,Cs=class{constructor(e=-1){this.symbolToIndices=new Map,this.inputIndex=e}addSymbol(e,t){let n=this.symbolToIndices.get(e);n===void 0?n=[t]:n.push(t),this.symbolToIndices.set(e,n)}},ws=class{constructor(e,t){this.equation=t,this.hasEllipsis=!1,this.symbolToInfo=new Map,this.lhs=[],this.outputDims=[];let[n,r]=t.includes(`->`)?t.split(`->`,2):[t,``];if(!n.match(RegExp(Ss)))throw Error(`Invalid LHS term`);if(n.split(`,`).forEach((t,n)=>{let r=e[n].dims.slice();if(!t.match(RegExp(bs)))throw Error(`Invalid LHS term`);let i=this.processTerm(t,!0,r,n);this.lhs.push(i)}),r===``)r+=[...this.symbolToInfo.entries()].filter(([e,t])=>t.count===1||e===`...`).map(([e])=>e).join(``);else if(!r.match(RegExp(ys)))throw Error(`Invalid RHS`);r.match(RegExp(vs,`g`))?.forEach(e=>{if(e===`...`)this.outputDims=this.outputDims.concat(this.ellipsisDims);else{let t=this.symbolToInfo.get(e);if(t===void 0)throw Error(`Invalid RHS symbol`);this.outputDims.push(t.dimValue)}}),this.rhs=this.processTerm(r,!1,this.outputDims)}addSymbol(e,t,n){let r=this.symbolToInfo.get(e);if(r!==void 0){if(r.dimValue!==t&&r.count!==1)throw Error(`Dimension mismatch`);r.count++,r.inputIndices.push(n)}else r={count:1,dimValue:t,inputIndices:[n]};this.symbolToInfo.set(e,r)}processTerm(e,t,n,r=-1){let i=n.length,a=!1,o=[],s=0;if(!e.match(RegExp(bs))&&!t&&e!==``)throw Error(`Invalid LHS term`);let c=e.match(RegExp(vs,`g`)),l=new Cs(r);return c?.forEach((e,u)=>{if(e===`...`){if(a)throw Error(`Only one ellipsis is allowed per input term`);a=!0;let e=i-c.length+1;if(e<0)throw Error(`Ellipsis out of bounds`);if(o=n.slice(s,s+e),this.hasEllipsis){if(this.ellipsisDims.length!==o.length||this.ellipsisDims.toString()!==o.toString())throw Error(`Ellipsis dimensions mismatch`)}else if(t)this.hasEllipsis=!0,this.ellipsisDims=o;else throw Error(`Ellipsis must be specified in the LHS`);for(let e=0;ee+`_max`,Es=(e,t,n,r)=>{let i=e.map(e=>e.length).map((e,n)=>q(`input${n}`,t,e)),a=U.size(r),o=J(`output`,t,r.length),s=[...n.symbolToInfo.keys()].filter(e=>!n.rhs.symbolToIndices.has(e)),c=e=>{let t=[],r=`var prod = 1.0;`,a=`var sum = 0.0;`,c=`sum += prod;`,l=[],u=[],d=[],f=[],p=n.symbolToInfo.size===n.rhs.symbolToIndices.size;n.symbolToInfo.forEach((e,r)=>{if(n.rhs.symbolToIndices.has(r)){let a=n.rhs.symbolToIndices.get(r)?.[0];a!==void 0&&n.lhs.forEach((n,s)=>{if(e.inputIndices.includes(s)){let e=n.symbolToIndices.get(r);if(e===void 0)throw Error(`Invalid symbol error`);e.forEach(e=>{t.push(`${i[s].indicesSet(`input${s}Indices`,e,o.indicesGet(`outputIndices`,a))}`)})}})}else n.lhs.forEach((t,n)=>{if(e.inputIndices.includes(n)){let e=t.symbolToIndices.get(r);if(e===void 0)throw Error(`Invalid symbol error`);e.forEach(e=>{l.push(`${i[n].indicesSet(`input${n}Indices`,e,`${r}`)}`)}),f.push(`prod *= ${i[n].getByIndices(`input${n}Indices`)};`)}}),u.push(`for(var ${r}: u32 = 0; ${r} < uniforms.${Ts(r)}; ${r}++) {`),d.push(`}`)});let m=p?[...t,`let sum = ${i.map((e,t)=>e.getByIndices(`input${t}Indices`)).join(` * `)};`]:[...t,a,...u,...l,r,...f,c,...d];return` - ${e.registerUniforms(s.map(e=>({name:`${Ts(e)}`,type:`u32`}))).registerUniform(`outputSize`,`u32`).declareVariables(...i,o)} + }`;return{name:`DepthToSpace`,shaderCache:{hint:`${e.dims};${t.blocksize};${t.mode}`,inputDependencies:[`rank`]},getRunData:e=>{let t=c?[n,r*l,i*l,a/l**2]:[n,a/l**2,r*l,i*l],o=W.size(t),u=d.dims,f=W.sortBasedOnPerm(u,s);return{outputs:[{dims:t,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(o/64)},programUniforms:[{type:12,data:o},...K(u,f)]}},getShaderSource:g}},ms=(e,t)=>{ds(e.inputs),e.compute(ps(e.inputs[0],t))},hs=e=>Jn({blocksize:e.blocksize,mode:e.mode,format:e.format})}),_s,vs,ys,bs,xs,Ss,Cs,ws,Ts,Es,Ds,Os=M(()=>{"use strict";U(),G(),Yn(),X(),_s=`[a-zA-Z]|\\.\\.\\.`,vs=`(`+_s+`)+`,ys=`^`+vs+`$`,bs=`(`+vs+`,)*`+vs,xs=`^`+bs+`$`,Ss=class{constructor(e=-1){this.symbolToIndices=new Map,this.inputIndex=e}addSymbol(e,t){let n=this.symbolToIndices.get(e);n===void 0?n=[t]:n.push(t),this.symbolToIndices.set(e,n)}},Cs=class{constructor(e,t){this.equation=t,this.hasEllipsis=!1,this.symbolToInfo=new Map,this.lhs=[],this.outputDims=[];let[n,r]=t.includes(`->`)?t.split(`->`,2):[t,``];if(!n.match(RegExp(xs)))throw Error(`Invalid LHS term`);if(n.split(`,`).forEach((t,n)=>{let r=e[n].dims.slice();if(!t.match(RegExp(ys)))throw Error(`Invalid LHS term`);let i=this.processTerm(t,!0,r,n);this.lhs.push(i)}),r===``)r+=[...this.symbolToInfo.entries()].filter(([e,t])=>t.count===1||e===`...`).map(([e])=>e).join(``);else if(!r.match(RegExp(vs)))throw Error(`Invalid RHS`);r.match(RegExp(_s,`g`))?.forEach(e=>{if(e===`...`)this.outputDims=this.outputDims.concat(this.ellipsisDims);else{let t=this.symbolToInfo.get(e);if(t===void 0)throw Error(`Invalid RHS symbol`);this.outputDims.push(t.dimValue)}}),this.rhs=this.processTerm(r,!1,this.outputDims)}addSymbol(e,t,n){let r=this.symbolToInfo.get(e);if(r!==void 0){if(r.dimValue!==t&&r.count!==1)throw Error(`Dimension mismatch`);r.count++,r.inputIndices.push(n)}else r={count:1,dimValue:t,inputIndices:[n]};this.symbolToInfo.set(e,r)}processTerm(e,t,n,r=-1){let i=n.length,a=!1,o=[],s=0;if(!e.match(RegExp(ys))&&!t&&e!==``)throw Error(`Invalid LHS term`);let c=e.match(RegExp(_s,`g`)),l=new Ss(r);return c?.forEach((e,u)=>{if(e===`...`){if(a)throw Error(`Only one ellipsis is allowed per input term`);a=!0;let e=i-c.length+1;if(e<0)throw Error(`Ellipsis out of bounds`);if(o=n.slice(s,s+e),this.hasEllipsis){if(this.ellipsisDims.length!==o.length||this.ellipsisDims.toString()!==o.toString())throw Error(`Ellipsis dimensions mismatch`)}else if(t)this.hasEllipsis=!0,this.ellipsisDims=o;else throw Error(`Ellipsis must be specified in the LHS`);for(let e=0;ee+`_max`,Ts=(e,t,n,r)=>{let i=e.map(e=>e.length).map((e,n)=>J(`input${n}`,t,e)),a=W.size(r),o=Y(`output`,t,r.length),s=[...n.symbolToInfo.keys()].filter(e=>!n.rhs.symbolToIndices.has(e)),c=e=>{let t=[],r=`var prod = 1.0;`,a=`var sum = 0.0;`,c=`sum += prod;`,l=[],u=[],d=[],f=[],p=n.symbolToInfo.size===n.rhs.symbolToIndices.size;n.symbolToInfo.forEach((e,r)=>{if(n.rhs.symbolToIndices.has(r)){let a=n.rhs.symbolToIndices.get(r)?.[0];a!==void 0&&n.lhs.forEach((n,s)=>{if(e.inputIndices.includes(s)){let e=n.symbolToIndices.get(r);if(e===void 0)throw Error(`Invalid symbol error`);e.forEach(e=>{t.push(`${i[s].indicesSet(`input${s}Indices`,e,o.indicesGet(`outputIndices`,a))}`)})}})}else n.lhs.forEach((t,n)=>{if(e.inputIndices.includes(n)){let e=t.symbolToIndices.get(r);if(e===void 0)throw Error(`Invalid symbol error`);e.forEach(e=>{l.push(`${i[n].indicesSet(`input${n}Indices`,e,`${r}`)}`)}),f.push(`prod *= ${i[n].getByIndices(`input${n}Indices`)};`)}}),u.push(`for(var ${r}: u32 = 0; ${r} < uniforms.${ws(r)}; ${r}++) {`),d.push(`}`)});let m=p?[...t,`let sum = ${i.map((e,t)=>e.getByIndices(`input${t}Indices`)).join(` * `)};`]:[...t,a,...u,...l,r,...f,c,...d];return` + ${e.registerUniforms(s.map(e=>({name:`${ws(e)}`,type:`u32`}))).registerUniform(`outputSize`,`u32`).declareVariables(...i,o)} ${e.mainStart()} ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.outputSize`)} @@ -1337,7 +1337,7 @@ fn main(@builtin(local_invocation_id) localId : vec3, ${m.join(` `)}; ${o.setByOffset(`global_idx`,`sum`)}; - }`};return{name:`Einsum`,shaderCache:{hint:n.equation,inputDependencies:e.map(()=>`rank`)},getRunData:()=>{let i=s.filter(e=>n.symbolToInfo.has(e)).map(e=>({type:12,data:n.symbolToInfo.get(e)?.dimValue||0}));i.push({type:12,data:a});let o=e.map((e,t)=>[...G(e)]).reduce((e,t)=>e.concat(t),i);return o.push(...G(r)),{outputs:[{dims:r,dataType:t}],dispatchGroup:{x:Math.ceil(a/64)},programUniforms:o}},getShaderSource:c}},Ds=(e,t)=>{let n=new ws(e.inputs,t.equation),r=n.outputDims,i=e.inputs.map((e,t)=>e.dims);e.compute(Es(i,e.inputs[0].dataType,n,r))},Os=e=>{let t=e.equation.replace(/\s+/g,``);return Yn({equation:t})}}),As,js,Ms,Ns,Ps,Fs=M(()=>{"use strict";V(),W(),Y(),As=e=>{if(!e||e.length!==2)throw Error(`Expand requires 2 input.`);let t=e[0].dims,n=Array.from(e[1].getBigInt64Array(),Number),r=n.length{let n=e.length-t.length,r=[];for(let t=0;te.length>t.length?js(e,t):js(t,e),Ns=e=>{let t=e[0].dims,n=Array.from(e[1].getBigInt64Array(),Number),r=Ms(t,n),i=e[0].dataType,a=i===9||U.size(t)===1,o=i===9||t.length>0&&t[t.length-1]%4==0?4:1,s=a||r.length>0&&r[r.length-1]%4==0?4:1,c=Math.ceil(U.size(r)/s),l=e=>{let n=q(`input`,i,t.length,o),a=J(`output`,i,r.length,s),c;if(i===9){let e=(e,t,r=``)=>` + }`};return{name:`Einsum`,shaderCache:{hint:n.equation,inputDependencies:e.map(()=>`rank`)},getRunData:()=>{let i=s.filter(e=>n.symbolToInfo.has(e)).map(e=>({type:12,data:n.symbolToInfo.get(e)?.dimValue||0}));i.push({type:12,data:a});let o=e.map((e,t)=>[...K(e)]).reduce((e,t)=>e.concat(t),i);return o.push(...K(r)),{outputs:[{dims:r,dataType:t}],dispatchGroup:{x:Math.ceil(a/64)},programUniforms:o}},getShaderSource:c}},Es=(e,t)=>{let n=new Cs(e.inputs,t.equation),r=n.outputDims,i=e.inputs.map((e,t)=>e.dims);e.compute(Ts(i,e.inputs[0].dataType,n,r))},Ds=e=>{let t=e.equation.replace(/\s+/g,``);return Jn({equation:t})}}),ks,As,js,Ms,Ns,Ps=M(()=>{"use strict";U(),G(),X(),ks=e=>{if(!e||e.length!==2)throw Error(`Expand requires 2 input.`);let t=e[0].dims,n=Array.from(e[1].getBigInt64Array(),Number),r=n.length{let n=e.length-t.length,r=[];for(let t=0;te.length>t.length?As(e,t):As(t,e),Ms=e=>{let t=e[0].dims,n=Array.from(e[1].getBigInt64Array(),Number),r=js(t,n),i=e[0].dataType,a=i===9||W.size(t)===1,o=i===9||t.length>0&&t[t.length-1]%4==0?4:1,s=a||r.length>0&&r[r.length-1]%4==0?4:1,c=Math.ceil(W.size(r)/s),l=e=>{let n=J(`input`,i,t.length,o),a=Y(`output`,i,r.length,s),c;if(i===9){let e=(e,t,r=``)=>` let outputIndices${t} = ${a.offsetToIndices(`outputOffset + ${t}u`)}; let offset${t} = ${n.broadcastedIndicesToOffset(`outputIndices${t}`,a)}; let index${t} = offset${t} / 4u; @@ -1360,22 +1360,22 @@ fn main(@builtin(local_invocation_id) localId : vec3, ${e.registerUniform(`vec_size`,`u32`).declareVariables(n,a)} ${e.mainStart()} ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.vec_size`)} - ${c}`},u=[{type:12,data:c},...G(t,r)];return{name:`Expand`,shaderCache:{hint:`${r.length};${o}${s}`,inputDependencies:[`rank`]},getShaderSource:l,getRunData:()=>({outputs:[{dims:r,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(c/64)},programUniforms:u})}},Ps=e=>{As(e.inputs),e.compute(Ns(e.inputs),{inputs:[0]})}}),Is,Ls,Rs=M(()=>{"use strict";V(),W(),Y(),Oa(),Is=e=>{let t=e[0].dataType,n=U.size(e[0].dims),r=U.size(e[1].dims),i=r%4==0,a=e=>{let n=q(`x`,t,[1],4),r=q(`bias`,t,[1],4),a=J(`y`,t,[1],4),o=[{name:`output_vec_size`,type:`u32`},{name:`bias_size`,type:`u32`}],s=e=>` + ${c}`},u=[{type:12,data:c},...K(t,r)];return{name:`Expand`,shaderCache:{hint:`${r.length};${o}${s}`,inputDependencies:[`rank`]},getShaderSource:l,getRunData:()=>({outputs:[{dims:r,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(c/64)},programUniforms:u})}},Ns=e=>{ks(e.inputs),e.compute(Ms(e.inputs),{inputs:[0]})}}),Fs,Is,Ls=M(()=>{"use strict";U(),G(),X(),Da(),Fs=e=>{let t=e[0].dataType,n=W.size(e[0].dims),r=W.size(e[1].dims),i=r%4==0,a=e=>{let n=J(`x`,t,[1],4),r=J(`bias`,t,[1],4),a=Y(`y`,t,[1],4),o=[{name:`output_vec_size`,type:`u32`},{name:`bias_size`,type:`u32`}],s=e=>` let bias${e}_offset: u32 = (global_idx * 4 + ${e}) % uniforms.bias_size; let bias${e} = ${r.getByOffset(`bias${e}_offset / 4`)}[bias${e}_offset % 4];`,c=i?` let bias = ${r.getByOffset(`global_idx % (uniforms.bias_size / 4)`)};`:`${s(0)}${s(1)}${s(2)}${s(3)} let bias = ${n.type.value}(bias0, bias1, bias2, bias3);`;return`${e.registerUniforms(o).declareVariables(n,r,a)} - ${ba(er(t))} + ${ya($n(t))} - ${e.mainStart(Zn)} + ${e.mainStart(Xn)} ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_vec_size`)} let x = ${n.getByOffset(`global_idx`)}; ${c} let x_in = x + bias; - ${a.setByOffset(`global_idx`,xa(`x_in`))} - }`};return{name:`FastGeluWithBias`,shaderCache:{hint:`${i}`,inputDependencies:[`type`,`type`]},getShaderSource:a,getRunData:e=>({outputs:[{dims:e[0].dims,dataType:e[0].dataType}],programUniforms:[{type:12,data:Math.ceil(n/4)},{type:12,data:r}],dispatchGroup:{x:Math.ceil(n/Zn/4)}})}},Ls=e=>{e.inputs.length<2||U.size(e.inputs[1].dims)===0?Sa(e):e.compute(Is(e.inputs))}}),zs,Bs,Vs,Hs,Us=M(()=>{"use strict";V(),W(),Xn(),Y(),zs=e=>{if(!e||e.length!==2)throw Error(`Gather requires 2 inputs.`)},Bs=(e,t)=>{let n=e[0].dims,r=e[1].dims,i=n.length,a=U.normalizeAxis(t.axis,i),o=n.slice(0);o.splice(a,1,...r);let s=n[a],c=e[0].dataType===9?4:1,l=Math.ceil(U.size(o)/c),u=[{type:12,data:l},{type:6,data:s},{type:12,data:a},...G(e[0].dims,e[1].dims,o)],d=t=>{let n=q(`data`,e[0].dataType,e[0].dims.length,c),s=q(`inputIndices`,e[1].dataType,e[1].dims.length),l=J(`output`,e[0].dataType,o.length,c),u=e=>{let t=r.length,c=`var indicesIndices${e} = ${s.type.indices}(0);`;for(let n=0;n1?`indicesIndices${e}[${n}]`:`indicesIndices${e}`} = ${o.length>1?`outputIndices${e}[uniforms.axis + ${n}]`:`outputIndices${e}`};`;c+=` + ${a.setByOffset(`global_idx`,ba(`x_in`))} + }`};return{name:`FastGeluWithBias`,shaderCache:{hint:`${i}`,inputDependencies:[`type`,`type`]},getShaderSource:a,getRunData:e=>({outputs:[{dims:e[0].dims,dataType:e[0].dataType}],programUniforms:[{type:12,data:Math.ceil(n/4)},{type:12,data:r}],dispatchGroup:{x:Math.ceil(n/Xn/4)}})}},Is=e=>{e.inputs.length<2||W.size(e.inputs[1].dims)===0?xa(e):e.compute(Fs(e.inputs))}}),Rs,zs,Bs,Vs,Hs=M(()=>{"use strict";U(),G(),Yn(),X(),Rs=e=>{if(!e||e.length!==2)throw Error(`Gather requires 2 inputs.`)},zs=(e,t)=>{let n=e[0].dims,r=e[1].dims,i=n.length,a=W.normalizeAxis(t.axis,i),o=n.slice(0);o.splice(a,1,...r);let s=n[a],c=e[0].dataType===9?4:1,l=Math.ceil(W.size(o)/c),u=[{type:12,data:l},{type:6,data:s},{type:12,data:a},...K(e[0].dims,e[1].dims,o)],d=t=>{let n=J(`data`,e[0].dataType,e[0].dims.length,c),s=J(`inputIndices`,e[1].dataType,e[1].dims.length),l=Y(`output`,e[0].dataType,o.length,c),u=e=>{let t=r.length,c=`var indicesIndices${e} = ${s.type.indices}(0);`;for(let n=0;n1?`indicesIndices${e}[${n}]`:`indicesIndices${e}`} = ${o.length>1?`outputIndices${e}[uniforms.axis + ${n}]`:`outputIndices${e}`};`;c+=` var idx${e} = ${s.getByIndices(`indicesIndices${e}`)}; if (idx${e} < 0) { idx${e} = idx${e} + uniforms.axisDimLimit; @@ -1406,7 +1406,7 @@ fn main(@builtin(local_invocation_id) localId : vec3, ${t.mainStart()} ${t.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.outputSize`)} ${d} - }`};return{name:`Gather`,shaderCache:{hint:t.cacheKey,inputDependencies:[`rank`,`rank`]},getRunData:()=>({outputs:[{dims:o,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(l/64)},programUniforms:u}),getShaderSource:d}},Vs=e=>Yn({axis:e.axis}),Hs=(e,t)=>{let n=e.inputs;zs(n),e.compute(Bs(e.inputs,t))}}),Ws,Gs,Ks,qs=M(()=>{"use strict";V(),W(),Y(),Ws=(e,t,n,r,i,a,o,s,c)=>{let l=[{type:12,data:a},{type:12,data:r},{type:12,data:i},{type:12,data:n},{type:12,data:o},{type:12,data:s},{type:12,data:c}],u=[a];l.push(...G(t.dims,u));let d=e=>{let r=q(`indices_data`,t.dataType,t.dims.length),a=J(`input_slice_offsets_data`,12,1,1),o=[r,a],s=[{name:`output_size`,type:`u32`},{name:`batch_dims`,type:`u32`},{name:`input_dims`,type:`u32`,length:i.length},{name:`sizes_from_slice_dims_data`,type:`u32`,length:n.length},{name:`num_slices_per_batch`,type:`u32`},{name:`input_batch_stride`,type:`u32`},{name:`num_slice_dims`,type:`u32`}];return` + }`};return{name:`Gather`,shaderCache:{hint:t.cacheKey,inputDependencies:[`rank`,`rank`]},getRunData:()=>({outputs:[{dims:o,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(l/64)},programUniforms:u}),getShaderSource:d}},Bs=e=>Jn({axis:e.axis}),Vs=(e,t)=>{let n=e.inputs;Rs(n),e.compute(zs(e.inputs,t))}}),Us,Ws,Gs,Ks=M(()=>{"use strict";U(),G(),X(),Us=(e,t,n,r,i,a,o,s,c)=>{let l=[{type:12,data:a},{type:12,data:r},{type:12,data:i},{type:12,data:n},{type:12,data:o},{type:12,data:s},{type:12,data:c}],u=[a];l.push(...K(t.dims,u));let d=e=>{let r=J(`indices_data`,t.dataType,t.dims.length),a=Y(`input_slice_offsets_data`,12,1,1),o=[r,a],s=[{name:`output_size`,type:`u32`},{name:`batch_dims`,type:`u32`},{name:`input_dims`,type:`u32`,length:i.length},{name:`sizes_from_slice_dims_data`,type:`u32`,length:n.length},{name:`num_slices_per_batch`,type:`u32`},{name:`input_batch_stride`,type:`u32`},{name:`num_slice_dims`,type:`u32`}];return` ${e.registerUniforms(s).declareVariables(...o)} ${e.mainStart()} ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} @@ -1425,13 +1425,13 @@ fn main(@builtin(local_invocation_id) localId : vec3, } input_slice_offsets_data[global_idx] = base_offset + u32(relative_slice_offset); - }`};return e.compute({name:`computeSliceOffsets`,shaderCache:{hint:`${i.length}_${n.length}`,inputDependencies:[`rank`]},getRunData:()=>({outputs:[{dims:u,dataType:e.inputs[1].dataType}],dispatchGroup:{x:Math.ceil(a/64)},programUniforms:l}),getShaderSource:d},{inputs:[t],outputs:[-1]})[0]},Gs=(e,t)=>{let n=e.inputs,r=n[0].dims,i=n[0].dataType,a=n[1].dims,o=a[a.length-1],s=U.sizeToDimension(a,a.length-1),c=U.sizeFromDimension(r,t.batchDims+o),l=U.sizeToDimension(r,t.batchDims),u=U.sizeFromDimension(r,t.batchDims),d=s/l,f=Array(o),p=c;for(let e=0;er.length)throw Error(`last dimension of indices must not be larger than rank of input tensor`);let g=a.slice(0,-1).concat(r.slice(h)),_=U.size(g),v=[{type:12,data:_},{type:12,data:c},...G(n[0].dims,m.dims,g)],y=e=>{let t=q(`data`,n[0].dataType,n[0].dims.length),r=q(`slice_offsets`,12,m.dims.length),i=J(`output`,n[0].dataType,g.length);return` + }`};return e.compute({name:`computeSliceOffsets`,shaderCache:{hint:`${i.length}_${n.length}`,inputDependencies:[`rank`]},getRunData:()=>({outputs:[{dims:u,dataType:e.inputs[1].dataType}],dispatchGroup:{x:Math.ceil(a/64)},programUniforms:l}),getShaderSource:d},{inputs:[t],outputs:[-1]})[0]},Ws=(e,t)=>{let n=e.inputs,r=n[0].dims,i=n[0].dataType,a=n[1].dims,o=a[a.length-1],s=W.sizeToDimension(a,a.length-1),c=W.sizeFromDimension(r,t.batchDims+o),l=W.sizeToDimension(r,t.batchDims),u=W.sizeFromDimension(r,t.batchDims),d=s/l,f=Array(o),p=c;for(let e=0;er.length)throw Error(`last dimension of indices must not be larger than rank of input tensor`);let g=a.slice(0,-1).concat(r.slice(h)),_=W.size(g),v=[{type:12,data:_},{type:12,data:c},...K(n[0].dims,m.dims,g)],y=e=>{let t=J(`data`,n[0].dataType,n[0].dims.length),r=J(`slice_offsets`,12,m.dims.length),i=Y(`output`,n[0].dataType,g.length);return` ${e.registerUniform(`output_size`,`u32`).registerUniform(`slice_size`,`u32`).declareVariables(t,r,i)} ${e.mainStart()} ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} let slice_offset = slice_offsets[global_idx / uniforms.slice_size]; output[global_idx] = data[u32(slice_offset) + global_idx % uniforms.slice_size]; - }`};e.compute({name:`GatherND`,shaderCache:{hint:t.cacheKey,inputDependencies:[`rank`,`rank`]},getRunData:()=>({outputs:[{dims:g,dataType:i}],dispatchGroup:{x:Math.ceil(_/64)},programUniforms:v}),getShaderSource:y},{inputs:[n[0],m]})},Ks=e=>({batchDims:e.batch_dims,cacheKey:``})}),Js,Ys,Xs,Zs,Qs=M(()=>{"use strict";V(),W(),Xn(),Y(),Js=(e,t)=>{if(e.length<3||e.length>4)throw Error(`GatherBlockQuantized requires 3 or 4 inputs.`);let n=U.normalizeAxis(t.quantizeAxis,e[0].dims.length),r=t.blockSize,i=e[0],a=e[2],o=e.length===4?e[3]:void 0;if(a.dims.length!==i.dims.length||!i.dims.map((e,t)=>t===n?Math.ceil(e/r)===a.dims[t]:e===a.dims[t]).reduce((e,t)=>e&&t,!0))throw Error(`Scales must have the same rank as the input tensor and the dims should match except on gatherAxis.`);if(o){if(o.dataType!==i.dataType)throw Error(`Zero point must have the same data type as the input tensor.`);if(o.dims.length!==a.dims.length||!o.dims.map((e,t)=>e===a.dims[t]).reduce((e,t)=>e&&t,!0))throw Error(`Zero point must have the same rank as the input tensor and the dims should match except on quantizeAxis.`)}},Ys=(e,t)=>{let n=e[0].dims,r=e[1].dims,i=n.length,a=U.normalizeAxis(t.gatherAxis,i),o=U.normalizeAxis(t.quantizeAxis,i),s=n.slice(0);s.splice(a,1,...r);let c=U.size(s),l=e[2].dataType,u=e[0].dataType===22,d=[{type:12,data:c},{type:12,data:o},{type:12,data:a},{type:12,data:t.blockSize},...G(...e.map((e,t)=>e.dims),s)],f=t=>{let i=q(`data`,e[0].dataType,e[0].dims.length),o=q(`inputIndices`,e[1].dataType,e[1].dims.length),c=q(`scales`,e[2].dataType,e[2].dims.length),d=e.length>3?q(`zeroPoint`,e[3].dataType,e[3].dims.length):void 0,f=J(`output`,l,s.length),p=[i,o,c];d&&p.push(d);let m=[{name:`output_size`,type:`u32`},{name:`quantize_axis`,type:`u32`},{name:`gather_axis`,type:`u32`},{name:`block_size`,type:`u32`}];return` + }`};e.compute({name:`GatherND`,shaderCache:{hint:t.cacheKey,inputDependencies:[`rank`,`rank`]},getRunData:()=>({outputs:[{dims:g,dataType:i}],dispatchGroup:{x:Math.ceil(_/64)},programUniforms:v}),getShaderSource:y},{inputs:[n[0],m]})},Gs=e=>({batchDims:e.batch_dims,cacheKey:``})}),qs,Js,Ys,Xs,Zs=M(()=>{"use strict";U(),G(),Yn(),X(),qs=(e,t)=>{if(e.length<3||e.length>4)throw Error(`GatherBlockQuantized requires 3 or 4 inputs.`);let n=W.normalizeAxis(t.quantizeAxis,e[0].dims.length),r=t.blockSize,i=e[0],a=e[2],o=e.length===4?e[3]:void 0;if(a.dims.length!==i.dims.length||!i.dims.map((e,t)=>t===n?Math.ceil(e/r)===a.dims[t]:e===a.dims[t]).reduce((e,t)=>e&&t,!0))throw Error(`Scales must have the same rank as the input tensor and the dims should match except on gatherAxis.`);if(o){if(o.dataType!==i.dataType)throw Error(`Zero point must have the same data type as the input tensor.`);if(o.dims.length!==a.dims.length||!o.dims.map((e,t)=>e===a.dims[t]).reduce((e,t)=>e&&t,!0))throw Error(`Zero point must have the same rank as the input tensor and the dims should match except on quantizeAxis.`)}},Js=(e,t)=>{let n=e[0].dims,r=e[1].dims,i=n.length,a=W.normalizeAxis(t.gatherAxis,i),o=W.normalizeAxis(t.quantizeAxis,i),s=n.slice(0);s.splice(a,1,...r);let c=W.size(s),l=e[2].dataType,u=e[0].dataType===22,d=[{type:12,data:c},{type:12,data:o},{type:12,data:a},{type:12,data:t.blockSize},...K(...e.map((e,t)=>e.dims),s)],f=t=>{let i=J(`data`,e[0].dataType,e[0].dims.length),o=J(`inputIndices`,e[1].dataType,e[1].dims.length),c=J(`scales`,e[2].dataType,e[2].dims.length),d=e.length>3?J(`zeroPoint`,e[3].dataType,e[3].dims.length):void 0,f=Y(`output`,l,s.length),p=[i,o,c];d&&p.push(d);let m=[{name:`output_size`,type:`u32`},{name:`quantize_axis`,type:`u32`},{name:`gather_axis`,type:`u32`},{name:`block_size`,type:`u32`}];return` ${t.registerUniforms(m).declareVariables(...p,f)} ${t.mainStart()} let output_indices = ${f.offsetToIndices(`global_idx`)}; @@ -1474,10 +1474,10 @@ fn main(@builtin(local_invocation_id) localId : vec3, let packed_8bit_zero_points = (packed_4bit_zero_points >> (4 * (zero_point_index % 2))) & 0x0f0f0f0f; let zero_point_vec = ${u?`unpack4xI8`:`unpack4xU8`}(u32(packed_8bit_zero_points)); let zero_point = zero_point_vec[zero_point_index / 2];`:`var zero_point = 0`}; - let dequantized_data = ${er(l)}(quantized_data - zero_point) * scale; + let dequantized_data = ${$n(l)}(quantized_data - zero_point) * scale; ${f.setByOffset(`global_idx`,`dequantized_data`)}; - }`};return{name:`GatherBlockQuantized`,shaderCache:{hint:`${t.cacheKey};${e.filter((e,t)=>t!==1).map(e=>e.dims.join(`_`)).join(`;`)}`,inputDependencies:Array.from({length:e.length},(e,t)=>`rank`)},getRunData:()=>({outputs:[{dims:s,dataType:l}],dispatchGroup:{x:Math.ceil(c/64)},programUniforms:d}),getShaderSource:f}},Xs=(e,t)=>{let n=e.inputs;Js(n,t),e.compute(Ys(e.inputs,t))},Zs=e=>Yn({blockSize:e.blockSize,gatherAxis:e.gatherAxis,quantizeAxis:e.quantizeAxis})}),$s,ec,tc,nc,rc=M(()=>{"use strict";V(),W(),Xn(),Y(),$s=e=>{if(!e||e.length!==2)throw Error(`GatherElements requires 2 inputs.`);if(e[0].dims.length<1)throw Error(`GatherElements requires that the data input be rank >= 1.`);if(e[0].dims.length!==e[1].dims.length)throw Error(`GatherElements requires that the data input and - indices input tensors be of same rank.`)},ec=(e,t)=>{let n=e[0].dims,r=e[0].dataType,i=n.length,a=e[1].dims,o=e[1].dataType,s=U.normalizeAxis(t.axis,i),c=n[s],l=a.slice(0),u=U.size(l),d=q(`input`,r,i),f=q(`indicesInput`,o,a.length),p=J(`output`,r,l.length),m=[{type:12,data:u},{type:6,data:c},{type:12,data:s}];return m.push(...G(n,a,l)),{name:`GatherElements`,shaderCache:{inputDependencies:[`rank`,`rank`]},getRunData:()=>({outputs:[{dims:l,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(u/64)},programUniforms:m}),getShaderSource:e=>` + }`};return{name:`GatherBlockQuantized`,shaderCache:{hint:`${t.cacheKey};${e.filter((e,t)=>t!==1).map(e=>e.dims.join(`_`)).join(`;`)}`,inputDependencies:Array.from({length:e.length},(e,t)=>`rank`)},getRunData:()=>({outputs:[{dims:s,dataType:l}],dispatchGroup:{x:Math.ceil(c/64)},programUniforms:d}),getShaderSource:f}},Ys=(e,t)=>{let n=e.inputs;qs(n,t),e.compute(Js(e.inputs,t))},Xs=e=>Jn({blockSize:e.blockSize,gatherAxis:e.gatherAxis,quantizeAxis:e.quantizeAxis})}),Qs,$s,ec,tc,nc=M(()=>{"use strict";U(),G(),Yn(),X(),Qs=e=>{if(!e||e.length!==2)throw Error(`GatherElements requires 2 inputs.`);if(e[0].dims.length<1)throw Error(`GatherElements requires that the data input be rank >= 1.`);if(e[0].dims.length!==e[1].dims.length)throw Error(`GatherElements requires that the data input and + indices input tensors be of same rank.`)},$s=(e,t)=>{let n=e[0].dims,r=e[0].dataType,i=n.length,a=e[1].dims,o=e[1].dataType,s=W.normalizeAxis(t.axis,i),c=n[s],l=a.slice(0),u=W.size(l),d=J(`input`,r,i),f=J(`indicesInput`,o,a.length),p=Y(`output`,r,l.length),m=[{type:12,data:u},{type:6,data:c},{type:12,data:s}];return m.push(...K(n,a,l)),{name:`GatherElements`,shaderCache:{inputDependencies:[`rank`,`rank`]},getRunData:()=>({outputs:[{dims:l,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(u/64)},programUniforms:m}),getShaderSource:e=>` ${e.registerUniform(`outputSize`,`u32`).registerUniform(`axisDimLimit`,`i32`).registerUniform(`axis`,`u32`).declareVariables(d,f,p)} ${e.mainStart()} ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.outputSize`)} @@ -1493,7 +1493,7 @@ fn main(@builtin(local_invocation_id) localId : vec3, let value = ${d.getByIndices(`inputIndices`)}; ${p.setByOffset(`global_idx`,`value`)}; - }`}},tc=e=>Yn({axis:e.axis}),nc=(e,t)=>{let n=e.inputs;$s(n),e.compute(ec(e.inputs,t))}}),ic,ac,oc,sc,cc=M(()=>{"use strict";V(),W(),Y(),ic=e=>{if(!e)throw Error(`Input is missing`);if(e.length<2||e.length>3)throw Error(`Invaid input number.`);if(e.length===3&&e[2].dims.length>2)throw Error(`Invalid input shape of C`);if(e[0].dataType!==e[1].dataType||e.length===3&&e[0].dataType!==e[2].dataType)throw Error(`Input types are mismatched`)},ac=(e,t)=>{let n=e[0].dims.slice(),r=e[1].dims.slice(),[i,a,o]=_n.getShapeOfGemmResult(n,t.transA,r,t.transB,e.length===3?e[2].dims:void 0),s=[i,a];if(!s)throw Error(`Can't use gemm on the given tensors`);let c=16,l=Math.ceil(a/c),u=Math.ceil(i/c),d=!0,f=U.size(s),p=[{type:12,data:d?l:f},{type:12,data:i},{type:12,data:a},{type:12,data:o},{type:1,data:t.alpha},{type:1,data:t.beta}],m=[`type`,`type`];e.length===3&&(p.push(...G(e[2].dims)),m.push(`rank`)),p.push(...G(s));let h=n=>{let r=``;t.transA&&t.transB?r=`value += a[k * uniforms.M + m] * b[n * uniforms.K + k];`:t.transA&&!t.transB?r=`value += a[k * uniforms.M + m] * b[k * uniforms.N + n];`:!t.transA&&t.transB?r=`value += a[m * uniforms.K + k] * b[n * uniforms.K + k];`:!t.transA&&!t.transB&&(r=`value += a[m * uniforms.K + k] * b[k * uniforms.N + n];`);let i=t.alpha===1?``:`value *= uniforms.alpha;`,a=q(`a`,e[0].dataType,e[0].dims),o=q(`b`,e[1].dataType,e[1].dims),c=a.type.value,l=null,u=[a,o];e.length===3&&(l=q(`c`,e[2].dataType,e[2].dims.length),u.push(l));let d=J(`output`,e[0].dataType,s.length);u.push(d);let f=[{name:`output_size`,type:`u32`},{name:`M`,type:`u32`},{name:`N`,type:`u32`},{name:`K`,type:`u32`},{name:`alpha`,type:`f32`},{name:`beta`,type:`f32`}];return` + }`}},ec=e=>Jn({axis:e.axis}),tc=(e,t)=>{let n=e.inputs;Qs(n),e.compute($s(e.inputs,t))}}),rc,ic,ac,oc,sc=M(()=>{"use strict";U(),G(),X(),rc=e=>{if(!e)throw Error(`Input is missing`);if(e.length<2||e.length>3)throw Error(`Invaid input number.`);if(e.length===3&&e[2].dims.length>2)throw Error(`Invalid input shape of C`);if(e[0].dataType!==e[1].dataType||e.length===3&&e[0].dataType!==e[2].dataType)throw Error(`Input types are mismatched`)},ic=(e,t)=>{let n=e[0].dims.slice(),r=e[1].dims.slice(),[i,a,o]=gn.getShapeOfGemmResult(n,t.transA,r,t.transB,e.length===3?e[2].dims:void 0),s=[i,a];if(!s)throw Error(`Can't use gemm on the given tensors`);let c=16,l=Math.ceil(a/c),u=Math.ceil(i/c),d=!0,f=W.size(s),p=[{type:12,data:d?l:f},{type:12,data:i},{type:12,data:a},{type:12,data:o},{type:1,data:t.alpha},{type:1,data:t.beta}],m=[`type`,`type`];e.length===3&&(p.push(...K(e[2].dims)),m.push(`rank`)),p.push(...K(s));let h=n=>{let r=``;t.transA&&t.transB?r=`value += a[k * uniforms.M + m] * b[n * uniforms.K + k];`:t.transA&&!t.transB?r=`value += a[k * uniforms.M + m] * b[k * uniforms.N + n];`:!t.transA&&t.transB?r=`value += a[m * uniforms.K + k] * b[n * uniforms.K + k];`:!t.transA&&!t.transB&&(r=`value += a[m * uniforms.K + k] * b[k * uniforms.N + n];`);let i=t.alpha===1?``:`value *= uniforms.alpha;`,a=J(`a`,e[0].dataType,e[0].dims),o=J(`b`,e[1].dataType,e[1].dims),c=a.type.value,l=null,u=[a,o];e.length===3&&(l=J(`c`,e[2].dataType,e[2].dims.length),u.push(l));let d=Y(`output`,e[0].dataType,s.length);u.push(d);let f=[{name:`output_size`,type:`u32`},{name:`M`,type:`u32`},{name:`N`,type:`u32`},{name:`K`,type:`u32`},{name:`alpha`,type:`f32`},{name:`beta`,type:`f32`}];return` ${n.registerUniforms(f).declareVariables(...u)} ${n.mainStart()} @@ -1510,7 +1510,7 @@ fn main(@builtin(local_invocation_id) localId : vec3, ${i} ${l==null?``:`let cOffset = ${l.broadcastedIndicesToOffset(`vec2(m, n)`,d)}; value += ${c}(uniforms.beta) * ${l.getByOffset(`cOffset`)};`} output[global_idx] = value; - }`},g=n=>{let r=q(`a`,e[0].dataType,e[0].dims),i=q(`b`,e[1].dataType,e[1].dims),a=null,o=[r,i];e.length===3&&(a=q(`c`,e[2].dataType,e[2].dims.length),o.push(a));let l=J(`output`,e[0].dataType,s.length);o.push(l);let u=[{name:`num_tile_n`,type:`u32`},{name:`M`,type:`u32`},{name:`N`,type:`u32`},{name:`K`,type:`u32`},{name:`alpha`,type:`f32`},{name:`beta`,type:`f32`}],d=``,f=``;t.transA&&t.transB?(f=` + }`},g=n=>{let r=J(`a`,e[0].dataType,e[0].dims),i=J(`b`,e[1].dataType,e[1].dims),a=null,o=[r,i];e.length===3&&(a=J(`c`,e[2].dataType,e[2].dims.length),o.push(a));let l=Y(`output`,e[0].dataType,s.length);o.push(l);let u=[{name:`num_tile_n`,type:`u32`},{name:`M`,type:`u32`},{name:`N`,type:`u32`},{name:`K`,type:`u32`},{name:`alpha`,type:`f32`},{name:`beta`,type:`f32`}],d=``,f=``;t.transA&&t.transB?(f=` var col = tile_row_start + local_id.x; var row = k_start + local_id.y; if (col < uniforms.M && row < uniforms.K) { @@ -1602,7 +1602,7 @@ fn main(@builtin(local_invocation_id) localId : vec3, if (m < uniforms.M && n < uniforms.N) { output[m * uniforms.N + n] = value; } - }`};return d?{name:`GemmShared`,shaderCache:{hint:`${t.cacheKey}`,inputDependencies:m},getRunData:()=>({outputs:[{dims:s,dataType:e[0].dataType}],dispatchGroup:{x:l*u},programUniforms:p}),getShaderSource:g}:{name:`Gemm`,shaderCache:{hint:`${t.cacheKey}`,inputDependencies:m},getRunData:()=>({outputs:[{dims:s,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(f/64)},programUniforms:p}),getShaderSource:h}},oc=e=>{let t=e.transA,n=e.transB,r=e.alpha,i=e.beta;return{transA:t,transB:n,alpha:r,beta:i,cacheKey:`${e.transA};${e.transB};${e.alpha===1}`}},sc=(e,t)=>{ic(e.inputs),e.compute(ac(e.inputs,t))}}),lc,uc,dc,fc,pc,mc,hc,gc,_c,vc,yc,bc,xc,Sc,Cc=M(()=>{"use strict";V(),W(),Xn(),Y(),[lc,uc,dc,fc]=[0,1,2,3],pc=e=>{if(e[0].dims.length!==4)throw Error(`only 4-D tensor is supported.`);if(e[0].dims.length!==e[1].dims.length)throw Error(`input dimensions must be equal to grid dimensions`);if(e[0].dims.length-2!==e[1].dims[e[1].dims.length-1])throw Error(`last dimension of grid must be equal to ${e[0].dims.length-2}`);if(e[0].dims[0]!==e[1].dims[0])throw Error(`grid batch size must match input batch size`)},mc=` + }`};return d?{name:`GemmShared`,shaderCache:{hint:`${t.cacheKey}`,inputDependencies:m},getRunData:()=>({outputs:[{dims:s,dataType:e[0].dataType}],dispatchGroup:{x:l*u},programUniforms:p}),getShaderSource:g}:{name:`Gemm`,shaderCache:{hint:`${t.cacheKey}`,inputDependencies:m},getRunData:()=>({outputs:[{dims:s,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(f/64)},programUniforms:p}),getShaderSource:h}},ac=e=>{let t=e.transA,n=e.transB,r=e.alpha,i=e.beta;return{transA:t,transB:n,alpha:r,beta:i,cacheKey:`${e.transA};${e.transB};${e.alpha===1}`}},oc=(e,t)=>{rc(e.inputs),e.compute(ic(e.inputs,t))}}),cc,lc,uc,dc,fc,pc,mc,hc,gc,_c,vc,yc,bc,xc,Sc=M(()=>{"use strict";U(),G(),Yn(),X(),[cc,lc,uc,dc]=[0,1,2,3],fc=e=>{if(e[0].dims.length!==4)throw Error(`only 4-D tensor is supported.`);if(e[0].dims.length!==e[1].dims.length)throw Error(`input dimensions must be equal to grid dimensions`);if(e[0].dims.length-2!==e[1].dims[e[1].dims.length-1])throw Error(`last dimension of grid must be equal to ${e[0].dims.length-2}`);if(e[0].dims[0]!==e[1].dims[0])throw Error(`grid batch size must match input batch size`)},pc=` fn gs_get_cubic_coeffs(x: f32) -> vec4 { let cubic_alpha = -0.75f; let x_abs = abs(x); @@ -1613,7 +1613,7 @@ fn main(@builtin(local_invocation_id) localId : vec3, coeffs[3] = (((cubic_alpha * (2 - x_abs) - 5 * cubic_alpha) * (2 - x_abs) + 8 * cubic_alpha) * (2 - x_abs) - 4 * cubic_alpha); return coeffs; } -`,hc=e=>` +`,mc=e=>` fn gs_bicubic_interpolate(p: mat4x4<${e}>, x: f32, y: f32) -> ${e} { var v: vec4; var coeffs = gs_get_cubic_coeffs(x); @@ -1624,7 +1624,7 @@ fn main(@builtin(local_invocation_id) localId : vec3, let pixel = ${e}(coeffs[0] * v[0] + coeffs[1] * v[1] + coeffs[2] * v[2] + coeffs[3] * v[3]); return pixel; } -`,gc=e=>` +`,hc=e=>` fn gs_denormalize(n: f32, length: i32) -> f32 { ${e.alignCorners===0?` // alignCorners: false => [-1, 1] to [-0.5, length - 0.5] @@ -1634,7 +1634,7 @@ fn main(@builtin(local_invocation_id) localId : vec3, return (n + 1.0) / 2.0 * (f32(length - 1)); `} } -`,_c=e=>` +`,gc=e=>` ${e.paddingMode===`reflection`?` fn gs_reflect(x: i32, x_min: f32, x_max: f32) -> u32 { var dx = 0.0; @@ -1661,39 +1661,39 @@ fn main(@builtin(local_invocation_id) localId : vec3, } return u32(fx); }`:``} -`,vc=(e,t,n)=>` +`,_c=(e,t,n)=>` fn pixel_at_grid(r: i32, c: i32, H: i32, W: i32, batch: u32, channel: u32, border: vec4) -> ${t} { var pixel = ${t}(0); var indices = vec4(0); - indices[${lc}] = batch; - indices[${uc}] = channel;`+(()=>{switch(n.paddingMode){case`zeros`:return` + indices[${cc}] = batch; + indices[${lc}] = channel;`+(()=>{switch(n.paddingMode){case`zeros`:return` if (r >= 0 && r < H && c >=0 && c < W) { - indices[${dc}] = u32(r); - indices[${fc}] = u32(c); + indices[${uc}] = u32(r); + indices[${dc}] = u32(c); } else { return ${t}(0); } `;case`border`:return` - indices[${dc}] = u32(clamp(r, 0, H - 1)); - indices[${fc}] = u32(clamp(c, 0, W - 1)); + indices[${uc}] = u32(clamp(r, 0, H - 1)); + indices[${dc}] = u32(clamp(c, 0, W - 1)); `;case`reflection`:return` - indices[${dc}] = gs_reflect(r, border[1], border[3]); - indices[${fc}] = gs_reflect(c, border[0], border[2]); + indices[${uc}] = gs_reflect(r, border[1], border[3]); + indices[${dc}] = gs_reflect(c, border[0], border[2]); `;default:throw Error(`padding mode ${n.paddingMode} is not supported`)}})()+` return ${e.getByIndices(`indices`)}; } -`,yc=(e,t,n)=>(()=>{switch(n.mode){case`nearest`:return` - let result = pixel_at_grid(i32(round(y)), i32(round(x)), H_in, W_in, indices[${lc}], indices[${uc}], border); +`,vc=(e,t,n)=>(()=>{switch(n.mode){case`nearest`:return` + let result = pixel_at_grid(i32(round(y)), i32(round(x)), H_in, W_in, indices[${cc}], indices[${lc}], border); `;case`bilinear`:return` let x1 = i32(floor(x)); let y1 = i32(floor(y)); let x2 = x1 + 1; let y2 = y1 + 1; - let p11 = pixel_at_grid(y1, x1, H_in, W_in, indices[${lc}], indices[${uc}], border); - let p12 = pixel_at_grid(y1, x2, H_in, W_in, indices[${lc}], indices[${uc}], border); - let p21 = pixel_at_grid(y2, x1, H_in, W_in, indices[${lc}], indices[${uc}], border); - let p22 = pixel_at_grid(y2, x2, H_in, W_in, indices[${lc}], indices[${uc}], border); + let p11 = pixel_at_grid(y1, x1, H_in, W_in, indices[${cc}], indices[${lc}], border); + let p12 = pixel_at_grid(y1, x2, H_in, W_in, indices[${cc}], indices[${lc}], border); + let p21 = pixel_at_grid(y2, x1, H_in, W_in, indices[${cc}], indices[${lc}], border); + let p22 = pixel_at_grid(y2, x2, H_in, W_in, indices[${cc}], indices[${lc}], border); let dx2 = ${t}(f32(x2) - x); let dx1 = ${t}(x - f32(x1)); @@ -1706,25 +1706,25 @@ fn main(@builtin(local_invocation_id) localId : vec3, var p: mat4x4<${t}>; for (var h = 0; h < 4; h++) { for (var w = 0; w < 4; w++) { - p[h][w] = pixel_at_grid(h + y0, w + x0, H_in, W_in, indices[${lc}], indices[${uc}], border); + p[h][w] = pixel_at_grid(h + y0, w + x0, H_in, W_in, indices[${cc}], indices[${lc}], border); } } let dx = x - f32(x0 + 1); let dy = y - f32(y0 + 1); let result = gs_bicubic_interpolate(p, dx, dy); - `;default:throw Error(`mode ${n.mode} is not supported`)}})()+`${e.setByOffset(`global_idx`,`result`)}`,bc=(e,t)=>{let n=q(`x`,e[0].dataType,e[0].dims.length),r=[e[1].dims[0],e[1].dims[1],e[1].dims[2]],i=q(`grid`,e[1].dataType,r.length,2),a=[e[0].dims[0],e[0].dims[1],e[1].dims[1],e[1].dims[2]];t.format===`NHWC`&&(a=[e[0].dims[0],e[1].dims[1],e[1].dims[2],e[0].dims[3]],[lc,uc,dc,fc]=[0,3,1,2]);let o=J(`output`,e[0].dataType,a.length),s=n.type.value,c=U.size(a),l=[{type:12,data:c},...G(e[0].dims,r,a)],u=e=>` + `;default:throw Error(`mode ${n.mode} is not supported`)}})()+`${e.setByOffset(`global_idx`,`result`)}`,yc=(e,t)=>{let n=J(`x`,e[0].dataType,e[0].dims.length),r=[e[1].dims[0],e[1].dims[1],e[1].dims[2]],i=J(`grid`,e[1].dataType,r.length,2),a=[e[0].dims[0],e[0].dims[1],e[1].dims[1],e[1].dims[2]];t.format===`NHWC`&&(a=[e[0].dims[0],e[1].dims[1],e[1].dims[2],e[0].dims[3]],[cc,lc,uc,dc]=[0,3,1,2]);let o=Y(`output`,e[0].dataType,a.length),s=n.type.value,c=W.size(a),l=[{type:12,data:c},...K(e[0].dims,r,a)],u=e=>` ${e.registerUniform(`output_size`,`u32`).declareVariables(n,i,o)} - ${mc} - ${hc(s)} + ${pc} + ${mc(s)} + ${hc(t)} ${gc(t)} - ${_c(t)} - ${vc(n,s,t)} + ${_c(n,s,t)} ${e.mainStart()} ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} - let H_in = i32(uniforms.x_shape[${dc}]); - let W_in = i32(uniforms.x_shape[${fc}]); + let H_in = i32(uniforms.x_shape[${uc}]); + let W_in = i32(uniforms.x_shape[${dc}]); ${t.alignCorners===0?` let x_min = -0.5; @@ -1740,35 +1740,35 @@ fn main(@builtin(local_invocation_id) localId : vec3, let border = vec4(x_min, y_min, x_max, y_max); let indices = ${o.offsetToIndices(`global_idx`)}; - var grid_indices = vec3(indices[${lc}], indices[${dc}], indices[${fc}]); + var grid_indices = vec3(indices[${cc}], indices[${uc}], indices[${dc}]); let nxy = ${i.getByIndices(`grid_indices`)}; var x = gs_denormalize(f32(nxy[0]), W_in); var y = gs_denormalize(f32(nxy[1]), H_in); - ${yc(o,s,t)} - }`;return{name:`GridSample`,shaderCache:{hint:`${t.cacheKey}`,inputDependencies:[`type`,`type`]},getRunData:e=>{let t=U.size(a);return{outputs:[{dims:a,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(t/64)},programUniforms:l}},getShaderSource:u}},xc=(e,t)=>{pc(e.inputs),e.compute(bc(e.inputs,t))},Sc=e=>Yn({alignCorners:e.align_corners,mode:e.mode,paddingMode:e.padding_mode,format:e.format})}),wc,Tc,Ec,Dc,Oc,kc,Ac,jc=M(()=>{"use strict";V(),W(),Xn(),Ln(),Di(),Y(),vr(),wc=(e,t)=>e.length>t&&e[t].dims.length>0?e[t]:void 0,Tc=(e,t)=>{let n=e[0],r=wc(e,1),i=wc(e,2),a=wc(e,3),o=wc(e,4),s=wc(e,5),c=wc(e,6),l=wc(e,7);if(n.dims.length!==3&&n.dims.length!==5)throw Error(`Input query is expected to have 3 or 5 dimensions`);let u=n.dims[0],d=n.dims[1],f=n.dims.length===3?n.dims[2]:t.numHeads*n.dims[4],p=d,m=0,h=0,g=Math.floor(f/t.numHeads);if(c&&l&&U.size(c.dims)&&U.size(l.dims)){if(c.dims.length!==4)throw Error(`Input "past_key" is expected to have 4 dimensions`);if(c.dims[0]!==u||c.dims[1]!==t.numHeads||c.dims[3]!==g)throw Error(`Input "past_key" shape (batch_size, num_heads, past_sequence_length, head_size)`);if(l.dims[0]!==u||l.dims[1]!==t.numHeads||l.dims[3]!==g)throw Error(`Input "past_value" shape (batch_size, num_heads, past_sequence_length, head_size)`);if(c.dims[2]!==l.dims[2])throw Error(`Input "past_key" and "past_value" shall have same dim 2 (past_sequence_length)`);if(l.dims.length!==4)throw Error(`Input "past_value" is expected to have 4 dimensions`);m=c.dims[2],h=c.dims[2]}else if(c&&U.size(c.dims)||l&&U.size(l.dims))throw Error(`Input "past_key" and "past_value" shall be both present or both absent`);let _;if(r&&U.size(r.dims)>0){if(n.dims.length!==3)throw Error(`Input "query" is expected to have 3 dimensions when key is given`);if(r.dims.length<3||r.dims.length>5)throw Error(`Input "key" is expected to have 3, 4, or 5 dimensions`);if(n.dims[0]!==r.dims[0])throw Error(`Input "query" and "key" shall have same dim 0 (batch size)`);if(r.dims.length===3){if(r.dims[2]!==n.dims[2])throw Error(`Input "query" and "key" shall have same dim 2 (hidden_size)`);_=2,p=r.dims[1]}else if(r.dims.length===5){if(r.dims[2]!==t.numHeads||r.dims[3]!==2||r.dims[4]!==g)throw Error(`Expect "key" shape (batch_size, kv_sequence_length, num_heads, 2, head_size) for packed kv`);if(i)throw Error(`Expect "value" be none when "key" has packed kv format.`);_=5,p=r.dims[1]}else{if(r.dims[1]!==t.numHeads||r.dims[3]!==g)throw Error(`Expect "key" shape (batch_size, num_heads, kv_sequence_length, head_size) for past_key`);_=0,p=r.dims[2]}}else{if(n.dims.length!==5)throw Error(`Input "query" is expected to have 5 dimensions when key is empty`);if(n.dims[2]!==t.numHeads||n.dims[3]!==3)throw Error(`Expect "query" shape (batch_size, kv_sequence_length, num_heads, 3, head_size) for packed kv`);_=3}if(a&&U.size(a.dims)>0){if(a.dims.length!==1)throw Error(`Input "bias" is expected to have 1 dimension`);if(r&&r.dims.length===5&&r.dims[3]===2)throw Error(`bias is not allowed for packed kv.`)}let v=m+p,y=0;if(o&&U.size(o.dims)>0){y=8;let e=o.dims;throw e.length===1?e[0]===u?y=1:e[0]===3*u+2&&(y=3):e.length===2&&e[0]===u&&e[1]===v&&(y=5),y===8?Error(`Input "key_padding_mask" shape shall be (batch_size) or (batch_size, total_sequence_length)`):Error(`Mask not supported`)}let b=!1,x=f;if(i&&U.size(i.dims)>0){if(i.dims.length!==3&&i.dims.length!==4)throw Error(`Input "value" is expected to have 3 or 4 dimensions`);if(n.dims[0]!==i.dims[0])throw Error(`Input "query" and "value" shall have same dim 0 (batch_size)`);if(i.dims.length===3){if(p!==i.dims[1])throw Error(`Input "key" and "value" shall have the same dim 1 (kv_sequence_length)`);x=i.dims[2]}else{if(p!==i.dims[2])throw Error(`Input "key" and "value" shall have the same dim 2 (kv_sequence_length)`);x=i.dims[1]*i.dims[3],b=!0}}let S=!1;if(o&&U.size(o.dims)>0)throw Error(`Key padding mask is not supported`);if(s&&U.size(s.dims)>0){if(s.dims.length!==4)throw Error(`Input "attention_bias" is expected to have 4 dimensions`);if(s.dims[0]!==u||s.dims[1]!==t.numHeads||s.dims[2]!==d||s.dims[3]!==v)throw Error(`Expect "attention_bias" shape (batch_size, num_heads, sequence_length, total_sequence_length)`)}return{batchSize:u,sequenceLength:d,pastSequenceLength:m,kvSequenceLength:p,totalSequenceLength:v,maxSequenceLength:h,inputHiddenSize:0,hiddenSize:f,vHiddenSize:x,headSize:g,vHeadSize:Math.floor(x/t.numHeads),numHeads:t.numHeads,isUnidirectional:!1,pastPresentShareBuffer:!1,maskFilterValue:t.maskFilterValue,maskType:y,scale:t.scale,broadcastResPosBias:S,passPastInKv:b,qkvFormat:_}},Ec=e=>Yn({...e}),Dc=Yn({perm:[0,2,1,3]}),Oc=(e,t,n,r,i,a,o)=>{let s=[r,i,a],c=U.size(s),l=[{type:12,data:c},{type:12,data:o},{type:12,data:a}],u=e=>{let r=J(`qkv_with_bias`,t.dataType,s),i=q(`qkv`,t.dataType,s),a=q(`bias`,n.dataType,s),o=[{name:`output_size`,type:`u32`},{name:`bias_offset`,type:`u32`},{name:`hidden_size`,type:`u32`}];return` + ${vc(o,s,t)} + }`;return{name:`GridSample`,shaderCache:{hint:`${t.cacheKey}`,inputDependencies:[`type`,`type`]},getRunData:e=>{let t=W.size(a);return{outputs:[{dims:a,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(t/64)},programUniforms:l}},getShaderSource:u}},bc=(e,t)=>{fc(e.inputs),e.compute(yc(e.inputs,t))},xc=e=>Jn({alignCorners:e.align_corners,mode:e.mode,paddingMode:e.padding_mode,format:e.format})}),Cc,wc,Tc,Ec,Dc,Oc,kc,Ac=M(()=>{"use strict";U(),G(),Yn(),In(),Ei(),X(),_r(),Cc=(e,t)=>e.length>t&&e[t].dims.length>0?e[t]:void 0,wc=(e,t)=>{let n=e[0],r=Cc(e,1),i=Cc(e,2),a=Cc(e,3),o=Cc(e,4),s=Cc(e,5),c=Cc(e,6),l=Cc(e,7);if(n.dims.length!==3&&n.dims.length!==5)throw Error(`Input query is expected to have 3 or 5 dimensions`);let u=n.dims[0],d=n.dims[1],f=n.dims.length===3?n.dims[2]:t.numHeads*n.dims[4],p=d,m=0,h=0,g=Math.floor(f/t.numHeads);if(c&&l&&W.size(c.dims)&&W.size(l.dims)){if(c.dims.length!==4)throw Error(`Input "past_key" is expected to have 4 dimensions`);if(c.dims[0]!==u||c.dims[1]!==t.numHeads||c.dims[3]!==g)throw Error(`Input "past_key" shape (batch_size, num_heads, past_sequence_length, head_size)`);if(l.dims[0]!==u||l.dims[1]!==t.numHeads||l.dims[3]!==g)throw Error(`Input "past_value" shape (batch_size, num_heads, past_sequence_length, head_size)`);if(c.dims[2]!==l.dims[2])throw Error(`Input "past_key" and "past_value" shall have same dim 2 (past_sequence_length)`);if(l.dims.length!==4)throw Error(`Input "past_value" is expected to have 4 dimensions`);m=c.dims[2],h=c.dims[2]}else if(c&&W.size(c.dims)||l&&W.size(l.dims))throw Error(`Input "past_key" and "past_value" shall be both present or both absent`);let _;if(r&&W.size(r.dims)>0){if(n.dims.length!==3)throw Error(`Input "query" is expected to have 3 dimensions when key is given`);if(r.dims.length<3||r.dims.length>5)throw Error(`Input "key" is expected to have 3, 4, or 5 dimensions`);if(n.dims[0]!==r.dims[0])throw Error(`Input "query" and "key" shall have same dim 0 (batch size)`);if(r.dims.length===3){if(r.dims[2]!==n.dims[2])throw Error(`Input "query" and "key" shall have same dim 2 (hidden_size)`);_=2,p=r.dims[1]}else if(r.dims.length===5){if(r.dims[2]!==t.numHeads||r.dims[3]!==2||r.dims[4]!==g)throw Error(`Expect "key" shape (batch_size, kv_sequence_length, num_heads, 2, head_size) for packed kv`);if(i)throw Error(`Expect "value" be none when "key" has packed kv format.`);_=5,p=r.dims[1]}else{if(r.dims[1]!==t.numHeads||r.dims[3]!==g)throw Error(`Expect "key" shape (batch_size, num_heads, kv_sequence_length, head_size) for past_key`);_=0,p=r.dims[2]}}else{if(n.dims.length!==5)throw Error(`Input "query" is expected to have 5 dimensions when key is empty`);if(n.dims[2]!==t.numHeads||n.dims[3]!==3)throw Error(`Expect "query" shape (batch_size, kv_sequence_length, num_heads, 3, head_size) for packed kv`);_=3}if(a&&W.size(a.dims)>0){if(a.dims.length!==1)throw Error(`Input "bias" is expected to have 1 dimension`);if(r&&r.dims.length===5&&r.dims[3]===2)throw Error(`bias is not allowed for packed kv.`)}let v=m+p,y=0;if(o&&W.size(o.dims)>0){y=8;let e=o.dims;throw e.length===1?e[0]===u?y=1:e[0]===3*u+2&&(y=3):e.length===2&&e[0]===u&&e[1]===v&&(y=5),y===8?Error(`Input "key_padding_mask" shape shall be (batch_size) or (batch_size, total_sequence_length)`):Error(`Mask not supported`)}let b=!1,x=f;if(i&&W.size(i.dims)>0){if(i.dims.length!==3&&i.dims.length!==4)throw Error(`Input "value" is expected to have 3 or 4 dimensions`);if(n.dims[0]!==i.dims[0])throw Error(`Input "query" and "value" shall have same dim 0 (batch_size)`);if(i.dims.length===3){if(p!==i.dims[1])throw Error(`Input "key" and "value" shall have the same dim 1 (kv_sequence_length)`);x=i.dims[2]}else{if(p!==i.dims[2])throw Error(`Input "key" and "value" shall have the same dim 2 (kv_sequence_length)`);x=i.dims[1]*i.dims[3],b=!0}}let S=!1;if(o&&W.size(o.dims)>0)throw Error(`Key padding mask is not supported`);if(s&&W.size(s.dims)>0){if(s.dims.length!==4)throw Error(`Input "attention_bias" is expected to have 4 dimensions`);if(s.dims[0]!==u||s.dims[1]!==t.numHeads||s.dims[2]!==d||s.dims[3]!==v)throw Error(`Expect "attention_bias" shape (batch_size, num_heads, sequence_length, total_sequence_length)`)}return{batchSize:u,sequenceLength:d,pastSequenceLength:m,kvSequenceLength:p,totalSequenceLength:v,maxSequenceLength:h,inputHiddenSize:0,hiddenSize:f,vHiddenSize:x,headSize:g,vHeadSize:Math.floor(x/t.numHeads),numHeads:t.numHeads,isUnidirectional:!1,pastPresentShareBuffer:!1,maskFilterValue:t.maskFilterValue,maskType:y,scale:t.scale,broadcastResPosBias:S,passPastInKv:b,qkvFormat:_}},Tc=e=>Jn({...e}),Ec=Jn({perm:[0,2,1,3]}),Dc=(e,t,n,r,i,a,o)=>{let s=[r,i,a],c=W.size(s),l=[{type:12,data:c},{type:12,data:o},{type:12,data:a}],u=e=>{let r=Y(`qkv_with_bias`,t.dataType,s),i=J(`qkv`,t.dataType,s),a=J(`bias`,n.dataType,s),o=[{name:`output_size`,type:`u32`},{name:`bias_offset`,type:`u32`},{name:`hidden_size`,type:`u32`}];return` ${e.registerUniforms(o).declareVariables(i,a,r)} ${e.mainStart()} ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} let bias_offset_idx = (global_idx % uniforms.hidden_size) + uniforms.bias_offset; qkv_with_bias[global_idx] = qkv[global_idx] + bias[bias_offset_idx]; - }`};return e.compute({name:`MultiHeadAttentionAddBias`,shaderCache:{inputDependencies:[`type`,`type`]},getRunData:()=>({outputs:[{dims:s,dataType:t.dataType,gpuDataType:0}],dispatchGroup:{x:Math.ceil(c/64)},programUniforms:l}),getShaderSource:u},{inputs:[t,n],outputs:[-1]})[0]},kc=(e,t,n,r,i,a,o,s)=>{let c=a;if(o&&U.size(o.dims)>0){if(r===1)throw Error(`AddBiasReshape is not implemented. Please export your model with packed QKV or KV`);return c=Oc(e,a,o,t,r,n*i,s),c=c.reshape([t,r,n,i]),n===1||r===1?c:e.compute(hr(c,Dc.perm),{inputs:[c],outputs:[-1]})[0]}else return a.dims.length===3&&(c=a.reshape([t,r,n,i])),n===1||r===1?c:e.compute(hr(c,Dc.perm),{inputs:[c],outputs:[-1]})[0]},Ac=(e,t)=>{let n=Tc(e.inputs,t),r=e.inputs[0],i=wc(e.inputs,1),a=wc(e.inputs,2),o=wc(e.inputs,3),s=wc(e.inputs,4),c=wc(e.inputs,5),l=wc(e.inputs,6),u=wc(e.inputs,7);if(r.dims.length===5)throw Error(`Packed QKV is not implemented`);if(i?.dims.length===5)throw Error(`Packed KV is not implemented`);let d=i&&a&&i.dims.length===4&&a.dims.length===4,f=kc(e,n.batchSize,n.numHeads,n.sequenceLength,n.headSize,r,o,0);if(d)return wi(e,f,i,a,s,void 0,l,u,c,n);if(!i||!a)throw Error(`key and value must be provided`);let p=kc(e,n.batchSize,n.numHeads,n.kvSequenceLength,n.headSize,i,o,n.hiddenSize),m=kc(e,n.batchSize,n.numHeads,n.kvSequenceLength,n.vHeadSize,a,o,2*n.hiddenSize);wi(e,f,p,m,s,void 0,l,u,c,n)}}),Mc,Nc,Pc,Fc,Ic,Lc,Rc,zc=M(()=>{"use strict";V(),W(),Xn(),Y(),Mc=e=>{if(!e||e.length<1)throw Error(`too few inputs`)},Nc=(e,t)=>{let n=[],r=t.numOutputs;return e[1].dims[0]>0&&(e[1].getBigInt64Array().forEach(e=>n.push(Number(e))),r=n.length),Yn({numOutputs:r,axis:t.axis,splitSizes:n})},Pc=e=>` + }`};return e.compute({name:`MultiHeadAttentionAddBias`,shaderCache:{inputDependencies:[`type`,`type`]},getRunData:()=>({outputs:[{dims:s,dataType:t.dataType,gpuDataType:0}],dispatchGroup:{x:Math.ceil(c/64)},programUniforms:l}),getShaderSource:u},{inputs:[t,n],outputs:[-1]})[0]},Oc=(e,t,n,r,i,a,o,s)=>{let c=a;if(o&&W.size(o.dims)>0){if(r===1)throw Error(`AddBiasReshape is not implemented. Please export your model with packed QKV or KV`);return c=Dc(e,a,o,t,r,n*i,s),c=c.reshape([t,r,n,i]),n===1||r===1?c:e.compute(mr(c,Ec.perm),{inputs:[c],outputs:[-1]})[0]}else return a.dims.length===3&&(c=a.reshape([t,r,n,i])),n===1||r===1?c:e.compute(mr(c,Ec.perm),{inputs:[c],outputs:[-1]})[0]},kc=(e,t)=>{let n=wc(e.inputs,t),r=e.inputs[0],i=Cc(e.inputs,1),a=Cc(e.inputs,2),o=Cc(e.inputs,3),s=Cc(e.inputs,4),c=Cc(e.inputs,5),l=Cc(e.inputs,6),u=Cc(e.inputs,7);if(r.dims.length===5)throw Error(`Packed QKV is not implemented`);if(i?.dims.length===5)throw Error(`Packed KV is not implemented`);let d=i&&a&&i.dims.length===4&&a.dims.length===4,f=Oc(e,n.batchSize,n.numHeads,n.sequenceLength,n.headSize,r,o,0);if(d)return Ci(e,f,i,a,s,void 0,l,u,c,n);if(!i||!a)throw Error(`key and value must be provided`);let p=Oc(e,n.batchSize,n.numHeads,n.kvSequenceLength,n.headSize,i,o,n.hiddenSize),m=Oc(e,n.batchSize,n.numHeads,n.kvSequenceLength,n.vHeadSize,a,o,2*n.hiddenSize);Ci(e,f,p,m,s,void 0,l,u,c,n)}}),jc,Mc,Nc,Pc,Fc,Ic,Lc,Rc=M(()=>{"use strict";U(),G(),Yn(),X(),jc=e=>{if(!e||e.length<1)throw Error(`too few inputs`)},Mc=(e,t)=>{let n=[],r=t.numOutputs;return e[1].dims[0]>0&&(e[1].getBigInt64Array().forEach(e=>n.push(Number(e))),r=n.length),Jn({numOutputs:r,axis:t.axis,splitSizes:n})},Nc=e=>` fn calculateOutputIndex(index: u32) -> u32 { for (var i: u32 = 0u; i < ${e}u; i += 1u ) { - if (index < ${K(`uniforms.size_in_split_axis`,`i`,e)}) { + if (index < ${q(`uniforms.size_in_split_axis`,`i`,e)}) { return i; } } return ${e}u; -}`,Fc=e=>{let t=e.length,n=[];for(let r=0;r{let t=e.length,n=[];for(let r=0;r{let n=e[0].dims,r=U.size(n),i=e[0].dataType,a=U.normalizeAxis(t.axis,n.length),o=Array(t.numOutputs),s=q(`input`,i,n.length),c=Array(t.numOutputs),l=[],u=[],d=0,f=[{type:12,data:r}];for(let r=0;r` + }`},Fc=(e,t)=>{let n=e[0].dims,r=W.size(n),i=e[0].dataType,a=W.normalizeAxis(t.axis,n.length),o=Array(t.numOutputs),s=J(`input`,i,n.length),c=Array(t.numOutputs),l=[],u=[],d=0,f=[{type:12,data:r}];for(let r=0;r` ${e.registerUniform(`input_size`,`u32`).registerUniform(`size_in_split_axis`,`u32`,c.length).declareVariables(s,...o)} - ${Pc(c.length)} - ${Fc(o)} + ${Nc(c.length)} + ${Pc(o)} ${e.mainStart()} ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.input_size`)} @@ -1777,14 +1777,14 @@ fn calculateOutputIndex(index: u32) -> u32 { var index = ${s.indicesGet(`indices`,a)}; let output_number = calculateOutputIndex(index); if (output_number != 0) { - index -= ${K(`uniforms.size_in_split_axis`,`output_number - 1u`,c.length)}; + index -= ${q(`uniforms.size_in_split_axis`,`output_number - 1u`,c.length)}; ${s.indicesSet(`indices`,a,`index`)}; } writeBufferData(output_number, indices, global_idx); - }`;return{name:`Split`,shaderCache:{hint:t.cacheKey,inputDependencies:[`rank`]},getShaderSource:p,getRunData:()=>({outputs:l,dispatchGroup:{x:Math.ceil(r/64)},programUniforms:f})}},Lc=(e,t)=>{Mc(e.inputs);let n=e.inputs.length===1?t:Nc(e.inputs,t);e.compute(Ic(e.inputs,n),{inputs:[0]})},Rc=e=>{let t=e.axis,n=e.splitSizes,r=e.numOutputs<0?n.length:e.numOutputs;if(r!==n.length)throw Error(`numOutputs and splitSizes lengh must be equal`);return Yn({axis:t,numOutputs:r,splitSizes:n})}}),Bc,Vc,Hc,Uc=M(()=>{"use strict";V(),W(),Xn(),Y(),Bc=(e,t)=>{let[n,r,i,a]=e,{numHeads:o,rotaryEmbeddingDim:s}=t;if(n.dims.length!==3&&n.dims.length!==4)throw Error(`Input 'x' is expected to have 3 or 4 dimensions, got ${n.dims.length}`);if(!U.areEqual(r.dims,[])&&!U.areEqual(r.dims,[1])&&r.dims.length!==2)throw Error(`Input 'position_ids' is expected to have 0, 1, or 2 dimensions, got ${r.dims.length}`);if(i.dims.length!==2)throw Error(`Input 'cos_cache' is expected to have 2 dimensions, got ${i.dims.length}`);if(a.dims.length!==2)throw Error(`Input 'sin_cache' is expected to have 2 dimensions, got ${a.dims.length}`);if(!U.areEqual(i.dims,a.dims))throw Error(`Inputs 'cos_cache' and 'sin_cache' are expected to have the same shape`);if(s>0&&o===0)throw Error(`num_heads must be provided if rotary_embedding_dim is specified`);let c=n.dims[0],l=n.dims[n.dims.length-2],u=i.dims[0],d=U.sizeFromDimension(n.dims,1)/l,f=s===0?i.dims[1]*2:d/o;if(s>f)throw Error(`rotary_embedding_dim must be less than or equal to head_size`);if(r.dims.length===2){if(c!==r.dims[0])throw Error(`Input 'position_ids' dimension 0 should be of size batch_size, got ${r.dims[0]}`);if(l!==r.dims[1])throw Error(`Input 'position_ids' dimension 1 should be of size sequence_length, got ${r.dims[1]}`)}if(f/2!==i.dims[1]&&s/2!==i.dims[1])throw Error(`Input 'cos_cache' dimension 1 should be same as head_size / 2 or rotary_embedding_dim / 2, got ${i.dims[1]}`);if(l>u)throw Error(`Updating cos_cache and sin_cache in RotaryEmbedding is not currently supported`)},Vc=(e,t)=>{let{interleaved:n,numHeads:r,rotaryEmbeddingDim:i,scale:a}=t,o=e[0].dims[0],s=U.sizeFromDimension(e[0].dims,1),c=e[0].dims[e[0].dims.length-2],l=s/c,u=e[2].dims[1],d=i===0?u*2:l/r,f=[o,c,l/d,d-u],p=U.computeStrides(f),m=[{type:1,data:a},{type:12,data:f},{type:12,data:p},...e[0].dims.length===3?Array({type:12,data:[s,l,d,1]}):[],...e[0].dims.length===4?Array({type:12,data:[s,d,c*d,1]}):[],...G(e[0].dims,e[1].dims,e[2].dims,e[3].dims,e[0].dims)],h=t=>{let r=q(`input`,e[0].dataType,e[0].dims.length),i=q(`position_ids`,e[1].dataType,e[1].dims.length),a=q(`cos_cache`,e[2].dataType,e[2].dims.length),o=q(`sin_cache`,e[3].dataType,e[3].dims.length),s=J(`output`,e[0].dataType,e[0].dims.length);return t.registerUniforms([{name:`scale`,type:`f32`},{name:`global_shape`,type:`u32`,length:f.length},{name:`global_strides`,type:`u32`,length:p.length},{name:`input_output_strides`,type:`u32`,length:p.length}]),` + }`;return{name:`Split`,shaderCache:{hint:t.cacheKey,inputDependencies:[`rank`]},getShaderSource:p,getRunData:()=>({outputs:l,dispatchGroup:{x:Math.ceil(r/64)},programUniforms:f})}},Ic=(e,t)=>{jc(e.inputs);let n=e.inputs.length===1?t:Mc(e.inputs,t);e.compute(Fc(e.inputs,n),{inputs:[0]})},Lc=e=>{let t=e.axis,n=e.splitSizes,r=e.numOutputs<0?n.length:e.numOutputs;if(r!==n.length)throw Error(`numOutputs and splitSizes lengh must be equal`);return Jn({axis:t,numOutputs:r,splitSizes:n})}}),zc,Bc,Vc,Hc=M(()=>{"use strict";U(),G(),Yn(),X(),zc=(e,t)=>{let[n,r,i,a]=e,{numHeads:o,rotaryEmbeddingDim:s}=t;if(n.dims.length!==3&&n.dims.length!==4)throw Error(`Input 'x' is expected to have 3 or 4 dimensions, got ${n.dims.length}`);if(!W.areEqual(r.dims,[])&&!W.areEqual(r.dims,[1])&&r.dims.length!==2)throw Error(`Input 'position_ids' is expected to have 0, 1, or 2 dimensions, got ${r.dims.length}`);if(i.dims.length!==2)throw Error(`Input 'cos_cache' is expected to have 2 dimensions, got ${i.dims.length}`);if(a.dims.length!==2)throw Error(`Input 'sin_cache' is expected to have 2 dimensions, got ${a.dims.length}`);if(!W.areEqual(i.dims,a.dims))throw Error(`Inputs 'cos_cache' and 'sin_cache' are expected to have the same shape`);if(s>0&&o===0)throw Error(`num_heads must be provided if rotary_embedding_dim is specified`);let c=n.dims[0],l=n.dims[n.dims.length-2],u=i.dims[0],d=W.sizeFromDimension(n.dims,1)/l,f=s===0?i.dims[1]*2:d/o;if(s>f)throw Error(`rotary_embedding_dim must be less than or equal to head_size`);if(r.dims.length===2){if(c!==r.dims[0])throw Error(`Input 'position_ids' dimension 0 should be of size batch_size, got ${r.dims[0]}`);if(l!==r.dims[1])throw Error(`Input 'position_ids' dimension 1 should be of size sequence_length, got ${r.dims[1]}`)}if(f/2!==i.dims[1]&&s/2!==i.dims[1])throw Error(`Input 'cos_cache' dimension 1 should be same as head_size / 2 or rotary_embedding_dim / 2, got ${i.dims[1]}`);if(l>u)throw Error(`Updating cos_cache and sin_cache in RotaryEmbedding is not currently supported`)},Bc=(e,t)=>{let{interleaved:n,numHeads:r,rotaryEmbeddingDim:i,scale:a}=t,o=e[0].dims[0],s=W.sizeFromDimension(e[0].dims,1),c=e[0].dims[e[0].dims.length-2],l=s/c,u=e[2].dims[1],d=i===0?u*2:l/r,f=[o,c,l/d,d-u],p=W.computeStrides(f),m=[{type:1,data:a},{type:12,data:f},{type:12,data:p},...e[0].dims.length===3?Array({type:12,data:[s,l,d,1]}):[],...e[0].dims.length===4?Array({type:12,data:[s,d,c*d,1]}):[],...K(e[0].dims,e[1].dims,e[2].dims,e[3].dims,e[0].dims)],h=t=>{let r=J(`input`,e[0].dataType,e[0].dims.length),i=J(`position_ids`,e[1].dataType,e[1].dims.length),a=J(`cos_cache`,e[2].dataType,e[2].dims.length),o=J(`sin_cache`,e[3].dataType,e[3].dims.length),s=Y(`output`,e[0].dataType,e[0].dims.length);return t.registerUniforms([{name:`scale`,type:`f32`},{name:`global_shape`,type:`u32`,length:f.length},{name:`global_strides`,type:`u32`,length:p.length},{name:`input_output_strides`,type:`u32`,length:p.length}]),` ${t.declareVariables(r,i,a,o,s)} - ${t.mainStart(Zn)} + ${t.mainStart(Xn)} let half_rotary_emb_dim = uniforms.${a.name}_shape[1]; let bsnh = global_idx / uniforms.global_strides % uniforms.global_shape; let size = uniforms.global_shape[0] * uniforms.global_strides[0]; @@ -1792,7 +1792,7 @@ fn calculateOutputIndex(index: u32) -> u32 { if (bsnh[3] < half_rotary_emb_dim) { let position_ids_idx = - ${i.broadcastedIndicesToOffset(`bsnh.xy`,J(``,i.type.tensor,2))}; + ${i.broadcastedIndicesToOffset(`bsnh.xy`,Y(``,i.type.tensor,2))}; let position_id = u32(${i.getByOffset(`position_ids_idx`)}) + select(0, bsnh[1], position_ids_idx == 0); let i = dot(bsnh, uniforms.input_output_strides) + select(0, bsnh[3], ${n}); @@ -1807,7 +1807,7 @@ fn calculateOutputIndex(index: u32) -> u32 { let k = dot(bsnh, uniforms.input_output_strides) + half_rotary_emb_dim; ${s.setByOffset(`k`,r.getByOffset(`k`))} } - }`};return{name:`RotaryEmbedding`,shaderCache:{hint:Yn({interleaved:n}).cacheKey,inputDependencies:[`rank`,`rank`,`rank`,`rank`]},getShaderSource:h,getRunData:()=>({outputs:[{dims:e[0].dims,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(U.size(f)/Zn)},programUniforms:m})}},Hc=(e,t)=>{Bc(e.inputs,t),e.compute(Vc(e.inputs,t))}}),Wc,Gc,Kc,qc,Jc,Yc=M(()=>{"use strict";Xn(),V(),Di(),jc(),zc(),vr(),Uc(),Y(),Wc=(e,t)=>{if(t.doRotary&&e.length<=7)throw Error(`cos_cache and sin_cache inputs are required if do_rotary is specified`);let n=e[0],r=e[1],i=e[2],a=e[3],o=e[4];if(t.doRotary!==0&&e.length<=7)throw Error(`cos_cast and sin_cache are expected if do_rotary attribute is non-zero`);if(t.localWindowSize!==-1)throw Error(`Local attention is not supported`);if(t.softcap!==0)throw Error(`Softcap is not supported`);if(t.rotaryInterleaved!==0)throw Error(`Rotary interleaved is not supported`);if(t.smoothSoftmax)throw Error(`Smooth softmax is not supported`);if(n.dims.length!==3&&n.dims.length!==5)throw Error(`Input query is expected to have 3 or 5 dimensions`);let s=!1,c=n.dims[0],l=n.dims[1],u=n.dims.length===3?s?n.dims[2]/3:n.dims[2]:t.numHeads*n.dims[4],d=l,f=0,p=!r||r.dims.length===0,m=Math.floor(p?u/(t.numHeads+2*t.kvNumHeads):u/t.numHeads);p&&(u=m*t.numHeads);let h=a&&a.dims.length!==0,g=o&&o.dims.length!==0;if(h&&a.dims.length===4&&a.dims[0]===c&&a.dims[1]!==t.kvNumHeads&&a.dims[2]===t.kvNumHeads&&a.dims[3]===m)throw Error(`BSNH pastKey/pastValue is not supported`);if(h&&g){if(a.dims.length!==4)throw Error(`Input "past_key" is expected to have 4 dimensions`);if(o.dims.length!==4)throw Error(`Input "past_value" is expected to have 4 dimensions`);f=a.dims[2]}else if(h||g)throw Error(`Input "past_key" and "past_value" shall be both present or both absent`);let _=1;if(r&&r.dims.length>0){if(n.dims.length!==3)throw Error(`Input "query" is expected to have 3 dimensions when key is given`);if(r.dims.length<3||r.dims.length>5)throw Error(`Input "key" is expected to have 3, 4, or 5 dimensions`);if(n.dims[0]!==r.dims[0])throw Error(`Input "query" and "key" shall have same dim 0 (batch size)`);if(r.dims.length===3){if(n.dims[2]%r.dims[2]!==0)throw Error(`Dimension 2 of "query" should be a multiple of "key"`);d=r.dims[1]}else if(r.dims.length===5){if(r.dims[2]!==t.numHeads||r.dims[3]!==2||r.dims[4]!==m)throw Error(`Expect "key" shape (batch_size, kv_sequence_length, num_heads, 2, head_size) for packed kv`);if(i)throw Error(`Expect "value" be none when "key" has packed kv format.`);d=r.dims[1]}else{if(r.dims[1]!==t.numHeads||r.dims[3]!==m)throw Error(`Expect "key" shape (batch_size, num_heads, kv_sequence_length, head_size) for past_key`);d=r.dims[2]}}else{if(n.dims.length!==3&&n.dims.length!==5)throw Error(`Input "query" is expected to have 3 or 5 dimensions when key is empty`);if(n.dims.length===5&&(n.dims[2]!==t.numHeads||n.dims[3]!==3))throw Error(`Expect "query" shape (batch_size, kv_sequence_length, num_heads, 3, head_size) for packed kv`);_=3}let v=0,y=!1,b=t.kvNumHeads?m*t.kvNumHeads:u;if(i&&i.dims.length>0){if(i.dims.length!==3&&i.dims.length!==4)throw Error(`Input "value" is expected to have 3 or 4 dimensions`);if(n.dims[0]!==i.dims[0])throw Error(`Input "query" and "value" shall have same dim 0 (batch_size)`);if(i.dims.length===3){if(d!==i.dims[1])throw Error(`Input "key" and "value" shall have the same dim 1 (kv_sequence_length)`);b=i.dims[2]}else{if(d!==i.dims[2])throw Error(`Input "past_key" and "past_value" shall have the same dim 2 (kv_sequence_length)`);b=i.dims[1]*i.dims[3],y=!0}}let x=e.length>4?e[5]:void 0;if(x&&x.dims.length!==1&&x.dims[0]!==c)throw Error(`Input "seqlens" is expected to have 1 dimension and the same dim 0 as batch_size`);return{batchSize:c,sequenceLength:l,pastSequenceLength:f,kvSequenceLength:d,totalSequenceLength:-1,maxSequenceLength:-1,inputHiddenSize:0,hiddenSize:u,vHiddenSize:b,headSize:m,vHeadSize:Math.floor(b/t.kvNumHeads),numHeads:t.numHeads,kvNumHeads:t.kvNumHeads,nReps:t.numHeads/t.kvNumHeads,pastPresentShareBuffer:!1,maskType:v,scale:t.scale,broadcastResPosBias:!1,passPastInKv:y,qkvFormat:_}},Gc=Yn({perm:[0,2,1,3]}),Kc=(e,t,n)=>{let r=t,i=n.kvNumHeads;return t.dims.length===3&&n.kvSequenceLength!==0&&(r=t.reshape([n.batchSize,n.kvSequenceLength,i,n.headSize]),r=e.compute(hr(r,Gc.perm),{inputs:[r],outputs:[-1]})[0]),r},qc=(e,t,n,r)=>{let i=7,a=[`type`,`type`],o=[e*t],s=e*t,c=[{type:12,data:s},{type:12,data:t},{type:12,data:e}],l=e=>{let t=q(`seq_lens`,n.dataType,n.dims),a=q(`total_seq_lens`,r.dataType,r.dims),s=J(`pos_ids`,i,o),c=[{name:`output_size`,type:`u32`},{name:`sequence_length`,type:`u32`},{name:`batch_size`,type:`u32`}];return` + }`};return{name:`RotaryEmbedding`,shaderCache:{hint:Jn({interleaved:n}).cacheKey,inputDependencies:[`rank`,`rank`,`rank`,`rank`]},getShaderSource:h,getRunData:()=>({outputs:[{dims:e[0].dims,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(W.size(f)/Xn)},programUniforms:m})}},Vc=(e,t)=>{zc(e.inputs,t),e.compute(Bc(e.inputs,t))}}),Uc,Wc,Gc,Kc,qc,Jc=M(()=>{"use strict";Yn(),U(),Ei(),Ac(),Rc(),_r(),Hc(),X(),Uc=(e,t)=>{if(t.doRotary&&e.length<=7)throw Error(`cos_cache and sin_cache inputs are required if do_rotary is specified`);let n=e[0],r=e[1],i=e[2],a=e[3],o=e[4];if(t.doRotary!==0&&e.length<=7)throw Error(`cos_cast and sin_cache are expected if do_rotary attribute is non-zero`);if(t.localWindowSize!==-1)throw Error(`Local attention is not supported`);if(t.softcap!==0)throw Error(`Softcap is not supported`);if(t.rotaryInterleaved!==0)throw Error(`Rotary interleaved is not supported`);if(t.smoothSoftmax)throw Error(`Smooth softmax is not supported`);if(n.dims.length!==3&&n.dims.length!==5)throw Error(`Input query is expected to have 3 or 5 dimensions`);let s=!1,c=n.dims[0],l=n.dims[1],u=n.dims.length===3?s?n.dims[2]/3:n.dims[2]:t.numHeads*n.dims[4],d=l,f=0,p=!r||r.dims.length===0,m=Math.floor(p?u/(t.numHeads+2*t.kvNumHeads):u/t.numHeads);p&&(u=m*t.numHeads);let h=a&&a.dims.length!==0,g=o&&o.dims.length!==0;if(h&&a.dims.length===4&&a.dims[0]===c&&a.dims[1]!==t.kvNumHeads&&a.dims[2]===t.kvNumHeads&&a.dims[3]===m)throw Error(`BSNH pastKey/pastValue is not supported`);if(h&&g){if(a.dims.length!==4)throw Error(`Input "past_key" is expected to have 4 dimensions`);if(o.dims.length!==4)throw Error(`Input "past_value" is expected to have 4 dimensions`);f=a.dims[2]}else if(h||g)throw Error(`Input "past_key" and "past_value" shall be both present or both absent`);let _=1;if(r&&r.dims.length>0){if(n.dims.length!==3)throw Error(`Input "query" is expected to have 3 dimensions when key is given`);if(r.dims.length<3||r.dims.length>5)throw Error(`Input "key" is expected to have 3, 4, or 5 dimensions`);if(n.dims[0]!==r.dims[0])throw Error(`Input "query" and "key" shall have same dim 0 (batch size)`);if(r.dims.length===3){if(n.dims[2]%r.dims[2]!==0)throw Error(`Dimension 2 of "query" should be a multiple of "key"`);d=r.dims[1]}else if(r.dims.length===5){if(r.dims[2]!==t.numHeads||r.dims[3]!==2||r.dims[4]!==m)throw Error(`Expect "key" shape (batch_size, kv_sequence_length, num_heads, 2, head_size) for packed kv`);if(i)throw Error(`Expect "value" be none when "key" has packed kv format.`);d=r.dims[1]}else{if(r.dims[1]!==t.numHeads||r.dims[3]!==m)throw Error(`Expect "key" shape (batch_size, num_heads, kv_sequence_length, head_size) for past_key`);d=r.dims[2]}}else{if(n.dims.length!==3&&n.dims.length!==5)throw Error(`Input "query" is expected to have 3 or 5 dimensions when key is empty`);if(n.dims.length===5&&(n.dims[2]!==t.numHeads||n.dims[3]!==3))throw Error(`Expect "query" shape (batch_size, kv_sequence_length, num_heads, 3, head_size) for packed kv`);_=3}let v=0,y=!1,b=t.kvNumHeads?m*t.kvNumHeads:u;if(i&&i.dims.length>0){if(i.dims.length!==3&&i.dims.length!==4)throw Error(`Input "value" is expected to have 3 or 4 dimensions`);if(n.dims[0]!==i.dims[0])throw Error(`Input "query" and "value" shall have same dim 0 (batch_size)`);if(i.dims.length===3){if(d!==i.dims[1])throw Error(`Input "key" and "value" shall have the same dim 1 (kv_sequence_length)`);b=i.dims[2]}else{if(d!==i.dims[2])throw Error(`Input "past_key" and "past_value" shall have the same dim 2 (kv_sequence_length)`);b=i.dims[1]*i.dims[3],y=!0}}let x=e.length>4?e[5]:void 0;if(x&&x.dims.length!==1&&x.dims[0]!==c)throw Error(`Input "seqlens" is expected to have 1 dimension and the same dim 0 as batch_size`);return{batchSize:c,sequenceLength:l,pastSequenceLength:f,kvSequenceLength:d,totalSequenceLength:-1,maxSequenceLength:-1,inputHiddenSize:0,hiddenSize:u,vHiddenSize:b,headSize:m,vHeadSize:Math.floor(b/t.kvNumHeads),numHeads:t.numHeads,kvNumHeads:t.kvNumHeads,nReps:t.numHeads/t.kvNumHeads,pastPresentShareBuffer:!1,maskType:v,scale:t.scale,broadcastResPosBias:!1,passPastInKv:y,qkvFormat:_}},Wc=Jn({perm:[0,2,1,3]}),Gc=(e,t,n)=>{let r=t,i=n.kvNumHeads;return t.dims.length===3&&n.kvSequenceLength!==0&&(r=t.reshape([n.batchSize,n.kvSequenceLength,i,n.headSize]),r=e.compute(mr(r,Wc.perm),{inputs:[r],outputs:[-1]})[0]),r},Kc=(e,t,n,r)=>{let i=7,a=[`type`,`type`],o=[e*t],s=e*t,c=[{type:12,data:s},{type:12,data:t},{type:12,data:e}],l=e=>{let t=J(`seq_lens`,n.dataType,n.dims),a=J(`total_seq_lens`,r.dataType,r.dims),s=Y(`pos_ids`,i,o),c=[{name:`output_size`,type:`u32`},{name:`sequence_length`,type:`u32`},{name:`batch_size`,type:`u32`}];return` ${e.registerUniforms(c).declareVariables(t,a,s)} ${e.mainStart()} ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} @@ -1838,7 +1838,7 @@ fn calculateOutputIndex(index: u32) -> u32 { ${s.setByOffset(`global_idx`,`seqlen`)} }; } - `};return{name:`GeneratePositionIds`,shaderCache:{hint:`${e};${t}`,inputDependencies:a},getRunData:()=>({outputs:[{dims:o,dataType:i}],dispatchGroup:{x:Math.ceil(s/64)},programUniforms:c}),getShaderSource:l}},Jc=(e,t)=>{let n=Wc(e.inputs,t);if(e.inputs[0].dims.length===5)throw Error(`Packed QKV is not implemented`);if(e.inputs[1]?.dims.length===5)throw Error(`Packed KV is not implemented`);let r=e.inputs[0],i=e.inputs[1]&&e.inputs[1].dims.length>0?e.inputs[1]:void 0,a=e.inputs[2]&&e.inputs[2].dims.length>0?e.inputs[2]:void 0,o=e.inputs[3]&&e.inputs[3].dims.length!==0?e.inputs[3]:void 0,s=e.inputs[4]&&e.inputs[4].dims.length!==0?e.inputs[4]:void 0,c=e.inputs.length>4?e.inputs[5]:void 0,l=e.inputs.length>5?e.inputs[6]:void 0,u=n.kvNumHeads?n.kvNumHeads:n.numHeads,d=Yn({axis:2,numOutputs:3,splitSizes:[n.numHeads*n.headSize,u*n.headSize,u*n.headSize]}),[f,p,m]=!i&&!a?e.compute(Ic([r],d),{inputs:[r],outputs:[-1,-1,-1]}):[r,i,a],h,g;if(t.doRotary){let r=e.compute(qc(n.batchSize,n.sequenceLength,c,l),{inputs:[c,l],outputs:[-1]})[0],i=e.inputs[7],a=e.inputs[8],o=Yn({interleaved:t.rotaryInterleaved!==0,numHeads:n.numHeads,rotaryEmbeddingDim:0,scale:t.scale}),s=[f,r,i,a],u=[-1];h=e.compute(Vc(s,o),{inputs:s,outputs:u})[0],s.splice(0,1,p);let d=Yn({interleaved:t.rotaryInterleaved!==0,numHeads:n.kvNumHeads,rotaryEmbeddingDim:0,scale:t.scale});g=e.compute(Vc(s,d),{inputs:s,outputs:u})[0]}let _=kc(e,n.batchSize,n.numHeads,n.sequenceLength,n.headSize,t.doRotary?h:f,void 0,0),v=Kc(e,t.doRotary?g:p,n),y=Kc(e,m,n);wi(e,_,v,y,void 0,void 0,o,s,void 0,n,c,l)}}),Xc,Zc,Qc,$c,el=M(()=>{"use strict";V(),W(),vr(),Y(),Xc=(e,t,n,r,i,a,o,s)=>{let c=tr(a),l=c===1?`f32`:`vec${c}f`,u=c===1?`vec2f`:`mat2x${c}f`,d=i*o,f=64;d===1&&(f=256);let p=[i,o,a/c],m=[i,o,2],h=[`rank`,`type`,`type`],g=[];g.push(...G(p,m));let _=e=>{let i=q(`x`,t.dataType,3,c),a=q(`scale`,n.dataType,n.dims),o=q(`bias`,r.dataType,r.dims),d=J(`output`,1,3,2),p=[i,a,o,d];return` + `};return{name:`GeneratePositionIds`,shaderCache:{hint:`${e};${t}`,inputDependencies:a},getRunData:()=>({outputs:[{dims:o,dataType:i}],dispatchGroup:{x:Math.ceil(s/64)},programUniforms:c}),getShaderSource:l}},qc=(e,t)=>{let n=Uc(e.inputs,t);if(e.inputs[0].dims.length===5)throw Error(`Packed QKV is not implemented`);if(e.inputs[1]?.dims.length===5)throw Error(`Packed KV is not implemented`);let r=e.inputs[0],i=e.inputs[1]&&e.inputs[1].dims.length>0?e.inputs[1]:void 0,a=e.inputs[2]&&e.inputs[2].dims.length>0?e.inputs[2]:void 0,o=e.inputs[3]&&e.inputs[3].dims.length!==0?e.inputs[3]:void 0,s=e.inputs[4]&&e.inputs[4].dims.length!==0?e.inputs[4]:void 0,c=e.inputs.length>4?e.inputs[5]:void 0,l=e.inputs.length>5?e.inputs[6]:void 0,u=n.kvNumHeads?n.kvNumHeads:n.numHeads,d=Jn({axis:2,numOutputs:3,splitSizes:[n.numHeads*n.headSize,u*n.headSize,u*n.headSize]}),[f,p,m]=!i&&!a?e.compute(Fc([r],d),{inputs:[r],outputs:[-1,-1,-1]}):[r,i,a],h,g;if(t.doRotary){let r=e.compute(Kc(n.batchSize,n.sequenceLength,c,l),{inputs:[c,l],outputs:[-1]})[0],i=e.inputs[7],a=e.inputs[8],o=Jn({interleaved:t.rotaryInterleaved!==0,numHeads:n.numHeads,rotaryEmbeddingDim:0,scale:t.scale}),s=[f,r,i,a],u=[-1];h=e.compute(Bc(s,o),{inputs:s,outputs:u})[0],s.splice(0,1,p);let d=Jn({interleaved:t.rotaryInterleaved!==0,numHeads:n.kvNumHeads,rotaryEmbeddingDim:0,scale:t.scale});g=e.compute(Bc(s,d),{inputs:s,outputs:u})[0]}let _=Oc(e,n.batchSize,n.numHeads,n.sequenceLength,n.headSize,t.doRotary?h:f,void 0,0),v=Gc(e,t.doRotary?g:p,n),y=Gc(e,m,n);Ci(e,_,v,y,void 0,void 0,o,s,void 0,n,c,l)}}),Yc,Xc,Zc,Qc,$c=M(()=>{"use strict";U(),G(),_r(),X(),Yc=(e,t,n,r,i,a,o,s)=>{let c=er(a),l=c===1?`f32`:`vec${c}f`,u=c===1?`vec2f`:`mat2x${c}f`,d=i*o,f=64;d===1&&(f=256);let p=[i,o,a/c],m=[i,o,2],h=[`rank`,`type`,`type`],g=[];g.push(...K(p,m));let _=e=>{let i=J(`x`,t.dataType,3,c),a=J(`scale`,n.dataType,n.dims),o=J(`bias`,r.dataType,r.dims),d=Y(`output`,1,3,2),p=[i,a,o,d];return` var workgroup_shared : array<${u}, ${f}>; const workgroup_size = ${f}u; ${e.declareVariables(...p)} @@ -1864,15 +1864,15 @@ fn calculateOutputIndex(index: u32) -> u32 { workgroupBarrier(); } if (local_idx == 0) { - let sum_final = ${ir(`workgroup_shared[0][0]`,c)} / f32(hight * ${c}); - let squared_sum_final = ${ir(`workgroup_shared[0][1]`,c)} / f32(hight * ${c}); + let sum_final = ${rr(`workgroup_shared[0][0]`,c)} / f32(hight * ${c}); + let squared_sum_final = ${rr(`workgroup_shared[0][1]`,c)} / f32(hight * ${c}); let inv_std_dev = inverseSqrt(squared_sum_final - sum_final * sum_final + f32(${s})); let channel_scale = inv_std_dev * f32(scale[channel]); let channel_shift = f32(bias[channel]) - sum_final * channel_scale; output[workgroup_index] = vec2f(channel_scale, channel_shift); } - }`};return e.compute({name:`InstanceNormComputeChannelScaleShift`,shaderCache:{hint:`${c};${s};${f}`,inputDependencies:h},getRunData:()=>({outputs:[{dims:m,dataType:1}],dispatchGroup:{x:d},programUniforms:g}),getShaderSource:_},{inputs:[t,n,r],outputs:[-1]})[0]},Zc=(e,t,n)=>{let r=t[0].dims,i=r,a=2,o=r[0],s=r[1],c=U.sizeFromDimension(r,a),l=tr(c),u=U.size(i)/l,d=Xc(e,t[0],t[1],t[2],o,c,s,n.epsilon),f=[o,s,c/l],p=[o,s],m=[`type`,`none`],h=e=>{let n=q(`x`,t[0].dataType,f.length,l),r=q(`scale_shift`,1,p.length,2),i=J(`output`,t[0].dataType,f.length,l),a=[n,r,i];return` + }`};return e.compute({name:`InstanceNormComputeChannelScaleShift`,shaderCache:{hint:`${c};${s};${f}`,inputDependencies:h},getRunData:()=>({outputs:[{dims:m,dataType:1}],dispatchGroup:{x:d},programUniforms:g}),getShaderSource:_},{inputs:[t,n,r],outputs:[-1]})[0]},Xc=(e,t,n)=>{let r=t[0].dims,i=r,a=2,o=r[0],s=r[1],c=W.sizeFromDimension(r,a),l=er(c),u=W.size(i)/l,d=Yc(e,t[0],t[1],t[2],o,c,s,n.epsilon),f=[o,s,c/l],p=[o,s],m=[`type`,`none`],h=e=>{let n=J(`x`,t[0].dataType,f.length,l),r=J(`scale_shift`,1,p.length,2),i=Y(`output`,t[0].dataType,f.length,l),a=[n,r,i];return` ${e.registerUniform(`output_size`,`u32`).declareVariables(...a)} ${e.mainStart()} ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} @@ -1882,7 +1882,7 @@ fn calculateOutputIndex(index: u32) -> u32 { let scale_shift = ${r.getByIndices(`vec2(batch, channel)`)}; let value = ${n.getByOffset(`global_idx`)} * ${i.type.value}(scale_shift.x) + ${i.type.value}(scale_shift.y); ${i.setByOffset(`global_idx`,`value`)}; - }`};e.compute({name:`InstanceNormalization`,shaderCache:{hint:`${l}`,inputDependencies:m},getRunData:()=>({outputs:[{dims:i,dataType:t[0].dataType}],dispatchGroup:{x:Math.ceil(u/64)},programUniforms:[{type:12,data:u},...G(f,p,f)]}),getShaderSource:h},{inputs:[t[0],d]})},Qc=(e,t,n)=>{let r=t[0].dims,i=r,a=r[0],o=r[r.length-1],s=U.sizeFromDimension(r,1)/o,c=tr(o),l=U.size(i)/c,u=[{type:12,data:s},{type:12,data:Math.floor(o/c)}],d=[`type`,`type`],f=!1,p=[0,r.length-1];for(let e=0;er[p[t]])),h=Xc(e,m,t[1],t[2],a,s,o,n.epsilon),g=e=>{let n=$n(t[0].dataType),r=c===1?`vec2f`:`mat${c}x2f`,a=e=>{let t=e===0?`x`:`y`,r=c===1?`f32`:`vec${c}f`;switch(c){case 1:return`${n}(${r}(scale.${t}))`;case 2:return`vec2<${n}>(${r}(scale[0].${t}, scale[1].${t}))`;case 4:return`vec4<${n}>(${r}(scale[0].${t}, scale[1].${t}, scale[2].${t}, scale[3].${t}))`;default:throw Error(`Not supported compoents ${c}`)}},o=q(`input`,t[0].dataType,t[0].dims,c),s=J(`output`,t[0].dataType,i,c);return` + }`};e.compute({name:`InstanceNormalization`,shaderCache:{hint:`${l}`,inputDependencies:m},getRunData:()=>({outputs:[{dims:i,dataType:t[0].dataType}],dispatchGroup:{x:Math.ceil(u/64)},programUniforms:[{type:12,data:u},...K(f,p,f)]}),getShaderSource:h},{inputs:[t[0],d]})},Zc=(e,t,n)=>{let r=t[0].dims,i=r,a=r[0],o=r[r.length-1],s=W.sizeFromDimension(r,1)/o,c=er(o),l=W.size(i)/c,u=[{type:12,data:s},{type:12,data:Math.floor(o/c)}],d=[`type`,`type`],f=!1,p=[0,r.length-1];for(let e=0;er[p[t]])),h=Yc(e,m,t[1],t[2],a,s,o,n.epsilon),g=e=>{let n=Qn(t[0].dataType),r=c===1?`vec2f`:`mat${c}x2f`,a=e=>{let t=e===0?`x`:`y`,r=c===1?`f32`:`vec${c}f`;switch(c){case 1:return`${n}(${r}(scale.${t}))`;case 2:return`vec2<${n}>(${r}(scale[0].${t}, scale[1].${t}))`;case 4:return`vec4<${n}>(${r}(scale[0].${t}, scale[1].${t}, scale[2].${t}, scale[3].${t}))`;default:throw Error(`Not supported compoents ${c}`)}},o=J(`input`,t[0].dataType,t[0].dims,c),s=Y(`output`,t[0].dataType,i,c);return` @group(0) @binding(0) var input : array<${o.type.storage}>; @group(0) @binding(1) var scale_input : array<${r}>; @group(0) @binding(2) var output : array<${s.type.storage}>; @@ -1896,35 +1896,35 @@ fn calculateOutputIndex(index: u32) -> u32 { let scale_offset = current_image_number * uniforms.C + current_channel_number; let scale = scale_input[scale_offset]; output[global_idx] = fma(input[global_idx], ${a(0)}, ${a(1)}); - }`};e.compute({name:`InstanceNormalizationNHWC`,shaderCache:{hint:`${c}`,inputDependencies:d},getRunData:()=>({outputs:[{dims:i,dataType:t[0].dataType}],dispatchGroup:{x:Math.ceil(l/64)},programUniforms:u}),getShaderSource:g},{inputs:[t[0],h]})},$c=(e,t)=>{t.format===`NHWC`?Qc(e,e.inputs,t):Zc(e,e.inputs,t)}}),tl,nl,rl,il=M(()=>{"use strict";V(),W(),Y(),tl=e=>{if(!e||e.length<2)throw Error(`layerNorm requires at least 2 inputs.`)},nl=(e,t,n)=>{let r=t.simplified,i=e[0].dims,a=e[1],o=!r&&e[2],s=i,c=U.normalizeAxis(t.axis,i.length),l=U.sizeToDimension(i,c),u=U.sizeFromDimension(i,c),d=U.size(a.dims),f=o?U.size(o.dims):0;if(d!==u||o&&f!==u)throw Error(`Size of X.shape()[axis:] == ${u}. + }`};e.compute({name:`InstanceNormalizationNHWC`,shaderCache:{hint:`${c}`,inputDependencies:d},getRunData:()=>({outputs:[{dims:i,dataType:t[0].dataType}],dispatchGroup:{x:Math.ceil(l/64)},programUniforms:u}),getShaderSource:g},{inputs:[t[0],h]})},Qc=(e,t)=>{t.format===`NHWC`?Zc(e,e.inputs,t):Xc(e,e.inputs,t)}}),el,tl,nl,rl=M(()=>{"use strict";U(),G(),X(),el=e=>{if(!e||e.length<2)throw Error(`layerNorm requires at least 2 inputs.`)},tl=(e,t,n)=>{let r=t.simplified,i=e[0].dims,a=e[1],o=!r&&e[2],s=i,c=W.normalizeAxis(t.axis,i.length),l=W.sizeToDimension(i,c),u=W.sizeFromDimension(i,c),d=W.size(a.dims),f=o?W.size(o.dims):0;if(d!==u||o&&f!==u)throw Error(`Size of X.shape()[axis:] == ${u}. Size of scale and bias (if provided) must match this. - Got scale size of ${d} and bias size of ${f}`);let p=[];for(let e=0;e1,v=n>2,y=t=>{let n=$n(e[0].dataType),i=[q(`x`,e[0].dataType,e[0].dims,m),q(`scale`,a.dataType,a.dims,m)];o&&i.push(q(`bias`,o.dataType,o.dims,m)),i.push(J(`output`,e[0].dataType,s,m)),_&&i.push(J(`mean_data_output`,1,p)),v&&i.push(J(`inv_std_output`,1,p));let c=[{name:`norm_count`,type:`u32`},{name:`norm_size`,type:`f32`},{name:`norm_size_vectorized`,type:`u32`},{name:`epsilon`,type:`f32`}];return` + Got scale size of ${d} and bias size of ${f}`);let p=[];for(let e=0;e1,v=n>2,y=t=>{let n=Qn(e[0].dataType),i=[J(`x`,e[0].dataType,e[0].dims,m),J(`scale`,a.dataType,a.dims,m)];o&&i.push(J(`bias`,o.dataType,o.dims,m)),i.push(Y(`output`,e[0].dataType,s,m)),_&&i.push(Y(`mean_data_output`,1,p)),v&&i.push(Y(`inv_std_output`,1,p));let c=[{name:`norm_count`,type:`u32`},{name:`norm_size`,type:`f32`},{name:`norm_size_vectorized`,type:`u32`},{name:`epsilon`,type:`f32`}];return` ${t.registerUniforms(c).declareVariables(...i)} ${t.mainStart()} ${t.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.norm_count`)} let offset = global_idx * uniforms.norm_size_vectorized; - var mean_vector = ${nr(`f32`,m)}; - var mean_square_vector = ${nr(`f32`,m)}; + var mean_vector = ${tr(`f32`,m)}; + var mean_square_vector = ${tr(`f32`,m)}; for (var h: u32 = 0u; h < uniforms.norm_size_vectorized; h++) { - let value = ${rr(n,m,`x[h + offset]`)}; + let value = ${nr(n,m,`x[h + offset]`)}; mean_vector += value; mean_square_vector += value * value; } - let mean = ${ir(`mean_vector`,m)} / uniforms.norm_size; - let inv_std_dev = inverseSqrt(${ir(`mean_square_vector`,m)} / uniforms.norm_size ${r?``:`- mean * mean`} + uniforms.epsilon); + let mean = ${rr(`mean_vector`,m)} / uniforms.norm_size; + let inv_std_dev = inverseSqrt(${rr(`mean_square_vector`,m)} / uniforms.norm_size ${r?``:`- mean * mean`} + uniforms.epsilon); for (var j: u32 = 0; j < uniforms.norm_size_vectorized; j++) { - let f32input = ${rr(n,m,`x[j + offset]`)}; - let f32scale = ${rr(n,m,`scale[j]`)}; + let f32input = ${nr(n,m,`x[j + offset]`)}; + let f32scale = ${nr(n,m,`scale[j]`)}; output[j + offset] = ${i[0].type.value}((f32input ${r?``:`- mean`}) * inv_std_dev * f32scale - ${o?`+ ${rr(n,m,`bias[j]`)}`:``} + ${o?`+ ${nr(n,m,`bias[j]`)}`:``} ); } ${_?`mean_data_output[global_idx] = mean`:``}; ${v?`inv_std_output[global_idx] = inv_std_dev`:``}; - }`},b=[{dims:s,dataType:e[0].dataType}];return _&&b.push({dims:p,dataType:1}),v&&b.push({dims:p,dataType:1}),{name:`LayerNormalization`,shaderCache:{hint:`${m};${n};${r}`,inputDependencies:h},getRunData:()=>({outputs:b,dispatchGroup:{x:Math.ceil(l/64)},programUniforms:g}),getShaderSource:y}},rl=(e,t)=>{tl(e.inputs),e.compute(nl(e.inputs,t,e.outputCount))}}),al,ol,sl=M(()=>{"use strict";W(),po(),So(),al=e=>{if(!e||e.length!==2)throw Error(`MatMul requires 2 inputs.`);if(e[0].dims[e[0].dims.length-1]!==e[1].dims[e[1].dims.length-2])throw Error(`shared dimension does not match.`)},ol=e=>{al(e.inputs);let t=hn.calcShape(e.inputs[0].dims,e.inputs[1].dims,!0);if(!t)throw Error(`Can't use matmul on the given tensors`);let n=t[t.length-1],r=e.inputs[0].dims[e.inputs[0].dims.length-1];if(n<8&&r<8)e.compute(fo(e.inputs,{activation:``},t));else{let i=t[t.length-2],a=U.size(e.inputs[0].dims.slice(0,-2)),o=U.size(e.inputs[1].dims.slice(0,-2));if(a!==1&&i===1&&o===1){let i=e.inputs[0].reshape([1,a,r]),o=e.inputs[1].reshape([1,r,n]),s=[1,a,n],c=[i,o];e.compute(xo(c,{activation:``},t,s),{inputs:c})}else e.compute(xo(e.inputs,{activation:``},t))}}}),cl,ll,ul,dl,fl,pl=M(()=>{"use strict";V(),W(),Xn(),Y(),cl=(e,t)=>{if(e.length<3||e.length>4)throw Error(`MatMulNBits requires 3 or 4 inputs`);let n=e[0],r=n.dims.length;if(n.dims[r-1]!==t.k)throw Error(`The last dim of input shape does not match the k value`);let i=Math.floor((t.k+t.blockSize-1)/t.blockSize),a=t.blockSize/8*t.bits,o=e[1];if(!U.areEqual(o.dims,[t.n,i,a]))throw Error(`The second inputs must be 3D tensor with shape N X nBlocksPerCol X blobSize`);let s=e[2].dims;if(U.size(s)!==t.n*i)throw Error(`scales input size error.`);if(e.length===4){let n=e[3].dims,r=t.bits>4?t.n*i:t.n*Math.floor((i+1)/2);if(U.size(n)!==r)throw Error(`zeroPoints input size error.`)}},ll=(e,t)=>{let n=e[0].dims,r=n.length,i=n[r-2],a=t.k,o=t.n,s=n.slice(0,r-2),c=U.size(s),l=e[1].dims[2]/4,u=e[0].dataType,d=tr(t.k),f=tr(l),p=tr(o),m=s.concat([i,o]),h=i>1&&o/p%2==0?2:1,g=U.size(m)/p/h,_=64,v=[],y=[c,i,a/d],b=U.convertShape(e[1].dims).slice();b.splice(-1,1,l/f),v.push(...G(y)),v.push(...G(b)),v.push(...G(e[2].dims)),e.length===4&&v.push(...G(U.convertShape(e[3].dims)));let x=[c,i,o/p];v.push(...G(x));let S=n=>{let r=y.length,i=q(`a`,e[0].dataType,r,d),a=q(`b`,12,b.length,f),o=q(`scales`,e[2].dataType,e[2].dims.length),s=[i,a,o],c=e.length===4?q(`zero_points`,12,e[3].dims.length):void 0;c&&s.push(c);let u=x.length,m=J(`output`,e[0].dataType,u,p),g=$n(e[0].dataType),v=(()=>{switch(d){case 1:return`array<${g}, 8>`;case 2:return`mat4x2<${g}>`;case 4:return`mat2x4<${g}>`;default:throw Error(`${d}-component is not supported.`)}})(),S=()=>{let e=` + }`},b=[{dims:s,dataType:e[0].dataType}];return _&&b.push({dims:p,dataType:1}),v&&b.push({dims:p,dataType:1}),{name:`LayerNormalization`,shaderCache:{hint:`${m};${n};${r}`,inputDependencies:h},getRunData:()=>({outputs:b,dispatchGroup:{x:Math.ceil(l/64)},programUniforms:g}),getShaderSource:y}},nl=(e,t)=>{el(e.inputs),e.compute(tl(e.inputs,t,e.outputCount))}}),il,al,ol=M(()=>{"use strict";G(),fo(),xo(),il=e=>{if(!e||e.length!==2)throw Error(`MatMul requires 2 inputs.`);if(e[0].dims[e[0].dims.length-1]!==e[1].dims[e[1].dims.length-2])throw Error(`shared dimension does not match.`)},al=e=>{il(e.inputs);let t=mn.calcShape(e.inputs[0].dims,e.inputs[1].dims,!0);if(!t)throw Error(`Can't use matmul on the given tensors`);let n=t[t.length-1],r=e.inputs[0].dims[e.inputs[0].dims.length-1];if(n<8&&r<8)e.compute(uo(e.inputs,{activation:``},t));else{let i=t[t.length-2],a=W.size(e.inputs[0].dims.slice(0,-2)),o=W.size(e.inputs[1].dims.slice(0,-2));if(a!==1&&i===1&&o===1){let i=e.inputs[0].reshape([1,a,r]),o=e.inputs[1].reshape([1,r,n]),s=[1,a,n],c=[i,o];e.compute(bo(c,{activation:``},t,s),{inputs:c})}else e.compute(bo(e.inputs,{activation:``},t))}}}),sl,cl,ll,ul,dl,fl=M(()=>{"use strict";U(),G(),Yn(),X(),sl=(e,t)=>{if(e.length<3||e.length>4)throw Error(`MatMulNBits requires 3 or 4 inputs`);let n=e[0],r=n.dims.length;if(n.dims[r-1]!==t.k)throw Error(`The last dim of input shape does not match the k value`);let i=Math.floor((t.k+t.blockSize-1)/t.blockSize),a=t.blockSize/8*t.bits,o=e[1];if(!W.areEqual(o.dims,[t.n,i,a]))throw Error(`The second inputs must be 3D tensor with shape N X nBlocksPerCol X blobSize`);let s=e[2].dims;if(W.size(s)!==t.n*i)throw Error(`scales input size error.`);if(e.length===4){let n=e[3].dims,r=t.bits>4?t.n*i:t.n*Math.floor((i+1)/2);if(W.size(n)!==r)throw Error(`zeroPoints input size error.`)}},cl=(e,t)=>{let n=e[0].dims,r=n.length,i=n[r-2],a=t.k,o=t.n,s=n.slice(0,r-2),c=W.size(s),l=e[1].dims[2]/4,u=e[0].dataType,d=er(t.k),f=er(l),p=er(o),m=s.concat([i,o]),h=i>1&&o/p%2==0?2:1,g=W.size(m)/p/h,_=64,v=[],y=[c,i,a/d],b=W.convertShape(e[1].dims).slice();b.splice(-1,1,l/f),v.push(...K(y)),v.push(...K(b)),v.push(...K(e[2].dims)),e.length===4&&v.push(...K(W.convertShape(e[3].dims)));let x=[c,i,o/p];v.push(...K(x));let S=n=>{let r=y.length,i=J(`a`,e[0].dataType,r,d),a=J(`b`,12,b.length,f),o=J(`scales`,e[2].dataType,e[2].dims.length),s=[i,a,o],c=e.length===4?J(`zero_points`,12,e[3].dims.length):void 0;c&&s.push(c);let u=x.length,m=Y(`output`,e[0].dataType,u,p),g=Qn(e[0].dataType),v=(()=>{switch(d){case 1:return`array<${g}, 8>`;case 2:return`mat4x2<${g}>`;case 4:return`mat2x4<${g}>`;default:throw Error(`${d}-component is not supported.`)}})(),S=()=>{let e=` // reuse a data var input_offset = ${i.indicesToOffset(`${i.type.indices}(batch, row, word_offset)`)}; var a_data: ${v}; @@ -2001,7 +2001,7 @@ fn calculateOutputIndex(index: u32) -> u32 { } ${m.setByIndices(`${m.type.indices}(batch, row, col + local_id.x)`,`output_value`)}; } - }`};return{name:`MatMulNBits`,shaderCache:{hint:`${t.blockSize};${t.bits};${d};${f};${p};${h};${_}`,inputDependencies:Array(e.length).fill(`rank`)},getRunData:()=>({outputs:[{dims:m,dataType:u}],dispatchGroup:{x:g},programUniforms:v}),getShaderSource:S}},ul=(e,t)=>{let n=e[0].dims,r=n.length,i=n[r-2],a=t.k,o=t.n,s=n.slice(0,r-2),c=U.size(s),l=e[1].dims[2]/4,u=e[0].dataType,d=tr(t.k),f=tr(l),p=s.concat([i,o]),m=128,h=o%8==0?8:o%4==0?4:1,g=m/h,_=g*f*8,v=_/d,y=_/t.blockSize,b=U.size(p)/h,x=[],S=[c,i,a/d],C=U.convertShape(e[1].dims).slice();C.splice(-1,1,l/f),x.push(...G(S)),x.push(...G(C)),x.push(...G(e[2].dims)),e.length===4&&x.push(...G(U.convertShape(e[3].dims)));let w=[c,i,o];x.push(...G(w));let T=n=>{let r=S.length,i=q(`a`,e[0].dataType,r,d),a=q(`b`,12,C.length,f),o=q(`scales`,e[2].dataType,e[2].dims.length),s=[i,a,o],c=e.length===4?q(`zero_points`,12,e[3].dims.length):void 0;c&&s.push(c);let l=w.length,u=J(`output`,e[0].dataType,l),p=$n(e[0].dataType),_=()=>{switch(d){case 1:return` + }`};return{name:`MatMulNBits`,shaderCache:{hint:`${t.blockSize};${t.bits};${d};${f};${p};${h};${_}`,inputDependencies:Array(e.length).fill(`rank`)},getRunData:()=>({outputs:[{dims:m,dataType:u}],dispatchGroup:{x:g},programUniforms:v}),getShaderSource:S}},ll=(e,t)=>{let n=e[0].dims,r=n.length,i=n[r-2],a=t.k,o=t.n,s=n.slice(0,r-2),c=W.size(s),l=e[1].dims[2]/4,u=e[0].dataType,d=er(t.k),f=er(l),p=s.concat([i,o]),m=128,h=o%8==0?8:o%4==0?4:1,g=m/h,_=g*f*8,v=_/d,y=_/t.blockSize,b=W.size(p)/h,x=[],S=[c,i,a/d],C=W.convertShape(e[1].dims).slice();C.splice(-1,1,l/f),x.push(...K(S)),x.push(...K(C)),x.push(...K(e[2].dims)),e.length===4&&x.push(...K(W.convertShape(e[3].dims)));let w=[c,i,o];x.push(...K(w));let T=n=>{let r=S.length,i=J(`a`,e[0].dataType,r,d),a=J(`b`,12,C.length,f),o=J(`scales`,e[2].dataType,e[2].dims.length),s=[i,a,o],c=e.length===4?J(`zero_points`,12,e[3].dims.length):void 0;c&&s.push(c);let l=w.length,u=Y(`output`,e[0].dataType,l),p=Qn(e[0].dataType),_=()=>{switch(d){case 1:return` let a_data0 = vec4<${p}>(sub_a[word_offset], sub_a[word_offset + 1], sub_a[word_offset + 2], sub_a[word_offset + 3]); let a_data1 = vec4<${p}>(sub_a[word_offset + 4], sub_a[word_offset + 5], sub_a[word_offset + 6], sub_a[word_offset + 7]);`;case 2:return` let a_data0 = vec4<${p}>(sub_a[word_offset], sub_a[word_offset + 1]); @@ -2075,15 +2075,15 @@ fn calculateOutputIndex(index: u32) -> u32 { ${u.setByIndices(`${u.type.indices}(batch, row, col + local_idx)`,`output_value`)} } } - }`};return{name:`BlockwiseMatMulNBits32`,shaderCache:{hint:`${t.blockSize};${d};${f};${g};${h}`,inputDependencies:Array(e.length).fill(`rank`)},getRunData:()=>({outputs:[{dims:p,dataType:u}],dispatchGroup:{x:b},programUniforms:x}),getShaderSource:T}},dl=(e,t)=>{cl(e.inputs,t),t.blockSize===32&&e.adapterInfo.isVendor(`intel`)&&e.adapterInfo.isArchitecture(`gen-12lp`)?e.compute(ul(e.inputs,t)):e.compute(ll(e.inputs,t))},fl=e=>Yn(e)}),ml,hl,gl,_l,vl,yl,bl,xl,Sl,Cl=M(()=>{"use strict";V(),W(),Y(),ml=e=>{if(!e||e.length<1)throw Error(`Too few inputs`);if(e[0].dataType!==1&&e[0].dataType!==10)throw Error(`Input type must be float or float16.`);if(e.length>=2){let t=e[0].dims.length*2===e[1].dims[0];if(e.length===4&&(t=e[3].dims[0]*2===e[1].dims[0]),!t)throw Error(`The pads should be a 1D tensor of shape [2 * input_rank] or [2 * num_axes].`)}},hl=(e,t,n)=>{let r=``;for(let i=t-1;i>=0;--i)r+=` - k = i32(${e.indicesGet(`indices`,i)}) - ${K(`uniforms.pads`,i,n)}; + }`};return{name:`BlockwiseMatMulNBits32`,shaderCache:{hint:`${t.blockSize};${d};${f};${g};${h}`,inputDependencies:Array(e.length).fill(`rank`)},getRunData:()=>({outputs:[{dims:p,dataType:u}],dispatchGroup:{x:b},programUniforms:x}),getShaderSource:T}},ul=(e,t)=>{sl(e.inputs,t),t.blockSize===32&&e.adapterInfo.isVendor(`intel`)&&e.adapterInfo.isArchitecture(`gen-12lp`)?e.compute(ll(e.inputs,t)):e.compute(cl(e.inputs,t))},dl=e=>Jn(e)}),pl,ml,hl,gl,_l,vl,yl,bl,xl,Sl=M(()=>{"use strict";U(),G(),X(),pl=e=>{if(!e||e.length<1)throw Error(`Too few inputs`);if(e[0].dataType!==1&&e[0].dataType!==10)throw Error(`Input type must be float or float16.`);if(e.length>=2){let t=e[0].dims.length*2===e[1].dims[0];if(e.length===4&&(t=e[3].dims[0]*2===e[1].dims[0]),!t)throw Error(`The pads should be a 1D tensor of shape [2 * input_rank] or [2 * num_axes].`)}},ml=(e,t,n)=>{let r=``;for(let i=t-1;i>=0;--i)r+=` + k = i32(${e.indicesGet(`indices`,i)}) - ${q(`uniforms.pads`,i,n)}; if (k < 0) { break; } - if (k >= i32(${K(`uniforms.x_shape`,i,t)})) { + if (k >= i32(${q(`uniforms.x_shape`,i,t)})) { break; } - offset += k * i32(${K(`uniforms.x_strides`,i,t)}); + offset += k * i32(${q(`uniforms.x_strides`,i,t)}); `;return` value = ${e.type.value}(uniforms.constant_value); for (var i = 0; i < 1; i++) { @@ -2092,53 +2092,53 @@ fn calculateOutputIndex(index: u32) -> u32 { ${r} value = x[offset]; } - `},gl=(e,t,n)=>{let r=``;for(let i=t-1;i>=0;--i)r+=` - k = i32(${e.indicesGet(`indices`,i)}) - ${K(`uniforms.pads`,i,n)}; + `},hl=(e,t,n)=>{let r=``;for(let i=t-1;i>=0;--i)r+=` + k = i32(${e.indicesGet(`indices`,i)}) - ${q(`uniforms.pads`,i,n)}; if (k < 0) { k = -k; } { - let _2n_1 = 2 * (i32(${K(`uniforms.x_shape`,i,t)}) - 1); + let _2n_1 = 2 * (i32(${q(`uniforms.x_shape`,i,t)}) - 1); k = k % _2n_1; - if(k >= i32(${K(`uniforms.x_shape`,i,t)})) { + if(k >= i32(${q(`uniforms.x_shape`,i,t)})) { k = _2n_1 - k; } } - offset += k * i32(${K(`uniforms.x_strides`,i,t)}); + offset += k * i32(${q(`uniforms.x_strides`,i,t)}); `;return` var offset = 0; var k = 0; ${r} value = x[offset]; - `},_l=(e,t,n)=>{let r=``;for(let i=t-1;i>=0;--i)r+=` - k = i32(${e.indicesGet(`indices`,i)}) - ${K(`uniforms.pads`,i,n)}; + `},gl=(e,t,n)=>{let r=``;for(let i=t-1;i>=0;--i)r+=` + k = i32(${e.indicesGet(`indices`,i)}) - ${q(`uniforms.pads`,i,n)}; if (k < 0) { k = 0; } - if (k >= i32(${K(`uniforms.x_shape`,i,t)})) { - k = i32(${K(`uniforms.x_shape`,i,t)}) - 1; + if (k >= i32(${q(`uniforms.x_shape`,i,t)})) { + k = i32(${q(`uniforms.x_shape`,i,t)}) - 1; } - offset += k * i32(${K(`uniforms.x_strides`,i,t)}); + offset += k * i32(${q(`uniforms.x_strides`,i,t)}); `;return` var offset = 0; var k = 0; ${r} value = x[offset]; - `},vl=(e,t,n)=>{let r=``;for(let i=t-1;i>=0;--i)r+=` - k = i32(${e.indicesGet(`indices`,i)}) - ${K(`uniforms.pads`,i,n)}; + `},_l=(e,t,n)=>{let r=``;for(let i=t-1;i>=0;--i)r+=` + k = i32(${e.indicesGet(`indices`,i)}) - ${q(`uniforms.pads`,i,n)}; if (k < 0) { - k += i32(${K(`uniforms.x_shape`,i,t)}]); + k += i32(${q(`uniforms.x_shape`,i,t)}]); } - if (k >= i32(${K(`uniforms.x_shape`,i,t)})) { - k -= i32(${K(`uniforms.x_shape`,i,t)}); + if (k >= i32(${q(`uniforms.x_shape`,i,t)})) { + k -= i32(${q(`uniforms.x_shape`,i,t)}); } - offset += k * i32(${K(`uniforms.x_strides`,i,t)}); + offset += k * i32(${q(`uniforms.x_strides`,i,t)}); `;return` var offset = 0; var k = 0; ${r} value = x[offset]; - `},yl=(e,t,n)=>{switch(n.mode){case 0:return hl(e,t,n.pads.length);case 1:return gl(e,t,n.pads.length);case 2:return _l(e,t,n.pads.length);case 3:return vl(e,t,n.pads.length);default:throw Error(`Invalid mode`)}},bl=(e,t)=>{let n=U.padShape(e[0].dims.slice(),t.pads),r=e[0].dims,i=U.size(n),a=[{type:12,data:i},{type:6,data:t.pads}],o=e.length>=3&&e[2].data;t.mode===0&&a.push({type:o?e[2].dataType:1,data:t.value}),a.push(...G(e[0].dims,n));let s=[`rank`],c=i=>{let a=J(`output`,e[0].dataType,n.length),s=q(`x`,e[0].dataType,r.length),c=s.type.value,l=yl(a,r.length,t),u=[{name:`output_size`,type:`u32`},{name:`pads`,type:`i32`,length:t.pads.length}];return t.mode===0&&u.push({name:`constant_value`,type:o?c:`f32`}),` + `},vl=(e,t,n)=>{switch(n.mode){case 0:return ml(e,t,n.pads.length);case 1:return hl(e,t,n.pads.length);case 2:return gl(e,t,n.pads.length);case 3:return _l(e,t,n.pads.length);default:throw Error(`Invalid mode`)}},yl=(e,t)=>{let n=W.padShape(e[0].dims.slice(),t.pads),r=e[0].dims,i=W.size(n),a=[{type:12,data:i},{type:6,data:t.pads}],o=e.length>=3&&e[2].data;t.mode===0&&a.push({type:o?e[2].dataType:1,data:t.value}),a.push(...K(e[0].dims,n));let s=[`rank`],c=i=>{let a=Y(`output`,e[0].dataType,n.length),s=J(`x`,e[0].dataType,r.length),c=s.type.value,l=vl(a,r.length,t),u=[{name:`output_size`,type:`u32`},{name:`pads`,type:`i32`,length:t.pads.length}];return t.mode===0&&u.push({name:`constant_value`,type:o?c:`f32`}),` ${i.registerUniforms(u).declareVariables(s,a)} ${i.mainStart()} ${i.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} @@ -2148,7 +2148,7 @@ fn calculateOutputIndex(index: u32) -> u32 { var value = ${c}(0); ${l} output[global_idx] = value; - }`};return{name:`Pad`,shaderCache:{hint:`${t.mode}${o}`,inputDependencies:s},getRunData:()=>({outputs:[{dims:n,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(U.size(n)/64)},programUniforms:a}),getShaderSource:c}},xl=(e,t)=>{if(e.length>1){let n=e[1].getBigInt64Array(),r=e.length>=3&&e[2].data?e[2].dataType===10?e[2].getUint16Array()[0]:e[2].getFloat32Array()[0]:0,i=e[0].dims.length,a=new Int32Array(2*i).fill(0);if(e.length>=4){let t=e[3].getBigInt64Array();for(let e=0;ea[Number(t)]=Number(e));let o=[];return a.forEach(e=>o.push(e)),{mode:t.mode,value:r,pads:o}}else return t},Sl=(e,t)=>{ml(e.inputs);let n=xl(e.inputs,t);e.compute(bl(e.inputs,n),{inputs:[0]})}}),Z,wl,Tl,El,Dl,Ol,kl,Al,jl,Ml,Nl,Pl,Fl,Il,Ll,Rl,zl,Bl,Vl,Hl=M(()=>{"use strict";$e(),V(),W(),Y(),Z=e=>{if(L.webgpu.validateInputContent&&(!e||e.length!==1))throw Error(`Pool ops requires 1 input.`)},wl=(e,t,n)=>{let r=t.format===`NHWC`,i=e.dims.slice();r&&i.splice(1,0,i.pop());let a=Object.hasOwnProperty.call(t,`dilations`),o=t.kernelShape.slice(),s=t.strides.slice(),c=a?t.dilations.slice():[],l=t.pads.slice();gn.adjustPoolAttributes(n,i,o,s,c,l);let u=gn.computePoolOutputShape(n,i,s,c,o,l,t.autoPad),d=Object.assign({},t);a?Object.assign(d,{kernelShape:o,strides:s,pads:l,dilations:c,cacheKey:t.cacheKey}):Object.assign(d,{kernelShape:o,strides:s,pads:l,cacheKey:t.cacheKey});let f=u.slice();return f.push(f.splice(1,1)[0]),[d,r?f:u]},Tl=(e,t)=>{let n=t.format===`NHWC`,r=U.size(e),i=U.size(t.kernelShape),a=[{type:12,data:r},{type:12,data:i}],o=[{name:`outputSize`,type:`u32`},{name:`kernelSize`,type:`u32`}];if(t.kernelShape.length<=2){let e=t.kernelShape[t.kernelShape.length-1],n=t.strides[t.strides.length-1],r=t.pads[t.pads.length/2-1],i=t.pads[t.pads.length-1],s=!!(r+i);a.push({type:12,data:e},{type:12,data:n},{type:12,data:r},{type:12,data:i}),o.push({name:`kw`,type:`u32`},{name:`sw`,type:`u32`},{name:`pwStart`,type:`u32`},{name:`pwEnd`,type:`u32`});let c=!1;if(t.kernelShape.length===2){let e=t.kernelShape[t.kernelShape.length-2],n=t.strides[t.strides.length-2],r=t.pads[t.pads.length/2-2],i=t.pads[t.pads.length-2];c=!!(r+i),a.push({type:12,data:e},{type:12,data:n},{type:12,data:r},{type:12,data:i}),o.push({name:`kh`,type:`u32`},{name:`sh`,type:`u32`},{name:`phStart`,type:`u32`},{name:`phEnd`,type:`u32`})}return[a,o,!0,s,c]}else{if(n)throw Error(`Pooling with kernelShape.length > 2 is not supported for NHWC format.`);let e=U.computeStrides(t.kernelShape);a.push({type:12,data:e},{type:12,data:t.pads},{type:12,data:t.strides}),o.push({name:`kernelStrides`,type:`u32`,length:e.length},{name:`pads`,type:`u32`,length:t.pads.length},{name:`strides`,type:`u32`,length:t.strides.length});let r=t.pads.reduce((e,t)=>e+t);return[a,o,!!r,!1,!1]}},El=(e,t,n,r,i,a,o,s,c,l,u,d)=>{let f=i.format===`NHWC`,p=t.type.value,m=J(`output`,t.type.tensor,r);if(i.kernelShape.length<=2){let r=``,l=``,h=``,g=n-(f?2:1);if(r=u?` + }`};return{name:`Pad`,shaderCache:{hint:`${t.mode}${o}`,inputDependencies:s},getRunData:()=>({outputs:[{dims:n,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(W.size(n)/64)},programUniforms:a}),getShaderSource:c}},bl=(e,t)=>{if(e.length>1){let n=e[1].getBigInt64Array(),r=e.length>=3&&e[2].data?e[2].dataType===10?e[2].getUint16Array()[0]:e[2].getFloat32Array()[0]:0,i=e[0].dims.length,a=new Int32Array(2*i).fill(0);if(e.length>=4){let t=e[3].getBigInt64Array();for(let e=0;ea[Number(t)]=Number(e));let o=[];return a.forEach(e=>o.push(e)),{mode:t.mode,value:r,pads:o}}else return t},xl=(e,t)=>{pl(e.inputs);let n=bl(e.inputs,t);e.compute(yl(e.inputs,n),{inputs:[0]})}}),Cl,wl,Tl,El,Dl,Ol,kl,Al,jl,Ml,Nl,Pl,Fl,Il,Ll,Rl,zl,Bl,Vl,Hl=M(()=>{"use strict";Ze(),U(),G(),X(),Cl=e=>{if(R.webgpu.validateInputContent&&(!e||e.length!==1))throw Error(`Pool ops requires 1 input.`)},wl=(e,t,n)=>{let r=t.format===`NHWC`,i=e.dims.slice();r&&i.splice(1,0,i.pop());let a=Object.hasOwnProperty.call(t,`dilations`),o=t.kernelShape.slice(),s=t.strides.slice(),c=a?t.dilations.slice():[],l=t.pads.slice();hn.adjustPoolAttributes(n,i,o,s,c,l);let u=hn.computePoolOutputShape(n,i,s,c,o,l,t.autoPad),d=Object.assign({},t);a?Object.assign(d,{kernelShape:o,strides:s,pads:l,dilations:c,cacheKey:t.cacheKey}):Object.assign(d,{kernelShape:o,strides:s,pads:l,cacheKey:t.cacheKey});let f=u.slice();return f.push(f.splice(1,1)[0]),[d,r?f:u]},Tl=(e,t)=>{let n=t.format===`NHWC`,r=W.size(e),i=W.size(t.kernelShape),a=[{type:12,data:r},{type:12,data:i}],o=[{name:`outputSize`,type:`u32`},{name:`kernelSize`,type:`u32`}];if(t.kernelShape.length<=2){let e=t.kernelShape[t.kernelShape.length-1],n=t.strides[t.strides.length-1],r=t.pads[t.pads.length/2-1],i=t.pads[t.pads.length-1],s=!!(r+i);a.push({type:12,data:e},{type:12,data:n},{type:12,data:r},{type:12,data:i}),o.push({name:`kw`,type:`u32`},{name:`sw`,type:`u32`},{name:`pwStart`,type:`u32`},{name:`pwEnd`,type:`u32`});let c=!1;if(t.kernelShape.length===2){let e=t.kernelShape[t.kernelShape.length-2],n=t.strides[t.strides.length-2],r=t.pads[t.pads.length/2-2],i=t.pads[t.pads.length-2];c=!!(r+i),a.push({type:12,data:e},{type:12,data:n},{type:12,data:r},{type:12,data:i}),o.push({name:`kh`,type:`u32`},{name:`sh`,type:`u32`},{name:`phStart`,type:`u32`},{name:`phEnd`,type:`u32`})}return[a,o,!0,s,c]}else{if(n)throw Error(`Pooling with kernelShape.length > 2 is not supported for NHWC format.`);let e=W.computeStrides(t.kernelShape);a.push({type:12,data:e},{type:12,data:t.pads},{type:12,data:t.strides}),o.push({name:`kernelStrides`,type:`u32`,length:e.length},{name:`pads`,type:`u32`,length:t.pads.length},{name:`strides`,type:`u32`,length:t.strides.length});let r=t.pads.reduce((e,t)=>e+t);return[a,o,!!r,!1,!1]}},El=(e,t,n,r,i,a,o,s,c,l,u,d)=>{let f=i.format===`NHWC`,p=t.type.value,m=Y(`output`,t.type.tensor,r);if(i.kernelShape.length<=2){let r=``,l=``,h=``,g=n-(f?2:1);if(r=u?` for (var i: u32 = 0u; i < uniforms.kw; i++) { xIndices[${g}] = indices[${g}] * uniforms.sw - uniforms.pwStart + i; if (xIndices[${g}] < 0 || xIndices[${g}] @@ -2223,23 +2223,23 @@ fn calculateOutputIndex(index: u32) -> u32 { for (var i: u32 = 0u; i < uniforms.kernelSize; i++) { var offset = i; for (var j = 0u; j < ${r-1}u; j++) { - offsets[j] = offset / ${K(`uniforms.kernelStrides`,`j`,r)}; - offset -= offsets[j] * ${K(`uniforms.kernelStrides`,`j`,r)}; + offsets[j] = offset / ${q(`uniforms.kernelStrides`,`j`,r)}; + offset -= offsets[j] * ${q(`uniforms.kernelStrides`,`j`,r)}; } offsets[${r-1}] = offset; isPad = false; for (var j = ${n-r}u; j < ${n}u; j++) { - xIndices[j] = indices[j] * ${K(`uniforms.strides`,`j - ${n-r}u`,r)} - + offsets[j - ${n-r}u] - ${K(`uniforms.pads`,`j - 2u`,u)}; + xIndices[j] = indices[j] * ${q(`uniforms.strides`,`j - ${n-r}u`,r)} + + offsets[j - ${n-r}u] - ${q(`uniforms.pads`,`j - 2u`,u)}; ${d} } ${o} output[global_idx] = value; - }`}},Dl=e=>`${e.format};${e.ceilMode};${e.autoPad};${e.kernelShape.length}`,Ol=e=>`${Dl(e)};${e.countIncludePad}`,kl=e=>`${Dl(e)};${e.storageOrder};${e.dilations}`,Al=e=>({format:e.format,autoPad:[`NOTSET`,`VALID`,`SAME_UPPER`,`SAME_LOWER`][e.auto_pad],ceilMode:e.ceil_mode,kernelShape:e.kernel_shape,strides:e.strides,pads:e.pads}),jl=(e,t,n,r)=>{let[i,a]=wl(t,r,n),o=q(`x`,t.dataType,t.dims.length),s=o.type.value,c=`value += x_val;`,l=``;i.countIncludePad?l+=`value /= ${s}(uniforms.kernelSize);`:l+=`value /= ${s}(i32(uniforms.kernelSize) - pad);`;let[u,d,f,p,m]=Tl(a,i);u.push(...G(t.dims,a));let h=[`rank`];return{name:e,shaderCache:{hint:`${r.cacheKey};${f};${p};${m}`,inputDependencies:h},getRunData:()=>({outputs:[{dims:a,dataType:t.dataType}],dispatchGroup:{x:Math.ceil(U.size(a)/64)},programUniforms:u}),getShaderSource:e=>El(e,o,t.dims.length,a.length,i,c,l,0,d,f,p,m)}},Ml=e=>{let t=e.count_include_pad!==0,n=Al(e);if(n.ceilMode!==0)throw Error(`using ceil() in shape computation is not yet supported for AveragePool`);let r={countIncludePad:t,...n,cacheKey:``};return{...r,cacheKey:Ol(r)}},Nl=(e,t)=>{Z(e.inputs),e.compute(jl(`AveragePool`,e.inputs[0],!1,t))},Pl={autoPad:``,ceilMode:0,countIncludePad:!1,kernelShape:[],strides:[],pads:[],storageOrder:0,dilations:[]},Fl=e=>{let t=e.format;return{format:t,...Pl,cacheKey:t}},Il=(e,t)=>{Z(e.inputs),e.compute(jl(`GlobalAveragePool`,e.inputs[0],!0,t))},Ll=(e,t,n,r)=>{let[i,a]=wl(t,r,n),o=` + }`}},Dl=e=>`${e.format};${e.ceilMode};${e.autoPad};${e.kernelShape.length}`,Ol=e=>`${Dl(e)};${e.countIncludePad}`,kl=e=>`${Dl(e)};${e.storageOrder};${e.dilations}`,Al=e=>({format:e.format,autoPad:[`NOTSET`,`VALID`,`SAME_UPPER`,`SAME_LOWER`][e.auto_pad],ceilMode:e.ceil_mode,kernelShape:e.kernel_shape,strides:e.strides,pads:e.pads}),jl=(e,t,n,r)=>{let[i,a]=wl(t,r,n),o=J(`x`,t.dataType,t.dims.length),s=o.type.value,c=`value += x_val;`,l=``;i.countIncludePad?l+=`value /= ${s}(uniforms.kernelSize);`:l+=`value /= ${s}(i32(uniforms.kernelSize) - pad);`;let[u,d,f,p,m]=Tl(a,i);u.push(...K(t.dims,a));let h=[`rank`];return{name:e,shaderCache:{hint:`${r.cacheKey};${f};${p};${m}`,inputDependencies:h},getRunData:()=>({outputs:[{dims:a,dataType:t.dataType}],dispatchGroup:{x:Math.ceil(W.size(a)/64)},programUniforms:u}),getShaderSource:e=>El(e,o,t.dims.length,a.length,i,c,l,0,d,f,p,m)}},Ml=e=>{let t=e.count_include_pad!==0,n=Al(e);if(n.ceilMode!==0)throw Error(`using ceil() in shape computation is not yet supported for AveragePool`);let r={countIncludePad:t,...n,cacheKey:``};return{...r,cacheKey:Ol(r)}},Nl=(e,t)=>{Cl(e.inputs),e.compute(jl(`AveragePool`,e.inputs[0],!1,t))},Pl={autoPad:``,ceilMode:0,countIncludePad:!1,kernelShape:[],strides:[],pads:[],storageOrder:0,dilations:[]},Fl=e=>{let t=e.format;return{format:t,...Pl,cacheKey:t}},Il=(e,t)=>{Cl(e.inputs),e.compute(jl(`GlobalAveragePool`,e.inputs[0],!0,t))},Ll=(e,t,n,r)=>{let[i,a]=wl(t,r,n),o=` value = max(x_val, value); - `,s=``,c=q(`x`,t.dataType,t.dims.length),l=[`rank`],[u,d,f,p,m]=Tl(a,i);return u.push(...G(t.dims,a)),{name:e,shaderCache:{hint:`${r.cacheKey};${f};${p};${m}`,inputDependencies:l},getRunData:()=>({outputs:[{dims:a,dataType:t.dataType}],dispatchGroup:{x:Math.ceil(U.size(a)/64)},programUniforms:u}),getShaderSource:e=>El(e,c,t.dims.length,a.length,i,o,s,t.dataType===10?-65504:-1e5,d,f,p,m)}},Rl=(e,t)=>{Z(e.inputs),e.compute(Ll(`MaxPool`,e.inputs[0],!1,t))},zl=e=>{let t=e.storage_order,n=e.dilations,r=Al(e);if(t!==0)throw Error(`column major storage order is not yet supported for MaxPool`);if(r.ceilMode!==0)throw Error(`using ceil() in shape computation is not yet supported for MaxPool`);let i={storageOrder:t,dilations:n,...r,cacheKey:``};return{...i,cacheKey:kl(i)}},Bl=e=>{let t=e.format;return{format:t,...Pl,cacheKey:t}},Vl=(e,t)=>{Z(e.inputs),e.compute(Ll(`GlobalMaxPool`,e.inputs[0],!0,t))}}),Ul,Wl,Gl,Kl,ql=M(()=>{"use strict";V(),W(),Xn(),Y(),Ul=(e,t)=>{if(e.length<2||e.length>3)throw Error(`DequantizeLinear requires 2 or 3 inputs.`);if(e.length===3&&e[1].dims===e[2].dims)throw Error(`x-scale and x-zero-point must have the same shape.`);if(e.length===3&&e[0].dataType!==e[2].dataType)throw Error(`x and x-zero-point must have the same data type.`);if(e[0].dataType===6&&e.length>2)throw Error(`In the case of dequantizing int32 there is no zero point.`);if(e[1].dims.length!==0&&e[1].dims.length!==1&&e[1].dims.length!==e[0].dims.length)throw Error(`scale input must be a scalar, a 1D tensor, or have the same rank as the input tensor.`);if(e.length>2){if(e[0].dataType!==e[2].dataType)throw Error(`x and x-zero-point must have the same data type.`);if(e[1].dims.length!==e[2].dims.length)throw Error(`scale and zero-point inputs must have the same rank.`);if(!e[1].dims.map((t,n)=>t===e[2].dims[n]).reduce((e,t)=>e&&t,!0))throw Error(`scale and zero-point inputs must have the same shape.`)}if(t.blockSize>0){if(e[1].dims.length===0||e[1].dims.length===1&&e[1].dims[0]===1)throw Error(`blockSize must be set only for block quantization.`);if(!e[1].dims.map((n,r)=>r===t.axis||n===e[0].dims[r]).reduce((e,t)=>e&&t,!0))throw Error(`For block qunatization, scale input shape to match the input shape except for the axis`);if(e[1].dims.length!==e[0].dims.length)throw Error(`For block qunatization the scale input rank must be the same as the x rank.`);let n=e[0].dims[t.axis],r=e[1].dims[t.axis];if(t.blockSizeMath.ceil(n/(r-1)-1))throw Error(`blockSize must be with in the range [ceil(dI / Si), ceil(dI / (Si - 1) - 1)].`)}},Wl=(e,t)=>{let n=U.normalizeAxis(t.axis,e[0].dims.length),r=e[0].dataType,i=r===3,a=e[0].dims,o=e[1].dataType,s=U.size(a),c=r===3||r===2,l=c?[Math.ceil(U.size(e[0].dims)/4)]:e[0].dims,u=e[1].dims,d=e.length>2?e[2]:void 0,f=d?c?[Math.ceil(U.size(d.dims)/4)]:d.dims:void 0,p=u.length===0||u.length===1&&u[0]===1,m=p===!1&&u.length===1,h=tr(s),g=p&&(!c||h===4),_=g?h:1,v=g&&!c?h:1,y=q(`input`,c?12:r,l.length,v),b=q(`scale`,o,u.length),x=d?q(`zero_point`,c?12:r,f.length):void 0,S=J(`output`,o,a.length,_),C=[y,b];x&&C.push(x);let w=[l,u];d&&w.push(f);let T=[{type:12,data:s/_},{type:12,data:n},{type:12,data:t.blockSize},...G(...w,a)],E=e=>{let t=[{name:`output_size`,type:`u32`},{name:`axis`,type:`u32`},{name:`block_size`,type:`u32`}];return` + `,s=``,c=J(`x`,t.dataType,t.dims.length),l=[`rank`],[u,d,f,p,m]=Tl(a,i);return u.push(...K(t.dims,a)),{name:e,shaderCache:{hint:`${r.cacheKey};${f};${p};${m}`,inputDependencies:l},getRunData:()=>({outputs:[{dims:a,dataType:t.dataType}],dispatchGroup:{x:Math.ceil(W.size(a)/64)},programUniforms:u}),getShaderSource:e=>El(e,c,t.dims.length,a.length,i,o,s,t.dataType===10?-65504:-1e5,d,f,p,m)}},Rl=(e,t)=>{Cl(e.inputs),e.compute(Ll(`MaxPool`,e.inputs[0],!1,t))},zl=e=>{let t=e.storage_order,n=e.dilations,r=Al(e);if(t!==0)throw Error(`column major storage order is not yet supported for MaxPool`);if(r.ceilMode!==0)throw Error(`using ceil() in shape computation is not yet supported for MaxPool`);let i={storageOrder:t,dilations:n,...r,cacheKey:``};return{...i,cacheKey:kl(i)}},Bl=e=>{let t=e.format;return{format:t,...Pl,cacheKey:t}},Vl=(e,t)=>{Cl(e.inputs),e.compute(Ll(`GlobalMaxPool`,e.inputs[0],!0,t))}}),Ul,Wl,Gl,Kl,ql=M(()=>{"use strict";U(),G(),Yn(),X(),Ul=(e,t)=>{if(e.length<2||e.length>3)throw Error(`DequantizeLinear requires 2 or 3 inputs.`);if(e.length===3&&e[1].dims===e[2].dims)throw Error(`x-scale and x-zero-point must have the same shape.`);if(e.length===3&&e[0].dataType!==e[2].dataType)throw Error(`x and x-zero-point must have the same data type.`);if(e[0].dataType===6&&e.length>2)throw Error(`In the case of dequantizing int32 there is no zero point.`);if(e[1].dims.length!==0&&e[1].dims.length!==1&&e[1].dims.length!==e[0].dims.length)throw Error(`scale input must be a scalar, a 1D tensor, or have the same rank as the input tensor.`);if(e.length>2){if(e[0].dataType!==e[2].dataType)throw Error(`x and x-zero-point must have the same data type.`);if(e[1].dims.length!==e[2].dims.length)throw Error(`scale and zero-point inputs must have the same rank.`);if(!e[1].dims.map((t,n)=>t===e[2].dims[n]).reduce((e,t)=>e&&t,!0))throw Error(`scale and zero-point inputs must have the same shape.`)}if(t.blockSize>0){if(e[1].dims.length===0||e[1].dims.length===1&&e[1].dims[0]===1)throw Error(`blockSize must be set only for block quantization.`);if(!e[1].dims.map((n,r)=>r===t.axis||n===e[0].dims[r]).reduce((e,t)=>e&&t,!0))throw Error(`For block qunatization, scale input shape to match the input shape except for the axis`);if(e[1].dims.length!==e[0].dims.length)throw Error(`For block qunatization the scale input rank must be the same as the x rank.`);let n=e[0].dims[t.axis],r=e[1].dims[t.axis];if(t.blockSizeMath.ceil(n/(r-1)-1))throw Error(`blockSize must be with in the range [ceil(dI / Si), ceil(dI / (Si - 1) - 1)].`)}},Wl=(e,t)=>{let n=W.normalizeAxis(t.axis,e[0].dims.length),r=e[0].dataType,i=r===3,a=e[0].dims,o=e[1].dataType,s=W.size(a),c=r===3||r===2,l=c?[Math.ceil(W.size(e[0].dims)/4)]:e[0].dims,u=e[1].dims,d=e.length>2?e[2]:void 0,f=d?c?[Math.ceil(W.size(d.dims)/4)]:d.dims:void 0,p=u.length===0||u.length===1&&u[0]===1,m=p===!1&&u.length===1,h=er(s),g=p&&(!c||h===4),_=g?h:1,v=g&&!c?h:1,y=J(`input`,c?12:r,l.length,v),b=J(`scale`,o,u.length),x=d?J(`zero_point`,c?12:r,f.length):void 0,S=Y(`output`,o,a.length,_),C=[y,b];x&&C.push(x);let w=[l,u];d&&w.push(f);let T=[{type:12,data:s/_},{type:12,data:n},{type:12,data:t.blockSize},...K(...w,a)],E=e=>{let t=[{name:`output_size`,type:`u32`},{name:`axis`,type:`u32`},{name:`block_size`,type:`u32`}];return` ${e.registerUniforms(t).declareVariables(...C,S)} ${e.mainStart()} ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} @@ -2277,12 +2277,12 @@ fn calculateOutputIndex(index: u32) -> u32 { let zero_point_value = zero_point_vec[zero_point_offset % 4];`:`let zero_point_value = ${x.getByIndices(`scale_indices`)};`:`let zero_point_value = ${c?i?`i32`:`u32`:y.type.value}(0);`}; // Compute and write output ${S.setByOffset(`global_idx`,`${S.type.value}(x_value - zero_point_value) * scale_value`)}; - }`};return{name:`DequantizeLinear`,shaderCache:{hint:t.cacheKey,inputDependencies:x?[`rank`,`rank`,`rank`]:[`rank`,`rank`]},getShaderSource:E,getRunData:()=>({outputs:[{dims:a,dataType:o}],dispatchGroup:{x:Math.ceil(s/_/64),y:1,z:1},programUniforms:T})}},Gl=(e,t)=>{Ul(e.inputs,t),e.compute(Wl(e.inputs,t))},Kl=e=>Yn({axis:e.axis,blockSize:e.blockSize})}),Jl,Yl,Xl,Zl=M(()=>{"use strict";$e(),V(),Y(),Jl=(e,t,n)=>{let r=e===t,i=et&&n>0;if(r||i||a)throw Error(`Range these inputs' contents are invalid.`)},Yl=(e,t,n,r)=>{let i=Math.abs(Math.ceil((t-e)/n)),a=[i],o=i,s=[{type:12,data:o},{type:r,data:e},{type:r,data:n},...G(a)],c=e=>{let t=J(`output`,r,a.length),n=t.type.value,i=[{name:`outputSize`,type:`u32`},{name:`start`,type:n},{name:`delta`,type:n}];return` + }`};return{name:`DequantizeLinear`,shaderCache:{hint:t.cacheKey,inputDependencies:x?[`rank`,`rank`,`rank`]:[`rank`,`rank`]},getShaderSource:E,getRunData:()=>({outputs:[{dims:a,dataType:o}],dispatchGroup:{x:Math.ceil(s/_/64),y:1,z:1},programUniforms:T})}},Gl=(e,t)=>{Ul(e.inputs,t),e.compute(Wl(e.inputs,t))},Kl=e=>Jn({axis:e.axis,blockSize:e.blockSize})}),Jl,Yl,Xl,Zl=M(()=>{"use strict";Ze(),U(),X(),Jl=(e,t,n)=>{let r=e===t,i=et&&n>0;if(r||i||a)throw Error(`Range these inputs' contents are invalid.`)},Yl=(e,t,n,r)=>{let i=Math.abs(Math.ceil((t-e)/n)),a=[i],o=i,s=[{type:12,data:o},{type:r,data:e},{type:r,data:n},...K(a)],c=e=>{let t=Y(`output`,r,a.length),n=t.type.value,i=[{name:`outputSize`,type:`u32`},{name:`start`,type:n},{name:`delta`,type:n}];return` ${e.registerUniforms(i).declareVariables(t)} ${e.mainStart()} ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.outputSize`)} output[global_idx] = uniforms.start + ${n}(global_idx) * uniforms.delta; - }`};return{name:`Range`,shaderCache:{hint:`${r}`},getShaderSource:c,getRunData:()=>({outputs:[{dims:a,dataType:r}],dispatchGroup:{x:Math.ceil(o/64)},programUniforms:s})}},Xl=e=>{let t=0,n=0,r=0;e.inputs[0].dataType===6?(t=e.inputs[0].getInt32Array()[0],n=e.inputs[1].getInt32Array()[0],r=e.inputs[2].getInt32Array()[0]):e.inputs[0].dataType===1&&(t=e.inputs[0].getFloat32Array()[0],n=e.inputs[1].getFloat32Array()[0],r=e.inputs[2].getFloat32Array()[0]),L.webgpu.validateInputContent&&Jl(t,n,r),e.compute(Yl(t,n,r,e.inputs[0].dataType),{inputs:[]})}}),Ql,$l,eu,tu,nu,ru,iu=M(()=>{"use strict";V(),W(),Xn(),Y(),Ql=(e,t,n,r)=>{if(e!==`none`&&r!==`i32`&&r!==`u32`&&r!==`f32`)throw Error(`Input ${r} is not supported with reduction ${e}.`);let i=`{ + }`};return{name:`Range`,shaderCache:{hint:`${r}`},getShaderSource:c,getRunData:()=>({outputs:[{dims:a,dataType:r}],dispatchGroup:{x:Math.ceil(o/64)},programUniforms:s})}},Xl=e=>{let t=0,n=0,r=0;e.inputs[0].dataType===6?(t=e.inputs[0].getInt32Array()[0],n=e.inputs[1].getInt32Array()[0],r=e.inputs[2].getInt32Array()[0]):e.inputs[0].dataType===1&&(t=e.inputs[0].getFloat32Array()[0],n=e.inputs[1].getFloat32Array()[0],r=e.inputs[2].getFloat32Array()[0]),R.webgpu.validateInputContent&&Jl(t,n,r),e.compute(Yl(t,n,r,e.inputs[0].dataType),{inputs:[]})}}),Ql,$l,eu,tu,nu,ru,iu=M(()=>{"use strict";U(),G(),Yn(),X(),Ql=(e,t,n,r)=>{if(e!==`none`&&r!==`i32`&&r!==`u32`&&r!==`f32`)throw Error(`Input ${r} is not supported with reduction ${e}.`);let i=`{ var oldValue = 0; loop { let newValueF32 =`,a=`; @@ -2315,7 +2315,7 @@ fn calculateOutputIndex(index: u32) -> u32 { data_offset += u32((u32(index) * element_count_dim));`,eu=(e,t,n)=>`for (var i = 0u; i < uniforms.num_updates_elements; i++) { let value = updates[uniforms.num_updates_elements * ${n?`global_idx`:`idx`} + i]; ${Ql(e.reduction,`output[data_offset + i]`,`value`,t)} - }`,tu=(e,t)=>{let n=e[0].dims,r=e[1].dims,i=n,a=1,o=Math.ceil(U.size(r)/a),s=r[r.length-1],c=U.sizeFromDimension(n,s),l=U.sizeFromDimension(r,0)/s,u=[{type:12,data:o},{type:12,data:s},{type:12,data:c},...G(e[1].dims,e[2].dims,i)],d=r=>{let o=q(`indices`,e[1].dataType,e[1].dims.length),s=q(`updates`,e[2].dataType,e[2].dims.length,a),c=t.reduction!==`none`&&t.reduction!==``?or(`output`,e[0].dataType,i.length):J(`output`,e[0].dataType,i.length,a);return` + }`,tu=(e,t)=>{let n=e[0].dims,r=e[1].dims,i=n,a=1,o=Math.ceil(W.size(r)/a),s=r[r.length-1],c=W.sizeFromDimension(n,s),l=W.sizeFromDimension(r,0)/s,u=[{type:12,data:o},{type:12,data:s},{type:12,data:c},...K(e[1].dims,e[2].dims,i)],d=r=>{let o=J(`indices`,e[1].dataType,e[1].dims.length),s=J(`updates`,e[2].dataType,e[2].dims.length,a),c=t.reduction!==`none`&&t.reduction!==``?ar(`output`,e[0].dataType,i.length):Y(`output`,e[0].dataType,i.length,a);return` ${r.registerUniform(`output_size`,`u32`).registerUniform(`last_index_dimension`,`u32`).registerUniform(`num_updates_elements`,`u32`).declareVariables(o,s,c)} ${r.mainStart()} ${r.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} @@ -2360,7 +2360,7 @@ fn calculateOutputIndex(index: u32) -> u32 { ${$l(n.length,!0)} } ${eu(t,c.type.value,!0)} - }`};return{name:`ScatterND`,shaderCache:{hint:`${t.cacheKey}_${t.reduction}`,inputDependencies:[`rank`,`rank`]},getRunData:()=>({outputs:[{dims:i,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(o/64)},programUniforms:u}),getShaderSource:d}},nu=e=>Yn({reduction:e.reduction}),ru=(e,t)=>{e.compute(tu(e.inputs,t),{inputs:[e.inputs[1],e.inputs[2]],outputs:[]})}}),au,ou,su,cu,lu,uu,du,fu,pu,mu,hu,gu,_u,vu,yu,bu,xu,Su,Cu,wu,Tu=M(()=>{"use strict";V(),W(),Xn(),Y(),au=(e,t)=>{if(e.every(e=>e>0||(()=>{throw Error(`Resize requires scales input values to be positive`)})),e.length>0){if(t.mode===`linear`){if(!(e.length===2||e.length===3||e.length===4&&e[0]===1&&e[1]===1||e.length===4&&e[0]===1&&e[3]===1||e.length===5&&e[0]===1&&e[1]===1))throw Error(`For linear mode, Resize requires scales to be 2D, 3D, 4D with either two outermost or one innermost and + }`};return{name:`ScatterND`,shaderCache:{hint:`${t.cacheKey}_${t.reduction}`,inputDependencies:[`rank`,`rank`]},getRunData:()=>({outputs:[{dims:i,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(o/64)},programUniforms:u}),getShaderSource:d}},nu=e=>Jn({reduction:e.reduction}),ru=(e,t)=>{e.compute(tu(e.inputs,t),{inputs:[e.inputs[1],e.inputs[2]],outputs:[]})}}),au,ou,su,cu,lu,uu,du,fu,pu,mu,hu,gu,_u,vu,yu,bu,xu,Su,Cu,wu,Tu=M(()=>{"use strict";U(),G(),Yn(),X(),au=(e,t)=>{if(e.every(e=>e>0||(()=>{throw Error(`Resize requires scales input values to be positive`)})),e.length>0){if(t.mode===`linear`){if(!(e.length===2||e.length===3||e.length===4&&e[0]===1&&e[1]===1||e.length===4&&e[0]===1&&e[3]===1||e.length===5&&e[0]===1&&e[1]===1))throw Error(`For linear mode, Resize requires scales to be 2D, 3D, 4D with either two outermost or one innermost and one outermost scale values equal to 1, or 5D with two outermost scale values equal to 1`)}else if(t.mode===`cubic`&&!(e.length===2||e.length===4&&e[0]===1&&e[1]===1||e.length===4&&e[0]===1&&e[3]===1))throw Error(`Resize requires scales input size to be 2 or 4 for cubic mode`)}},ou=(e,t,n)=>{t.every(e=>e>=0&&e{throw Error(`Resize requires axes input values to be positive and less than rank`)}));let r=Array(n).fill(1);return t.forEach((t,n)=>r[t]=e[n]),r},su=(e,t,n,r,i,a)=>{let[o,s,c]=n>10?[1,2,3]:[-1,e.length>1?1:-1,-1],l=e[0].dims.length;if(o>0&&e.length>o&&e[o].dims.length>0)e[o].getFloat32Array().forEach(e=>a.push(e));else if(t.coordinateTransformMode===`tf_crop_and_resize`)throw Error(`Resize requires RoI input to be specified when coordinateTransformMode is tfCropAndResize`);if(s>0&&e.length>s&&e[s].dims.length===1&&e[s].dims[0]>0){if(e[s].getFloat32Array().forEach(e=>r.push(e)),r.length!==0&&r.length!==l&&n>=18&&r.length!==t.axes.length)throw Error(`Resize requires scales input size to be same as input rank or axes size for opset 18 and up`);au(r,t),t.axes.length>0&&ou(r,t.axes,l).forEach((e,t)=>r[t]=e)}if(c>0&&e.length>c&&e[c].dims.length===1&&e[c].dims[0]>0&&(e[c].getBigInt64Array().forEach(e=>i.push(Number(e))),i.length!==0&&i.length!==l&&n>=18&&i.length!==t.axes.length))throw Error(`Resize requires sizes input size to be same as input rank or axes size for opset 18 and up`);if(t.axes.length>0){if(r.length!==0&&r.length!==t.axes.length)throw Error(`Resize requires "scales" input size to be of axes rank when axes attributes is specified`);if(i.length!==0&&i.length!==t.axes.length)throw Error(`Resize requires "sizes" input size to be of rank axes rank when axes attributes is specified`)}if(typeof r<`u`&&typeof i<`u`&&r.length>0&&i.length>l)throw Error(`Resize requires only of scales or sizes to be specified`)},cu=(e,t,n,r)=>` // The whole part and the fractional part are calculated separately due to inaccuracy of floating // point division. As an example, f32(21) / f32(7) may evaluate to 2.99... instead of 3, causing an @@ -2399,14 +2399,14 @@ fn calculateOutputIndex(index: u32) -> u32 { var original_indices: array<${e.type.value}, ${n.length}>; for (var i:u32 = 0; i < ${n.length}; i++) { var output_index = ${e.indicesGet(`output_indices`,`i`)}; - var scale = ${K(`uniforms.scales`,`i`,r)}; - var roi_low = ${K(`uniforms.roi`,`i`,i)}; - var roi_hi = ${K(`uniforms.roi`,`i + ${t.length}`,i)}; + var scale = ${q(`uniforms.scales`,`i`,r)}; + var roi_low = ${q(`uniforms.roi`,`i`,i)}; + var roi_hi = ${q(`uniforms.roi`,`i + ${t.length}`,i)}; if (scale == 1.0) { original_indices[i] = ${e.type.value}(output_index); } else { - var input_shape_i = ${K(`uniforms.input_shape`,`i`,t.length)}; - var output_shape_i = ${K(`uniforms.output_shape`,`i`,n.length)}; + var input_shape_i = ${q(`uniforms.input_shape`,`i`,t.length)}; + var output_shape_i = ${q(`uniforms.output_shape`,`i`,n.length)}; original_indices[i] = getOriginalCoordinateFromResizedCoordinate(output_index, scale, output_shape_i, input_shape_i, roi_low, roi_hi); } @@ -2418,14 +2418,14 @@ fn calculateOutputIndex(index: u32) -> u32 { for (var i:u32 = 0; i < ${r.length}; i++) { var output_index = ${t.indicesGet(`output_indices`,`i`)}; var input_index: u32; - var scale = ${K(`uniforms.scales`,`i`,i)}; + var scale = ${q(`uniforms.scales`,`i`,i)}; if (scale == 1.0) { input_index = output_index; } else { - var roi_low = ${K(`uniforms.roi`,`i`,a)}; - var roi_hi = ${K(`uniforms.roi`,`i + ${n.length}`,a)}; - var input_shape_i = ${K(`uniforms.input_shape`,`i`,n.length)}; - var output_shape_i = ${K(`uniforms.output_shape`,`i`,r.length)}; + var roi_low = ${q(`uniforms.roi`,`i`,a)}; + var roi_hi = ${q(`uniforms.roi`,`i + ${n.length}`,a)}; + var input_shape_i = ${q(`uniforms.input_shape`,`i`,n.length)}; + var output_shape_i = ${q(`uniforms.output_shape`,`i`,r.length)}; var original_idx = getOriginalCoordinateFromResizedCoordinate(output_index, scale, output_shape_i, input_shape_i, roi_low, roi_hi); if (!${o} || (original_idx >= 0 && original_idx < ${t.type.value}(input_shape_i))) { @@ -2447,7 +2447,7 @@ fn calculateOutputIndex(index: u32) -> u32 { fn checkInputIndices(input_indices: ${e.type.indices}) -> bool { for (var i:u32 = 0; i < ${t.length}; i++) { var input_index = ${e.indicesGet(`input_indices`,`i`)}; - if (input_index < 0 || input_index >= ${K(`uniforms.input_shape`,`i`,t.length)}) { + if (input_index < 0 || input_index >= ${q(`uniforms.input_shape`,`i`,t.length)}) { return false; } } @@ -2603,7 +2603,7 @@ fn calculateOutputIndex(index: u32) -> u32 { } return (x111 * dx2 * dy2 * dz2 + x112 * dx2 * dy2 * dz1 + x121 * dx2 * dy1 *dz2 + x122 * dx2 * dy1 * dz1 + x211 * dx1 * dy2 * dz2 + x212 * dx1 * dy2 * dz1 + x221 * dx1 * dy1 *dz2 + x222 * dx1 * dy1 * dz1); - }`},xu=(e,t,n,r,i,a)=>{let o=e.dims,s=du(a,t.axes,o.length),c=fu(o,r,i,t.axes),l=r.slice();r.length===0&&(l=o.map((e,t)=>e===0?1:c[t]/e),t.keepAspectRatioPolicy!==`stretch`&&(c=pu(o,l,t)));let u=J(`output`,e.dataType,c.length),d=q(`input`,e.dataType,o.length),f=U.size(c),p=o.length===c.length&&o.every((e,t)=>e===c[t]),m=t.coordinateTransformMode===`tf_crop_and_resize`,h=t.extrapolationValue,g=d.type.value,_=e=>` + }`},xu=(e,t,n,r,i,a)=>{let o=e.dims,s=du(a,t.axes,o.length),c=fu(o,r,i,t.axes),l=r.slice();r.length===0&&(l=o.map((e,t)=>e===0?1:c[t]/e),t.keepAspectRatioPolicy!==`stretch`&&(c=pu(o,l,t)));let u=Y(`output`,e.dataType,c.length),d=J(`input`,e.dataType,o.length),f=W.size(c),p=o.length===c.length&&o.every((e,t)=>e===c[t]),m=t.coordinateTransformMode===`tf_crop_and_resize`,h=t.extrapolationValue,g=d.type.value,_=e=>` ${p?``:` ${lu(t.coordinateTransformMode,g)}; ${(()=>{switch(t.mode){case`nearest`:return` @@ -2630,7 +2630,7 @@ fn calculateOutputIndex(index: u32) -> u32 { output[global_idx] = ${t.extrapolationValue}; }`;case`linear`:return`output[global_idx] = ${o.length===2||o.length===4?`bilinearInterpolation`:`trilinearInterpolation`}(output_indices);`;case`cubic`:return`output[global_idx] = bicubicInterpolation(output_indices);`;default:throw Error(`Unsupported resize mode: ${t.mode}`)}})()}; `} - }`;return{name:`Resize`,shaderCache:{hint:`${t.cacheKey}|${n}|${l.length>0?t.mode===`cubic`?l:l.length:``}|${i.length>0?i:``}|${s.length>0?s:``}|${p}|${t.mode===`nearest`?o.length:o}`,inputDependencies:[`rank`]},getShaderSource:_,getRunData:()=>({outputs:[{dims:c,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(f/64)},programUniforms:[{type:12,data:f},{type:1,data:l},{type:1,data:s},...G(o,c)]})}},Su=e=>{let t=e.customDataBuffer;return new Uint32Array(t,t.byteOffset,1)[0]},Cu=(e,t)=>{let n=[],r=[],i=[],a=Su(e);if(t.antialias!==0)throw Error(`Only default value (0) for Antialias attribute is supported`);su(e.inputs,t,a,n,r,i),e.compute(xu(e.inputs[0],t,a,n,r,i),{inputs:[0]})},wu=e=>{let t=e.antialias,n=e.axes,r=e.coordinateTransformMode,i=e.cubicCoeffA,a=e.excludeOutside!==0,o=e.extrapolationValue,s=e.keepAspectRatioPolicy,c=e.mode,l=e.nearestMode===``?`simple`:e.nearestMode;return Yn({antialias:t,axes:n,coordinateTransformMode:r,cubicCoeffA:i,excludeOutside:a,extrapolationValue:o,keepAspectRatioPolicy:s,mode:c,nearestMode:l})}}),Eu,Du,Ou,ku=M(()=>{"use strict";V(),W(),Y(),Eu=e=>{if(!e||e.length<3)throw Error(`layerNorm requires at least 3 inputs.`);let t=e[0],n=e[1],r=e[2];if(t.dataType!==n.dataType||t.dataType!==r.dataType)throw Error(`All inputs must have the same data type`);if(t.dims.length!==3&&t.dims.length!==2)throw Error(`Input must be 2D or 3D`);if(n.dims.length!==3&&n.dims.length!==2)throw Error(`Skip must be 2D or 3D`);let i=t.dims[t.dims.length-1],a=t.dims[t.dims.length-2];if(n.dims[n.dims.length-1]!==i)throw Error(`Skip must have the same hidden size as input`);if(n.dims[n.dims.length-2]!==a)throw Error(`Skip must have the same sequence length as input`);if(r.dims.length!==1)throw Error(`Gamma must be 1D`);if(r.dims[r.dims.length-1]!==i)throw Error(`Gamma must have the same hidden size as input`);if(e.length>3){let t=e[3];if(t.dims.length!==1)throw Error(`Beta must be 1D`);if(t.dims[t.dims.length-1]!==i)throw Error(`Beta must have the same hidden size as input`)}if(e.length>4){let t=e[4];if(t.dims.length!==1)throw Error(`Bias must be 1D`);if(t.dims[t.dims.length-1]!==i)throw Error(`Bias must have the same hidden size as input`)}},Du=(e,t,n,r)=>{let i=t.simplified,a=e[0].dims,o=U.size(a),s=a,c=o,l=a.slice(-1)[0],u=r?a.slice(0,-1).concat(1):[],d=!i&&e.length>3,f=e.length>4,p=r&&n>1,m=r&&n>2,h=n>3,g=64,_=tr(l),v=[{type:12,data:c},{type:12,data:_},{type:12,data:l},{type:1,data:t.epsilon}],y=t=>{let n=[{name:`output_size`,type:`u32`},{name:`components`,type:`u32`},{name:`hidden_size`,type:`u32`},{name:`epsilon`,type:`f32`}],r=[q(`x`,e[0].dataType,e[0].dims,_),q(`skip`,e[1].dataType,e[1].dims,_),q(`gamma`,e[2].dataType,e[2].dims,_)];d&&r.push(q(`beta`,e[3].dataType,e[3].dims,_)),f&&r.push(q(`bias`,e[4].dataType,e[4].dims,_)),r.push(J(`output`,e[0].dataType,s,_)),p&&r.push(J(`mean_output`,1,u)),m&&r.push(J(`inv_std_output`,1,u)),h&&r.push(J(`input_skip_bias_sum`,e[0].dataType,s,_));let a=$n(e[0].dataType),o=$n(1,_);return` + }`;return{name:`Resize`,shaderCache:{hint:`${t.cacheKey}|${n}|${l.length>0?t.mode===`cubic`?l:l.length:``}|${i.length>0?i:``}|${s.length>0?s:``}|${p}|${t.mode===`nearest`?o.length:o}`,inputDependencies:[`rank`]},getShaderSource:_,getRunData:()=>({outputs:[{dims:c,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(f/64)},programUniforms:[{type:12,data:f},{type:1,data:l},{type:1,data:s},...K(o,c)]})}},Su=e=>{let t=e.customDataBuffer;return new Uint32Array(t,t.byteOffset,1)[0]},Cu=(e,t)=>{let n=[],r=[],i=[],a=Su(e);if(t.antialias!==0)throw Error(`Only default value (0) for Antialias attribute is supported`);su(e.inputs,t,a,n,r,i),e.compute(xu(e.inputs[0],t,a,n,r,i),{inputs:[0]})},wu=e=>{let t=e.antialias,n=e.axes,r=e.coordinateTransformMode,i=e.cubicCoeffA,a=e.excludeOutside!==0,o=e.extrapolationValue,s=e.keepAspectRatioPolicy,c=e.mode,l=e.nearestMode===``?`simple`:e.nearestMode;return Jn({antialias:t,axes:n,coordinateTransformMode:r,cubicCoeffA:i,excludeOutside:a,extrapolationValue:o,keepAspectRatioPolicy:s,mode:c,nearestMode:l})}}),Eu,Du,Ou,ku=M(()=>{"use strict";U(),G(),X(),Eu=e=>{if(!e||e.length<3)throw Error(`layerNorm requires at least 3 inputs.`);let t=e[0],n=e[1],r=e[2];if(t.dataType!==n.dataType||t.dataType!==r.dataType)throw Error(`All inputs must have the same data type`);if(t.dims.length!==3&&t.dims.length!==2)throw Error(`Input must be 2D or 3D`);if(n.dims.length!==3&&n.dims.length!==2)throw Error(`Skip must be 2D or 3D`);let i=t.dims[t.dims.length-1],a=t.dims[t.dims.length-2];if(n.dims[n.dims.length-1]!==i)throw Error(`Skip must have the same hidden size as input`);if(n.dims[n.dims.length-2]!==a)throw Error(`Skip must have the same sequence length as input`);if(r.dims.length!==1)throw Error(`Gamma must be 1D`);if(r.dims[r.dims.length-1]!==i)throw Error(`Gamma must have the same hidden size as input`);if(e.length>3){let t=e[3];if(t.dims.length!==1)throw Error(`Beta must be 1D`);if(t.dims[t.dims.length-1]!==i)throw Error(`Beta must have the same hidden size as input`)}if(e.length>4){let t=e[4];if(t.dims.length!==1)throw Error(`Bias must be 1D`);if(t.dims[t.dims.length-1]!==i)throw Error(`Bias must have the same hidden size as input`)}},Du=(e,t,n,r)=>{let i=t.simplified,a=e[0].dims,o=W.size(a),s=a,c=o,l=a.slice(-1)[0],u=r?a.slice(0,-1).concat(1):[],d=!i&&e.length>3,f=e.length>4,p=r&&n>1,m=r&&n>2,h=n>3,g=64,_=er(l),v=[{type:12,data:c},{type:12,data:_},{type:12,data:l},{type:1,data:t.epsilon}],y=t=>{let n=[{name:`output_size`,type:`u32`},{name:`components`,type:`u32`},{name:`hidden_size`,type:`u32`},{name:`epsilon`,type:`f32`}],r=[J(`x`,e[0].dataType,e[0].dims,_),J(`skip`,e[1].dataType,e[1].dims,_),J(`gamma`,e[2].dataType,e[2].dims,_)];d&&r.push(J(`beta`,e[3].dataType,e[3].dims,_)),f&&r.push(J(`bias`,e[4].dataType,e[4].dims,_)),r.push(Y(`output`,e[0].dataType,s,_)),p&&r.push(Y(`mean_output`,1,u)),m&&r.push(Y(`inv_std_output`,1,u)),h&&r.push(Y(`input_skip_bias_sum`,e[0].dataType,s,_));let a=Qn(e[0].dataType),o=Qn(1,_);return` ${t.registerUniforms(n).declareVariables(...r)} var sum_shared : array<${o}, ${g}>; @@ -2654,7 +2654,7 @@ fn calculateOutputIndex(index: u32) -> u32 { let value = input_value + skip_value + bias_value; ${h?`input_skip_bias_sum[offset + i] = value;`:``} output[offset + i] = value; - let f32_value = ${rr(a,_,`value`)}; + let f32_value = ${nr(a,_,`value`)}; sum_shared[ix] += f32_value; sum_squared_shared[ix] += f32_value * f32_value; } @@ -2672,8 +2672,8 @@ fn calculateOutputIndex(index: u32) -> u32 { let sum = sum_shared[0]; let square_sum = sum_squared_shared[0]; - let mean = ${ir(`sum`,_)} / f32(uniforms.hidden_size); - let inv_std_dev = inverseSqrt(${ir(`square_sum`,_)} / f32(uniforms.hidden_size) ${i?``:`- mean * mean`} + uniforms.epsilon); + let mean = ${rr(`sum`,_)} / f32(uniforms.hidden_size); + let inv_std_dev = inverseSqrt(${rr(`square_sum`,_)} / f32(uniforms.hidden_size) ${i?``:`- mean * mean`} + uniforms.epsilon); ${p?`mean_output[global_idx] = mean;`:``} ${m?`inv_std_output[global_idx] = inv_std_dev;`:``} @@ -2682,14 +2682,14 @@ fn calculateOutputIndex(index: u32) -> u32 { ${a}(inv_std_dev) * gamma[offset1d + i] ${d?`+ beta[offset1d + i]`:``}; } - }`},b=[{dims:s,dataType:e[0].dataType}];return n>1&&b.push({dims:u,dataType:1}),n>2&&b.push({dims:u,dataType:1}),n>3&&b.push({dims:a,dataType:e[0].dataType}),{name:`SkipLayerNormalization`,shaderCache:{hint:`${_};${p};${m};${h}`,inputDependencies:e.map((e,t)=>`type`)},getShaderSource:y,getRunData:()=>({outputs:b,dispatchGroup:{x:Math.ceil(c/l)},programUniforms:v})}},Ou=(e,t)=>{Eu(e.inputs);let n=[0];e.outputCount>1&&n.push(-3),e.outputCount>2&&n.push(-3),e.outputCount>3&&n.push(3),e.compute(Du(e.inputs,t,e.outputCount,!1),{outputs:n})}}),Au,ju,Mu,Nu,Pu,Fu,Iu,Lu,Ru=M(()=>{"use strict";V(),W(),Xn(),Y(),Au=(e,t)=>{if(!e||e.length<1)throw Error(`too few inputs`);if(t.axes.length!==0){if(t.axes.length!==t.starts.length||t.axes.length!==t.ends.length)throw Error(`axes, starts and ends must have the same length`)}else if(t.starts.length!==t.ends.length)throw Error(`starts and ends must have the same length`);e.slice(1).forEach((t,n)=>{if(e[n+1].dataType!==6&&e[n+1].dataType!==7)throw Error(`Input ${n} must be an array of int32 or int64`)})},ju=(e,t)=>{let n=[];if(e.length>t)if(e[t].dataType===7)e[t].getBigInt64Array().forEach(e=>n.push(Number(e)));else if(e[t].dataType===6)e[t].getInt32Array().forEach(e=>n.push(Number(e)));else throw Error(`Input ${t} must be an array of int32 or int64`);return n},Mu=(e,t)=>{if(e.length>1){let t=ju(e,1),n=ju(e,2),r=ju(e,3);return r.length===0&&(r=[...Array(e[0].dims.length).keys()]),Yn({starts:t,ends:n,axes:r})}else return t},Nu=(e,t,n,r,i)=>{let a=e;return e<0&&(a+=n[r[t]]),i[t]<0?Math.max(0,Math.min(a,n[r[t]]-1)):Math.max(0,Math.min(a,n[r[t]]))},Pu=(e,t,n)=>`fn calculateInputIndices(output_indices: ${t.type.indices}) -> ${e.type.indices} { + }`},b=[{dims:s,dataType:e[0].dataType}];return n>1&&b.push({dims:u,dataType:1}),n>2&&b.push({dims:u,dataType:1}),n>3&&b.push({dims:a,dataType:e[0].dataType}),{name:`SkipLayerNormalization`,shaderCache:{hint:`${_};${p};${m};${h}`,inputDependencies:e.map((e,t)=>`type`)},getShaderSource:y,getRunData:()=>({outputs:b,dispatchGroup:{x:Math.ceil(c/l)},programUniforms:v})}},Ou=(e,t)=>{Eu(e.inputs);let n=[0];e.outputCount>1&&n.push(-3),e.outputCount>2&&n.push(-3),e.outputCount>3&&n.push(3),e.compute(Du(e.inputs,t,e.outputCount,!1),{outputs:n})}}),Au,ju,Mu,Nu,Pu,Fu,Iu,Lu,Ru=M(()=>{"use strict";U(),G(),Yn(),X(),Au=(e,t)=>{if(!e||e.length<1)throw Error(`too few inputs`);if(t.axes.length!==0){if(t.axes.length!==t.starts.length||t.axes.length!==t.ends.length)throw Error(`axes, starts and ends must have the same length`)}else if(t.starts.length!==t.ends.length)throw Error(`starts and ends must have the same length`);e.slice(1).forEach((t,n)=>{if(e[n+1].dataType!==6&&e[n+1].dataType!==7)throw Error(`Input ${n} must be an array of int32 or int64`)})},ju=(e,t)=>{let n=[];if(e.length>t)if(e[t].dataType===7)e[t].getBigInt64Array().forEach(e=>n.push(Number(e)));else if(e[t].dataType===6)e[t].getInt32Array().forEach(e=>n.push(Number(e)));else throw Error(`Input ${t} must be an array of int32 or int64`);return n},Mu=(e,t)=>{if(e.length>1){let t=ju(e,1),n=ju(e,2),r=ju(e,3);return r.length===0&&(r=[...Array(e[0].dims.length).keys()]),Jn({starts:t,ends:n,axes:r})}else return t},Nu=(e,t,n,r,i)=>{let a=e;return e<0&&(a+=n[r[t]]),i[t]<0?Math.max(0,Math.min(a,n[r[t]]-1)):Math.max(0,Math.min(a,n[r[t]]))},Pu=(e,t,n)=>`fn calculateInputIndices(output_indices: ${t.type.indices}) -> ${e.type.indices} { var input_indices: ${e.type.indices}; var carry = 0u; for (var i = ${n.length}; i >= 0; i--) { - let input_shape_i = ${K(`uniforms.input_shape`,`i`,n.length)}; - let steps_i = ${K(`uniforms.steps`,`i`,n.length)}; - let signs_i = ${K(`uniforms.signs`,`i`,n.length)}; - let starts_i = ${K(`uniforms.starts`,`i`,n.length)}; + let input_shape_i = ${q(`uniforms.input_shape`,`i`,n.length)}; + let steps_i = ${q(`uniforms.steps`,`i`,n.length)}; + let signs_i = ${q(`uniforms.signs`,`i`,n.length)}; + let starts_i = ${q(`uniforms.starts`,`i`,n.length)}; var output_index = ${t.indicesGet(`output_indices`,`i`)}; var input_index = output_index * steps_i + starts_i + carry; carry = input_index / input_shape_i; @@ -2700,7 +2700,7 @@ fn calculateOutputIndex(index: u32) -> u32 { ${e.indicesSet(`input_indices`,`i`,`input_index`)}; } return input_indices; - }`,Fu=(e,t)=>{let n=e[0].dims,r=U.size(n),i=t.axes.length>0?U.normalizeAxes(t.axes,n.length):[...Array(n.length).keys()],a=ju(e,4);a.forEach(e=>e!==0||(()=>{throw Error(`step cannot be 0`)})),a.length===0&&(a=Array(i.length).fill(1));let o=t.starts.map((e,t)=>Nu(e,t,n,i,a)),s=t.ends.map((e,t)=>Nu(e,t,n,i,a));if(i.length!==o.length||i.length!==s.length)throw Error(`start, ends and axes should have the same number of elements`);if(i.length!==n.length)for(let e=0;eMath.sign(e));a.forEach((e,t,n)=>{if(e<0){let r=(s[t]-o[t])/e,i=o[t],c=i+r*a[t];o[t]=c,s[t]=i,n[t]=-e}});let l=n.slice(0);i.forEach((e,t)=>{l[e]=Math.ceil((s[e]-o[e])/a[e])});let u={dims:l,dataType:e[0].dataType},d=J(`output`,e[0].dataType,l.length),f=q(`input`,e[0].dataType,e[0].dims.length),p=U.size(l),m=[{name:`outputSize`,type:`u32`},{name:`starts`,type:`u32`,length:o.length},{name:`signs`,type:`i32`,length:c.length},{name:`steps`,type:`u32`,length:a.length}],h=[{type:12,data:p},{type:12,data:o},{type:6,data:c},{type:12,data:a},...G(e[0].dims,l)],g=e=>` + }`,Fu=(e,t)=>{let n=e[0].dims,r=W.size(n),i=t.axes.length>0?W.normalizeAxes(t.axes,n.length):[...Array(n.length).keys()],a=ju(e,4);a.forEach(e=>e!==0||(()=>{throw Error(`step cannot be 0`)})),a.length===0&&(a=Array(i.length).fill(1));let o=t.starts.map((e,t)=>Nu(e,t,n,i,a)),s=t.ends.map((e,t)=>Nu(e,t,n,i,a));if(i.length!==o.length||i.length!==s.length)throw Error(`start, ends and axes should have the same number of elements`);if(i.length!==n.length)for(let e=0;eMath.sign(e));a.forEach((e,t,n)=>{if(e<0){let r=(s[t]-o[t])/e,i=o[t],c=i+r*a[t];o[t]=c,s[t]=i,n[t]=-e}});let l=n.slice(0);i.forEach((e,t)=>{l[e]=Math.ceil((s[e]-o[e])/a[e])});let u={dims:l,dataType:e[0].dataType},d=Y(`output`,e[0].dataType,l.length),f=J(`input`,e[0].dataType,e[0].dims.length),p=W.size(l),m=[{name:`outputSize`,type:`u32`},{name:`starts`,type:`u32`,length:o.length},{name:`signs`,type:`i32`,length:c.length},{name:`steps`,type:`u32`,length:a.length}],h=[{type:12,data:p},{type:12,data:o},{type:6,data:c},{type:12,data:a},...K(e[0].dims,l)],g=e=>` ${e.registerUniforms(m).declareVariables(f,d)} ${Pu(f,d,n)} ${e.mainStart()} @@ -2708,7 +2708,7 @@ fn calculateOutputIndex(index: u32) -> u32 { let output_indices = ${d.offsetToIndices(`global_idx`)}; let input_indices = calculateInputIndices(output_indices); ${d.setByOffset(`global_idx`,f.getByIndices(`input_indices`))} - }`;return{name:`Slice`,shaderCache:{hint:`${c.length}_${o.length}_${a.length}`,inputDependencies:[`rank`]},getShaderSource:g,getRunData:()=>({outputs:[u],dispatchGroup:{x:Math.ceil(r/64)},programUniforms:h})}},Iu=(e,t)=>{Au(e.inputs,t);let n=Mu(e.inputs,t);e.compute(Fu(e.inputs,n),{inputs:[0]})},Lu=e=>{let t=e.starts,n=e.ends,r=e.axes;return Yn({starts:t,ends:n,axes:r})}}),zu,Bu,Q,Vu,Hu=M(()=>{"use strict";V(),W(),Xn(),vr(),Y(),zu=e=>{if(!e||e.length!==1)throw Error(`Softmax op requires 1 input.`)},Bu=(e,t)=>{let n=e.inputs[0],r=n.dims,i=U.size(r),a=r.length,o=U.normalizeAxis(t.axis,a),s=ot),l[o]=a-1,l[a-1]=o,c=e.compute(hr(n,l),{inputs:[n],outputs:[-1]})[0]):c=n;let u=c.dims,d=u[a-1],f=i/d,p=tr(d),m=d/p,h=64;f===1&&(h=256);let g=(e,t)=>t===4?`max(max(${e}.x, ${e}.y), max(${e}.z, ${e}.w))`:t===2?`max(${e}.x, ${e}.y)`:t===3?`max(max(${e}.x, ${e}.y), ${e}.z)`:e,_=q(`x`,c.dataType,c.dims,p),v=J(`result`,c.dataType,c.dims,p),y=_.type.value,b=$n(c.dataType)===`f32`?`var threadMax = ${y}(-3.402823e+38f);`:`var threadMax = ${y}(-65504.0h);`,x=e=>` + }`;return{name:`Slice`,shaderCache:{hint:`${c.length}_${o.length}_${a.length}`,inputDependencies:[`rank`]},getShaderSource:g,getRunData:()=>({outputs:[u],dispatchGroup:{x:Math.ceil(r/64)},programUniforms:h})}},Iu=(e,t)=>{Au(e.inputs,t);let n=Mu(e.inputs,t);e.compute(Fu(e.inputs,n),{inputs:[0]})},Lu=e=>{let t=e.starts,n=e.ends,r=e.axes;return Jn({starts:t,ends:n,axes:r})}}),zu,Bu,Vu,Hu,Uu=M(()=>{"use strict";U(),G(),Yn(),_r(),X(),zu=e=>{if(!e||e.length!==1)throw Error(`Softmax op requires 1 input.`)},Bu=(e,t)=>{let n=e.inputs[0],r=n.dims,i=W.size(r),a=r.length,o=W.normalizeAxis(t.axis,a),s=ot),l[o]=a-1,l[a-1]=o,c=e.compute(mr(n,l),{inputs:[n],outputs:[-1]})[0]):c=n;let u=c.dims,d=u[a-1],f=i/d,p=er(d),m=d/p,h=64;f===1&&(h=256);let g=(e,t)=>t===4?`max(max(${e}.x, ${e}.y), max(${e}.z, ${e}.w))`:t===2?`max(${e}.x, ${e}.y)`:t===3?`max(max(${e}.x, ${e}.y), ${e}.z)`:e,_=J(`x`,c.dataType,c.dims,p),v=Y(`result`,c.dataType,c.dims,p),y=_.type.value,b=Qn(c.dataType)===`f32`?`var threadMax = ${y}(-3.402823e+38f);`:`var threadMax = ${y}(-65504.0h);`,x=e=>` var rowMaxShared : ${y}; var rowSumShared : ${y}; var threadShared : array<${y}, ${h}>; @@ -2771,7 +2771,7 @@ fn calculateOutputIndex(index: u32) -> u32 { workgroupBarrier(); } if (lindex == 0) { - rowSumShared = ${y}(${ir(`threadShared[0]`,p)}); + rowSumShared = ${y}(${rr(`threadShared[0]`,p)}); } workgroupBarrier(); @@ -2780,7 +2780,7 @@ fn calculateOutputIndex(index: u32) -> u32 { let value = exp(getValue(row, col, row_stride) - rowMaxShared) / rowSumShared; setValue(row, col, row_stride, value); } - }`,S=e.compute({name:`Softmax`,shaderCache:{hint:`${p};${h}`,inputDependencies:[`type`]},getRunData:()=>({outputs:[{dims:u,dataType:c.dataType}],dispatchGroup:{x:f},programUniforms:[{type:6,data:m}]}),getShaderSource:x},{inputs:[c],outputs:[s?-1:0]})[0];s&&e.compute(hr(S,l),{inputs:[S]})},Q=(e,t)=>{zu(e.inputs),Bu(e,t)},Vu=e=>Yn({axis:e.axis})}),Uu,Wu,Gu,Ku,qu,Ju=M(()=>{"use strict";V(),W(),Y(),Uu=e=>Array.from(e.getBigInt64Array(),Number),Wu=e=>{if(!e||e.length!==2)throw Error(`Tile requires 2 inputs.`);if(e[0].dataType!==1&&e[0].dataType!==10&&e[0].dataType!==6&&e[0].dataType!==12)throw Error(`Tile only support float, float16, int32, and uint32 data types`);if(e[1].dataType!==7)throw Error("Tile `repeats` input should be of int64 data type");if(e[1].dims.length!==1)throw Error("Tile `repeats` input should be 1-D");if(Uu(e[1]).length!==e[0].dims.length)throw Error("Tile `repeats` input should have same number of elements as rank of input data tensor")},Gu=(e,t)=>{let n=[];for(let r=0;r{let n=e[0].dims,r=t??Uu(e[1]),i=Gu(n,r),a=U.size(i),o=e[0].dataType,s=q(`input`,o,n.length),c=J(`output`,o,i.length),l=e=>` + }`,S=e.compute({name:`Softmax`,shaderCache:{hint:`${p};${h}`,inputDependencies:[`type`]},getRunData:()=>({outputs:[{dims:u,dataType:c.dataType}],dispatchGroup:{x:f},programUniforms:[{type:6,data:m}]}),getShaderSource:x},{inputs:[c],outputs:[s?-1:0]})[0];s&&e.compute(mr(S,l),{inputs:[S]})},Vu=(e,t)=>{zu(e.inputs),Bu(e,t)},Hu=e=>Jn({axis:e.axis})}),Wu,Gu,Ku,Q,qu,Ju=M(()=>{"use strict";U(),G(),X(),Wu=e=>Array.from(e.getBigInt64Array(),Number),Gu=e=>{if(!e||e.length!==2)throw Error(`Tile requires 2 inputs.`);if(e[0].dataType!==1&&e[0].dataType!==10&&e[0].dataType!==6&&e[0].dataType!==12)throw Error(`Tile only support float, float16, int32, and uint32 data types`);if(e[1].dataType!==7)throw Error("Tile `repeats` input should be of int64 data type");if(e[1].dims.length!==1)throw Error("Tile `repeats` input should be 1-D");if(Wu(e[1]).length!==e[0].dims.length)throw Error("Tile `repeats` input should have same number of elements as rank of input data tensor")},Ku=(e,t)=>{let n=[];for(let r=0;r{let n=e[0].dims,r=t??Wu(e[1]),i=Ku(n,r),a=W.size(i),o=e[0].dataType,s=J(`input`,o,n.length),c=Y(`output`,o,i.length),l=e=>` const inputShape = ${s.indices(...n)}; ${e.registerUniform(`output_size`,`u32`).declareVariables(s,c)} ${e.mainStart()} @@ -2794,7 +2794,7 @@ fn calculateOutputIndex(index: u32) -> u32 { ${s.indicesSet(`input_indices`,`i`,`input_dim_value`)} } ${c.setByOffset(`global_idx`,s.getByIndices(`input_indices`))} - }`;return{name:`Tile`,shaderCache:{hint:`${r}`,inputDependencies:[`rank`]},getRunData:()=>({outputs:[{dims:i,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(a/64)},programUniforms:[{type:12,data:a},...G(e[0].dims,i)]}),getShaderSource:l}},qu=e=>{Wu(e.inputs),e.compute(Ku(e.inputs),{inputs:[0]})}}),Yu,Xu,Zu,Qu=M(()=>{"use strict";V(),W(),Y(),Yu=(e,t,n,r,i)=>{let a=J(`output_data`,i,n.length,4),o=q(`a_data`,t[1].dataType,t[1].dims.length,4),s=q(`b_data`,t[2].dataType,t[2].dims.length,4),c=q(`c_data`,t[0].dataType,t[0].dims.length,4),l,u=(e,t,n)=>`select(${t}, ${e}, ${n})`;if(!r)l=a.setByOffset(`global_idx`,u(o.getByOffset(`global_idx`),s.getByOffset(`global_idx`),c.getByOffset(`global_idx`)));else{let e=(e,t,n=``)=>{let r=`a_data[index_a${t}][component_a${t}]`,i=`b_data[index_b${t}][component_b${t}]`,l=`bool(c_data[index_c${t}] & (0xffu << (component_c${t} * 8)))`;return` + }`;return{name:`Tile`,shaderCache:{hint:`${r}`,inputDependencies:[`rank`]},getRunData:()=>({outputs:[{dims:i,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(a/64)},programUniforms:[{type:12,data:a},...K(e[0].dims,i)]}),getShaderSource:l}},qu=e=>{Gu(e.inputs),e.compute(Q(e.inputs),{inputs:[0]})}}),Yu,Xu,Zu,Qu=M(()=>{"use strict";U(),G(),X(),Yu=(e,t,n,r,i)=>{let a=Y(`output_data`,i,n.length,4),o=J(`a_data`,t[1].dataType,t[1].dims.length,4),s=J(`b_data`,t[2].dataType,t[2].dims.length,4),c=J(`c_data`,t[0].dataType,t[0].dims.length,4),l,u=(e,t,n)=>`select(${t}, ${e}, ${n})`;if(!r)l=a.setByOffset(`global_idx`,u(o.getByOffset(`global_idx`),s.getByOffset(`global_idx`),c.getByOffset(`global_idx`)));else{let e=(e,t,n=``)=>{let r=`a_data[index_a${t}][component_a${t}]`,i=`b_data[index_b${t}][component_b${t}]`,l=`bool(c_data[index_c${t}] & (0xffu << (component_c${t} * 8)))`;return` let output_indices${t} = ${a.offsetToIndices(`global_idx * 4u + ${t}u`)}; let offset_a${t} = ${o.broadcastedIndicesToOffset(`output_indices${t}`,a)}; let offset_b${t} = ${s.broadcastedIndicesToOffset(`output_indices${t}`,a)}; @@ -2822,10 +2822,10 @@ fn calculateOutputIndex(index: u32) -> u32 { ${e.mainStart()} ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.vec_size`)} ${l} - }`},Xu=e=>{let t=e[1].dims,n=e[2].dims,r=e[0].dims,i=e[1].dataType,a=!(U.areEqual(t,n)&&U.areEqual(n,r)),o=t,s=U.size(t);if(a){let e=hn.calcShape(hn.calcShape(t,n,!1),r,!1);if(!e)throw Error(`Can't perform where op on the given tensors`);o=e,s=U.size(o)}let c=Math.ceil(s/4);return{name:`Where`,shaderCache:{inputDependencies:[`rank`,`rank`,`rank`]},getShaderSource:t=>Yu(t,e,o,a,i),getRunData:()=>({outputs:[{dims:o,dataType:i}],dispatchGroup:{x:Math.ceil(s/64/4)},programUniforms:[{type:12,data:c},...G(r,t,n,o)]})}},Zu=e=>{e.compute(Xu(e.inputs))}}),$u,ed=M(()=>{"use strict";vi(),Di(),Mi(),Ii(),Ma(),Ka(),$a(),qo(),ss(),ds(),_s(),ks(),Fs(),Rs(),Us(),qs(),Qs(),rc(),cc(),Cc(),Yc(),el(),il(),sl(),pl(),jc(),Cl(),Hl(),ql(),Zl(),iu(),pi(),Tu(),Uc(),ku(),Ru(),Hu(),zc(),Ju(),vr(),Oa(),Qu(),$u=new Map([[`Abs`,[zi]],[`Acos`,[Bi]],[`Acosh`,[Vi]],[`Add`,[Ia]],[`ArgMax`,[gi,_i]],[`ArgMin`,[hi,_i]],[`Asin`,[Hi]],[`Asinh`,[Ui]],[`Atan`,[Wi]],[`Atanh`,[Gi]],[`Attention`,[Ei]],[`AveragePool`,[Nl,Ml]],[`BatchNormalization`,[ji]],[`BiasAdd`,[Fi]],[`BiasSplitGelu`,[ja]],[`Cast`,[qi,Ki]],[`Ceil`,[Xi]],[`Clip`,[Yi]],[`Concat`,[Za,Qa]],[`Conv`,[Ko,Ho]],[`ConvTranspose`,[os,es]],[`Cos`,[Zi]],[`Cosh`,[Qi]],[`CumSum`,[ls,us]],[`DepthToSpace`,[hs,gs]],[`DequantizeLinear`,[Gl,Kl]],[`Div`,[La]],[`Einsum`,[Ds,Os]],[`Elu`,[ea,$i]],[`Equal`,[Ra]],[`Erf`,[na]],[`Exp`,[ra]],[`Expand`,[Ps]],[`FastGelu`,[Ls]],[`Floor`,[ia]],[`FusedConv`,[Ko,Ho]],[`Gather`,[Hs,Vs]],[`GatherElements`,[nc,tc]],[`GatherBlockQuantized`,[Xs,Zs]],[`GatherND`,[Gs,Ks]],[`Gelu`,[aa]],[`Gemm`,[sc,oc]],[`GlobalAveragePool`,[Il,Fl]],[`GlobalMaxPool`,[Vl,Bl]],[`Greater`,[Ha]],[`GreaterOrEqual`,[Wa]],[`GridSample`,[xc,Sc]],[`GroupQueryAttention`,[Jc]],[`HardSigmoid`,[pa,fa]],[`InstanceNormalization`,[$c]],[`LayerNormalization`,[rl]],[`LeakyRelu`,[oa,$i]],[`Less`,[Ua]],[`LessOrEqual`,[Ga]],[`Log`,[wa]],[`MatMul`,[ol]],[`MatMulNBits`,[dl,fl]],[`MaxPool`,[Rl,zl]],[`Mul`,[za]],[`MultiHeadAttention`,[Ac,Ec]],[`Neg`,[ca]],[`Not`,[sa]],[`Pad`,[Sl]],[`Pow`,[Ba]],[`QuickGelu`,[Da,$i]],[`Range`,[Xl]],[`Reciprocal`,[la]],[`ReduceMin`,[ci]],[`ReduceMean`,[ri]],[`ReduceMax`,[si]],[`ReduceSum`,[ui]],[`ReduceProd`,[li]],[`ReduceL1`,[ii]],[`ReduceL2`,[ai]],[`ReduceLogSum`,[fi]],[`ReduceLogSumExp`,[oi]],[`ReduceSumSquare`,[di]],[`Relu`,[ua]],[`Resize`,[Cu,wu]],[`RotaryEmbedding`,[Hc]],[`ScatterND`,[ru,nu]],[`Sigmoid`,[da]],[`Sin`,[ma]],[`Sinh`,[ha]],[`Slice`,[Iu,Lu]],[`SkipLayerNormalization`,[Ou]],[`Split`,[Lc,Rc]],[`Sqrt`,[ga]],[`Softmax`,[Q,Vu]],[`Sub`,[Va]],[`Tan`,[_a]],[`Tanh`,[ya]],[`ThresholdedRelu`,[Ca,$i]],[`Tile`,[qu]],[`Transpose`,[gr,_r]],[`Where`,[Zu]]])}),td,nd=M(()=>{"use strict";$e(),pn(),Y(),td=class{constructor(e){this.backend=e,this.repo=new Map,this.attributesBound=!1}getArtifact(e){return this.repo.get(e)}setArtifact(e,t){this.repo.set(e,t)}run(e,t,n,r,i){He(e.programInfo.name);let a=this.backend.device,o=this.backend.getComputePassEncoder();this.backend.writeTimestamp(this.backend.pendingDispatchNumber*2);let s=[];for(let e of t)s.push({binding:s.length,resource:{buffer:e.buffer}});for(let e of n)s.push({binding:s.length,resource:{buffer:e.buffer}});i&&s.push({binding:s.length,resource:i});let c=a.createBindGroup({layout:e.computePipeline.getBindGroupLayout(0),entries:s,label:e.programInfo.name});if(this.backend.sessionStatus===`capturing`){let t={kernelId:this.backend.currentKernelId,computePipeline:e.computePipeline,bindGroup:c,dispatchGroup:r};this.backend.capturedCommandList.get(this.backend.currentSessionId).push(t)}o.setPipeline(e.computePipeline),o.setBindGroup(0,c),o.dispatchWorkgroups(...r),this.backend.writeTimestamp(this.backend.pendingDispatchNumber*2+1),this.backend.pendingDispatchNumber++,(this.backend.pendingDispatchNumber>=this.backend.maxDispatchNumber||this.backend.queryType===`at-passes`)&&this.backend.endComputePass(),this.backend.pendingDispatchNumber>=this.backend.maxDispatchNumber&&this.backend.flush(),B(e.programInfo.name)}dispose(){}build(e,t){He(e.name);let n=this.backend.device,r=[];[{feature:`shader-f16`,extension:`f16`},{feature:`subgroups`,extension:`subgroups`}].forEach(e=>{n.features.has(e.feature)&&r.push(`enable ${e.extension};`)});let i=lr(t,this.backend.device.limits),a=e.getShaderSource(i),o=`${r.join(` + }`},Xu=e=>{let t=e[1].dims,n=e[2].dims,r=e[0].dims,i=e[1].dataType,a=!(W.areEqual(t,n)&&W.areEqual(n,r)),o=t,s=W.size(t);if(a){let e=mn.calcShape(mn.calcShape(t,n,!1),r,!1);if(!e)throw Error(`Can't perform where op on the given tensors`);o=e,s=W.size(o)}let c=Math.ceil(s/4);return{name:`Where`,shaderCache:{inputDependencies:[`rank`,`rank`,`rank`]},getShaderSource:t=>Yu(t,e,o,a,i),getRunData:()=>({outputs:[{dims:o,dataType:i}],dispatchGroup:{x:Math.ceil(s/64/4)},programUniforms:[{type:12,data:c},...K(r,t,n,o)]})}},Zu=e=>{e.compute(Xu(e.inputs))}}),$u,ed=M(()=>{"use strict";_i(),Ei(),ji(),Fi(),ja(),Ga(),Qa(),Ko(),os(),us(),gs(),Os(),Ps(),Ls(),Hs(),Ks(),Zs(),nc(),sc(),Sc(),Jc(),$c(),rl(),ol(),fl(),Ac(),Sl(),Hl(),ql(),Zl(),iu(),fi(),Tu(),Hc(),ku(),Ru(),Uu(),Rc(),Ju(),_r(),Da(),Qu(),$u=new Map([[`Abs`,[Ri]],[`Acos`,[zi]],[`Acosh`,[Bi]],[`Add`,[Fa]],[`ArgMax`,[hi,gi]],[`ArgMin`,[mi,gi]],[`Asin`,[Vi]],[`Asinh`,[Hi]],[`Atan`,[Ui]],[`Atanh`,[Wi]],[`Attention`,[Ti]],[`AveragePool`,[Nl,Ml]],[`BatchNormalization`,[Ai]],[`BiasAdd`,[Pi]],[`BiasSplitGelu`,[Aa]],[`Cast`,[Ki,Gi]],[`Ceil`,[Yi]],[`Clip`,[Ji]],[`Concat`,[Xa,Za]],[`Conv`,[Go,Vo]],[`ConvTranspose`,[rs,$o]],[`Cos`,[Xi]],[`Cosh`,[Zi]],[`CumSum`,[cs,ls]],[`DepthToSpace`,[ms,hs]],[`DequantizeLinear`,[Gl,Kl]],[`Div`,[Ia]],[`Einsum`,[Es,Ds]],[`Elu`,[$i,Qi]],[`Equal`,[La]],[`Erf`,[ta]],[`Exp`,[na]],[`Expand`,[Ns]],[`FastGelu`,[Is]],[`Floor`,[ra]],[`FusedConv`,[Go,Vo]],[`Gather`,[Vs,Bs]],[`GatherElements`,[tc,ec]],[`GatherBlockQuantized`,[Ys,Xs]],[`GatherND`,[Ws,Gs]],[`Gelu`,[ia]],[`Gemm`,[oc,ac]],[`GlobalAveragePool`,[Il,Fl]],[`GlobalMaxPool`,[Vl,Bl]],[`Greater`,[Va]],[`GreaterOrEqual`,[Ua]],[`GridSample`,[bc,xc]],[`GroupQueryAttention`,[qc]],[`HardSigmoid`,[fa,da]],[`InstanceNormalization`,[Qc]],[`LayerNormalization`,[nl]],[`LeakyRelu`,[aa,Qi]],[`Less`,[Ha]],[`LessOrEqual`,[Wa]],[`Log`,[Ca]],[`MatMul`,[al]],[`MatMulNBits`,[ul,dl]],[`MaxPool`,[Rl,zl]],[`Mul`,[Ra]],[`MultiHeadAttention`,[kc,Tc]],[`Neg`,[sa]],[`Not`,[oa]],[`Pad`,[xl]],[`Pow`,[za]],[`QuickGelu`,[Ea,Qi]],[`Range`,[Xl]],[`Reciprocal`,[ca]],[`ReduceMin`,[si]],[`ReduceMean`,[ni]],[`ReduceMax`,[oi]],[`ReduceSum`,[li]],[`ReduceProd`,[ci]],[`ReduceL1`,[ri]],[`ReduceL2`,[ii]],[`ReduceLogSum`,[di]],[`ReduceLogSumExp`,[ai]],[`ReduceSumSquare`,[ui]],[`Relu`,[la]],[`Resize`,[Cu,wu]],[`RotaryEmbedding`,[Vc]],[`ScatterND`,[ru,nu]],[`Sigmoid`,[ua]],[`Sin`,[pa]],[`Sinh`,[ma]],[`Slice`,[Iu,Lu]],[`SkipLayerNormalization`,[Ou]],[`Split`,[Ic,Lc]],[`Sqrt`,[ha]],[`Softmax`,[Vu,Hu]],[`Sub`,[Ba]],[`Tan`,[ga]],[`Tanh`,[va]],[`ThresholdedRelu`,[Sa,Qi]],[`Tile`,[qu]],[`Transpose`,[hr,gr]],[`Where`,[Zu]]])}),td,nd=M(()=>{"use strict";Ze(),fn(),X(),td=class{constructor(e){this.backend=e,this.repo=new Map,this.attributesBound=!1}getArtifact(e){return this.repo.get(e)}setArtifact(e,t){this.repo.set(e,t)}run(e,t,n,r,i){Be(e.programInfo.name);let a=this.backend.device,o=this.backend.getComputePassEncoder();this.backend.writeTimestamp(this.backend.pendingDispatchNumber*2);let s=[];for(let e of t)s.push({binding:s.length,resource:{buffer:e.buffer}});for(let e of n)s.push({binding:s.length,resource:{buffer:e.buffer}});i&&s.push({binding:s.length,resource:i});let c=a.createBindGroup({layout:e.computePipeline.getBindGroupLayout(0),entries:s,label:e.programInfo.name});if(this.backend.sessionStatus===`capturing`){let t={kernelId:this.backend.currentKernelId,computePipeline:e.computePipeline,bindGroup:c,dispatchGroup:r};this.backend.capturedCommandList.get(this.backend.currentSessionId).push(t)}o.setPipeline(e.computePipeline),o.setBindGroup(0,c),o.dispatchWorkgroups(...r),this.backend.writeTimestamp(this.backend.pendingDispatchNumber*2+1),this.backend.pendingDispatchNumber++,(this.backend.pendingDispatchNumber>=this.backend.maxDispatchNumber||this.backend.queryType===`at-passes`)&&this.backend.endComputePass(),this.backend.pendingDispatchNumber>=this.backend.maxDispatchNumber&&this.backend.flush(),H(e.programInfo.name)}dispose(){}build(e,t){Be(e.name);let n=this.backend.device,r=[];[{feature:`shader-f16`,extension:`f16`},{feature:`subgroups`,extension:`subgroups`}].forEach(e=>{n.features.has(e.feature)&&r.push(`enable ${e.extension};`)});let i=cr(t,this.backend.device.limits),a=e.getShaderSource(i),o=`${r.join(` `)} ${i.additionalImplementations} -${a}`,s=n.createShaderModule({code:o,label:e.name});H(`verbose`,()=>`[WebGPU] ${e.name} shader code: ${o}`);let c=n.createComputePipeline({compute:{module:s,entryPoint:`main`},layout:`auto`,label:e.name});return B(e.name),{programInfo:e,computePipeline:c,uniformVariablesInfo:i.variablesInfo}}normalizeDispatchGroupSize(e){let t=typeof e==`number`?e:e.x,n=typeof e==`number`?1:e.y||1,r=typeof e==`number`?1:e.z||1,i=this.backend.device.limits.maxComputeWorkgroupsPerDimension;if(t<=i&&n<=i&&r<=i)return[t,n,r];let a=t*n*r,o=Math.ceil(Math.sqrt(a));if(o>i){if(o=Math.ceil(Math.cbrt(a)),o>i)throw Error(`Total dispatch size exceeds WebGPU maximum.`);return[o,o,o]}else return[o,o,1]}}}),rd={};N(rd,{WebGpuBackend:()=>sd});var id,ad,od,sd,cd=M(()=>{"use strict";$e(),V(),pn(),xn(),qn(),ed(),nd(),id=(e,t)=>{if(t.length!==e.length)throw Error(`inputDependencies length ${t.length} is not equal to inputTensors length ${e.length}.`);let n=[];for(let r=0;r{let r=e.name;return e.shaderCache?.hint&&(r+=`[`+e.shaderCache.hint+`]`),r+=`:`+n+`:${id(t,e.shaderCache?.inputDependencies??Array(t.length).fill(`dims`))}`,r},od=class{constructor(e){e&&(this.architecture=e.architecture,this.vendor=e.vendor)}isArchitecture(e){return this.architecture===e}isVendor(e){return this.vendor===e}},sd=class{constructor(){this.currentSessionId=null,this.currentKernelId=null,this.commandEncoder=null,this.computePassEncoder=null,this.maxDispatchNumber=16,this.pendingDispatchNumber=0,this.pendingKernels=[],this.pendingQueries=new Map,this.sessionStatus=`default`,this.capturedCommandList=new Map,this.capturedPendingKernels=new Map,this.sessionExternalDataMapping=new Map}get currentKernelCustomData(){if(this.currentKernelId===null)throw Error(`currentKernelCustomData(): currentKernelId is null. (should not happen)`);let e=this.kernelCustomData.get(this.currentKernelId);return e||(e={},this.kernelCustomData.set(this.currentKernelId,e)),e}async initialize(e,t){this.env=e;let n=[],r={requiredLimits:{maxComputeWorkgroupStorageSize:t.limits.maxComputeWorkgroupStorageSize,maxComputeWorkgroupsPerDimension:t.limits.maxComputeWorkgroupsPerDimension,maxStorageBufferBindingSize:t.limits.maxStorageBufferBindingSize,maxBufferSize:t.limits.maxBufferSize,maxComputeInvocationsPerWorkgroup:t.limits.maxComputeInvocationsPerWorkgroup,maxComputeWorkgroupSizeX:t.limits.maxComputeWorkgroupSizeX,maxComputeWorkgroupSizeY:t.limits.maxComputeWorkgroupSizeY,maxComputeWorkgroupSizeZ:t.limits.maxComputeWorkgroupSizeZ},requiredFeatures:n},i=e=>t.features.has(e)&&n.push(e)&&!0;i(`chromium-experimental-timestamp-query-inside-passes`)||i(`timestamp-query`),i(`shader-f16`),i(`subgroups`),this.device=await t.requestDevice(r),this.adapterInfo=new od(t.info||await t.requestAdapterInfo()),this.gpuDataManager=Kn(this),this.programManager=new td(this),this.kernels=new Map,this.kernelPersistentData=new Map,this.kernelCustomData=new Map,dn(e.logLevel,!!e.debug),this.device.onuncapturederror=e=>{e.error instanceof GPUValidationError&&console.error(`An uncaught WebGPU validation error was raised: ${e.error.message}`)},Object.defineProperty(this.env.webgpu,`device`,{value:this.device,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(this.env.webgpu,`adapter`,{value:t,writable:!1,enumerable:!0,configurable:!1}),this.setQueryType()}dispose(){typeof this.querySet<`u`&&this.querySet.destroy(),this.gpuDataManager.dispose()}getCommandEncoder(){return this.commandEncoder||=this.device.createCommandEncoder(),this.commandEncoder}getComputePassEncoder(){if(!this.computePassEncoder){let e=this.getCommandEncoder(),t={};this.queryType===`at-passes`&&(t.timestampWrites={querySet:this.querySet,beginningOfPassWriteIndex:this.pendingDispatchNumber*2,endOfPassWriteIndex:this.pendingDispatchNumber*2+1}),this.computePassEncoder=e.beginComputePass(t)}return this.computePassEncoder}endComputePass(){this.computePassEncoder&&(this.computePassEncoder.end(),this.computePassEncoder=null)}flush(){if(!this.commandEncoder)return;He(),this.endComputePass();let e;this.queryType!==`none`&&(this.commandEncoder.resolveQuerySet(this.querySet,0,this.pendingDispatchNumber*2,this.queryResolveBuffer,0),e=this.device.createBuffer({size:this.pendingDispatchNumber*2*8,usage:GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST}),this.pendingQueries.set(e,this.pendingKernels),this.pendingKernels=[],this.commandEncoder.copyBufferToBuffer(this.queryResolveBuffer,0,e,0,this.pendingDispatchNumber*2*8)),this.device.queue.submit([this.commandEncoder.finish()]),this.gpuDataManager.refreshPendingBuffers(),this.commandEncoder=null,this.pendingDispatchNumber=0,this.queryType!==`none`&&e.mapAsync(GPUMapMode.READ).then(()=>{let t=new BigUint64Array(e.getMappedRange()),n=this.pendingQueries.get(e);for(let e=0;e`u`&&(this.queryTimeBase=d);let p=Number(d-this.queryTimeBase),m=Number(f-this.queryTimeBase);if(!Number.isSafeInteger(p)||!Number.isSafeInteger(m))throw RangeError(`incorrect timestamp range`);if(this.env.webgpu.profiling?.ondata)this.env.webgpu.profiling.ondata({version:1,inputsMetadata:l.map(e=>({dims:e.dims,dataType:Zt(e.dataType)})),outputsMetadata:u.map(e=>({dims:e.dims,dataType:Zt(e.dataType)})),kernelId:i,kernelType:o,kernelName:s,programName:c,startTime:p,endTime:m});else{let e=``;l.forEach((t,n)=>{e+=`input[${n}]: [${t.dims}] | ${Zt(t.dataType)}, `});let t=``;u.forEach((e,n)=>{t+=`output[${n}]: [${e.dims}] | ${Zt(e.dataType)}, `}),console.log(`[profiling] kernel "${i}|${o}|${s}|${c}" ${e}${t}execution time: ${m-p} ns`)}z(`GPU`,`${c}::${d}::${f}`)}e.unmap(),this.pendingQueries.delete(e)}),B()}run(e,t,n,r,i,a){He(e.name);let o=[];for(let e=0;et):n;if(u.length!==s.length)throw Error(`Output size ${u.length} must be equal to ${s.length}.`);let d=[],f=[];for(let e=0;e=a)throw Error(`Invalid output index: ${u[e]}`);if(u[e]===-3)continue;let t=u[e]===-1,n=u[e]===-2,o=t||n?i(s[e].dataType,s[e].dims):r(u[e],s[e].dataType,s[e].dims);if(d.push(o),o.data===0)continue;let c=this.gpuDataManager.get(o.data);if(!c)throw Error(`no GPU data for output: ${o.data}`);if(t&&this.temporaryData.push(c),n){let e=this.kernelPersistentData.get(this.currentKernelId);e||(e=[],this.kernelPersistentData.set(this.currentKernelId,e)),e.push(c)}f.push(c)}if(o.length!==t.length||f.length!==d.length){if(f.length===0)return B(e.name),d;throw Error(`Program ${e.name} has zero-sized tensor(s) in inputs or outputs. This is not supported now.`)}let p;if(l){let e=0,t=[];l.forEach(n=>{let r=typeof n.data==`number`?[n.data]:n.data;if(r.length===0)return;let i=n.type===10?2:4,a,o;n.type===10?(o=r.length>4?16:r.length>2?8:r.length*i,a=r.length>4?16:i*r.length):(o=r.length<=2?r.length*i:16,a=16),e=Math.ceil(e/o)*o,t.push(e);let s=n.type===10?8:4;e+=r.length>4?Math.ceil(r.length/s)*a:r.length*i});let n=16;e=Math.ceil(e/n)*n;let r=new ArrayBuffer(e);l.forEach((e,n)=>{let i=t[n],a=typeof e.data==`number`?[e.data]:e.data;if(e.type===6)new Int32Array(r,i,a.length).set(a);else if(e.type===12)new Uint32Array(r,i,a.length).set(a);else if(e.type===10)new Uint16Array(r,i,a.length).set(a);else if(e.type===1)new Float32Array(r,i,a.length).set(a);else throw Error(`Unsupported uniform type: ${Zt(e.type)}`)});let i=this.gpuDataManager.create(e,GPUBufferUsage.COPY_DST|GPUBufferUsage.UNIFORM);this.device.queue.writeBuffer(i.buffer,0,r,0,e),this.gpuDataManager.release(i.id),p={offset:0,size:e,buffer:i.buffer}}let m=this.programManager.normalizeDispatchGroupSize(c),h=m[1]===1&&m[2]===1,g=ad(e,t,h),_=this.programManager.getArtifact(g);if(_||(_=this.programManager.build(e,m),this.programManager.setArtifact(g,_),H(`info`,()=>`[artifact] key: ${g}, programName: ${e.name}`)),l&&_.uniformVariablesInfo){if(l.length!==_.uniformVariablesInfo.length)throw Error(`Uniform variables count mismatch: expect ${_.uniformVariablesInfo.length}, got ${l.length} in program "${_.programInfo.name}".`);for(let e=0;e`[ProgramManager] run "${e.name}" (key=${g}) with ${m[0]}x${m[1]}x${m[2]}`),this.queryType!==`none`||this.sessionStatus===`capturing`){let e={kernelId:this.currentKernelId,programName:_.programInfo.name,inputTensorViews:t,outputTensorViews:d};this.pendingKernels.push(e),this.sessionStatus===`capturing`&&this.capturedPendingKernels.get(this.currentSessionId).push(e)}return this.programManager.run(_,o,f,m,p),B(e.name),d}upload(e,t){this.gpuDataManager.upload(e,t)}memcpy(e,t){this.gpuDataManager.memcpy(e,t)}async download(e,t){await this.gpuDataManager.download(e,t)}alloc(e){return this.gpuDataManager.create(e).id}free(e){return this.gpuDataManager.release(e)}createKernel(e,t,n,r){let i=$u.get(e);if(!i)throw Error(`kernel not implemented: ${e}`);let a={kernelType:e,kernelName:r,kernelEntry:i[0],attributes:[i[1],n]};this.kernels.set(t,a)}releaseKernel(e){let t=this.kernelPersistentData.get(e);if(t){for(let e of t)this.gpuDataManager.release(e.id);this.kernelPersistentData.delete(e)}this.kernelCustomData.delete(e),this.kernels.delete(e)}computeKernel(e,t,n){let r=this.kernels.get(e);if(!r)throw Error(`kernel not created: ${e}`);let i=r.kernelType,a=r.kernelName,o=r.kernelEntry,s=r.attributes;if(this.currentKernelId!==null)throw Error(`kernel "[${i}] ${a}" is not allowed to be called recursively`);this.currentKernelId=e,s[0]&&(s[1]=s[0](s[1]),s[0]=void 0),H(`info`,()=>`[WebGPU] Start to run kernel "[${i}] ${a}"...`);let c=this.env.debug;this.temporaryData=[];try{return c&&this.device.pushErrorScope(`validation`),o(t,s[1]),0}catch(e){return n.push(Promise.resolve(`[WebGPU] Kernel "[${i}] ${a}" failed. ${e}`)),1}finally{c&&n.push(this.device.popErrorScope().then(e=>e?`GPU validation error for kernel "[${i}] ${a}": ${e.message}`:null));for(let e of this.temporaryData)this.gpuDataManager.release(e.id);this.temporaryData=[],this.currentKernelId=null}}registerBuffer(e,t,n,r){let i=this.sessionExternalDataMapping.get(e);i||(i=new Map,this.sessionExternalDataMapping.set(e,i));let a=i.get(t),o=this.gpuDataManager.registerExternalBuffer(n,r,a);return i.set(t,[o,n]),o}unregisterBuffers(e){let t=this.sessionExternalDataMapping.get(e);t&&(t.forEach(e=>this.gpuDataManager.unregisterExternalBuffer(e[0])),this.sessionExternalDataMapping.delete(e))}getBuffer(e){let t=this.gpuDataManager.get(e);if(!t)throw Error(`no GPU data for buffer: ${e}`);return t.buffer}createDownloader(e,t,n){return async()=>{let r=await Wn(this,e,t);return bn(r.buffer,n)}}writeTimestamp(e){this.queryType===`inside-passes`&&this.computePassEncoder.writeTimestamp(this.querySet,e)}setQueryType(){this.queryType=`none`,(this.env.webgpu.profiling?.mode===`default`||(typeof this.env.trace>`u`?this.env.wasm.trace:this.env.trace))&&(this.device.features.has(`chromium-experimental-timestamp-query-inside-passes`)?this.queryType=`inside-passes`:this.device.features.has(`timestamp-query`)&&(this.queryType=`at-passes`),this.queryType!==`none`&&typeof this.querySet>`u`&&(this.querySet=this.device.createQuerySet({type:`timestamp`,count:this.maxDispatchNumber*2}),this.queryResolveBuffer=this.device.createBuffer({size:this.maxDispatchNumber*2*8,usage:GPUBufferUsage.COPY_SRC|GPUBufferUsage.QUERY_RESOLVE})))}captureBegin(){H(`info`,`captureBegin`),this.capturedCommandList.get(this.currentSessionId)||this.capturedCommandList.set(this.currentSessionId,[]),this.capturedPendingKernels.get(this.currentSessionId)||this.capturedPendingKernels.set(this.currentSessionId,[]),this.flush(),this.sessionStatus=`capturing`}captureEnd(){H(`info`,`captureEnd`),this.flush(),this.sessionStatus=`default`}replay(){H(`info`,`replay`),this.sessionStatus=`replaying`;let e=this.capturedCommandList.get(this.currentSessionId),t=this.capturedPendingKernels.get(this.currentSessionId),n=e.length;this.pendingKernels=[];for(let r=0;r=this.maxDispatchNumber||this.queryType===`at-passes`)&&this.endComputePass(),this.pendingDispatchNumber>=this.maxDispatchNumber&&this.flush()}this.flush(),this.sessionStatus=`default`}onCreateSession(){this.gpuDataManager.onCreateSession()}onReleaseSession(e){this.unregisterBuffers(e),this.capturedCommandList.has(e)&&this.capturedCommandList.delete(e),this.capturedPendingKernels.has(e)&&this.capturedPendingKernels.delete(e),this.gpuDataManager.onReleaseSession(e)}onRunStart(e){this.currentSessionId=e,this.setQueryType()}}}),ld={};N(ld,{init:()=>fd});var ud,dd,fd,pd=M(()=>{"use strict";V(),pn(),W(),In(),ud=class e{constructor(e,t,n,r){this.module=e,this.dataType=t,this.data=n,this.dims=r}getFloat32Array(){if(this.dataType!==1)throw Error(`Invalid data type`);let e=U.size(this.dims);return e===0?new Float32Array:new Float32Array(this.module.HEAP8.buffer,this.data,e)}getBigInt64Array(){if(this.dataType!==7)throw Error(`Invalid data type`);let e=U.size(this.dims);return e===0?new BigInt64Array:new BigInt64Array(this.module.HEAP8.buffer,this.data,e)}getInt32Array(){if(this.dataType!==6)throw Error(`Invalid data type`);let e=U.size(this.dims);return e===0?new Int32Array:new Int32Array(this.module.HEAP8.buffer,this.data,e)}getUint16Array(){if(this.dataType!==10&&this.dataType!==4)throw Error(`Invalid data type`);let e=U.size(this.dims);return e===0?new Uint16Array:new Uint16Array(this.module.HEAP8.buffer,this.data,e)}reshape(t){if(U.size(t)!==U.size(this.dims))throw Error(`Invalid new shape`);return new e(this.module,this.dataType,this.data,t)}},dd=class{constructor(e,t,n){this.module=e,this.backend=t,this.customDataOffset=0,this.customDataSize=0,this.adapterInfo=t.adapterInfo;let r=e.PTR_SIZE,i=n/e.PTR_SIZE,a=r===4?`i32`:`i64`;this.opKernelContext=Number(e.getValue(r*i++,a));let o=Number(e.getValue(r*i++,a));this.outputCount=Number(e.getValue(r*i++,a)),this.customDataOffset=Number(e.getValue(r*i++,`*`)),this.customDataSize=Number(e.getValue(r*i++,a));let s=[];for(let t=0;ttypeof e==`number`?this.inputs[e]:e)??this.inputs,r=t?.outputs??[],i=(e,t,n)=>new ud(this.module,t,this.output(e,n),n),a=(e,t)=>{let n=Qt(e,t);if(!n)throw Error(`Unsupported data type: ${e}`);let r=n>0?this.backend.gpuDataManager.create(n).id:0;return new ud(this.module,e,r,t)};return this.backend.run(e,n,r,i,a,this.outputCount)}output(e,t){let n=this.module.stackSave();try{let n=this.module.PTR_SIZE,r=n===4?`i32`:`i64`,i=this.module.stackAlloc((1+t.length)*n);this.module.setValue(i,t.length,r);for(let e=0;e{let i=t.jsepInit;if(!i)throw Error(`Failed to initialize JSEP. The WebAssembly module is not built with JSEP support.`);if(e===`webgpu`){let e=(cd(),le(rd)).WebGpuBackend,a=new e;await a.initialize(n,r),i(`webgpu`,[a,e=>a.alloc(Number(e)),e=>a.free(e),(e,n,r,i=!1)=>{if(i)H(`verbose`,()=>`[WebGPU] jsepCopyGpuToGpu: src=${Number(e)}, dst=${Number(n)}, size=${Number(r)}`),a.memcpy(Number(e),Number(n));else{H(`verbose`,()=>`[WebGPU] jsepCopyCpuToGpu: dataOffset=${Number(e)}, gpuDataId=${Number(n)}, size=${Number(r)}`);let i=t.HEAPU8.subarray(Number(e>>>0),Number(e>>>0)+Number(r));a.upload(Number(n),i)}},async(e,n,r)=>{H(`verbose`,()=>`[WebGPU] jsepCopyGpuToCpu: gpuDataId=${e}, dataOffset=${n}, size=${r}`),await a.download(Number(e),()=>t.HEAPU8.subarray(Number(n)>>>0,Number(n+r)>>>0))},(e,n,r)=>a.createKernel(e,Number(n),r,t.UTF8ToString(t._JsepGetNodeName(Number(n)))),e=>a.releaseKernel(e),(e,n,r,i)=>{H(`verbose`,()=>`[WebGPU] jsepRun: sessionHandle=${r}, kernel=${e}, contextDataOffset=${n}`);let o=new dd(t,a,Number(n));return a.computeKernel(Number(e),o,i)},()=>a.captureBegin(),()=>a.captureEnd(),()=>a.replay()])}else{let e=new Fn(n);i(`webnn`,[e,()=>e.reserveTensorId(),t=>e.releaseTensorId(t),async(t,n,r,i,a)=>e.ensureTensor(t,n,r,i,a),(t,n)=>{e.uploadTensor(t,n)},async(t,n)=>e.downloadTensor(t,n)])}}}),md,hd,gd,_d,vd,yd,bd,xd,Sd,Cd,wd,Td,Ed,Dd=M(()=>{"use strict";Ht(),Yt(),V(),It(),Bt(),on(),md=(e,t)=>{Ft()._OrtInit(e,t)!==0&&zt(`Can't initialize onnxruntime.`)},hd=async e=>{md(e.wasm.numThreads,en(e.logLevel))},gd=async(e,t)=>{Ft().asyncInit?.();{let n=(pd(),le(ld)).init;if(t===`webgpu`){if(typeof navigator>`u`||!navigator.gpu)throw Error(`WebGPU is not supported in current environment`);let t=e.webgpu.adapter;if(t){if(typeof t.limits!=`object`||typeof t.features!=`object`||typeof t.requestDevice!=`function`)throw Error("Invalid GPU adapter set in `env.webgpu.adapter`. It must be a GPUAdapter object.")}else{let n=e.webgpu.powerPreference;if(n!==void 0&&n!==`low-power`&&n!==`high-performance`)throw Error(`Invalid powerPreference setting: "${n}"`);let r=e.webgpu.forceFallbackAdapter;if(r!==void 0&&typeof r!=`boolean`)throw Error(`Invalid forceFallbackAdapter setting: "${r}"`);if(t=await navigator.gpu.requestAdapter({powerPreference:n,forceFallbackAdapter:r}),!t)throw Error(`Failed to get GPU adapter. You may need to enable flag "--enable-unsafe-webgpu" if you are using Chrome.`)}await n(`webgpu`,Ft(),e,t)}if(t===`webnn`){if(typeof navigator>`u`||!navigator.ml)throw Error(`WebNN is not supported in current environment`);await n(`webnn`,Ft(),e)}}},_d=new Map,vd=e=>{let t=Ft(),n=t.stackSave();try{let n=t.PTR_SIZE,r=t.stackAlloc(2*n);t._OrtGetInputOutputCount(e,r,r+n)!==0&&zt(`Can't get session input/output count.`);let i=n===4?`i32`:`i64`;return[Number(t.getValue(r,i)),Number(t.getValue(r+n,i))]}finally{t.stackRestore(n)}},yd=(e,t)=>{let n=Ft(),r=n.stackSave(),i=0;try{let r=n.PTR_SIZE,a=n.stackAlloc(2*r);n._OrtGetInputOutputMetadata(e,t,a,a+r)!==0&&zt(`Can't get session input/output metadata.`);let o=Number(n.getValue(a,`*`));i=Number(n.getValue(a+r,`*`));let s=n.HEAP32[i/4];if(s===0)return[o,0];let c=n.HEAPU32[i/4+1],l=[];for(let e=0;e{let t=Ft(),n=t._malloc(e.byteLength);if(n===0)throw Error(`Can't create a session. failed to allocate a buffer of size ${e.byteLength}.`);return t.HEAPU8.set(e,n),[n,e.byteLength]},xd=async(e,t)=>{let n,r,i=Ft();Array.isArray(e)?[n,r]=e:e.buffer===i.HEAPU8.buffer?[n,r]=[e.byteOffset,e.byteLength]:[n,r]=bd(e);let a=0,o=0,s=0,c=[],l=[],u=[];try{if([o,c]=await Jt(t),t?.externalData&&i.mountExternalData){let e=[];for(let n of t.externalData){let t=typeof n==`string`?n:n.path;e.push(an(typeof n==`string`?n:n.data).then(e=>{i.mountExternalData(t,e)}))}await Promise.all(e)}for(let e of t?.executionProviders??[])if((typeof e==`string`?e:e.name)===`webnn`){if(i.shouldTransferToMLTensor=!1,typeof e!=`string`){let t=e,n=t?.context,r=t?.gpuDevice,a=t?.deviceType,o=t?.powerPreference;n?i.currentContext=n:r?i.currentContext=await i.webnnCreateMLContext(r):i.currentContext=await i.webnnCreateMLContext({deviceType:a,powerPreference:o})}else i.currentContext=await i.webnnCreateMLContext();break}a=await i._OrtCreateSession(n,r,o),i.webgpuOnCreateSession?.(a),a===0&&zt(`Can't create a session.`),i.jsepOnCreateSession?.(),i.currentContext&&(i.webnnRegisterMLContext(a,i.currentContext),i.currentContext=void 0,i.shouldTransferToMLTensor=!0);let[e,d]=vd(a),f=!!t?.enableGraphCapture,p=[],m=[],h=[],g=[],_=[];for(let t=0;te===`gpu-buffer`||e===`ml-tensor`)&&(s=i._OrtCreateBinding(a),s===0&&zt(`Can't create IO binding.`),v={handle:s,outputPreferredLocations:_,outputPreferredLocationsEncoded:_.map(e=>rn(e))}),_d.set(a,[a,l,u,v,f,!1]),[a,p,m,h,g]}catch(e){throw l.forEach(e=>i._OrtFree(e)),u.forEach(e=>i._OrtFree(e)),s!==0&&i._OrtReleaseBinding(s)!==0&&zt(`Can't release IO binding.`),a!==0&&i._OrtReleaseSession(a)!==0&&zt(`Can't release session.`),e}finally{i._free(n),o!==0&&i._OrtReleaseSessionOptions(o)!==0&&zt(`Can't release session options.`),c.forEach(e=>i._free(e)),i.unmountExternalData?.()}},Sd=e=>{let t=Ft(),n=_d.get(e);if(!n)throw Error(`cannot release session. invalid session id: ${e}`);let[r,i,a,o,s]=n;o&&(s&&t._OrtClearBoundOutputs(o.handle)!==0&&zt(`Can't clear bound outputs.`),t._OrtReleaseBinding(o.handle)!==0&&zt(`Can't release IO binding.`)),t.jsepOnReleaseSession?.(e),t.webnnOnReleaseSession?.(e),t.webgpuOnReleaseSession?.(e),i.forEach(e=>t._OrtFree(e)),a.forEach(e=>t._OrtFree(e)),t._OrtReleaseSession(r)!==0&&zt(`Can't release session.`),_d.delete(e)},Cd=async(e,t,n,r,i,a,o=!1)=>{if(!e){t.push(0);return}let s=Ft(),c=s.PTR_SIZE,l=e[0],u=e[1],d=e[3],f=d,p,m;if(l===`string`&&(d===`gpu-buffer`||d===`ml-tensor`))throw Error(`String tensor is not supported on GPU.`);if(o&&d!==`gpu-buffer`)throw Error(`External buffer must be provided for input/output index ${a} when enableGraphCapture is true.`);if(d===`gpu-buffer`){let t=e[2].gpuBuffer;m=Qt(Xt(l),u);{let e=s.jsepRegisterBuffer;if(!e)throw Error(`Tensor location "gpu-buffer" is not supported without using WebGPU.`);p=e(r,a,t,m)}}else if(d===`ml-tensor`){let t=e[2].mlTensor;m=Qt(Xt(l),u);let n=s.webnnRegisterMLTensor;if(!n)throw Error(`Tensor location "ml-tensor" is not supported without using WebNN.`);p=n(r,t,Xt(l),u)}else{let t=e[2];if(Array.isArray(t)){m=c*t.length,p=s._malloc(m),n.push(p);for(let e=0;es.setValue(g+t*c,e,c===4?`i32`:`i64`));let e=s._OrtCreateTensor(Xt(l),p,m,g,u.length,rn(f));e===0&&zt(`Can't create tensor for input/output. session=${r}, index=${a}.`),t.push(e)}finally{s.stackRestore(h)}},wd=async(e,t,n,r,i,a)=>{let o=Ft(),s=o.PTR_SIZE,c=_d.get(e);if(!c)throw Error(`cannot run inference. invalid session id: ${e}`);let l=c[0],u=c[1],d=c[2],f=c[3],p=c[4],m=c[5],h=t.length,g=r.length,_=0,v=[],y=[],b=[],x=[],S=o.stackSave(),C=o.stackAlloc(h*s),w=o.stackAlloc(h*s),T=o.stackAlloc(g*s),E=o.stackAlloc(g*s);try{[_,v]=Vt(a);for(let r=0;re*t,1);d=Zt(a);let _=f?.outputPreferredLocations[r[t]];if(d===`string`){if(_===`gpu-buffer`||_===`ml-tensor`)throw Error(`String tensor is not supported on GPU.`);let e=[];for(let t=0;t0){let e=o.jsepGetBuffer;if(!e)throw Error(`preferredLocation "gpu-buffer" is not supported without using WebGPU.`);let t=e(p),r=Qt(a,g);if(r===void 0||!tn(d))throw Error(`Unsupported data type: ${d}`);u=!0,S.push([d,h,{gpuBuffer:t,download:o.jsepCreateDownloader(t,r,d),dispose:()=>{o._OrtReleaseTensor(n)!==0&&zt(`Can't release tensor.`)}},`gpu-buffer`])}else if(_===`ml-tensor`&&g>0){let t=o.webnnEnsureTensor,r=o.webnnIsInt64Supported;if(!t||!r)throw Error(`preferredLocation "ml-tensor" is not supported without using WebNN.`);if(Qt(a,g)===void 0||!nn(d))throw Error(`Unsupported data type: ${d}`);if(d===`int64`&&!r(e))throw Error(`preferredLocation "ml-tensor" for int64 output is not supported by current WebNN Context.`);let i=await t(e,p,a,h,!1);u=!0,S.push([d,h,{mlTensor:i,download:o.webnnCreateMLTensorDownloader(p,d),dispose:()=>{o.webnnReleaseTensorId(p),o._OrtReleaseTensor(n)}},`ml-tensor`])}else{let e=$t(d),t=new e(g);new Uint8Array(t.buffer,t.byteOffset,t.byteLength).set(o.HEAPU8.subarray(p,p+t.byteLength)),S.push([d,h,t,`cpu`])}}finally{o.stackRestore(a),d===`string`&&p&&o._free(p),u||o._OrtReleaseTensor(n),o.webnnOnRunEnd?.(l)}}return f&&!p&&(o._OrtClearBoundOutputs(f.handle)!==0&&zt(`Can't clear bound outputs.`),_d.set(e,[l,u,d,f,p,!1])),S}finally{o.stackRestore(S),y.forEach(e=>o._OrtReleaseTensor(e)),b.forEach(e=>o._OrtReleaseTensor(e)),x.forEach(e=>o._free(e)),_!==0&&o._OrtReleaseRunOptions(_),v.forEach(e=>o._free(e))}},Td=e=>{let t=Ft(),n=_d.get(e);if(!n)throw Error(`invalid session id`);let r=n[0],i=t._OrtEndProfiling(r);i===0&&zt(`Can't get an profile file name.`),t._OrtFree(i)},Ed=e=>{let t=[];for(let n of e){let e=n[2];!Array.isArray(e)&&`buffer`in e&&t.push(e.buffer)}return t}}),Od,kd,Ad,jd,Md,Nd,Pd,Fd,Id,Ld,Rd,zd,Bd,Vd,Hd,Ud,Wd,Gd,Kd=M(()=>{"use strict";$e(),Dd(),It(),Et(),Od=()=>!!L.wasm.proxy&&typeof document<`u`,Ad=!1,jd=!1,Md=!1,Fd=new Map,Id=(e,t)=>{let n=Fd.get(e);n?n.push(t):Fd.set(e,[t])},Ld=()=>{if(Ad||!jd||Md||!kd)throw Error(`worker not ready`)},Rd=e=>{switch(e.data.type){case`init-wasm`:Ad=!1,e.data.err?(Md=!0,Pd[1](e.data.err)):(jd=!0,Pd[0]()),Nd&&(URL.revokeObjectURL(Nd),Nd=void 0);break;case`init-ep`:case`copy-from`:case`create`:case`release`:case`run`:case`end-profiling`:{let t=Fd.get(e.data.type);e.data.err?t.shift()[1](e.data.err):t.shift()[0](e.data.out);break}default:}},zd=async()=>{if(!jd){if(Ad)throw Error(`multiple calls to 'initWasm()' detected.`);if(Md)throw Error(`previous call to 'initWasm()' failed.`);if(Ad=!0,Od())return new Promise((e,t)=>{kd?.terminate(),Ct().then(([n,r])=>{try{kd=r,kd.onerror=e=>t(e),kd.onmessage=Rd,Pd=[e,t];let i={type:`init-wasm`,in:L};!i.in.wasm.wasmPaths&&(n||pt)&&(i.in.wasm.wasmPaths={wasm:new URL(`/assets/ort-wasm-simd-threaded.jsep-B0T3yYHD.wasm`,``+import.meta.url).href}),kd.postMessage(i),Nd=n}catch(e){t(e)}},t)});try{await Pt(L.wasm),await hd(L),jd=!0}catch(e){throw Md=!0,e}finally{Ad=!1}}},Bd=async e=>{if(Od())return Ld(),new Promise((t,n)=>{Id(`init-ep`,[t,n]);let r={type:`init-ep`,in:{epName:e,env:L}};kd.postMessage(r)});await gd(L,e)},Vd=async e=>Od()?(Ld(),new Promise((t,n)=>{Id(`copy-from`,[t,n]);let r={type:`copy-from`,in:{buffer:e}};kd.postMessage(r,[e.buffer])})):bd(e),Hd=async(e,t)=>{if(Od()){if(t?.preferredOutputLocation)throw Error(`session option "preferredOutputLocation" is not supported for proxy.`);return Ld(),new Promise((n,r)=>{Id(`create`,[n,r]);let i={type:`create`,in:{model:e,options:{...t}}},a=[];e instanceof Uint8Array&&a.push(e.buffer),kd.postMessage(i,a)})}else return xd(e,t)},Ud=async e=>{if(Od())return Ld(),new Promise((t,n)=>{Id(`release`,[t,n]);let r={type:`release`,in:e};kd.postMessage(r)});Sd(e)},Wd=async(e,t,n,r,i,a)=>{if(Od()){if(n.some(e=>e[3]!==`cpu`))throw Error(`input tensor on GPU is not supported for proxy.`);if(i.some(e=>e))throw Error(`pre-allocated output tensor is not supported for proxy.`);return Ld(),new Promise((i,o)=>{Id(`run`,[i,o]);let s=n,c={type:`run`,in:{sessionId:e,inputIndices:t,inputs:s,outputIndices:r,options:a}};kd.postMessage(c,Ed(s))})}else return wd(e,t,n,r,i,a)},Gd=async e=>{if(Od())return Ld(),new Promise((t,n)=>{Id(`end-profiling`,[t,n]);let r={type:`end-profiling`,in:e};kd.postMessage(r)});Td(e)}}),qd,Jd,Yd,Xd=M(()=>{"use strict";$e(),Kd(),V(),et(),on(),qd=(e,t)=>{switch(e.location){case`cpu`:return[e.type,e.dims,e.data,`cpu`];case`gpu-buffer`:return[e.type,e.dims,{gpuBuffer:e.gpuBuffer},`gpu-buffer`];case`ml-tensor`:return[e.type,e.dims,{mlTensor:e.mlTensor},`ml-tensor`];default:throw Error(`invalid data location: ${e.location} for ${t()}`)}},Jd=e=>{switch(e[3]){case`cpu`:return new ze(e[0],e[2],e[1]);case`gpu-buffer`:{let t=e[0];if(!tn(t))throw Error(`not supported data type: ${t} for deserializing GPU tensor`);let{gpuBuffer:n,download:r,dispose:i}=e[2];return ze.fromGpuBuffer(n,{dataType:t,dims:e[1],download:r,dispose:i})}case`ml-tensor`:{let t=e[0];if(!nn(t))throw Error(`not supported data type: ${t} for deserializing MLTensor tensor`);let{mlTensor:n,download:r,dispose:i}=e[2];return ze.fromMLTensor(n,{dataType:t,dims:e[1],download:r,dispose:i})}default:throw Error(`invalid data location: ${e[3]}`)}},Yd=class{async fetchModelAndCopyToWasmMemory(e){return Vd(await an(e))}async loadModel(e,t){He();let n;n=typeof e==`string`?await this.fetchModelAndCopyToWasmMemory(e):e,[this.sessionId,this.inputNames,this.outputNames,this.inputMetadata,this.outputMetadata]=await Hd(n,t),B()}async dispose(){return Ud(this.sessionId)}async run(e,t,n){He();let r=[],i=[];Object.entries(e).forEach(e=>{let t=e[0],n=e[1],a=this.inputNames.indexOf(t);if(a===-1)throw Error(`invalid input '${t}'`);r.push(n),i.push(a)});let a=[],o=[];Object.entries(t).forEach(e=>{let t=e[0],n=e[1],r=this.outputNames.indexOf(t);if(r===-1)throw Error(`invalid output '${t}'`);a.push(n),o.push(r)});let s=r.map((e,t)=>qd(e,()=>`input "${this.inputNames[i[t]]}"`)),c=a.map((e,t)=>e?qd(e,()=>`output "${this.outputNames[o[t]]}"`):null),l=await Wd(this.sessionId,i,s,o,c,n),u={};for(let e=0;e$d,initializeFlags:()=>Qd,wasmBackend:()=>ef});var Qd,$d,ef,tf=M(()=>{"use strict";$e(),Kd(),Xd(),Qd=()=>{(typeof L.wasm.initTimeout!=`number`||L.wasm.initTimeout<0)&&(L.wasm.initTimeout=0);let e=L.wasm.simd;if(typeof e!=`boolean`&&e!==void 0&&e!==`fixed`&&e!==`relaxed`&&(console.warn(`Property "env.wasm.simd" is set to unknown value "${e}". Reset it to \`false\` and ignore SIMD feature checking.`),L.wasm.simd=!1),typeof L.wasm.proxy!=`boolean`&&(L.wasm.proxy=!1),typeof L.wasm.trace!=`boolean`&&(L.wasm.trace=!1),typeof L.wasm.numThreads!=`number`||!Number.isInteger(L.wasm.numThreads)||L.wasm.numThreads<=0)if(typeof self<`u`&&!self.crossOriginIsolated)L.wasm.numThreads=1;else{let e=typeof navigator>`u`?se(`node:os`).cpus().length:navigator.hardwareConcurrency;L.wasm.numThreads=Math.min(4,Math.ceil((e||1)/2))}},$d=class{async init(e){Qd(),await zd(),await Bd(e)}async createInferenceSessionHandler(e,t){let n=new Yd;return await n.loadModel(e,t),n}},ef=new $d});$e(),$e(),$e();var nf=`1.22.0-dev.20250409-89f8206ba4`,rf=Qe;{let e=(tf(),le(Zd)).wasmBackend;P(`webgpu`,e,5),P(`webnn`,e,5),P(`cpu`,e,10),P(`wasm`,e,10)}Object.defineProperty(L.versions,`web`,{value:nf,enumerable:!0}); +${a}`,s=n.createShaderModule({code:o,label:e.name});dn(`verbose`,()=>`[WebGPU] ${e.name} shader code: ${o}`);let c=n.createComputePipeline({compute:{module:s,entryPoint:`main`},layout:`auto`,label:e.name});return H(e.name),{programInfo:e,computePipeline:c,uniformVariablesInfo:i.variablesInfo}}normalizeDispatchGroupSize(e){let t=typeof e==`number`?e:e.x,n=typeof e==`number`?1:e.y||1,r=typeof e==`number`?1:e.z||1,i=this.backend.device.limits.maxComputeWorkgroupsPerDimension;if(t<=i&&n<=i&&r<=i)return[t,n,r];let a=t*n*r,o=Math.ceil(Math.sqrt(a));if(o>i){if(o=Math.ceil(Math.cbrt(a)),o>i)throw Error(`Total dispatch size exceeds WebGPU maximum.`);return[o,o,o]}else return[o,o,1]}}}),rd={};N(rd,{WebGpuBackend:()=>sd});var id,ad,od,sd,cd=M(()=>{"use strict";Ze(),U(),fn(),bn(),Kn(),ed(),nd(),id=(e,t)=>{if(t.length!==e.length)throw Error(`inputDependencies length ${t.length} is not equal to inputTensors length ${e.length}.`);let n=[];for(let r=0;r{let r=e.name;return e.shaderCache?.hint&&(r+=`[`+e.shaderCache.hint+`]`),r+=`:`+n+`:${id(t,e.shaderCache?.inputDependencies??Array(t.length).fill(`dims`))}`,r},od=class{constructor(e){e&&(this.architecture=e.architecture,this.vendor=e.vendor)}isArchitecture(e){return this.architecture===e}isVendor(e){return this.vendor===e}},sd=class{constructor(){this.currentSessionId=null,this.currentKernelId=null,this.commandEncoder=null,this.computePassEncoder=null,this.maxDispatchNumber=16,this.pendingDispatchNumber=0,this.pendingKernels=[],this.pendingQueries=new Map,this.sessionStatus=`default`,this.capturedCommandList=new Map,this.capturedPendingKernels=new Map,this.sessionExternalDataMapping=new Map}get currentKernelCustomData(){if(this.currentKernelId===null)throw Error(`currentKernelCustomData(): currentKernelId is null. (should not happen)`);let e=this.kernelCustomData.get(this.currentKernelId);return e||(e={},this.kernelCustomData.set(this.currentKernelId,e)),e}async initialize(e,t){this.env=e;let n=[],r={requiredLimits:{maxComputeWorkgroupStorageSize:t.limits.maxComputeWorkgroupStorageSize,maxComputeWorkgroupsPerDimension:t.limits.maxComputeWorkgroupsPerDimension,maxStorageBufferBindingSize:t.limits.maxStorageBufferBindingSize,maxBufferSize:t.limits.maxBufferSize,maxComputeInvocationsPerWorkgroup:t.limits.maxComputeInvocationsPerWorkgroup,maxComputeWorkgroupSizeX:t.limits.maxComputeWorkgroupSizeX,maxComputeWorkgroupSizeY:t.limits.maxComputeWorkgroupSizeY,maxComputeWorkgroupSizeZ:t.limits.maxComputeWorkgroupSizeZ},requiredFeatures:n},i=e=>t.features.has(e)&&n.push(e)&&!0;i(`chromium-experimental-timestamp-query-inside-passes`)||i(`timestamp-query`),i(`shader-f16`),i(`subgroups`),this.device=await t.requestDevice(r),this.adapterInfo=new od(t.info||await t.requestAdapterInfo()),this.gpuDataManager=Gn(this),this.programManager=new td(this),this.kernels=new Map,this.kernelPersistentData=new Map,this.kernelCustomData=new Map,ln(e.logLevel,!!e.debug),this.device.onuncapturederror=e=>{e.error instanceof GPUValidationError&&console.error(`An uncaught WebGPU validation error was raised: ${e.error.message}`)},Object.defineProperty(this.env.webgpu,`device`,{value:this.device,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(this.env.webgpu,`adapter`,{value:t,writable:!1,enumerable:!0,configurable:!1}),this.setQueryType()}dispose(){typeof this.querySet<`u`&&this.querySet.destroy(),this.gpuDataManager.dispose()}getCommandEncoder(){return this.commandEncoder||=this.device.createCommandEncoder(),this.commandEncoder}getComputePassEncoder(){if(!this.computePassEncoder){let e=this.getCommandEncoder(),t={};this.queryType===`at-passes`&&(t.timestampWrites={querySet:this.querySet,beginningOfPassWriteIndex:this.pendingDispatchNumber*2,endOfPassWriteIndex:this.pendingDispatchNumber*2+1}),this.computePassEncoder=e.beginComputePass(t)}return this.computePassEncoder}endComputePass(){this.computePassEncoder&&(this.computePassEncoder.end(),this.computePassEncoder=null)}flush(){if(!this.commandEncoder)return;Be(),this.endComputePass();let e;this.queryType!==`none`&&(this.commandEncoder.resolveQuerySet(this.querySet,0,this.pendingDispatchNumber*2,this.queryResolveBuffer,0),e=this.device.createBuffer({size:this.pendingDispatchNumber*2*8,usage:GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST}),this.pendingQueries.set(e,this.pendingKernels),this.pendingKernels=[],this.commandEncoder.copyBufferToBuffer(this.queryResolveBuffer,0,e,0,this.pendingDispatchNumber*2*8)),this.device.queue.submit([this.commandEncoder.finish()]),this.gpuDataManager.refreshPendingBuffers(),this.commandEncoder=null,this.pendingDispatchNumber=0,this.queryType!==`none`&&e.mapAsync(GPUMapMode.READ).then(()=>{let t=new BigUint64Array(e.getMappedRange()),n=this.pendingQueries.get(e);for(let e=0;e`u`&&(this.queryTimeBase=d);let p=Number(d-this.queryTimeBase),m=Number(f-this.queryTimeBase);if(!Number.isSafeInteger(p)||!Number.isSafeInteger(m))throw RangeError(`incorrect timestamp range`);if(this.env.webgpu.profiling?.ondata)this.env.webgpu.profiling.ondata({version:1,inputsMetadata:l.map(e=>({dims:e.dims,dataType:Yt(e.dataType)})),outputsMetadata:u.map(e=>({dims:e.dims,dataType:Yt(e.dataType)})),kernelId:i,kernelType:o,kernelName:s,programName:c,startTime:p,endTime:m});else{let e=``;l.forEach((t,n)=>{e+=`input[${n}]: [${t.dims}] | ${Yt(t.dataType)}, `});let t=``;u.forEach((e,n)=>{t+=`output[${n}]: [${e.dims}] | ${Yt(e.dataType)}, `}),console.log(`[profiling] kernel "${i}|${o}|${s}|${c}" ${e}${t}execution time: ${m-p} ns`)}V(`GPU`,`${c}::${d}::${f}`)}e.unmap(),this.pendingQueries.delete(e)}),H()}run(e,t,n,r,i,a){Be(e.name);let o=[];for(let e=0;et):n;if(u.length!==s.length)throw Error(`Output size ${u.length} must be equal to ${s.length}.`);let d=[],f=[];for(let e=0;e=a)throw Error(`Invalid output index: ${u[e]}`);if(u[e]===-3)continue;let t=u[e]===-1,n=u[e]===-2,o=t||n?i(s[e].dataType,s[e].dims):r(u[e],s[e].dataType,s[e].dims);if(d.push(o),o.data===0)continue;let c=this.gpuDataManager.get(o.data);if(!c)throw Error(`no GPU data for output: ${o.data}`);if(t&&this.temporaryData.push(c),n){let e=this.kernelPersistentData.get(this.currentKernelId);e||(e=[],this.kernelPersistentData.set(this.currentKernelId,e)),e.push(c)}f.push(c)}if(o.length!==t.length||f.length!==d.length){if(f.length===0)return H(e.name),d;throw Error(`Program ${e.name} has zero-sized tensor(s) in inputs or outputs. This is not supported now.`)}let p;if(l){let e=0,t=[];l.forEach(n=>{let r=typeof n.data==`number`?[n.data]:n.data;if(r.length===0)return;let i=n.type===10?2:4,a,o;n.type===10?(o=r.length>4?16:r.length>2?8:r.length*i,a=r.length>4?16:i*r.length):(o=r.length<=2?r.length*i:16,a=16),e=Math.ceil(e/o)*o,t.push(e);let s=n.type===10?8:4;e+=r.length>4?Math.ceil(r.length/s)*a:r.length*i});let n=16;e=Math.ceil(e/n)*n;let r=new ArrayBuffer(e);l.forEach((e,n)=>{let i=t[n],a=typeof e.data==`number`?[e.data]:e.data;if(e.type===6)new Int32Array(r,i,a.length).set(a);else if(e.type===12)new Uint32Array(r,i,a.length).set(a);else if(e.type===10)new Uint16Array(r,i,a.length).set(a);else if(e.type===1)new Float32Array(r,i,a.length).set(a);else throw Error(`Unsupported uniform type: ${Yt(e.type)}`)});let i=this.gpuDataManager.create(e,GPUBufferUsage.COPY_DST|GPUBufferUsage.UNIFORM);this.device.queue.writeBuffer(i.buffer,0,r,0,e),this.gpuDataManager.release(i.id),p={offset:0,size:e,buffer:i.buffer}}let m=this.programManager.normalizeDispatchGroupSize(c),h=m[1]===1&&m[2]===1,g=ad(e,t,h),_=this.programManager.getArtifact(g);if(_||(_=this.programManager.build(e,m),this.programManager.setArtifact(g,_),dn(`info`,()=>`[artifact] key: ${g}, programName: ${e.name}`)),l&&_.uniformVariablesInfo){if(l.length!==_.uniformVariablesInfo.length)throw Error(`Uniform variables count mismatch: expect ${_.uniformVariablesInfo.length}, got ${l.length} in program "${_.programInfo.name}".`);for(let e=0;e`[ProgramManager] run "${e.name}" (key=${g}) with ${m[0]}x${m[1]}x${m[2]}`),this.queryType!==`none`||this.sessionStatus===`capturing`){let e={kernelId:this.currentKernelId,programName:_.programInfo.name,inputTensorViews:t,outputTensorViews:d};this.pendingKernels.push(e),this.sessionStatus===`capturing`&&this.capturedPendingKernels.get(this.currentSessionId).push(e)}return this.programManager.run(_,o,f,m,p),H(e.name),d}upload(e,t){this.gpuDataManager.upload(e,t)}memcpy(e,t){this.gpuDataManager.memcpy(e,t)}async download(e,t){await this.gpuDataManager.download(e,t)}alloc(e){return this.gpuDataManager.create(e).id}free(e){return this.gpuDataManager.release(e)}createKernel(e,t,n,r){let i=$u.get(e);if(!i)throw Error(`kernel not implemented: ${e}`);let a={kernelType:e,kernelName:r,kernelEntry:i[0],attributes:[i[1],n]};this.kernels.set(t,a)}releaseKernel(e){let t=this.kernelPersistentData.get(e);if(t){for(let e of t)this.gpuDataManager.release(e.id);this.kernelPersistentData.delete(e)}this.kernelCustomData.delete(e),this.kernels.delete(e)}computeKernel(e,t,n){let r=this.kernels.get(e);if(!r)throw Error(`kernel not created: ${e}`);let i=r.kernelType,a=r.kernelName,o=r.kernelEntry,s=r.attributes;if(this.currentKernelId!==null)throw Error(`kernel "[${i}] ${a}" is not allowed to be called recursively`);this.currentKernelId=e,s[0]&&(s[1]=s[0](s[1]),s[0]=void 0),dn(`info`,()=>`[WebGPU] Start to run kernel "[${i}] ${a}"...`);let c=this.env.debug;this.temporaryData=[];try{return c&&this.device.pushErrorScope(`validation`),o(t,s[1]),0}catch(e){return n.push(Promise.resolve(`[WebGPU] Kernel "[${i}] ${a}" failed. ${e}`)),1}finally{c&&n.push(this.device.popErrorScope().then(e=>e?`GPU validation error for kernel "[${i}] ${a}": ${e.message}`:null));for(let e of this.temporaryData)this.gpuDataManager.release(e.id);this.temporaryData=[],this.currentKernelId=null}}registerBuffer(e,t,n,r){let i=this.sessionExternalDataMapping.get(e);i||(i=new Map,this.sessionExternalDataMapping.set(e,i));let a=i.get(t),o=this.gpuDataManager.registerExternalBuffer(n,r,a);return i.set(t,[o,n]),o}unregisterBuffers(e){let t=this.sessionExternalDataMapping.get(e);t&&(t.forEach(e=>this.gpuDataManager.unregisterExternalBuffer(e[0])),this.sessionExternalDataMapping.delete(e))}getBuffer(e){let t=this.gpuDataManager.get(e);if(!t)throw Error(`no GPU data for buffer: ${e}`);return t.buffer}createDownloader(e,t,n){return async()=>{let r=await Un(this,e,t);return yn(r.buffer,n)}}writeTimestamp(e){this.queryType===`inside-passes`&&this.computePassEncoder.writeTimestamp(this.querySet,e)}setQueryType(){this.queryType=`none`,(this.env.webgpu.profiling?.mode===`default`||(typeof this.env.trace>`u`?this.env.wasm.trace:this.env.trace))&&(this.device.features.has(`chromium-experimental-timestamp-query-inside-passes`)?this.queryType=`inside-passes`:this.device.features.has(`timestamp-query`)&&(this.queryType=`at-passes`),this.queryType!==`none`&&typeof this.querySet>`u`&&(this.querySet=this.device.createQuerySet({type:`timestamp`,count:this.maxDispatchNumber*2}),this.queryResolveBuffer=this.device.createBuffer({size:this.maxDispatchNumber*2*8,usage:GPUBufferUsage.COPY_SRC|GPUBufferUsage.QUERY_RESOLVE})))}captureBegin(){dn(`info`,`captureBegin`),this.capturedCommandList.get(this.currentSessionId)||this.capturedCommandList.set(this.currentSessionId,[]),this.capturedPendingKernels.get(this.currentSessionId)||this.capturedPendingKernels.set(this.currentSessionId,[]),this.flush(),this.sessionStatus=`capturing`}captureEnd(){dn(`info`,`captureEnd`),this.flush(),this.sessionStatus=`default`}replay(){dn(`info`,`replay`),this.sessionStatus=`replaying`;let e=this.capturedCommandList.get(this.currentSessionId),t=this.capturedPendingKernels.get(this.currentSessionId),n=e.length;this.pendingKernels=[];for(let r=0;r=this.maxDispatchNumber||this.queryType===`at-passes`)&&this.endComputePass(),this.pendingDispatchNumber>=this.maxDispatchNumber&&this.flush()}this.flush(),this.sessionStatus=`default`}onCreateSession(){this.gpuDataManager.onCreateSession()}onReleaseSession(e){this.unregisterBuffers(e),this.capturedCommandList.has(e)&&this.capturedCommandList.delete(e),this.capturedPendingKernels.has(e)&&this.capturedPendingKernels.delete(e),this.gpuDataManager.onReleaseSession(e)}onRunStart(e){this.currentSessionId=e,this.setQueryType()}}}),ld={};N(ld,{init:()=>fd});var ud,dd,fd,pd=M(()=>{"use strict";U(),fn(),G(),Fn(),ud=class e{constructor(e,t,n,r){this.module=e,this.dataType=t,this.data=n,this.dims=r}getFloat32Array(){if(this.dataType!==1)throw Error(`Invalid data type`);let e=W.size(this.dims);return e===0?new Float32Array:new Float32Array(this.module.HEAP8.buffer,this.data,e)}getBigInt64Array(){if(this.dataType!==7)throw Error(`Invalid data type`);let e=W.size(this.dims);return e===0?new BigInt64Array:new BigInt64Array(this.module.HEAP8.buffer,this.data,e)}getInt32Array(){if(this.dataType!==6)throw Error(`Invalid data type`);let e=W.size(this.dims);return e===0?new Int32Array:new Int32Array(this.module.HEAP8.buffer,this.data,e)}getUint16Array(){if(this.dataType!==10&&this.dataType!==4)throw Error(`Invalid data type`);let e=W.size(this.dims);return e===0?new Uint16Array:new Uint16Array(this.module.HEAP8.buffer,this.data,e)}reshape(t){if(W.size(t)!==W.size(this.dims))throw Error(`Invalid new shape`);return new e(this.module,this.dataType,this.data,t)}},dd=class{constructor(e,t,n){this.module=e,this.backend=t,this.customDataOffset=0,this.customDataSize=0,this.adapterInfo=t.adapterInfo;let r=e.PTR_SIZE,i=n/e.PTR_SIZE,a=r===4?`i32`:`i64`;this.opKernelContext=Number(e.getValue(r*i++,a));let o=Number(e.getValue(r*i++,a));this.outputCount=Number(e.getValue(r*i++,a)),this.customDataOffset=Number(e.getValue(r*i++,`*`)),this.customDataSize=Number(e.getValue(r*i++,a));let s=[];for(let t=0;ttypeof e==`number`?this.inputs[e]:e)??this.inputs,r=t?.outputs??[],i=(e,t,n)=>new ud(this.module,t,this.output(e,n),n),a=(e,t)=>{let n=Xt(e,t);if(!n)throw Error(`Unsupported data type: ${e}`);let r=n>0?this.backend.gpuDataManager.create(n).id:0;return new ud(this.module,e,r,t)};return this.backend.run(e,n,r,i,a,this.outputCount)}output(e,t){let n=this.module.stackSave();try{let n=this.module.PTR_SIZE,r=n===4?`i32`:`i64`,i=this.module.stackAlloc((1+t.length)*n);this.module.setValue(i,t.length,r);for(let e=0;e{let i=t.jsepInit;if(!i)throw Error(`Failed to initialize JSEP. The WebAssembly module is not built with JSEP support.`);if(e===`webgpu`){let e=(cd(),le(rd)).WebGpuBackend,a=new e;await a.initialize(n,r),i(`webgpu`,[a,e=>a.alloc(Number(e)),e=>a.free(e),(e,n,r,i=!1)=>{if(i)dn(`verbose`,()=>`[WebGPU] jsepCopyGpuToGpu: src=${Number(e)}, dst=${Number(n)}, size=${Number(r)}`),a.memcpy(Number(e),Number(n));else{dn(`verbose`,()=>`[WebGPU] jsepCopyCpuToGpu: dataOffset=${Number(e)}, gpuDataId=${Number(n)}, size=${Number(r)}`);let i=t.HEAPU8.subarray(Number(e>>>0),Number(e>>>0)+Number(r));a.upload(Number(n),i)}},async(e,n,r)=>{dn(`verbose`,()=>`[WebGPU] jsepCopyGpuToCpu: gpuDataId=${e}, dataOffset=${n}, size=${r}`),await a.download(Number(e),()=>t.HEAPU8.subarray(Number(n)>>>0,Number(n+r)>>>0))},(e,n,r)=>a.createKernel(e,Number(n),r,t.UTF8ToString(t._JsepGetNodeName(Number(n)))),e=>a.releaseKernel(e),(e,n,r,i)=>{dn(`verbose`,()=>`[WebGPU] jsepRun: sessionHandle=${r}, kernel=${e}, contextDataOffset=${n}`);let o=new dd(t,a,Number(n));return a.computeKernel(Number(e),o,i)},()=>a.captureBegin(),()=>a.captureEnd(),()=>a.replay()])}else{let e=new Pn(n);i(`webnn`,[e,()=>e.reserveTensorId(),t=>e.releaseTensorId(t),async(t,n,r,i,a)=>e.ensureTensor(t,n,r,i,a),(t,n)=>{e.uploadTensor(t,n)},async(t,n)=>e.downloadTensor(t,n)])}}}),md,hd,gd,_d,vd,yd,bd,xd,Sd,Cd,wd,Td,Ed,Dd=M(()=>{"use strict";Bt(),qt(),U(),Pt(),Rt(),rn(),md=(e,t)=>{Nt()._OrtInit(e,t)!==0&&Lt(`Can't initialize onnxruntime.`)},hd=async e=>{md(e.wasm.numThreads,Qt(e.logLevel))},gd=async(e,t)=>{Nt().asyncInit?.();{let n=(pd(),le(ld)).init;if(t===`webgpu`){if(typeof navigator>`u`||!navigator.gpu)throw Error(`WebGPU is not supported in current environment`);let t=e.webgpu.adapter;if(t){if(typeof t.limits!=`object`||typeof t.features!=`object`||typeof t.requestDevice!=`function`)throw Error("Invalid GPU adapter set in `env.webgpu.adapter`. It must be a GPUAdapter object.")}else{let n=e.webgpu.powerPreference;if(n!==void 0&&n!==`low-power`&&n!==`high-performance`)throw Error(`Invalid powerPreference setting: "${n}"`);let r=e.webgpu.forceFallbackAdapter;if(r!==void 0&&typeof r!=`boolean`)throw Error(`Invalid forceFallbackAdapter setting: "${r}"`);if(t=await navigator.gpu.requestAdapter({powerPreference:n,forceFallbackAdapter:r}),!t)throw Error(`Failed to get GPU adapter. You may need to enable flag "--enable-unsafe-webgpu" if you are using Chrome.`)}await n(`webgpu`,Nt(),e,t)}if(t===`webnn`){if(typeof navigator>`u`||!navigator.ml)throw Error(`WebNN is not supported in current environment`);await n(`webnn`,Nt(),e)}}},_d=new Map,vd=e=>{let t=Nt(),n=t.stackSave();try{let n=t.PTR_SIZE,r=t.stackAlloc(2*n);t._OrtGetInputOutputCount(e,r,r+n)!==0&&Lt(`Can't get session input/output count.`);let i=n===4?`i32`:`i64`;return[Number(t.getValue(r,i)),Number(t.getValue(r+n,i))]}finally{t.stackRestore(n)}},yd=(e,t)=>{let n=Nt(),r=n.stackSave(),i=0;try{let r=n.PTR_SIZE,a=n.stackAlloc(2*r);n._OrtGetInputOutputMetadata(e,t,a,a+r)!==0&&Lt(`Can't get session input/output metadata.`);let o=Number(n.getValue(a,`*`));i=Number(n.getValue(a+r,`*`));let s=n.HEAP32[i/4];if(s===0)return[o,0];let c=n.HEAPU32[i/4+1],l=[];for(let e=0;e{let t=Nt(),n=t._malloc(e.byteLength);if(n===0)throw Error(`Can't create a session. failed to allocate a buffer of size ${e.byteLength}.`);return t.HEAPU8.set(e,n),[n,e.byteLength]},xd=async(e,t)=>{let n,r,i=Nt();Array.isArray(e)?[n,r]=e:e.buffer===i.HEAPU8.buffer?[n,r]=[e.byteOffset,e.byteLength]:[n,r]=bd(e);let a=0,o=0,s=0,c=[],l=[],u=[];try{if([o,c]=await Kt(t),t?.externalData&&i.mountExternalData){let e=[];for(let n of t.externalData){let t=typeof n==`string`?n:n.path;e.push(nn(typeof n==`string`?n:n.data).then(e=>{i.mountExternalData(t,e)}))}await Promise.all(e)}for(let e of t?.executionProviders??[])if((typeof e==`string`?e:e.name)===`webnn`){if(i.shouldTransferToMLTensor=!1,typeof e!=`string`){let t=e,n=t?.context,r=t?.gpuDevice,a=t?.deviceType,o=t?.powerPreference;n?i.currentContext=n:r?i.currentContext=await i.webnnCreateMLContext(r):i.currentContext=await i.webnnCreateMLContext({deviceType:a,powerPreference:o})}else i.currentContext=await i.webnnCreateMLContext();break}a=await i._OrtCreateSession(n,r,o),i.webgpuOnCreateSession?.(a),a===0&&Lt(`Can't create a session.`),i.jsepOnCreateSession?.(),i.currentContext&&(i.webnnRegisterMLContext(a,i.currentContext),i.currentContext=void 0,i.shouldTransferToMLTensor=!0);let[e,d]=vd(a),f=!!t?.enableGraphCapture,p=[],m=[],h=[],g=[],_=[];for(let t=0;te===`gpu-buffer`||e===`ml-tensor`)&&(s=i._OrtCreateBinding(a),s===0&&Lt(`Can't create IO binding.`),v={handle:s,outputPreferredLocations:_,outputPreferredLocationsEncoded:_.map(e=>tn(e))}),_d.set(a,[a,l,u,v,f,!1]),[a,p,m,h,g]}catch(e){throw l.forEach(e=>i._OrtFree(e)),u.forEach(e=>i._OrtFree(e)),s!==0&&i._OrtReleaseBinding(s)!==0&&Lt(`Can't release IO binding.`),a!==0&&i._OrtReleaseSession(a)!==0&&Lt(`Can't release session.`),e}finally{i._free(n),o!==0&&i._OrtReleaseSessionOptions(o)!==0&&Lt(`Can't release session options.`),c.forEach(e=>i._free(e)),i.unmountExternalData?.()}},Sd=e=>{let t=Nt(),n=_d.get(e);if(!n)throw Error(`cannot release session. invalid session id: ${e}`);let[r,i,a,o,s]=n;o&&(s&&t._OrtClearBoundOutputs(o.handle)!==0&&Lt(`Can't clear bound outputs.`),t._OrtReleaseBinding(o.handle)!==0&&Lt(`Can't release IO binding.`)),t.jsepOnReleaseSession?.(e),t.webnnOnReleaseSession?.(e),t.webgpuOnReleaseSession?.(e),i.forEach(e=>t._OrtFree(e)),a.forEach(e=>t._OrtFree(e)),t._OrtReleaseSession(r)!==0&&Lt(`Can't release session.`),_d.delete(e)},Cd=async(e,t,n,r,i,a,o=!1)=>{if(!e){t.push(0);return}let s=Nt(),c=s.PTR_SIZE,l=e[0],u=e[1],d=e[3],f=d,p,m;if(l===`string`&&(d===`gpu-buffer`||d===`ml-tensor`))throw Error(`String tensor is not supported on GPU.`);if(o&&d!==`gpu-buffer`)throw Error(`External buffer must be provided for input/output index ${a} when enableGraphCapture is true.`);if(d===`gpu-buffer`){let t=e[2].gpuBuffer;m=Xt(Jt(l),u);{let e=s.jsepRegisterBuffer;if(!e)throw Error(`Tensor location "gpu-buffer" is not supported without using WebGPU.`);p=e(r,a,t,m)}}else if(d===`ml-tensor`){let t=e[2].mlTensor;m=Xt(Jt(l),u);let n=s.webnnRegisterMLTensor;if(!n)throw Error(`Tensor location "ml-tensor" is not supported without using WebNN.`);p=n(r,t,Jt(l),u)}else{let t=e[2];if(Array.isArray(t)){m=c*t.length,p=s._malloc(m),n.push(p);for(let e=0;es.setValue(g+t*c,e,c===4?`i32`:`i64`));let e=s._OrtCreateTensor(Jt(l),p,m,g,u.length,tn(f));e===0&&Lt(`Can't create tensor for input/output. session=${r}, index=${a}.`),t.push(e)}finally{s.stackRestore(h)}},wd=async(e,t,n,r,i,a)=>{let o=Nt(),s=o.PTR_SIZE,c=_d.get(e);if(!c)throw Error(`cannot run inference. invalid session id: ${e}`);let l=c[0],u=c[1],d=c[2],f=c[3],p=c[4],m=c[5],h=t.length,g=r.length,_=0,v=[],y=[],b=[],x=[],S=o.stackSave(),C=o.stackAlloc(h*s),w=o.stackAlloc(h*s),T=o.stackAlloc(g*s),E=o.stackAlloc(g*s);try{[_,v]=zt(a);for(let r=0;re*t,1);d=Yt(a);let _=f?.outputPreferredLocations[r[t]];if(d===`string`){if(_===`gpu-buffer`||_===`ml-tensor`)throw Error(`String tensor is not supported on GPU.`);let e=[];for(let t=0;t0){let e=o.jsepGetBuffer;if(!e)throw Error(`preferredLocation "gpu-buffer" is not supported without using WebGPU.`);let t=e(p),r=Xt(a,g);if(r===void 0||!$t(d))throw Error(`Unsupported data type: ${d}`);u=!0,S.push([d,h,{gpuBuffer:t,download:o.jsepCreateDownloader(t,r,d),dispose:()=>{o._OrtReleaseTensor(n)!==0&&Lt(`Can't release tensor.`)}},`gpu-buffer`])}else if(_===`ml-tensor`&&g>0){let t=o.webnnEnsureTensor,r=o.webnnIsInt64Supported;if(!t||!r)throw Error(`preferredLocation "ml-tensor" is not supported without using WebNN.`);if(Xt(a,g)===void 0||!en(d))throw Error(`Unsupported data type: ${d}`);if(d===`int64`&&!r(e))throw Error(`preferredLocation "ml-tensor" for int64 output is not supported by current WebNN Context.`);let i=await t(e,p,a,h,!1);u=!0,S.push([d,h,{mlTensor:i,download:o.webnnCreateMLTensorDownloader(p,d),dispose:()=>{o.webnnReleaseTensorId(p),o._OrtReleaseTensor(n)}},`ml-tensor`])}else{let e=Zt(d),t=new e(g);new Uint8Array(t.buffer,t.byteOffset,t.byteLength).set(o.HEAPU8.subarray(p,p+t.byteLength)),S.push([d,h,t,`cpu`])}}finally{o.stackRestore(a),d===`string`&&p&&o._free(p),u||o._OrtReleaseTensor(n),o.webnnOnRunEnd?.(l)}}return f&&!p&&(o._OrtClearBoundOutputs(f.handle)!==0&&Lt(`Can't clear bound outputs.`),_d.set(e,[l,u,d,f,p,!1])),S}finally{o.stackRestore(S),y.forEach(e=>o._OrtReleaseTensor(e)),b.forEach(e=>o._OrtReleaseTensor(e)),x.forEach(e=>o._free(e)),_!==0&&o._OrtReleaseRunOptions(_),v.forEach(e=>o._free(e))}},Td=e=>{let t=Nt(),n=_d.get(e);if(!n)throw Error(`invalid session id`);let r=n[0],i=t._OrtEndProfiling(r);i===0&&Lt(`Can't get an profile file name.`),t._OrtFree(i)},Ed=e=>{let t=[];for(let n of e){let e=n[2];!Array.isArray(e)&&`buffer`in e&&t.push(e.buffer)}return t}}),Od,kd,Ad,jd,Md,Nd,Pd,Fd,Id,Ld,Rd,zd,Bd,Vd,Hd,Ud,Wd,Gd,Kd=M(()=>{"use strict";Ze(),Dd(),Pt(),wt(),Od=()=>!!R.wasm.proxy&&typeof document<`u`,Ad=!1,jd=!1,Md=!1,Fd=new Map,Id=(e,t)=>{let n=Fd.get(e);n?n.push(t):Fd.set(e,[t])},Ld=()=>{if(Ad||!jd||Md||!kd)throw Error(`worker not ready`)},Rd=e=>{switch(e.data.type){case`init-wasm`:Ad=!1,e.data.err?(Md=!0,Pd[1](e.data.err)):(jd=!0,Pd[0]()),Nd&&(URL.revokeObjectURL(Nd),Nd=void 0);break;case`init-ep`:case`copy-from`:case`create`:case`release`:case`run`:case`end-profiling`:{let t=Fd.get(e.data.type);e.data.err?t.shift()[1](e.data.err):t.shift()[0](e.data.out);break}default:}},zd=async()=>{if(!jd){if(Ad)throw Error(`multiple calls to 'initWasm()' detected.`);if(Md)throw Error(`previous call to 'initWasm()' failed.`);if(Ad=!0,Od())return new Promise((e,t)=>{kd?.terminate(),xt().then(([n,r])=>{try{kd=r,kd.onerror=e=>t(e),kd.onmessage=Rd,Pd=[e,t];let i={type:`init-wasm`,in:R};!i.in.wasm.wasmPaths&&(n||dt)&&(i.in.wasm.wasmPaths={wasm:new URL(`/assets/ort-wasm-simd-threaded.jsep-B0T3yYHD.wasm`,``+import.meta.url).href}),kd.postMessage(i),Nd=n}catch(e){t(e)}},t)});try{await Mt(R.wasm),await hd(R),jd=!0}catch(e){throw Md=!0,e}finally{Ad=!1}}},Bd=async e=>{if(Od())return Ld(),new Promise((t,n)=>{Id(`init-ep`,[t,n]);let r={type:`init-ep`,in:{epName:e,env:R}};kd.postMessage(r)});await gd(R,e)},Vd=async e=>Od()?(Ld(),new Promise((t,n)=>{Id(`copy-from`,[t,n]);let r={type:`copy-from`,in:{buffer:e}};kd.postMessage(r,[e.buffer])})):bd(e),Hd=async(e,t)=>{if(Od()){if(t?.preferredOutputLocation)throw Error(`session option "preferredOutputLocation" is not supported for proxy.`);return Ld(),new Promise((n,r)=>{Id(`create`,[n,r]);let i={type:`create`,in:{model:e,options:{...t}}},a=[];e instanceof Uint8Array&&a.push(e.buffer),kd.postMessage(i,a)})}else return xd(e,t)},Ud=async e=>{if(Od())return Ld(),new Promise((t,n)=>{Id(`release`,[t,n]);let r={type:`release`,in:e};kd.postMessage(r)});Sd(e)},Wd=async(e,t,n,r,i,a)=>{if(Od()){if(n.some(e=>e[3]!==`cpu`))throw Error(`input tensor on GPU is not supported for proxy.`);if(i.some(e=>e))throw Error(`pre-allocated output tensor is not supported for proxy.`);return Ld(),new Promise((i,o)=>{Id(`run`,[i,o]);let s=n,c={type:`run`,in:{sessionId:e,inputIndices:t,inputs:s,outputIndices:r,options:a}};kd.postMessage(c,Ed(s))})}else return wd(e,t,n,r,i,a)},Gd=async e=>{if(Od())return Ld(),new Promise((t,n)=>{Id(`end-profiling`,[t,n]);let r={type:`end-profiling`,in:e};kd.postMessage(r)});Td(e)}}),qd,Jd,Yd,Xd=M(()=>{"use strict";Ze(),Kd(),U(),Qe(),rn(),qd=(e,t)=>{switch(e.location){case`cpu`:return[e.type,e.dims,e.data,`cpu`];case`gpu-buffer`:return[e.type,e.dims,{gpuBuffer:e.gpuBuffer},`gpu-buffer`];case`ml-tensor`:return[e.type,e.dims,{mlTensor:e.mlTensor},`ml-tensor`];default:throw Error(`invalid data location: ${e.location} for ${t()}`)}},Jd=e=>{switch(e[3]){case`cpu`:return new Le(e[0],e[2],e[1]);case`gpu-buffer`:{let t=e[0];if(!$t(t))throw Error(`not supported data type: ${t} for deserializing GPU tensor`);let{gpuBuffer:n,download:r,dispose:i}=e[2];return Le.fromGpuBuffer(n,{dataType:t,dims:e[1],download:r,dispose:i})}case`ml-tensor`:{let t=e[0];if(!en(t))throw Error(`not supported data type: ${t} for deserializing MLTensor tensor`);let{mlTensor:n,download:r,dispose:i}=e[2];return Le.fromMLTensor(n,{dataType:t,dims:e[1],download:r,dispose:i})}default:throw Error(`invalid data location: ${e[3]}`)}},Yd=class{async fetchModelAndCopyToWasmMemory(e){return Vd(await nn(e))}async loadModel(e,t){Be();let n;n=typeof e==`string`?await this.fetchModelAndCopyToWasmMemory(e):e,[this.sessionId,this.inputNames,this.outputNames,this.inputMetadata,this.outputMetadata]=await Hd(n,t),H()}async dispose(){return Ud(this.sessionId)}async run(e,t,n){Be();let r=[],i=[];Object.entries(e).forEach(e=>{let t=e[0],n=e[1],a=this.inputNames.indexOf(t);if(a===-1)throw Error(`invalid input '${t}'`);r.push(n),i.push(a)});let a=[],o=[];Object.entries(t).forEach(e=>{let t=e[0],n=e[1],r=this.outputNames.indexOf(t);if(r===-1)throw Error(`invalid output '${t}'`);a.push(n),o.push(r)});let s=r.map((e,t)=>qd(e,()=>`input "${this.inputNames[i[t]]}"`)),c=a.map((e,t)=>e?qd(e,()=>`output "${this.outputNames[o[t]]}"`):null),l=await Wd(this.sessionId,i,s,o,c,n),u={};for(let e=0;e$d,initializeFlags:()=>Qd,wasmBackend:()=>ef});var Qd,$d,ef,tf=M(()=>{"use strict";Ze(),Kd(),Xd(),Qd=()=>{(typeof R.wasm.initTimeout!=`number`||R.wasm.initTimeout<0)&&(R.wasm.initTimeout=0);let e=R.wasm.simd;if(typeof e!=`boolean`&&e!==void 0&&e!==`fixed`&&e!==`relaxed`&&(console.warn(`Property "env.wasm.simd" is set to unknown value "${e}". Reset it to \`false\` and ignore SIMD feature checking.`),R.wasm.simd=!1),typeof R.wasm.proxy!=`boolean`&&(R.wasm.proxy=!1),typeof R.wasm.trace!=`boolean`&&(R.wasm.trace=!1),typeof R.wasm.numThreads!=`number`||!Number.isInteger(R.wasm.numThreads)||R.wasm.numThreads<=0)if(typeof self<`u`&&!self.crossOriginIsolated)R.wasm.numThreads=1;else{let e=typeof navigator>`u`?se(`node:os`).cpus().length:navigator.hardwareConcurrency;R.wasm.numThreads=Math.min(4,Math.ceil((e||1)/2))}},$d=class{async init(e){Qd(),await zd(),await Bd(e)}async createInferenceSessionHandler(e,t){let n=new Yd;return await n.loadModel(e,t),n}},ef=new $d});Ze(),Ze(),Ze();var nf=`1.22.0-dev.20250409-89f8206ba4`,rf=Xe;{let e=(tf(),le(Zd)).wasmBackend;fe(`webgpu`,e,5),fe(`webnn`,e,5),fe(`cpu`,e,10),fe(`wasm`,e,10)}Object.defineProperty(R.versions,`web`,{value:nf,enumerable:!0}); /** * @license * Copyright 2021 Google LLC. All Rights Reserved. @@ -2874,15 +2874,15 @@ ${a}`,s=n.createShaderModule({code:o,label:e.name});H(`verbose`,()=>`[WebGPU] ${ * limitations under the License. * ============================================================================= */ -var af={"onnxruntime-common":e=>{e.exports=ne},"onnxruntime-web":e=>{e.exports=j},"?2ce3":()=>{},"?7992":()=>{},"?5af5":()=>{},"?2b25":()=>{},"?db59":()=>{},"?383f":()=>{},"?fa4b":()=>{},"./node_modules/@huggingface/jinja/dist/index.js":(e,t,n)=>{n.r(t),n.d(t,{Environment:()=>L,Interpreter:()=>ye,Template:()=>Pe,parse:()=>se,tokenize:()=>d});var r=Object.freeze({Text:`Text`,NumericLiteral:`NumericLiteral`,BooleanLiteral:`BooleanLiteral`,NullLiteral:`NullLiteral`,StringLiteral:`StringLiteral`,Identifier:`Identifier`,Equals:`Equals`,OpenParen:`OpenParen`,CloseParen:`CloseParen`,OpenStatement:`OpenStatement`,CloseStatement:`CloseStatement`,OpenExpression:`OpenExpression`,CloseExpression:`CloseExpression`,OpenSquareBracket:`OpenSquareBracket`,CloseSquareBracket:`CloseSquareBracket`,OpenCurlyBracket:`OpenCurlyBracket`,CloseCurlyBracket:`CloseCurlyBracket`,Comma:`Comma`,Dot:`Dot`,Colon:`Colon`,Pipe:`Pipe`,CallOperator:`CallOperator`,AdditiveBinaryOperator:`AdditiveBinaryOperator`,MultiplicativeBinaryOperator:`MultiplicativeBinaryOperator`,ComparisonBinaryOperator:`ComparisonBinaryOperator`,UnaryOperator:`UnaryOperator`,Set:`Set`,If:`If`,For:`For`,In:`In`,Is:`Is`,NotIn:`NotIn`,Else:`Else`,EndSet:`EndSet`,EndIf:`EndIf`,ElseIf:`ElseIf`,EndFor:`EndFor`,And:`And`,Or:`Or`,Not:`UnaryOperator`,Macro:`Macro`,EndMacro:`EndMacro`,Break:`Break`,Continue:`Continue`}),i=Object.freeze({set:r.Set,for:r.For,in:r.In,is:r.Is,if:r.If,else:r.Else,endset:r.EndSet,endif:r.EndIf,elif:r.ElseIf,endfor:r.EndFor,and:r.And,or:r.Or,not:r.Not,"not in":r.NotIn,macro:r.Macro,endmacro:r.EndMacro,break:r.Break,continue:r.Continue,true:r.BooleanLiteral,false:r.BooleanLiteral,none:r.NullLiteral,True:r.BooleanLiteral,False:r.BooleanLiteral,None:r.NullLiteral}),a=class{constructor(e,t){this.value=e,this.type=t}};function o(e){return/\w/.test(e)}function s(e){return/[0-9]/.test(e)}var c=[[`{%`,r.OpenStatement],[`%}`,r.CloseStatement],[`{{`,r.OpenExpression],[`}}`,r.CloseExpression],[`(`,r.OpenParen],[`)`,r.CloseParen],[`{`,r.OpenCurlyBracket],[`}`,r.CloseCurlyBracket],[`[`,r.OpenSquareBracket],[`]`,r.CloseSquareBracket],[`,`,r.Comma],[`.`,r.Dot],[`:`,r.Colon],[`|`,r.Pipe],[`<=`,r.ComparisonBinaryOperator],[`>=`,r.ComparisonBinaryOperator],[`==`,r.ComparisonBinaryOperator],[`!=`,r.ComparisonBinaryOperator],[`<`,r.ComparisonBinaryOperator],[`>`,r.ComparisonBinaryOperator],[`+`,r.AdditiveBinaryOperator],[`-`,r.AdditiveBinaryOperator],[`*`,r.MultiplicativeBinaryOperator],[`/`,r.MultiplicativeBinaryOperator],[`%`,r.MultiplicativeBinaryOperator],[`=`,r.Equals]],l=new Map([[`n`,` -`],[`t`,` `],[`r`,`\r`],[`b`,`\b`],[`f`,`\f`],[`v`,`\v`],[`'`,`'`],[`"`,`"`],[`\\`,`\\`]]);function u(e,t={}){return e.endsWith(` -`)&&(e=e.slice(0,-1)),e=e.replace(/{#.*?#}/gs,`{##}`),t.lstrip_blocks&&(e=e.replace(/^[ \t]*({[#%])/gm,`$1`)),t.trim_blocks&&(e=e.replace(/([#%]})\n/g,`$1`)),e.replace(/{##}/g,``).replace(/-%}\s*/g,`%}`).replace(/\s*{%-/g,`{%`).replace(/-}}\s*/g,`}}`).replace(/\s*{{-/g,`{{`)}function d(e,t={}){let n=[],d=u(e,t),f=0,p=e=>{let t=``;for(;e(d[f]);){if(d[f]===`\\`){if(++f,f>=d.length)throw SyntaxError(`Unexpected end of input`);let e=d[f++],n=l.get(e);if(n===void 0)throw SyntaxError(`Unexpected escaped character: ${e}`);t+=n;continue}if(t+=d[f++],f>=d.length)throw SyntaxError(`Unexpected end of input`)}return t};main:for(;f0){n.push(new a(e,r.Text));continue}}p(e=>/\s/.test(e));let t=d[f];if(t===`-`||t===`+`){let e=n.at(-1)?.type;if(e===r.Text||e===void 0)throw SyntaxError(`Unexpected character: ${t}`);switch(e){case r.Identifier:case r.NumericLiteral:case r.BooleanLiteral:case r.NullLiteral:case r.StringLiteral:case r.CloseParen:case r.CloseSquareBracket:break;default:{++f;let e=p(s);n.push(new a(`${t}${e}`,e.length>0?r.NumericLiteral:r.UnaryOperator));continue}}}for(let[e,t]of c){let r=d.slice(f,f+e.length);if(r===e){n.push(new a(e,t)),f+=e.length;continue main}}if(t===`'`||t===`"`){++f;let e=p(e=>e!==t);n.push(new a(e,r.StringLiteral)),++f;continue}if(s(t)){let e=p(s);n.push(new a(e,r.NumericLiteral));continue}if(o(t)){let e=p(o),t=Object.hasOwn(i,e)?i[e]:r.Identifier;t===r.In&&n.at(-1)?.type===r.Not?(n.pop(),n.push(new a(`not in`,r.NotIn))):n.push(new a(e,t));continue}throw SyntaxError(`Unexpected character: ${t}`)}return n}var f=class{type=`Statement`},p=class extends f{constructor(e){super(),this.body=e}type=`Program`},m=class extends f{constructor(e,t,n){super(),this.test=e,this.body=t,this.alternate=n}type=`If`},h=class extends f{constructor(e,t,n,r){super(),this.loopvar=e,this.iterable=t,this.body=n,this.defaultBlock=r}type=`For`},g=class extends f{type=`Break`},_=class extends f{type=`Continue`},v=class extends f{constructor(e,t,n){super(),this.assignee=e,this.value=t,this.body=n}type=`Set`},y=class extends f{constructor(e,t,n){super(),this.name=e,this.args=t,this.body=n}type=`Macro`},b=class extends f{type=`Expression`},x=class extends b{constructor(e,t,n){super(),this.object=e,this.property=t,this.computed=n}type=`MemberExpression`},S=class extends b{constructor(e,t){super(),this.callee=e,this.args=t}type=`CallExpression`},C=class extends b{constructor(e){super(),this.value=e}type=`Identifier`},w=class extends b{constructor(e){super(),this.value=e}type=`Literal`},T=class extends w{type=`NumericLiteral`},E=class extends w{type=`StringLiteral`},D=class extends w{type=`BooleanLiteral`},O=class extends w{type=`NullLiteral`},k=class extends w{type=`ArrayLiteral`},A=class extends w{type=`TupleLiteral`},ee=class extends w{type=`ObjectLiteral`},te=class extends b{constructor(e,t,n){super(),this.operator=e,this.left=t,this.right=n}type=`BinaryExpression`},ne=class extends b{constructor(e,t){super(),this.operand=e,this.filter=t}type=`FilterExpression`},j=class extends b{constructor(e,t){super(),this.iterable=e,this.test=t}type=`SelectExpression`},re=class extends b{constructor(e,t,n){super(),this.operand=e,this.negate=t,this.test=n}type=`TestExpression`},ie=class extends b{constructor(e,t){super(),this.operator=e,this.argument=t}type=`UnaryExpression`},ae=class extends b{constructor(e=void 0,t=void 0,n=void 0){super(),this.start=e,this.stop=t,this.step=n}type=`SliceExpression`},oe=class extends b{constructor(e,t){super(),this.key=e,this.value=t}type=`KeywordArgumentExpression`};function se(e){let t=new p([]),n=0;function i(t,r){let i=e[n++];if(!i||i.type!==t)throw Error(`Parser Error: ${r}. ${i.type} !== ${t}.`);return i}function a(){switch(e[n].type){case r.Text:return c();case r.OpenStatement:return l();case r.OpenExpression:return u();default:throw SyntaxError(`Unexpected token type: ${e[n].type}`)}}function o(...t){return n+t.length<=e.length&&t.some((t,r)=>t!==e[n+r].type)}function s(...t){return n+t.length<=e.length&&t.every((t,r)=>t===e[n+r].type)}function c(){return new E(i(r.Text,`Expected text token`).value)}function l(){i(r.OpenStatement,`Expected opening statement token`);let t;switch(e[n].type){case r.Set:++n,t=d(),i(r.CloseStatement,`Expected closing statement token`);break;case r.If:++n,t=f(),i(r.OpenStatement,`Expected {% token`),i(r.EndIf,`Expected endif token`),i(r.CloseStatement,`Expected %} token`);break;case r.Macro:++n,t=b(),i(r.OpenStatement,`Expected {% token`),i(r.EndMacro,`Expected endmacro token`),i(r.CloseStatement,`Expected %} token`);break;case r.For:++n,t=se(),i(r.OpenStatement,`Expected {% token`),i(r.EndFor,`Expected endfor token`),i(r.CloseStatement,`Expected %} token`);break;case r.Break:++n,i(r.CloseStatement,`Expected closing statement token`),t=new g;break;case r.Continue:++n,i(r.CloseStatement,`Expected closing statement token`),t=new _;break;default:throw SyntaxError(`Unknown statement type: ${e[n].type}`)}return t}function u(){i(r.OpenExpression,`Expected opening expression token`);let e=M();return i(r.CloseExpression,`Expected closing expression token`),e}function d(){let t=M();if(s(r.Equals)){++n;let e=M();return new v(t,e,[])}else{let o=[];for(i(r.CloseStatement,`Expected %} token`);!(e[n]?.type===r.OpenStatement&&e[n+1]?.type===r.EndSet);){let e=a();o.push(e)}return i(r.OpenStatement,`Expected {% token`),i(r.EndSet,`Expected endset token`),new v(t,null,o)}}function f(){let t=M();i(r.CloseStatement,`Expected closing statement token`);let o=[],c=[];for(;!(e[n]?.type===r.OpenStatement&&(e[n+1]?.type===r.ElseIf||e[n+1]?.type===r.Else||e[n+1]?.type===r.EndIf));)o.push(a());if(e[n]?.type===r.OpenStatement&&e[n+1]?.type!==r.EndIf)if(++n,s(r.ElseIf))i(r.ElseIf,`Expected elseif token`),c.push(f());else for(i(r.Else,`Expected else token`),i(r.CloseStatement,`Expected closing statement token`);!(e[n]?.type===r.OpenStatement&&e[n+1]?.type===r.EndIf);)c.push(a());return new m(t,o,c)}function b(){let e=L();if(e.type!==`Identifier`)throw SyntaxError(`Expected identifier following macro statement`);let t=I();i(r.CloseStatement,`Expected closing statement token`);let n=[];for(;o(r.OpenStatement,r.EndMacro);)n.push(a());return new y(e,t,n)}function w(e=!1){let t=e?L:M,i=[t()],a=s(r.Comma);for(;a&&(++n,i.push(t()),s(r.Comma)););return a?new A(i):i[0]}function se(){let e=w(!0);if(!(e instanceof C||e instanceof A))throw SyntaxError(`Expected identifier/tuple for the loop variable, got ${e.type} instead`);i(r.In,"Expected `in` keyword following loop variable");let t=M();i(r.CloseStatement,`Expected closing statement token`);let c=[];for(;o(r.OpenStatement,r.EndFor)&&o(r.OpenStatement,r.Else);)c.push(a());let l=[];if(s(r.OpenStatement,r.Else))for(++n,++n,i(r.CloseStatement,`Expected closing statement token`);o(r.OpenStatement,r.EndFor);)l.push(a());return new h(e,t,c,l)}function M(){return N()}function N(){let e=ce();if(s(r.If)){++n;let t=ce();if(s(r.Else)){++n;let r=ce();return new m(t,[e],[r])}else return new j(e,t)}return e}function ce(){let t=le();for(;s(r.Or);){let r=e[n];++n;let i=le();t=new te(r,t,i)}return t}function le(){let t=ue();for(;s(r.And);){let r=e[n];++n;let i=ue();t=new te(r,t,i)}return t}function ue(){let t;for(;s(r.Not);){let r=e[n];++n;let i=ue();t=new ie(r,i)}return t??de()}function de(){let t=P();for(;s(r.ComparisonBinaryOperator)||s(r.In)||s(r.NotIn);){let r=e[n];++n;let i=P();t=new te(r,t,i)}return t}function P(){let t=ge();for(;s(r.AdditiveBinaryOperator);){let r=e[n];++n;let i=ge();t=new te(r,t,i)}return t}function F(){let e=he(L());return s(r.OpenParen)?fe(e):e}function fe(e){let t=new S(e,I());return t=he(t),s(r.OpenParen)&&(t=fe(t)),t}function I(){i(r.OpenParen,`Expected opening parenthesis for arguments list`);let e=pe();return i(r.CloseParen,`Expected closing parenthesis for arguments list`),e}function pe(){let e=[];for(;!s(r.CloseParen);){let t=M();if(s(r.Equals)){if(++n,!(t instanceof C))throw SyntaxError(`Expected identifier for keyword argument`);let e=M();t=new oe(t,e)}e.push(t),s(r.Comma)&&++n}return e}function me(){let e=[],t=!1;for(;!s(r.CloseSquareBracket);)s(r.Colon)?(e.push(void 0),++n,t=!0):(e.push(M()),s(r.Colon)&&(++n,t=!0));if(e.length===0)throw SyntaxError(`Expected at least one argument for member/slice expression`);if(t){if(e.length>3)throw SyntaxError(`Expected 0-3 arguments for slice expression`);return new ae(...e)}return e[0]}function he(t){for(;s(r.Dot)||s(r.OpenSquareBracket);){let a=e[n];++n;let o,s=a.type!==r.Dot;if(s)o=me(),i(r.CloseSquareBracket,`Expected closing square bracket`);else if(o=L(),o.type!==`Identifier`)throw SyntaxError(`Expected identifier following dot operator`);t=new x(t,o,s)}return t}function ge(){let t=_e();for(;s(r.MultiplicativeBinaryOperator);){let r=e[n];++n;let i=_e();t=new te(r,t,i)}return t}function _e(){let e=ve();for(;s(r.Is);){++n;let t=s(r.Not);t&&++n;let i=L();if(i instanceof D?i=new C(i.value.toString()):i instanceof O&&(i=new C(`none`)),!(i instanceof C))throw SyntaxError(`Expected identifier for the test`);e=new re(e,t,i)}return e}function ve(){let e=F();for(;s(r.Pipe);){++n;let t=L();if(!(t instanceof C))throw SyntaxError(`Expected identifier for the filter`);s(r.OpenParen)&&(t=fe(t)),e=new ne(e,t)}return e}function L(){let t=e[n];switch(t.type){case r.NumericLiteral:return++n,new T(Number(t.value));case r.StringLiteral:return++n,new E(t.value);case r.BooleanLiteral:return++n,new D(t.value.toLowerCase()===`true`);case r.NullLiteral:return++n,new O(null);case r.Identifier:return++n,new C(t.value);case r.OpenParen:{++n;let t=w();if(e[n].type!==r.CloseParen)throw SyntaxError(`Expected closing parenthesis, got ${e[n].type} instead`);return++n,t}case r.OpenSquareBracket:{++n;let e=[];for(;!s(r.CloseSquareBracket);)e.push(M()),s(r.Comma)&&++n;return++n,new k(e)}case r.OpenCurlyBracket:{++n;let e=new Map;for(;!s(r.CloseCurlyBracket);){let t=M();i(r.Colon,`Expected colon between key and value in object literal`);let a=M();e.set(t,a),s(r.Comma)&&++n}return++n,new ee(e)}default:throw SyntaxError(`Unexpected token: ${t.type}`)}}for(;n=0?(t=(t??=0)<0?Math.max(e.length+t,0):Math.min(t,e.length),n=(n??=e.length)<0?Math.max(e.length+n,0):Math.min(n,e.length)):(t=(t??=e.length-1)<0?Math.max(e.length+t,-1):Math.min(t,e.length-1),n=(n??=-1)<-1?Math.max(e.length+n,-1):Math.min(n,e.length-1));let a=[];for(let o=t;i*oe.toUpperCase())}var le=class extends Error{},ue=class extends Error{},de=class{type=`RuntimeValue`;value;builtins=new Map;constructor(e=void 0){this.value=e}__bool__(){return new fe(!!this.value)}},P=class extends de{type=`NumericValue`},F=class extends de{type=`StringValue`;builtins=new Map([[`upper`,new ge(()=>new F(this.value.toUpperCase()))],[`lower`,new ge(()=>new F(this.value.toLowerCase()))],[`strip`,new ge(()=>new F(this.value.trim()))],[`title`,new ge(()=>new F(ce(this.value)))],[`length`,new P(this.value.length)],[`rstrip`,new ge(()=>new F(this.value.trimEnd()))],[`lstrip`,new ge(()=>new F(this.value.trimStart()))],[`startswith`,new ge(e=>{if(e.length===0)throw Error(`startswith() requires at least one argument`);let t=e[0];if(!(t instanceof F))throw Error(`startswith() argument must be a string`);return new fe(this.value.startsWith(t.value))})],[`endswith`,new ge(e=>{if(e.length===0)throw Error(`endswith() requires at least one argument`);let t=e[0];if(!(t instanceof F))throw Error(`endswith() argument must be a string`);return new fe(this.value.endsWith(t.value))})],[`split`,new ge(e=>{let t=e[0]??new _e;if(!(t instanceof F||t instanceof _e))throw Error(`sep argument must be a string or null`);let n=e[1]??new P(-1);if(!(n instanceof P))throw Error(`maxsplit argument must be a number`);let r=[];if(t instanceof _e){let e=this.value.trimStart();for(let{0:t,index:i}of e.matchAll(/\S+/g)){if(n.value!==-1&&r.length>=n.value&&i!==void 0){r.push(t+e.slice(i+t.length));break}r.push(t)}}else{if(t.value===``)throw Error(`empty separator`);r=this.value.split(t.value),n.value!==-1&&r.length>n.value&&r.push(r.splice(n.value).join(t.value))}return new me(r.map(e=>new F(e)))})]])},fe=class extends de{type=`BooleanValue`},I=class extends de{type=`ObjectValue`;__bool__(){return new fe(this.value.size>0)}builtins=new Map([[`get`,new ge(([e,t])=>{if(!(e instanceof F))throw Error(`Object key must be a string: got ${e.type}`);return this.value.get(e.value)??t??new _e})],[`items`,new ge(()=>new me(Array.from(this.value.entries()).map(([e,t])=>new me([new F(e),t]))))]])},pe=class extends I{type=`KeywordArgumentsValue`},me=class extends de{type=`ArrayValue`;builtins=new Map([[`length`,new P(this.value.length)]]);__bool__(){return new fe(this.value.length>0)}},he=class extends me{type=`TupleValue`},ge=class extends de{type=`FunctionValue`},_e=class extends de{type=`NullValue`},ve=class extends de{type=`UndefinedValue`},L=class{constructor(e){this.parent=e}variables=new Map([[`namespace`,new ge(e=>{if(e.length===0)return new I(new Map);if(e.length!==1||!(e[0]instanceof I))throw Error("`namespace` expects either zero arguments or a single object argument");return e[0]})]]);tests=new Map([[`boolean`,e=>e.type===`BooleanValue`],[`callable`,e=>e instanceof ge],[`odd`,e=>{if(e.type!==`NumericValue`)throw Error(`Cannot apply test "odd" to type: ${e.type}`);return e.value%2!=0}],[`even`,e=>{if(e.type!==`NumericValue`)throw Error(`Cannot apply test "even" to type: ${e.type}`);return e.value%2==0}],[`false`,e=>e.type===`BooleanValue`&&!e.value],[`true`,e=>e.type===`BooleanValue`&&e.value],[`none`,e=>e.type===`NullValue`],[`string`,e=>e.type===`StringValue`],[`number`,e=>e.type===`NumericValue`],[`integer`,e=>e.type===`NumericValue`&&Number.isInteger(e.value)],[`iterable`,e=>e.type===`ArrayValue`||e.type===`StringValue`],[`mapping`,e=>e.type===`ObjectValue`],[`lower`,e=>{let t=e.value;return e.type===`StringValue`&&t===t.toLowerCase()}],[`upper`,e=>{let t=e.value;return e.type===`StringValue`&&t===t.toUpperCase()}],[`none`,e=>e.type===`NullValue`],[`defined`,e=>e.type!==`UndefinedValue`],[`undefined`,e=>e.type===`UndefinedValue`],[`equalto`,(e,t)=>e.value===t.value],[`eq`,(e,t)=>e.value===t.value]]);set(e,t){return this.declareVariable(e,be(t))}declareVariable(e,t){if(this.variables.has(e))throw SyntaxError(`Variable already declared: ${e}`);return this.variables.set(e,t),t}setVariable(e,t){return this.variables.set(e,t),t}resolve(e){if(this.variables.has(e))return this;if(this.parent)return this.parent.resolve(e);throw Error(`Unknown variable: ${e}`)}lookupVariable(e){try{return this.resolve(e).variables.get(e)??new ve}catch{return new ve}}},ye=class{global;constructor(e){this.global=e??new L}run(e){return this.evaluate(e,this.global)}evaluateBinaryExpression(e,t){let n=this.evaluate(e.left,t);switch(e.operator.value){case`and`:return n.__bool__().value?this.evaluate(e.right,t):n;case`or`:return n.__bool__().value?n:this.evaluate(e.right,t)}let r=this.evaluate(e.right,t);switch(e.operator.value){case`==`:return new fe(n.value==r.value);case`!=`:return new fe(n.value!=r.value)}if(n instanceof ve||r instanceof ve)throw Error(`Cannot perform operation on undefined values`);if(n instanceof _e||r instanceof _e)throw Error(`Cannot perform operation on null values`);if(n instanceof P&&r instanceof P)switch(e.operator.value){case`+`:return new P(n.value+r.value);case`-`:return new P(n.value-r.value);case`*`:return new P(n.value*r.value);case`/`:return new P(n.value/r.value);case`%`:return new P(n.value%r.value);case`<`:return new fe(n.value`:return new fe(n.value>r.value);case`>=`:return new fe(n.value>=r.value);case`<=`:return new fe(n.value<=r.value)}else if(n instanceof me&&r instanceof me)switch(e.operator.value){case`+`:return new me(n.value.concat(r.value))}else if(r instanceof me){let t=r.value.find(e=>e.value===n.value)!==void 0;switch(e.operator.value){case`in`:return new fe(t);case`not in`:return new fe(!t)}}if(n instanceof F||r instanceof F)switch(e.operator.value){case`+`:return new F(n.value.toString()+r.value.toString())}if(n instanceof F&&r instanceof F)switch(e.operator.value){case`in`:return new fe(r.value.includes(n.value));case`not in`:return new fe(!r.value.includes(n.value))}if(n instanceof F&&r instanceof I)switch(e.operator.value){case`in`:return new fe(r.value.has(n.value));case`not in`:return new fe(!r.value.has(n.value))}throw SyntaxError(`Unknown operator "${e.operator.value}" between ${n.type} and ${r.type}`)}evaluateArguments(e,t){let n=[],r=new Map;for(let i of e)if(i.type===`KeywordArgumentExpression`){let e=i;r.set(e.key.value,this.evaluate(e.value,t))}else{if(r.size>0)throw Error(`Positional arguments must come before keyword arguments`);n.push(this.evaluate(i,t))}return[n,r]}evaluateFilterExpression(e,t){let n=this.evaluate(e.operand,t);if(e.filter.type===`Identifier`){let t=e.filter;if(t.value===`tojson`)return new F(xe(n));if(n instanceof me)switch(t.value){case`list`:return n;case`first`:return n.value[0];case`last`:return n.value[n.value.length-1];case`length`:return new P(n.value.length);case`reverse`:return new me(n.value.reverse());case`sort`:return new me(n.value.sort((e,t)=>{if(e.type!==t.type)throw Error(`Cannot compare different types: ${e.type} and ${t.type}`);switch(e.type){case`NumericValue`:return e.value-t.value;case`StringValue`:return e.value.localeCompare(t.value);default:throw Error(`Cannot compare type: ${e.type}`)}}));case`join`:return new F(n.value.map(e=>e.value).join(``));case`string`:return new F(xe(n));default:throw Error(`Unknown ArrayValue filter: ${t.value}`)}else if(n instanceof F)switch(t.value){case`length`:return new P(n.value.length);case`upper`:return new F(n.value.toUpperCase());case`lower`:return new F(n.value.toLowerCase());case`title`:return new F(ce(n.value));case`capitalize`:return new F(n.value.charAt(0).toUpperCase()+n.value.slice(1));case`trim`:return new F(n.value.trim());case`indent`:return new F(n.value.split(` +var af={"onnxruntime-common":e=>{e.exports=ne},"onnxruntime-web":e=>{e.exports=j},"?2ce3":()=>{},"?7992":()=>{},"?5af5":()=>{},"?2b25":()=>{},"?db59":()=>{},"?383f":()=>{},"?fa4b":()=>{},"./node_modules/@huggingface/jinja/dist/index.js":(e,t,n)=>{n.r(t),n.d(t,{Environment:()=>Ce,Interpreter:()=>Te,Template:()=>Ve,parse:()=>ce,tokenize:()=>u});var r=Object.freeze({Text:`Text`,NumericLiteral:`NumericLiteral`,StringLiteral:`StringLiteral`,Identifier:`Identifier`,Equals:`Equals`,OpenParen:`OpenParen`,CloseParen:`CloseParen`,OpenStatement:`OpenStatement`,CloseStatement:`CloseStatement`,OpenExpression:`OpenExpression`,CloseExpression:`CloseExpression`,OpenSquareBracket:`OpenSquareBracket`,CloseSquareBracket:`CloseSquareBracket`,OpenCurlyBracket:`OpenCurlyBracket`,CloseCurlyBracket:`CloseCurlyBracket`,Comma:`Comma`,Dot:`Dot`,Colon:`Colon`,Pipe:`Pipe`,CallOperator:`CallOperator`,AdditiveBinaryOperator:`AdditiveBinaryOperator`,MultiplicativeBinaryOperator:`MultiplicativeBinaryOperator`,ComparisonBinaryOperator:`ComparisonBinaryOperator`,UnaryOperator:`UnaryOperator`,Comment:`Comment`}),i=class{constructor(e,t){this.value=e,this.type=t}};function a(e){return/\w/.test(e)}function o(e){return/[0-9]/.test(e)}var s=[[`{%`,r.OpenStatement],[`%}`,r.CloseStatement],[`{{`,r.OpenExpression],[`}}`,r.CloseExpression],[`(`,r.OpenParen],[`)`,r.CloseParen],[`{`,r.OpenCurlyBracket],[`}`,r.CloseCurlyBracket],[`[`,r.OpenSquareBracket],[`]`,r.CloseSquareBracket],[`,`,r.Comma],[`.`,r.Dot],[`:`,r.Colon],[`|`,r.Pipe],[`<=`,r.ComparisonBinaryOperator],[`>=`,r.ComparisonBinaryOperator],[`==`,r.ComparisonBinaryOperator],[`!=`,r.ComparisonBinaryOperator],[`<`,r.ComparisonBinaryOperator],[`>`,r.ComparisonBinaryOperator],[`+`,r.AdditiveBinaryOperator],[`-`,r.AdditiveBinaryOperator],[`~`,r.AdditiveBinaryOperator],[`*`,r.MultiplicativeBinaryOperator],[`/`,r.MultiplicativeBinaryOperator],[`%`,r.MultiplicativeBinaryOperator],[`=`,r.Equals]],c=new Map([[`n`,` +`],[`t`,` `],[`r`,`\r`],[`b`,`\b`],[`f`,`\f`],[`v`,`\v`],[`'`,`'`],[`"`,`"`],[`\\`,`\\`]]);function l(e,t={}){return e.endsWith(` +`)&&(e=e.slice(0,-1)),t.lstrip_blocks&&(e=e.replace(/^[ \t]*({[#%-])/gm,`$1`)),t.trim_blocks&&(e=e.replace(/([#%-]})\n/g,`$1`)),e.replace(/-%}\s*/g,`%}`).replace(/\s*{%-/g,`{%`).replace(/-}}\s*/g,`}}`).replace(/\s*{{-/g,`{{`).replace(/-#}\s*/g,`#}`).replace(/\s*{#-/g,`{#`).replace(/{%\s*(end)?generation\s*%}/gs,``)}function u(e,t={}){let n=[],u=l(e,t),d=0,f=0,p=e=>{let t=``;for(;e(u[d]);){if(u[d]===`\\`){if(++d,d>=u.length)throw SyntaxError(`Unexpected end of input`);let e=u[d++],n=c.get(e);if(n===void 0)throw SyntaxError(`Unexpected escaped character: ${e}`);t+=n;continue}if(t+=u[d++],d>=u.length)throw SyntaxError(`Unexpected end of input`)}return t};main:for(;d0){n.push(new i(e,r.Text));continue}}if(u[d]===`{`&&u[d+1]===`#`){d+=2;let e=``;for(;u[d]!==`#`||u[d+1]!==`}`;){if(d+2>=u.length)throw SyntaxError(`Missing end of comment tag`);e+=u[d++]}n.push(new i(e,r.Comment)),d+=2;continue}p(e=>/\s/.test(e));let t=u[d];if(t===`-`||t===`+`){let e=n.at(-1)?.type;if(e===r.Text||e===void 0)throw SyntaxError(`Unexpected character: ${t}`);switch(e){case r.Identifier:case r.NumericLiteral:case r.StringLiteral:case r.CloseParen:case r.CloseSquareBracket:break;default:{++d;let e=p(o);n.push(new i(`${t}${e}`,e.length>0?r.NumericLiteral:r.UnaryOperator));continue}}}for(let[e,t]of s){if(e===`}}`&&f>0)continue;let a=u.slice(d,d+e.length);if(a===e){n.push(new i(e,t)),t===r.OpenExpression?f=0:t===r.OpenCurlyBracket?++f:t===r.CloseCurlyBracket&&--f,d+=e.length;continue main}}if(t===`'`||t===`"`){++d;let e=p(e=>e!==t);n.push(new i(e,r.StringLiteral)),++d;continue}if(o(t)){let e=p(o);if(u[d]===`.`&&o(u[d+1])){++d;let t=p(o);e=`${e}.${t}`}n.push(new i(e,r.NumericLiteral));continue}if(a(t)){let e=p(a);n.push(new i(e,r.Identifier));continue}throw SyntaxError(`Unexpected character: ${t}`)}return n}var d=class{type=`Statement`},f=class extends d{constructor(e){super(),this.body=e}type=`Program`},p=class extends d{constructor(e,t,n){super(),this.test=e,this.body=t,this.alternate=n}type=`If`},m=class extends d{constructor(e,t,n,r){super(),this.loopvar=e,this.iterable=t,this.body=n,this.defaultBlock=r}type=`For`},h=class extends d{type=`Break`},g=class extends d{type=`Continue`},_=class extends d{constructor(e,t,n){super(),this.assignee=e,this.value=t,this.body=n}type=`Set`},v=class extends d{constructor(e,t,n){super(),this.name=e,this.args=t,this.body=n}type=`Macro`},y=class extends d{constructor(e){super(),this.value=e}type=`Comment`},b=class extends d{type=`Expression`},x=class extends b{constructor(e,t,n){super(),this.object=e,this.property=t,this.computed=n}type=`MemberExpression`},S=class extends b{constructor(e,t){super(),this.callee=e,this.args=t}type=`CallExpression`},C=class extends b{constructor(e){super(),this.value=e}type=`Identifier`},w=class extends b{constructor(e){super(),this.value=e}type=`Literal`},T=class extends w{type=`IntegerLiteral`},E=class extends w{type=`FloatLiteral`},D=class extends w{type=`StringLiteral`},O=class extends w{type=`ArrayLiteral`},k=class extends w{type=`TupleLiteral`},A=class extends w{type=`ObjectLiteral`},ee=class extends b{constructor(e,t,n){super(),this.operator=e,this.left=t,this.right=n}type=`BinaryExpression`},te=class extends b{constructor(e,t){super(),this.operand=e,this.filter=t}type=`FilterExpression`},ne=class extends d{constructor(e,t){super(),this.filter=e,this.body=t}type=`FilterStatement`},j=class extends b{constructor(e,t){super(),this.lhs=e,this.test=t}type=`SelectExpression`},re=class extends b{constructor(e,t,n){super(),this.operand=e,this.negate=t,this.test=n}type=`TestExpression`},ie=class extends b{constructor(e,t){super(),this.operator=e,this.argument=t}type=`UnaryExpression`},ae=class extends b{constructor(e=void 0,t=void 0,n=void 0){super(),this.start=e,this.stop=t,this.step=n}type=`SliceExpression`},oe=class extends b{constructor(e,t){super(),this.key=e,this.value=t}type=`KeywordArgumentExpression`},se=class extends b{constructor(e){super(),this.argument=e}type=`SpreadExpression`},M=class extends d{constructor(e,t,n){super(),this.call=e,this.callerArgs=t,this.body=n}type=`CallStatement`},N=class extends b{constructor(e,t,n){super(),this.condition=e,this.trueExpr=t,this.falseExpr=n}type=`Ternary`};function ce(e){let t=new f([]),n=0;function a(t,r){let i=e[n++];if(!i||i.type!==t)throw Error(`Parser Error: ${r}. ${i.type} !== ${t}.`);return i}function o(e){if(!u(e))throw SyntaxError(`Expected ${e}`);++n}function s(){switch(e[n].type){case r.Comment:return new y(e[n++].value);case r.Text:return d();case r.OpenStatement:return b();case r.OpenExpression:return w();default:throw SyntaxError(`Unexpected token type: ${e[n].type}`)}}function c(...t){return n+t.length<=e.length&&t.every((t,r)=>t===e[n+r].type)}function l(...t){return e[n]?.type===r.OpenStatement&&e[n+1]?.type===r.Identifier&&t.includes(e[n+1]?.value)}function u(...t){return n+t.length<=e.length&&t.every((t,r)=>e[n+r].type===`Identifier`&&t===e[n+r].value)}function d(){return new D(a(r.Text,`Expected text token`).value)}function b(){if(a(r.OpenStatement,`Expected opening statement token`),e[n].type!==r.Identifier)throw SyntaxError(`Unknown statement, got ${e[n].type}`);let t=e[n].value,i;switch(t){case`set`:++n,i=ce();break;case`if`:++n,i=le(),a(r.OpenStatement,`Expected {% token`),o(`endif`),a(r.CloseStatement,`Expected %} token`);break;case`macro`:++n,i=ue(),a(r.OpenStatement,`Expected {% token`),o(`endmacro`),a(r.CloseStatement,`Expected %} token`);break;case`for`:++n,i=fe(),a(r.OpenStatement,`Expected {% token`),o(`endfor`),a(r.CloseStatement,`Expected %} token`);break;case`call`:{++n;let e=null;c(r.OpenParen)&&(e=R());let t=B();if(t.type!==`Identifier`)throw SyntaxError(`Expected identifier following call statement`);let u=R();a(r.CloseStatement,`Expected closing statement token`);let d=[];for(;!l(`endcall`);)d.push(s());a(r.OpenStatement,`Expected '{%'`),o(`endcall`),a(r.CloseStatement,`Expected closing statement token`);let f=new S(t,u);i=new M(f,e,d);break}case`break`:++n,a(r.CloseStatement,`Expected closing statement token`),i=new h;break;case`continue`:++n,a(r.CloseStatement,`Expected closing statement token`),i=new g;break;case`filter`:{++n;let e=B();e instanceof C&&c(r.OpenParen)&&(e=L(e)),a(r.CloseStatement,`Expected closing statement token`);let t=[];for(;!l(`endfilter`);)t.push(s());a(r.OpenStatement,`Expected '{%'`),o(`endfilter`),a(r.CloseStatement,`Expected '%}'`),i=new ne(e,t);break}default:throw SyntaxError(`Unknown statement type: ${t}`)}return i}function w(){a(r.OpenExpression,`Expected opening expression token`);let e=P();return a(r.CloseExpression,`Expected closing expression token`),e}function ce(){let e=de(),t=null,i=[];if(c(r.Equals))++n,t=de();else{for(a(r.CloseStatement,`Expected %} token`);!l(`endset`);)i.push(s());a(r.OpenStatement,`Expected {% token`),o(`endset`)}return a(r.CloseStatement,`Expected closing statement token`),new _(e,t,i)}function le(){let e=P();a(r.CloseStatement,`Expected closing statement token`);let t=[],i=[];for(;!l(`elif`,`else`,`endif`);)t.push(s());if(l(`elif`)){++n,++n;let e=le();i.push(e)}else if(l(`else`))for(++n,++n,a(r.CloseStatement,`Expected closing statement token`);!l(`endif`);)i.push(s());return new p(e,t,i)}function ue(){let e=B();if(e.type!==`Identifier`)throw SyntaxError(`Expected identifier following macro statement`);let t=R();a(r.CloseStatement,`Expected closing statement token`);let n=[];for(;!l(`endmacro`);)n.push(s());return new v(e,t,n)}function de(e=!1){let t=e?B:P,i=[t()],a=c(r.Comma);for(;a&&(++n,i.push(t()),c(r.Comma)););return a?new k(i):i[0]}function fe(){let e=de(!0);if(!(e instanceof C||e instanceof k))throw SyntaxError(`Expected identifier/tuple for the loop variable, got ${e.type} instead`);if(!u(`in`))throw SyntaxError("Expected `in` keyword following loop variable");++n;let t=P();a(r.CloseStatement,`Expected closing statement token`);let i=[];for(;!l(`endfor`,`else`);)i.push(s());let o=[];if(l(`else`))for(++n,++n,a(r.CloseStatement,`Expected closing statement token`);!l(`endfor`);)o.push(s());return new m(e,t,i,o)}function P(){return pe()}function pe(){let e=F();if(u(`if`)){++n;let t=F();if(u(`else`)){++n;let r=pe();return new N(t,e,r)}else return new j(e,t)}return e}function F(){let t=me();for(;u(`or`);){let r=e[n];++n;let i=me();t=new ee(r,t,i)}return t}function me(){let t=he();for(;u(`and`);){let r=e[n];++n;let i=he();t=new ee(r,t,i)}return t}function he(){let t;for(;u(`not`);){let r=e[n];++n;let i=he();t=new ie(r,i)}return t??ge()}function ge(){let t=I();for(;;){let a;if(u(`not`,`in`))a=new i(`not in`,r.Identifier),n+=2;else if(u(`in`))a=e[n++];else if(c(r.ComparisonBinaryOperator))a=e[n++];else break;let o=I();t=new ee(a,t,o)}return t}function I(){let t=be();for(;c(r.AdditiveBinaryOperator);){let r=e[n];++n;let i=be();t=new ee(r,t,i)}return t}function _e(){let e=z(B());return c(r.OpenParen)?L(e):e}function L(e){let t=new S(e,R());return t=z(t),c(r.OpenParen)&&(t=L(t)),t}function R(){a(r.OpenParen,`Expected opening parenthesis for arguments list`);let e=ve();return a(r.CloseParen,`Expected closing parenthesis for arguments list`),e}function ve(){let t=[];for(;!c(r.CloseParen);){let i;if(e[n].type===r.MultiplicativeBinaryOperator&&e[n].value===`*`){++n;let e=P();i=new se(e)}else if(i=P(),c(r.Equals)){if(++n,!(i instanceof C))throw SyntaxError(`Expected identifier for keyword argument`);let e=P();i=new oe(i,e)}t.push(i),c(r.Comma)&&++n}return t}function ye(){let e=[],t=!1;for(;!c(r.CloseSquareBracket);)c(r.Colon)?(e.push(void 0),++n,t=!0):(e.push(P()),c(r.Colon)&&(++n,t=!0));if(e.length===0)throw SyntaxError(`Expected at least one argument for member/slice expression`);if(t){if(e.length>3)throw SyntaxError(`Expected 0-3 arguments for slice expression`);return new ae(...e)}return e[0]}function z(t){for(;c(r.Dot)||c(r.OpenSquareBracket);){let i=e[n];++n;let o,s=i.type===r.OpenSquareBracket;if(s)o=ye(),a(r.CloseSquareBracket,`Expected closing square bracket`);else if(o=B(),o.type!==`Identifier`)throw SyntaxError(`Expected identifier following dot operator`);t=new x(t,o,s)}return t}function be(){let t=xe();for(;c(r.MultiplicativeBinaryOperator);){let r=e[n++],i=xe();t=new ee(r,t,i)}return t}function xe(){let e=Se();for(;u(`is`);){++n;let t=u(`not`);t&&++n;let r=B();if(!(r instanceof C))throw SyntaxError(`Expected identifier for the test`);e=new re(e,t,r)}return e}function Se(){let e=_e();for(;c(r.Pipe);){++n;let t=B();if(!(t instanceof C))throw SyntaxError(`Expected identifier for the filter`);c(r.OpenParen)&&(t=L(t)),e=new te(e,t)}return e}function B(){let t=e[n++];switch(t.type){case r.NumericLiteral:{let e=t.value;return e.includes(`.`)?new E(Number(e)):new T(Number(e))}case r.StringLiteral:{let i=t.value;for(;c(r.StringLiteral);)i+=e[n++].value;return new D(i)}case r.Identifier:return new C(t.value);case r.OpenParen:{let e=de();return a(r.CloseParen,"Expected closing parenthesis, got ${tokens[current].type} instead."),e}case r.OpenSquareBracket:{let e=[];for(;!c(r.CloseSquareBracket);)e.push(P()),c(r.Comma)&&++n;return++n,new O(e)}case r.OpenCurlyBracket:{let e=new Map;for(;!c(r.CloseCurlyBracket);){let t=P();a(r.Colon,`Expected colon between key and value in object literal`);let i=P();e.set(t,i),c(r.Comma)&&++n}return++n,new A(e)}default:throw SyntaxError(`Unexpected token: ${t.type}`)}}for(;n=0?(t=(t??=0)<0?Math.max(e.length+t,0):Math.min(t,e.length),n=(n??=e.length)<0?Math.max(e.length+n,0):Math.min(n,e.length)):(t=(t??=e.length-1)<0?Math.max(e.length+t,-1):Math.min(t,e.length-1),n=(n??=-1)<-1?Math.max(e.length+n,-1):Math.min(n,e.length-1));let a=[];for(let o=t;i*oe.toUpperCase())}function fe(e){return P(new Date,e)}function P(e,t){let n=new Intl.DateTimeFormat(void 0,{month:`long`}),r=new Intl.DateTimeFormat(void 0,{month:`short`}),i=e=>e<10?`0`+e:e.toString();return t.replace(/%[YmdbBHM%]/g,t=>{switch(t){case`%Y`:return e.getFullYear().toString();case`%m`:return i(e.getMonth()+1);case`%d`:return i(e.getDate());case`%b`:return r.format(e);case`%B`:return n.format(e);case`%H`:return i(e.getHours());case`%M`:return i(e.getMinutes());case`%%`:return`%`;default:return t}})}function pe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function F(e,t,n,r){if(r===0)return e;let i=r==null||r<0?1/0:r,a=t.length===0?RegExp(`(?=)`,`gu`):new RegExp(pe(t),`gu`);return e.replaceAll(a,e=>i>0?(--i,n):e)}var me=class extends Error{},he=class extends Error{},ge=class{type=`RuntimeValue`;value;builtins=new Map;constructor(e=void 0){this.value=e}__bool__(){return new R(!!this.value)}toString(){return String(this.value)}},I=class extends ge{type=`IntegerValue`},_e=class extends ge{type=`FloatValue`;toString(){return this.value%1==0?this.value.toFixed(1):this.value.toString()}},L=class extends ge{type=`StringValue`;builtins=new Map([[`upper`,new xe(()=>new L(this.value.toUpperCase()))],[`lower`,new xe(()=>new L(this.value.toLowerCase()))],[`strip`,new xe(()=>new L(this.value.trim()))],[`title`,new xe(()=>new L(de(this.value)))],[`capitalize`,new xe(()=>new L(this.value.charAt(0).toUpperCase()+this.value.slice(1)))],[`length`,new I(this.value.length)],[`rstrip`,new xe(()=>new L(this.value.trimEnd()))],[`lstrip`,new xe(()=>new L(this.value.trimStart()))],[`startswith`,new xe(e=>{if(e.length===0)throw Error(`startswith() requires at least one argument`);let t=e[0];if(t instanceof L)return new R(this.value.startsWith(t.value));if(t instanceof z){for(let e of t.value){if(!(e instanceof L))throw Error(`startswith() tuple elements must be strings`);if(this.value.startsWith(e.value))return new R(!0)}return new R(!1)}throw Error(`startswith() argument must be a string or tuple of strings`)})],[`endswith`,new xe(e=>{if(e.length===0)throw Error(`endswith() requires at least one argument`);let t=e[0];if(t instanceof L)return new R(this.value.endsWith(t.value));if(t instanceof z){for(let e of t.value){if(!(e instanceof L))throw Error(`endswith() tuple elements must be strings`);if(this.value.endsWith(e.value))return new R(!0)}return new R(!1)}throw Error(`endswith() argument must be a string or tuple of strings`)})],[`split`,new xe(e=>{let t=e[0]??new Se;if(!(t instanceof L||t instanceof Se))throw Error(`sep argument must be a string or null`);let n=e[1]??new I(-1);if(!(n instanceof I))throw Error(`maxsplit argument must be a number`);let r=[];if(t instanceof Se){let e=this.value.trimStart();for(let{0:t,index:i}of e.matchAll(/\S+/g)){if(n.value!==-1&&r.length>=n.value&&i!==void 0){r.push(t+e.slice(i+t.length));break}r.push(t)}}else{if(t.value===``)throw Error(`empty separator`);r=this.value.split(t.value),n.value!==-1&&r.length>n.value&&r.push(r.splice(n.value).join(t.value))}return new z(r.map(e=>new L(e)))})],[`replace`,new xe(e=>{if(e.length<2)throw Error(`replace() requires at least two arguments`);let t=e[0],n=e[1];if(!(t instanceof L&&n instanceof L))throw Error(`replace() arguments must be strings`);let r;if(r=e.length>2?e[2].type===`KeywordArgumentsValue`?e[2].value.get(`count`)??new Se:e[2]:new Se,!(r instanceof I||r instanceof Se))throw Error(`replace() count argument must be a number or null`);return new L(F(this.value,t.value,n.value,r.value))})]])},R=class extends ge{type=`BooleanValue`},ve=class extends ge{type=`ObjectValue`;__bool__(){return new R(this.value.size>0)}builtins=new Map([[`get`,new xe(([e,t])=>{if(!(e instanceof L))throw Error(`Object key must be a string: got ${e.type}`);return this.value.get(e.value)??t??new Se})],[`items`,new xe(()=>this.items())],[`keys`,new xe(()=>this.keys())],[`values`,new xe(()=>this.values())]]);items(){return new z(Array.from(this.value.entries()).map(([e,t])=>new z([new L(e),t])))}keys(){return new z(Array.from(this.value.keys()).map(e=>new L(e)))}values(){return new z(Array.from(this.value.values()))}},ye=class extends ve{type=`KeywordArgumentsValue`},z=class extends ge{type=`ArrayValue`;builtins=new Map([[`length`,new I(this.value.length)]]);__bool__(){return new R(this.value.length>0)}},be=class extends z{type=`TupleValue`},xe=class extends ge{type=`FunctionValue`},Se=class extends ge{type=`NullValue`},B=class extends ge{type=`UndefinedValue`},Ce=class{constructor(e){this.parent=e}variables=new Map([[`namespace`,new xe(e=>{if(e.length===0)return new ve(new Map);if(e.length!==1||!(e[0]instanceof ve))throw Error("`namespace` expects either zero arguments or a single object argument");return e[0]})]]);tests=new Map([[`boolean`,e=>e.type===`BooleanValue`],[`callable`,e=>e instanceof xe],[`odd`,e=>{if(!(e instanceof I))throw Error(`cannot odd on ${e.type}`);return e.value%2!=0}],[`even`,e=>{if(!(e instanceof I))throw Error(`cannot even on ${e.type}`);return e.value%2==0}],[`false`,e=>e.type===`BooleanValue`&&!e.value],[`true`,e=>e.type===`BooleanValue`&&e.value],[`none`,e=>e.type===`NullValue`],[`string`,e=>e.type===`StringValue`],[`number`,e=>e instanceof I||e instanceof _e],[`integer`,e=>e instanceof I],[`iterable`,e=>e.type===`ArrayValue`||e.type===`StringValue`],[`mapping`,e=>e.type===`ObjectValue`],[`lower`,e=>{let t=e.value;return e.type===`StringValue`&&t===t.toLowerCase()}],[`upper`,e=>{let t=e.value;return e.type===`StringValue`&&t===t.toUpperCase()}],[`none`,e=>e.type===`NullValue`],[`defined`,e=>e.type!==`UndefinedValue`],[`undefined`,e=>e.type===`UndefinedValue`],[`equalto`,(e,t)=>e.value===t.value],[`eq`,(e,t)=>e.value===t.value]]);set(e,t){return this.declareVariable(e,Ee(t))}declareVariable(e,t){if(this.variables.has(e))throw SyntaxError(`Variable already declared: ${e}`);return this.variables.set(e,t),t}setVariable(e,t){return this.variables.set(e,t),t}resolve(e){if(this.variables.has(e))return this;if(this.parent)return this.parent.resolve(e);throw Error(`Unknown variable: ${e}`)}lookupVariable(e){try{return this.resolve(e).variables.get(e)??new B}catch{return new B}}};function we(e){e.set(`false`,!1),e.set(`true`,!0),e.set(`none`,null),e.set(`raise_exception`,e=>{throw Error(e)}),e.set(`range`,le),e.set(`strftime_now`,fe),e.set(`True`,!0),e.set(`False`,!1),e.set(`None`,null)}var Te=class{global;constructor(e){this.global=e??new Ce}run(e){return this.evaluate(e,this.global)}evaluateBinaryExpression(e,t){let n=this.evaluate(e.left,t);switch(e.operator.value){case`and`:return n.__bool__().value?this.evaluate(e.right,t):n;case`or`:return n.__bool__().value?n:this.evaluate(e.right,t)}let r=this.evaluate(e.right,t);switch(e.operator.value){case`==`:return new R(n.value==r.value);case`!=`:return new R(n.value!=r.value)}if(n instanceof B||r instanceof B){if(r instanceof B&&[`in`,`not in`].includes(e.operator.value))return new R(e.operator.value===`not in`);throw Error(`Cannot perform operation ${e.operator.value} on undefined values`)}else if(n instanceof Se||r instanceof Se)throw Error(`Cannot perform operation on null values`);else if(e.operator.value===`~`)return new L(n.value.toString()+r.value.toString());else if((n instanceof I||n instanceof _e)&&(r instanceof I||r instanceof _e)){let t=n.value,i=r.value;switch(e.operator.value){case`+`:case`-`:case`*`:{let a=e.operator.value===`+`?t+i:e.operator.value===`-`?t-i:t*i,o=n instanceof _e||r instanceof _e;return o?new _e(a):new I(a)}case`/`:return new _e(t/i);case`%`:{let e=t%i,a=n instanceof _e||r instanceof _e;return a?new _e(e):new I(e)}case`<`:return new R(t`:return new R(t>i);case`>=`:return new R(t>=i);case`<=`:return new R(t<=i)}}else if(n instanceof z&&r instanceof z)switch(e.operator.value){case`+`:return new z(n.value.concat(r.value))}else if(r instanceof z){let t=r.value.find(e=>e.value===n.value)!==void 0;switch(e.operator.value){case`in`:return new R(t);case`not in`:return new R(!t)}}if(n instanceof L||r instanceof L)switch(e.operator.value){case`+`:return new L(n.value.toString()+r.value.toString())}if(n instanceof L&&r instanceof L)switch(e.operator.value){case`in`:return new R(r.value.includes(n.value));case`not in`:return new R(!r.value.includes(n.value))}if(n instanceof L&&r instanceof ve)switch(e.operator.value){case`in`:return new R(r.value.has(n.value));case`not in`:return new R(!r.value.has(n.value))}throw SyntaxError(`Unknown operator "${e.operator.value}" between ${n.type} and ${r.type}`)}evaluateArguments(e,t){let n=[],r=new Map;for(let i of e)if(i.type===`SpreadExpression`){let e=i,r=this.evaluate(e.argument,t);if(!(r instanceof z))throw Error(`Cannot unpack non-iterable type: ${r.type}`);for(let e of r.value)n.push(e)}else if(i.type===`KeywordArgumentExpression`){let e=i;r.set(e.key.value,this.evaluate(e.value,t))}else{if(r.size>0)throw Error(`Positional arguments must come before keyword arguments`);n.push(this.evaluate(i,t))}return[n,r]}applyFilter(e,t,n){if(t.type===`Identifier`){let r=t;if(r.value===`tojson`)return new L(De(e));if(e instanceof z)switch(r.value){case`list`:return e;case`first`:return e.value[0];case`last`:return e.value[e.value.length-1];case`length`:return new I(e.value.length);case`reverse`:return new z(e.value.reverse());case`sort`:return new z(e.value.sort((e,t)=>{if(e.type!==t.type)throw Error(`Cannot compare different types: ${e.type} and ${t.type}`);switch(e.type){case`IntegerValue`:case`FloatValue`:return e.value-t.value;case`StringValue`:return e.value.localeCompare(t.value);default:throw Error(`Cannot compare type: ${e.type}`)}}));case`join`:return new L(e.value.map(e=>e.value).join(``));case`string`:return new L(De(e));case`unique`:{let t=new Set,n=[];for(let r of e.value)t.has(r.value)||(t.add(r.value),n.push(r));return new z(n)}default:throw Error(`Unknown ArrayValue filter: ${r.value}`)}else if(e instanceof L)switch(r.value){case`length`:case`upper`:case`lower`:case`title`:case`capitalize`:{let t=e.builtins.get(r.value);if(t instanceof xe)return t.value([],n);if(t instanceof I)return t;throw Error(`Unknown StringValue filter: ${r.value}`)}case`trim`:return new L(e.value.trim());case`indent`:return new L(e.value.split(` `).map((e,t)=>t===0||e.length===0?e:` `+e).join(` -`));case`join`:case`string`:return n;default:throw Error(`Unknown StringValue filter: ${t.value}`)}else if(n instanceof P)switch(t.value){case`abs`:return new P(Math.abs(n.value));default:throw Error(`Unknown NumericValue filter: ${t.value}`)}else if(n instanceof I)switch(t.value){case`items`:return new me(Array.from(n.value.entries()).map(([e,t])=>new me([new F(e),t])));case`length`:return new P(n.value.size);default:throw Error(`Unknown ObjectValue filter: ${t.value}`)}throw Error(`Cannot apply filter "${t.value}" to type: ${n.type}`)}else if(e.filter.type===`CallExpression`){let r=e.filter;if(r.callee.type!==`Identifier`)throw Error(`Unknown filter: ${r.callee.type}`);let i=r.callee.value;if(i===`tojson`){let[,e]=this.evaluateArguments(r.args,t),i=e.get(`indent`)??new _e;if(!(i instanceof P||i instanceof _e))throw Error(`If set, indent must be a number`);return new F(xe(n,i.value))}else if(i===`join`){let e;if(n instanceof F)e=Array.from(n.value);else if(n instanceof me)e=n.value.map(e=>e.value);else throw Error(`Cannot apply filter "${i}" to type: ${n.type}`);let[a,o]=this.evaluateArguments(r.args,t),s=a.at(0)??o.get(`separator`)??new F(``);if(!(s instanceof F))throw Error(`separator must be a string`);return new F(e.join(s.value))}if(n instanceof me){switch(i){case`selectattr`:case`rejectattr`:{let e=i===`selectattr`;if(n.value.some(e=>!(e instanceof I)))throw Error(`\`${i}\` can only be applied to array of objects`);if(r.args.some(e=>e.type!==`StringLiteral`))throw Error(`arguments of \`${i}\` must be strings`);let[a,o,s]=r.args.map(e=>this.evaluate(e,t)),c;if(o){let e=t.tests.get(o.value);if(!e)throw Error(`Unknown test: ${o.value}`);c=e}else c=(...e)=>e[0].__bool__().value;let l=n.value.filter(t=>{let n=t.value.get(a.value),r=n?c(n,s):!1;return e?r:!r});return new me(l)}case`map`:{let[,e]=this.evaluateArguments(r.args,t);if(e.has(`attribute`)){let t=e.get(`attribute`);if(!(t instanceof F))throw Error(`attribute must be a string`);let r=e.get(`default`),i=n.value.map(e=>{if(!(e instanceof I))throw Error(`items in map must be an object`);return e.value.get(t.value)??r??new ve});return new me(i)}else throw Error("`map` expressions without `attribute` set are not currently supported.")}}throw Error(`Unknown ArrayValue filter: ${i}`)}else if(n instanceof F){switch(i){case`indent`:{let[e,i]=this.evaluateArguments(r.args,t),a=e.at(0)??i.get(`width`)??new P(4);if(!(a instanceof P))throw Error(`width must be a number`);let o=e.at(1)??i.get(`first`)??new fe(!1),s=e.at(2)??i.get(`blank`)??new fe(!1),c=n.value.split(` -`),l=` `.repeat(a.value),u=c.map((e,t)=>!o.value&&t===0||!s.value&&e.length===0?e:l+e);return new F(u.join(` -`))}}throw Error(`Unknown StringValue filter: ${i}`)}else throw Error(`Cannot apply filter "${i}" to type: ${n.type}`)}throw Error(`Unknown filter: ${e.filter.type}`)}evaluateTestExpression(e,t){let n=this.evaluate(e.operand,t),r=t.tests.get(e.test.value);if(!r)throw Error(`Unknown test: ${e.test.value}`);let i=r(n);return new fe(e.negate?!i:i)}evaluateUnaryExpression(e,t){let n=this.evaluate(e.argument,t);switch(e.operator.value){case`not`:return new fe(!n.value);default:throw SyntaxError(`Unknown operator: ${e.operator.value}`)}}evalProgram(e,t){return this.evaluateBlock(e.body,t)}evaluateBlock(e,t){let n=``;for(let r of e){let e=this.evaluate(r,t);e.type!==`NullValue`&&e.type!==`UndefinedValue`&&(n+=e.value)}return new F(n)}evaluateIdentifier(e,t){return t.lookupVariable(e.value)}evaluateCallExpression(e,t){let[n,r]=this.evaluateArguments(e.args,t);r.size>0&&n.push(new pe(r));let i=this.evaluate(e.callee,t);if(i.type!==`FunctionValue`)throw Error(`Cannot call something that is not a function: got ${i.type}`);return i.value(n,t)}evaluateSliceExpression(e,t,n){if(!(e instanceof me||e instanceof F))throw Error(`Slice object must be an array or string`);let r=this.evaluate(t.start,n),i=this.evaluate(t.stop,n),a=this.evaluate(t.step,n);if(!(r instanceof P||r instanceof ve))throw Error(`Slice start must be numeric or undefined`);if(!(i instanceof P||i instanceof ve))throw Error(`Slice stop must be numeric or undefined`);if(!(a instanceof P||a instanceof ve))throw Error(`Slice step must be numeric or undefined`);return e instanceof me?new me(N(e.value,r.value,i.value,a.value)):new F(N(Array.from(e.value),r.value,i.value,a.value).join(``))}evaluateMemberExpression(e,t){let n=this.evaluate(e.object,t),r;if(e.computed){if(e.property.type===`SliceExpression`)return this.evaluateSliceExpression(n,e.property,t);r=this.evaluate(e.property,t)}else r=new F(e.property.value);let i;if(n instanceof I){if(!(r instanceof F))throw Error(`Cannot access property with non-string: got ${r.type}`);i=n.value.get(r.value)??n.builtins.get(r.value)}else if(n instanceof me||n instanceof F)if(r instanceof P)i=n.value.at(r.value),n instanceof F&&(i=new F(n.value.at(r.value)));else if(r instanceof F)i=n.builtins.get(r.value);else throw Error(`Cannot access property with non-string/non-number: got ${r.type}`);else{if(!(r instanceof F))throw Error(`Cannot access property with non-string: got ${r.type}`);i=n.builtins.get(r.value)}return i instanceof de?i:new ve}evaluateSet(e,t){let n=e.value?this.evaluate(e.value,t):this.evaluateBlock(e.body,t);if(e.assignee.type===`Identifier`){let r=e.assignee.value;t.setVariable(r,n)}else if(e.assignee.type===`MemberExpression`){let r=e.assignee,i=this.evaluate(r.object,t);if(!(i instanceof I))throw Error(`Cannot assign to member of non-object`);if(r.property.type!==`Identifier`)throw Error(`Cannot assign to member with non-identifier property`);i.value.set(r.property.value,n)}else throw Error(`Invalid LHS inside assignment expression: ${JSON.stringify(e.assignee)}`);return new _e}evaluateIf(e,t){let n=this.evaluate(e.test,t);return this.evaluateBlock(n.__bool__().value?e.body:e.alternate,t)}evaluateFor(e,t){let n=new L(t),r,i;if(e.iterable.type===`SelectExpression`){let t=e.iterable;i=this.evaluate(t.iterable,n),r=t.test}else i=this.evaluate(e.iterable,n);if(!(i instanceof me))throw Error(`Expected iterable type in for loop: got ${i.type}`);let a=[],o=[];for(let t=0;tt.setVariable(e.loopvar.value,c);else if(e.loopvar.type===`TupleLiteral`){let t=e.loopvar;if(c.type!==`ArrayValue`)throw Error(`Cannot unpack non-iterable type: ${c.type}`);let n=c;if(t.value.length!==n.value.length)throw Error(`Too ${t.value.length>n.value.length?`few`:`many`} items to unpack`);l=e=>{for(let r=0;r0?a[t-1]:new ve],[`nextitem`,t{let r=new L(n);t=t.slice();let i;t.at(-1)?.type===`KeywordArgumentsValue`&&(i=t.pop());for(let n=0;nthis.evaluate(e,t)));case`TupleLiteral`:return new he(e.value.map(e=>this.evaluate(e,t)));case`ObjectLiteral`:{let n=new Map;for(let[r,i]of e.value){let e=this.evaluate(r,t);if(!(e instanceof F))throw Error(`Object keys must be strings: got ${e.type}`);n.set(e.value,this.evaluate(i,t))}return new I(n)}case`Identifier`:return this.evaluateIdentifier(e,t);case`CallExpression`:return this.evaluateCallExpression(e,t);case`MemberExpression`:return this.evaluateMemberExpression(e,t);case`UnaryExpression`:return this.evaluateUnaryExpression(e,t);case`BinaryExpression`:return this.evaluateBinaryExpression(e,t);case`FilterExpression`:return this.evaluateFilterExpression(e,t);case`TestExpression`:return this.evaluateTestExpression(e,t);default:throw SyntaxError(`Unknown node type: ${e.type}`)}}};function be(e){switch(typeof e){case`number`:return new P(e);case`string`:return new F(e);case`boolean`:return new fe(e);case`undefined`:return new ve;case`object`:return e===null?new _e:Array.isArray(e)?new me(e.map(be)):new I(new Map(Object.entries(e).map(([e,t])=>[e,be(t)])));case`function`:return new ge((t,n)=>{let r=e(...t.map(e=>e.value))??null;return be(r)});default:throw Error(`Cannot convert to runtime value: ${e}`)}}function xe(e,t,n){let r=n??0;switch(e.type){case`NullValue`:case`UndefinedValue`:return`null`;case`NumericValue`:case`StringValue`:case`BooleanValue`:return JSON.stringify(e.value);case`ArrayValue`:case`ObjectValue`:{let n=t?` `.repeat(t):``,i=` -`+n.repeat(r),a=i+n;if(e.type===`ArrayValue`){let n=e.value.map(e=>xe(e,t,r+1));return t?`[${a}${n.join(`,${a}`)}${i}]`:`[${n.join(`, `)}]`}else{let n=Array.from(e.value.entries()).map(([e,n])=>{let i=`"${e}": ${xe(n,t,r+1)}`;return t?`${a}${i}`:i});return t?`{${n.join(`,`)}${i}}`:`{${n.join(`, `)}}`}}default:throw Error(`Cannot convert to JSON: ${e.type}`)}}var Se=` -`,Ce=`{%- `,we=` -%}`,Te={MultiplicativeBinaryOperator:2,AdditiveBinaryOperator:1,ComparisonBinaryOperator:0};function Ee(e,t=` `){let n=typeof t==`number`?` `.repeat(t):t,r=Oe(e.body,0,n);return r.replace(/\n$/,``)}function De(...e){return Ce+e.join(` `)+we}function Oe(e,t,n){return e.map(e=>ke(e,t,n)).join(Se)}function ke(e,t,n){let r=n.repeat(t);switch(e.type){case`Program`:return Oe(e.body,t,n);case`If`:return Ae(e,t,n);case`For`:return je(e,t,n);case`Set`:return Me(e,t,n);case`Macro`:return Ne(e,t,n);case`Break`:return r+De(`break`);case`Continue`:return r+De(`continue`);default:return r+`{{- `+R(e)+` -}}`}}function Ae(e,t,n){let r=n.repeat(t),i=[],a=e;for(;a&&(i.push({test:a.test,body:a.body}),a.alternate.length===1&&a.alternate[0].type===`If`);)a=a.alternate[0];let o=r+De(`if`,R(i[0].test))+Se+Oe(i[0].body,t+1,n);for(let e=1;e0&&(o+=Se+r+De(`else`)+Se+Oe(a.alternate,t+1,n)),o+=Se+r+De(`endif`),o}function je(e,t,n){let r=n.repeat(t),i=``;if(e.iterable.type===`SelectExpression`){let t=e.iterable;i=`${R(t.iterable)} if ${R(t.test)}`}else i=R(e.iterable);let a=r+De(`for`,R(e.loopvar),`in`,i)+Se+Oe(e.body,t+1,n);return e.defaultBlock.length>0&&(a+=Se+r+De(`else`)+Se+Oe(e.defaultBlock,t+1,n)),a+=Se+r+De(`endfor`),a}function Me(e,t,n){let r=n.repeat(t),i=R(e.assignee),a=e.value?R(e.value):``,o=r+De(`set`,`${i}${e.value?` = `+a:``}`);return e.body.length===0?o:o+Se+Oe(e.body,t+1,n)+Se+r+De(`endset`)}function Ne(e,t,n){let r=n.repeat(t),i=e.args.map(R).join(`, `);return r+De(`macro`,`${e.name.value}(${i})`)+Se+Oe(e.body,t+1,n)+Se+r+De(`endmacro`)}function R(e,t=-1){switch(e.type){case`Identifier`:return e.value;case`NullLiteral`:return`none`;case`NumericLiteral`:case`BooleanLiteral`:return`${e.value}`;case`StringLiteral`:return JSON.stringify(e.value);case`BinaryExpression`:{let n=e,r=Te[n.operator.type]??0,i=R(n.left,r),a=R(n.right,r+1),o=`${i} ${n.operator.value} ${a}`;return rR(e,-1)).join(`, `);return`${R(t.callee,-1)}(${n})`}case`MemberExpression`:{let t=e,n=R(t.object,-1);t.object.type!==`Identifier`&&(n=`(${n})`);let r=R(t.property,-1);return!t.computed&&t.property.type!==`Identifier`&&(r=`(${r})`),t.computed?`${n}[${r}]`:`${n}.${r}`}case`FilterExpression`:{let t=e,n=R(t.operand,1/0);return t.filter.type===`CallExpression`?`${n} | ${R(t.filter,-1)}`:`${n} | ${t.filter.value}`}case`SelectExpression`:{let t=e;return`${R(t.iterable,-1)} | select(${R(t.test,-1)})`}case`TestExpression`:{let t=e;return`${R(t.operand,-1)} is${t.negate?` not`:``} ${t.test.value}`}case`ArrayLiteral`:case`TupleLiteral`:{let t=e.value.map(e=>R(e,-1)),n=e.type===`ArrayLiteral`?`[]`:`()`;return`${n[0]}${t.join(`, `)}${n[1]}`}case`ObjectLiteral`:{let t=Array.from(e.value.entries()).map(([e,t])=>`${R(e,-1)}: ${R(t,-1)}`);return`{ ${t.join(`, `)} }`}case`SliceExpression`:{let t=e,n=t.start?R(t.start,-1):``,r=t.stop?R(t.stop,-1):``,i=t.step?`:${R(t.step,-1)}`:``;return`${n}:${r}${i}`}case`KeywordArgumentExpression`:{let t=e;return`${t.key.value}=${R(t.value,-1)}`}case`If`:{let t=e,n=R(t.test,-1),r=R(t.body[0],0),i=R(t.alternate[0],-1);return`${r} if ${n} else ${i}`}default:throw Error(`Unknown expression type: ${e.type}`)}}var Pe=class{parsed;constructor(e){let t=d(e,{lstrip_blocks:!0,trim_blocks:!0});this.parsed=se(t)}render(e){let t=new L;if(t.set(`false`,!1),t.set(`true`,!0),t.set(`raise_exception`,e=>{throw Error(e)}),t.set(`range`,M),e)for(let[n,r]of Object.entries(e))t.set(n,r);let n=new ye(t),r=n.run(this.parsed);return r.value}format(e){return Ee(this.parsed,e?.indent||` `)}}},"./src/backends/onnx.js":(e,t,n)=>{var r;n.r(t),n.d(t,{Tensor:()=>s.Tensor,createInferenceSession:()=>g,deviceToExecutionProviders:()=>m,isONNXProxy:()=>y,isONNXTensor:()=>_});var i=n( +`));case`join`:case`string`:return e;case`int`:{let t=parseInt(e.value,10);return new I(isNaN(t)?0:t)}case`float`:{let t=parseFloat(e.value);return new _e(isNaN(t)?0:t)}default:throw Error(`Unknown StringValue filter: ${r.value}`)}else if(e instanceof I||e instanceof _e)switch(r.value){case`abs`:return e instanceof I?new I(Math.abs(e.value)):new _e(Math.abs(e.value));case`int`:return new I(Math.floor(e.value));case`float`:return new _e(e.value);default:throw Error(`Unknown NumericValue filter: ${r.value}`)}else if(e instanceof ve)switch(r.value){case`items`:return new z(Array.from(e.value.entries()).map(([e,t])=>new z([new L(e),t])));case`length`:return new I(e.value.size);default:throw Error(`Unknown ObjectValue filter: ${r.value}`)}else if(e instanceof R)switch(r.value){case`bool`:return new R(e.value);case`int`:return new I(e.value?1:0);case`float`:return new _e(e.value?1:0);case`string`:return new L(e.value?`true`:`false`);default:throw Error(`Unknown BooleanValue filter: ${r.value}`)}throw Error(`Cannot apply filter "${r.value}" to type: ${e.type}`)}else if(t.type===`CallExpression`){let r=t;if(r.callee.type!==`Identifier`)throw Error(`Unknown filter: ${r.callee.type}`);let i=r.callee.value;if(i===`tojson`){let[,t]=this.evaluateArguments(r.args,n),i=t.get(`indent`)??new Se;if(!(i instanceof I||i instanceof Se))throw Error(`If set, indent must be a number`);return new L(De(e,i.value))}else if(i===`join`){let t;if(e instanceof L)t=Array.from(e.value);else if(e instanceof z)t=e.value.map(e=>e.value);else throw Error(`Cannot apply filter "${i}" to type: ${e.type}`);let[a,o]=this.evaluateArguments(r.args,n),s=a.at(0)??o.get(`separator`)??new L(``);if(!(s instanceof L))throw Error(`separator must be a string`);return new L(t.join(s.value))}else if(i===`int`||i===`float`){let[t,a]=this.evaluateArguments(r.args,n),o=t.at(0)??a.get(`default`)??(i===`int`?new I(0):new _e(0));if(e instanceof L){let t=i===`int`?parseInt(e.value,10):parseFloat(e.value);return isNaN(t)?o:i===`int`?new I(t):new _e(t)}else if(e instanceof I||e instanceof _e)return e;else if(e instanceof R)return i===`int`?new I(e.value?1:0):new _e(e.value?1:0);else throw Error(`Cannot apply filter "${i}" to type: ${e.type}`)}else if(i===`default`){let[t,i]=this.evaluateArguments(r.args,n),a=t[0]??new L(``),o=t[1]??i.get(`boolean`)??new R(!1);if(!(o instanceof R))throw Error("`default` filter flag must be a boolean");return e instanceof B||o.value&&!e.__bool__().value?a:e}if(e instanceof z){switch(i){case`selectattr`:case`rejectattr`:{let t=i===`selectattr`;if(e.value.some(e=>!(e instanceof ve)))throw Error(`\`${i}\` can only be applied to array of objects`);if(r.args.some(e=>e.type!==`StringLiteral`))throw Error(`arguments of \`${i}\` must be strings`);let[a,o,s]=r.args.map(e=>this.evaluate(e,n)),c;if(o){let e=n.tests.get(o.value);if(!e)throw Error(`Unknown test: ${o.value}`);c=e}else c=(...e)=>e[0].__bool__().value;let l=e.value.filter(e=>{let n=e.value.get(a.value),r=n?c(n,s):!1;return t?r:!r});return new z(l)}case`map`:{let[,t]=this.evaluateArguments(r.args,n);if(t.has(`attribute`)){let n=t.get(`attribute`);if(!(n instanceof L))throw Error(`attribute must be a string`);let r=t.get(`default`),i=e.value.map(e=>{if(!(e instanceof ve))throw Error(`items in map must be an object`);return e.value.get(n.value)??r??new B});return new z(i)}else throw Error("`map` expressions without `attribute` set are not currently supported.")}}throw Error(`Unknown ArrayValue filter: ${i}`)}else if(e instanceof L){switch(i){case`indent`:{let[t,i]=this.evaluateArguments(r.args,n),a=t.at(0)??i.get(`width`)??new I(4);if(!(a instanceof I))throw Error(`width must be a number`);let o=t.at(1)??i.get(`first`)??new R(!1),s=t.at(2)??i.get(`blank`)??new R(!1),c=e.value.split(` +`),l=` `.repeat(a.value),u=c.map((e,t)=>!o.value&&t===0||!s.value&&e.length===0?e:l+e);return new L(u.join(` +`))}case`replace`:{let t=e.builtins.get(`replace`);if(!(t instanceof xe))throw Error(`replace filter not available`);let[i,a]=this.evaluateArguments(r.args,n);return t.value([...i,new ye(a)],n)}}throw Error(`Unknown StringValue filter: ${i}`)}else throw Error(`Cannot apply filter "${i}" to type: ${e.type}`)}throw Error(`Unknown filter: ${t.type}`)}evaluateFilterExpression(e,t){let n=this.evaluate(e.operand,t);return this.applyFilter(n,e.filter,t)}evaluateTestExpression(e,t){let n=this.evaluate(e.operand,t),r=t.tests.get(e.test.value);if(!r)throw Error(`Unknown test: ${e.test.value}`);let i=r(n);return new R(e.negate?!i:i)}evaluateSelectExpression(e,t){let n=this.evaluate(e.test,t);return n.__bool__().value?this.evaluate(e.lhs,t):new B}evaluateUnaryExpression(e,t){let n=this.evaluate(e.argument,t);switch(e.operator.value){case`not`:return new R(!n.value);default:throw SyntaxError(`Unknown operator: ${e.operator.value}`)}}evaluateTernaryExpression(e,t){let n=this.evaluate(e.condition,t);return n.__bool__().value?this.evaluate(e.trueExpr,t):this.evaluate(e.falseExpr,t)}evalProgram(e,t){return this.evaluateBlock(e.body,t)}evaluateBlock(e,t){let n=``;for(let r of e){let e=this.evaluate(r,t);e.type!==`NullValue`&&e.type!==`UndefinedValue`&&(n+=e.toString())}return new L(n)}evaluateIdentifier(e,t){return t.lookupVariable(e.value)}evaluateCallExpression(e,t){let[n,r]=this.evaluateArguments(e.args,t);r.size>0&&n.push(new ye(r));let i=this.evaluate(e.callee,t);if(i.type!==`FunctionValue`)throw Error(`Cannot call something that is not a function: got ${i.type}`);return i.value(n,t)}evaluateSliceExpression(e,t,n){if(!(e instanceof z||e instanceof L))throw Error(`Slice object must be an array or string`);let r=this.evaluate(t.start,n),i=this.evaluate(t.stop,n),a=this.evaluate(t.step,n);if(!(r instanceof I||r instanceof B))throw Error(`Slice start must be numeric or undefined`);if(!(i instanceof I||i instanceof B))throw Error(`Slice stop must be numeric or undefined`);if(!(a instanceof I||a instanceof B))throw Error(`Slice step must be numeric or undefined`);return e instanceof z?new z(ue(e.value,r.value,i.value,a.value)):new L(ue(Array.from(e.value),r.value,i.value,a.value).join(``))}evaluateMemberExpression(e,t){let n=this.evaluate(e.object,t),r;if(e.computed){if(e.property.type===`SliceExpression`)return this.evaluateSliceExpression(n,e.property,t);r=this.evaluate(e.property,t)}else r=new L(e.property.value);let i;if(n instanceof ve){if(!(r instanceof L))throw Error(`Cannot access property with non-string: got ${r.type}`);i=n.value.get(r.value)??n.builtins.get(r.value)}else if(n instanceof z||n instanceof L)if(r instanceof I)i=n.value.at(r.value),n instanceof L&&(i=new L(n.value.at(r.value)));else if(r instanceof L)i=n.builtins.get(r.value);else throw Error(`Cannot access property with non-string/non-number: got ${r.type}`);else{if(!(r instanceof L))throw Error(`Cannot access property with non-string: got ${r.type}`);i=n.builtins.get(r.value)}return i instanceof ge?i:new B}evaluateSet(e,t){let n=e.value?this.evaluate(e.value,t):this.evaluateBlock(e.body,t);if(e.assignee.type===`Identifier`){let r=e.assignee.value;t.setVariable(r,n)}else if(e.assignee.type===`TupleLiteral`){let r=e.assignee;if(!(n instanceof z))throw Error(`Cannot unpack non-iterable type in set: ${n.type}`);let i=n.value;if(i.length!==r.value.length)throw Error(`Too ${r.value.length>i.length?`few`:`many`} items to unpack in set`);for(let e=0;et.setVariable(e.loopvar.value,c);else if(e.loopvar.type===`TupleLiteral`){let t=e.loopvar;if(c.type!==`ArrayValue`)throw Error(`Cannot unpack non-iterable type: ${c.type}`);let n=c;if(t.value.length!==n.value.length)throw Error(`Too ${t.value.length>n.value.length?`few`:`many`} items to unpack`);l=e=>{for(let r=0;r0?a[t-1]:new B],[`nextitem`,t{let r=new Ce(n);t=t.slice();let i;t.at(-1)?.type===`KeywordArgumentsValue`&&(i=t.pop());for(let n=0;n{let r=new Ce(n);if(e.callerArgs)for(let n=0;nthis.evaluate(e,t)));case`TupleLiteral`:return new be(e.value.map(e=>this.evaluate(e,t)));case`ObjectLiteral`:{let n=new Map;for(let[r,i]of e.value){let e=this.evaluate(r,t);if(!(e instanceof L))throw Error(`Object keys must be strings: got ${e.type}`);n.set(e.value,this.evaluate(i,t))}return new ve(n)}case`Identifier`:return this.evaluateIdentifier(e,t);case`CallExpression`:return this.evaluateCallExpression(e,t);case`MemberExpression`:return this.evaluateMemberExpression(e,t);case`UnaryExpression`:return this.evaluateUnaryExpression(e,t);case`BinaryExpression`:return this.evaluateBinaryExpression(e,t);case`FilterExpression`:return this.evaluateFilterExpression(e,t);case`FilterStatement`:return this.evaluateFilterStatement(e,t);case`TestExpression`:return this.evaluateTestExpression(e,t);case`SelectExpression`:return this.evaluateSelectExpression(e,t);case`Ternary`:return this.evaluateTernaryExpression(e,t);case`Comment`:return new Se;default:throw SyntaxError(`Unknown node type: ${e.type}`)}}};function Ee(e){switch(typeof e){case`number`:return Number.isInteger(e)?new I(e):new _e(e);case`string`:return new L(e);case`boolean`:return new R(e);case`undefined`:return new B;case`object`:return e===null?new Se:Array.isArray(e)?new z(e.map(Ee)):new ve(new Map(Object.entries(e).map(([e,t])=>[e,Ee(t)])));case`function`:return new xe((t,n)=>{let r=e(...t.map(e=>e.value))??null;return Ee(r)});default:throw Error(`Cannot convert to runtime value: ${e}`)}}function De(e,t,n){let r=n??0;switch(e.type){case`NullValue`:case`UndefinedValue`:return`null`;case`IntegerValue`:case`FloatValue`:case`StringValue`:case`BooleanValue`:return JSON.stringify(e.value);case`ArrayValue`:case`ObjectValue`:{let n=t?` `.repeat(t):``,i=` +`+n.repeat(r),a=i+n;if(e.type===`ArrayValue`){let n=e.value.map(e=>De(e,t,r+1));return t?`[${a}${n.join(`,${a}`)}${i}]`:`[${n.join(`, `)}]`}else{let n=Array.from(e.value.entries()).map(([e,n])=>{let i=`"${e}": ${De(n,t,r+1)}`;return t?`${a}${i}`:i});return t?`{${n.join(`,`)}${i}}`:`{${n.join(`, `)}}`}}default:throw Error(`Cannot convert to JSON: ${e.type}`)}}var Oe=` +`,ke=`{%- `,Ae=` -%}`;function je(e){switch(e.operator.type){case`MultiplicativeBinaryOperator`:return 4;case`AdditiveBinaryOperator`:return 3;case`ComparisonBinaryOperator`:return 2;case`Identifier`:return e.operator.value===`and`?1:e.operator.value===`in`||e.operator.value===`not in`?2:0}return 0}function Me(e,t=` `){let n=typeof t==`number`?` `.repeat(t):t,r=Pe(e.body,0,n);return r.replace(/\n$/,``)}function Ne(...e){return ke+e.join(` `)+Ae}function Pe(e,t,n){return e.map(e=>Fe(e,t,n)).join(Oe)}function Fe(e,t,n){let r=n.repeat(t);switch(e.type){case`Program`:return Pe(e.body,t,n);case`If`:return Ie(e,t,n);case`For`:return Le(e,t,n);case`Set`:return Re(e,t,n);case`Macro`:return V(e,t,n);case`Break`:return r+Ne(`break`);case`Continue`:return r+Ne(`continue`);case`CallStatement`:return ze(e,t,n);case`FilterStatement`:return Be(e,t,n);case`Comment`:return r+`{# `+e.value+` #}`;default:return r+`{{- `+H(e)+` -}}`}}function Ie(e,t,n){let r=n.repeat(t),i=[],a=e;for(;a&&(i.push({test:a.test,body:a.body}),a.alternate.length===1&&a.alternate[0].type===`If`);)a=a.alternate[0];let o=r+Ne(`if`,H(i[0].test))+Oe+Pe(i[0].body,t+1,n);for(let e=1;e0&&(o+=Oe+r+Ne(`else`)+Oe+Pe(a.alternate,t+1,n)),o+=Oe+r+Ne(`endif`),o}function Le(e,t,n){let r=n.repeat(t),i=``;if(e.iterable.type===`SelectExpression`){let t=e.iterable;i=`${H(t.lhs)} if ${H(t.test)}`}else i=H(e.iterable);let a=r+Ne(`for`,H(e.loopvar),`in`,i)+Oe+Pe(e.body,t+1,n);return e.defaultBlock.length>0&&(a+=Oe+r+Ne(`else`)+Oe+Pe(e.defaultBlock,t+1,n)),a+=Oe+r+Ne(`endfor`),a}function Re(e,t,n){let r=n.repeat(t),i=H(e.assignee),a=e.value?H(e.value):``,o=r+Ne(`set`,`${i}${e.value?` = `+a:``}`);return e.body.length===0?o:o+Oe+Pe(e.body,t+1,n)+Oe+r+Ne(`endset`)}function V(e,t,n){let r=n.repeat(t),i=e.args.map(H).join(`, `);return r+Ne(`macro`,`${e.name.value}(${i})`)+Oe+Pe(e.body,t+1,n)+Oe+r+Ne(`endmacro`)}function ze(e,t,n){let r=n.repeat(t),i=e.callerArgs&&e.callerArgs.length>0?`(${e.callerArgs.map(H).join(`, `)})`:``,a=H(e.call),o=r+Ne(`call${i}`,a)+Oe;return o+=Pe(e.body,t+1,n)+Oe,o+=r+Ne(`endcall`),o}function Be(e,t,n){let r=n.repeat(t),i=e.filter.type===`Identifier`?e.filter.value:H(e.filter),a=r+Ne(`filter`,i)+Oe;return a+=Pe(e.body,t+1,n)+Oe,a+=r+Ne(`endfilter`),a}function H(e,t=-1){switch(e.type){case`SpreadExpression`:{let t=e;return`*${H(t.argument)}`}case`Identifier`:return e.value;case`IntegerLiteral`:return`${e.value}`;case`FloatLiteral`:return`${e.value}`;case`StringLiteral`:return JSON.stringify(e.value);case`BinaryExpression`:{let n=e,r=je(n),i=H(n.left,r),a=H(n.right,r+1),o=`${i} ${n.operator.value} ${a}`;return r`${H(e)}: ${H(t)}`);return`{${t.join(`, `)}}`}case`SliceExpression`:{let t=e,n=t.start?H(t.start):``,r=t.stop?H(t.stop):``,i=t.step?`:${H(t.step)}`:``;return`${n}:${r}${i}`}case`KeywordArgumentExpression`:{let t=e;return`${t.key.value}=${H(t.value)}`}case`Ternary`:{let n=e,r=`${H(n.trueExpr)} if ${H(n.condition,0)} else ${H(n.falseExpr)}`;return t>-1?`(${r})`:r}default:throw Error(`Unknown expression type: ${e.type}`)}}var Ve=class{parsed;constructor(e){let t=u(e,{lstrip_blocks:!0,trim_blocks:!0});this.parsed=ce(t)}render(e){let t=new Ce;if(we(t),e)for(let[n,r]of Object.entries(e))t.set(n,r);let n=new Te(t),r=n.run(this.parsed);return r.value}format(e){return Me(this.parsed,e?.indent||` `)}}},"./src/backends/onnx.js":(e,t,n)=>{var r;n.r(t),n.d(t,{Tensor:()=>s.Tensor,createInferenceSession:()=>g,deviceToExecutionProviders:()=>m,isONNXProxy:()=>y,isONNXTensor:()=>_});var i=n( /*! ../env.js */ `./src/env.js`),a=n( /*! onnxruntime-node */ @@ -2920,13 +2920,13 @@ var af={"onnxruntime-common":e=>{e.exports=ne},"onnxruntime-web":e=>{e.exports=j /*! ./utils/core.js */ `./src/utils/core.js`),i=n( /*! ./utils/hub.js */ -`./src/utils/hub.js`);async function a(e,t){return await(0,i.getModelJSON)(e,`config.json`,!0,t)}function o(e){let t={},n={};switch(e.model_type){case`llava`:case`paligemma`:case`gemma3`:case`florence2`:case`llava_onevision`:case`idefics3`:case`ultravox`:case`smolvlm`:case`gemma3n`:n=o(e.text_config);break;case`moondream1`:n=o(e.phi_config);break;case`musicgen`:n=o(e.decoder);break;case`multi_modality`:n=o(e.language_config);break;case`gpt2`:case`gptj`:case`jais`:case`codegen`:case`gpt_bigcode`:t.num_heads=`n_head`,t.num_layers=`n_layer`,t.hidden_size=`n_embd`;break;case`gpt_neox`:case`stablelm`:case`opt`:case`falcon`:t.num_heads=`num_attention_heads`,t.num_layers=`num_hidden_layers`,t.hidden_size=`hidden_size`;break;case`llama`:case`olmo`:case`olmo2`:case`mobilellm`:case`granite`:case`cohere`:case`mistral`:case`starcoder2`:case`qwen2`:case`qwen2_vl`:case`phi`:case`phi3`:case`phi3_v`:case`llava_qwen2`:t.num_heads=`num_key_value_heads`,t.num_layers=`num_hidden_layers`,t.hidden_size=`hidden_size`,t.num_attention_heads=`num_attention_heads`;break;case`qwen3`:case`gemma`:case`gemma2`:case`gemma3_text`:case`gemma3n_text`:case`glm`:case`helium`:t.num_heads=`num_key_value_heads`,t.num_layers=`num_hidden_layers`,t.dim_kv=`head_dim`;break;case`openelm`:t.num_heads=`num_kv_heads`,t.num_layers=`num_transformer_layers`,t.dim_kv=`head_dim`;break;case`gpt_neo`:case`donut-swin`:t.num_heads=`num_heads`,t.num_layers=`num_layers`,t.hidden_size=`hidden_size`;break;case`bloom`:t.num_heads=`n_head`,t.num_layers=`n_layer`,t.hidden_size=`hidden_size`;break;case`mpt`:t.num_heads=`n_heads`,t.num_layers=`n_layers`,t.hidden_size=`d_model`;break;case`exaone`:t.num_heads=`num_key_value_heads`,t.num_layers=`num_layers`,t.dim_kv=`head_dim`,t.num_attention_heads=`num_attention_heads`;break;case`t5`:case`mt5`:case`longt5`:t.num_decoder_layers=`num_decoder_layers`,t.num_decoder_heads=`num_heads`,t.decoder_dim_kv=`d_kv`,t.num_encoder_layers=`num_layers`,t.num_encoder_heads=`num_heads`,t.encoder_dim_kv=`d_kv`;break;case`bart`:case`mbart`:case`marian`:case`whisper`:case`lite-whisper`:case`m2m_100`:case`blenderbot`:case`blenderbot-small`:case`florence2_language`:t.num_decoder_layers=`decoder_layers`,t.num_decoder_heads=`decoder_attention_heads`,t.decoder_hidden_size=`d_model`,t.num_encoder_layers=`encoder_layers`,t.num_encoder_heads=`encoder_attention_heads`,t.encoder_hidden_size=`d_model`;break;case`speecht5`:t.num_decoder_layers=`decoder_layers`,t.num_decoder_heads=`decoder_attention_heads`,t.decoder_hidden_size=`hidden_size`,t.num_encoder_layers=`encoder_layers`,t.num_encoder_heads=`encoder_attention_heads`,t.encoder_hidden_size=`hidden_size`;break;case`trocr`:t.num_encoder_layers=t.num_decoder_layers=`decoder_layers`,t.num_encoder_heads=t.num_decoder_heads=`decoder_attention_heads`,t.encoder_hidden_size=t.decoder_hidden_size=`d_model`;break;case`musicgen_decoder`:t.num_encoder_layers=t.num_decoder_layers=`num_hidden_layers`,t.num_encoder_heads=t.num_decoder_heads=`num_attention_heads`,t.encoder_hidden_size=t.decoder_hidden_size=`hidden_size`;break;case`moonshine`:t.num_decoder_layers=`decoder_num_hidden_layers`,t.num_decoder_heads=`decoder_num_key_value_heads`,t.num_encoder_layers=`encoder_num_hidden_layers`,t.num_encoder_heads=`encoder_num_key_value_heads`,t.encoder_hidden_size=t.decoder_hidden_size=`hidden_size`;break;case`vision-encoder-decoder`:let i=o(e.decoder),a=`num_decoder_layers`in i,s=(0,r.pick)(e,[`model_type`,`is_encoder_decoder`]);return a?(s.num_decoder_layers=i.num_decoder_layers,s.num_decoder_heads=i.num_decoder_heads,s.decoder_hidden_size=i.decoder_hidden_size,s.num_encoder_layers=i.num_encoder_layers,s.num_encoder_heads=i.num_encoder_heads,s.encoder_hidden_size=i.encoder_hidden_size):(s.num_layers=i.num_layers,s.num_heads=i.num_heads,s.hidden_size=i.hidden_size),s}let i={...n,...(0,r.pick)(e,[`model_type`,`multi_query`,`is_encoder_decoder`])};for(let n in t)i[n]=e[t[n]];return i}function s(e,{prefix:t=`past_key_values`,batch_size:n=1}={}){let r={},i=e.normalized_config;if(i.is_encoder_decoder&&`num_encoder_heads`in i&&`num_decoder_heads`in i){let e=i.encoder_dim_kv??i.encoder_hidden_size/i.num_encoder_heads,a=i.decoder_dim_kv??i.decoder_hidden_size/i.num_decoder_heads,o=[n,i.num_encoder_heads,0,e],s=[n,i.num_decoder_heads,0,a];for(let e=0;e{n.r(t),n.d(t,{apis:()=>v,env:()=>w});var r=n( +`./src/utils/hub.js`);async function a(e,t){return await(0,i.getModelJSON)(e,`config.json`,!0,t)}function o(e){let t={},n={};switch(e.model_type){case`llava`:case`paligemma`:case`gemma3`:case`florence2`:case`llava_onevision`:case`idefics3`:case`ultravox`:case`smolvlm`:case`gemma3n`:n=o(e.text_config);break;case`moondream1`:n=o(e.phi_config);break;case`musicgen`:n=o(e.decoder);break;case`multi_modality`:n=o(e.language_config);break;case`gpt2`:case`gptj`:case`jais`:case`codegen`:case`gpt_bigcode`:t.num_heads=`n_head`,t.num_layers=`n_layer`,t.hidden_size=`n_embd`;break;case`gpt_neox`:case`stablelm`:case`opt`:case`falcon`:t.num_heads=`num_attention_heads`,t.num_layers=`num_hidden_layers`,t.hidden_size=`hidden_size`;break;case`llama`:case`smollm3`:case`olmo`:case`olmo2`:case`mobilellm`:case`granite`:case`cohere`:case`mistral`:case`starcoder2`:case`qwen2`:case`qwen2_vl`:case`phi`:case`phi3`:case`phi3_v`:case`llava_qwen2`:t.num_heads=`num_key_value_heads`,t.num_layers=`num_hidden_layers`,t.hidden_size=`hidden_size`,t.num_attention_heads=`num_attention_heads`;break;case`qwen3`:case`gemma`:case`gemma2`:case`gemma3_text`:case`gemma3n_text`:case`glm`:case`helium`:case`ernie4_5`:t.num_heads=`num_key_value_heads`,t.num_layers=`num_hidden_layers`,t.dim_kv=`head_dim`;break;case`openelm`:t.num_heads=`num_kv_heads`,t.num_layers=`num_transformer_layers`,t.dim_kv=`head_dim`;break;case`gpt_neo`:case`donut-swin`:t.num_heads=`num_heads`,t.num_layers=`num_layers`,t.hidden_size=`hidden_size`;break;case`bloom`:t.num_heads=`n_head`,t.num_layers=`n_layer`,t.hidden_size=`hidden_size`;break;case`mpt`:t.num_heads=`n_heads`,t.num_layers=`n_layers`,t.hidden_size=`d_model`;break;case`exaone`:t.num_heads=`num_key_value_heads`,t.num_layers=`num_layers`,t.dim_kv=`head_dim`,t.num_attention_heads=`num_attention_heads`;break;case`t5`:case`mt5`:case`longt5`:t.num_decoder_layers=`num_decoder_layers`,t.num_decoder_heads=`num_heads`,t.decoder_dim_kv=`d_kv`,t.num_encoder_layers=`num_layers`,t.num_encoder_heads=`num_heads`,t.encoder_dim_kv=`d_kv`;break;case`bart`:case`mbart`:case`marian`:case`whisper`:case`lite-whisper`:case`m2m_100`:case`blenderbot`:case`blenderbot-small`:case`florence2_language`:t.num_decoder_layers=`decoder_layers`,t.num_decoder_heads=`decoder_attention_heads`,t.decoder_hidden_size=`d_model`,t.num_encoder_layers=`encoder_layers`,t.num_encoder_heads=`encoder_attention_heads`,t.encoder_hidden_size=`d_model`;break;case`speecht5`:t.num_decoder_layers=`decoder_layers`,t.num_decoder_heads=`decoder_attention_heads`,t.decoder_hidden_size=`hidden_size`,t.num_encoder_layers=`encoder_layers`,t.num_encoder_heads=`encoder_attention_heads`,t.encoder_hidden_size=`hidden_size`;break;case`trocr`:t.num_encoder_layers=t.num_decoder_layers=`decoder_layers`,t.num_encoder_heads=t.num_decoder_heads=`decoder_attention_heads`,t.encoder_hidden_size=t.decoder_hidden_size=`d_model`;break;case`musicgen_decoder`:t.num_encoder_layers=t.num_decoder_layers=`num_hidden_layers`,t.num_encoder_heads=t.num_decoder_heads=`num_attention_heads`,t.encoder_hidden_size=t.decoder_hidden_size=`hidden_size`;break;case`moonshine`:t.num_decoder_layers=`decoder_num_hidden_layers`,t.num_decoder_heads=`decoder_num_key_value_heads`,t.num_encoder_layers=`encoder_num_hidden_layers`,t.num_encoder_heads=`encoder_num_key_value_heads`,t.encoder_hidden_size=t.decoder_hidden_size=`hidden_size`;break;case`vision-encoder-decoder`:let i=o(e.decoder),a=`num_decoder_layers`in i,s=(0,r.pick)(e,[`model_type`,`is_encoder_decoder`]);return a?(s.num_decoder_layers=i.num_decoder_layers,s.num_decoder_heads=i.num_decoder_heads,s.decoder_hidden_size=i.decoder_hidden_size,s.num_encoder_layers=i.num_encoder_layers,s.num_encoder_heads=i.num_encoder_heads,s.encoder_hidden_size=i.encoder_hidden_size):(s.num_layers=i.num_layers,s.num_heads=i.num_heads,s.hidden_size=i.hidden_size),s}let i={...n,...(0,r.pick)(e,[`model_type`,`multi_query`,`is_encoder_decoder`])};for(let n in t)i[n]=e[t[n]];return i}function s(e,{prefix:t=`past_key_values`,batch_size:n=1}={}){let r={},i=e.normalized_config;if(i.is_encoder_decoder&&`num_encoder_heads`in i&&`num_decoder_heads`in i){let e=i.encoder_dim_kv??i.encoder_hidden_size/i.num_encoder_heads,a=i.decoder_dim_kv??i.decoder_hidden_size/i.num_decoder_heads,o=[n,i.num_encoder_heads,0,e],s=[n,i.num_decoder_heads,0,a];for(let e=0;e{n.r(t),n.d(t,{apis:()=>v,env:()=>w});var r=n( /*! node:fs */ `?db59`),i=n( /*! node:path */ `?383f`),a=n( /*! node:url */ -`?fa4b`);let o=`3.6.1`,s=typeof window<`u`&&window.document!==void 0,c=typeof self<`u`&&[`DedicatedWorkerGlobalScope`,`ServiceWorkerGlobalScope`,`SharedWorkerGlobalScope`].includes(self.constructor?.name),l=typeof self<`u`&&`caches`in self,u=typeof navigator<`u`&&`gpu`in navigator,d=typeof navigator<`u`&&`ml`in navigator,f=typeof process<`u`,p=f&&process?.release?.name===`node`,m=!T(r),h=!T(i),g=globalThis.Deno!==void 0,_=globalThis.Bun!==void 0,v=Object.freeze({IS_BROWSER_ENV:s,IS_WEBWORKER_ENV:c,IS_WEB_CACHE_AVAILABLE:l,IS_WEBGPU_AVAILABLE:u,IS_WEBNN_AVAILABLE:d,IS_PROCESS_AVAILABLE:f,IS_NODE_ENV:p,IS_FS_AVAILABLE:m,IS_PATH_AVAILABLE:h}),y=m&&h,b=`./`;if(y){let e=Object(import.meta).url;e?b=i.dirname(i.dirname(a.fileURLToPath(e))):typeof __dirname<`u`&&(b=i.dirname(__dirname))}let x=y?i.join(b,`/.cache/`):null,S=`/models/`,C=y?i.join(b,S):S,w={version:o,backends:{onnx:{}},allowRemoteModels:!0,remoteHost:`https://huggingface.co/`,remotePathTemplate:`{model}/resolve/{revision}/`,allowLocalModels:!(s||c),localModelPath:C,useFS:m,useBrowserCache:l&&!g,useFSCache:m,cacheDir:x,useCustomCache:!1,customCache:null};function T(e){return Object.keys(e).length===0}},"./src/generation/configuration_utils.js":(e,t,n)=>{n.r(t),n.d(t,{GenerationConfig:()=>i});var r=n( +`?fa4b`);let o=`3.6.3`,s=typeof window<`u`&&window.document!==void 0,c=typeof self<`u`&&[`DedicatedWorkerGlobalScope`,`ServiceWorkerGlobalScope`,`SharedWorkerGlobalScope`].includes(self.constructor?.name),l=typeof self<`u`&&`caches`in self,u=typeof navigator<`u`&&`gpu`in navigator,d=typeof navigator<`u`&&`ml`in navigator,f=typeof process<`u`,p=f&&process?.release?.name===`node`,m=!T(r),h=!T(i),g=globalThis.Deno!==void 0,_=globalThis.Bun!==void 0,v=Object.freeze({IS_BROWSER_ENV:s,IS_WEBWORKER_ENV:c,IS_WEB_CACHE_AVAILABLE:l,IS_WEBGPU_AVAILABLE:u,IS_WEBNN_AVAILABLE:d,IS_PROCESS_AVAILABLE:f,IS_NODE_ENV:p,IS_FS_AVAILABLE:m,IS_PATH_AVAILABLE:h}),y=m&&h,b=`./`;if(y){let e=Object(import.meta).url;e?b=i.dirname(i.dirname(a.fileURLToPath(e))):typeof __dirname<`u`&&(b=i.dirname(__dirname))}let x=y?i.join(b,`/.cache/`):null,S=`/models/`,C=y?i.join(b,S):S,w={version:o,backends:{onnx:{}},allowRemoteModels:!0,remoteHost:`https://huggingface.co/`,remotePathTemplate:`{model}/resolve/{revision}/`,allowLocalModels:!(s||c),localModelPath:C,useFS:m,useBrowserCache:l&&!g,useFSCache:m,cacheDir:x,useCustomCache:!1,customCache:null};function T(e){return Object.keys(e).length===0}},"./src/generation/configuration_utils.js":(e,t,n)=>{n.r(t),n.d(t,{GenerationConfig:()=>i});var r=n( /*! ../utils/core.js */ `./src/utils/core.js`);class i{max_length=20;max_new_tokens=null;min_length=0;min_new_tokens=null;early_stopping=!1;max_time=null;do_sample=!1;num_beams=1;num_beam_groups=1;penalty_alpha=null;use_cache=!0;temperature=1;top_k=50;top_p=1;typical_p=1;epsilon_cutoff=0;eta_cutoff=0;diversity_penalty=0;repetition_penalty=1;encoder_repetition_penalty=1;length_penalty=1;no_repeat_ngram_size=0;bad_words_ids=null;force_words_ids=null;renormalize_logits=!1;constraints=null;forced_bos_token_id=null;forced_eos_token_id=null;remove_invalid_values=!1;exponential_decay_length_penalty=null;suppress_tokens=null;streamer=null;begin_suppress_tokens=null;forced_decoder_ids=null;guidance_scale=null;num_return_sequences=1;output_attentions=!1;output_hidden_states=!1;output_scores=!1;return_dict_in_generate=!1;pad_token_id=null;bos_token_id=null;eos_token_id=null;encoder_no_repeat_ngram_size=0;decoder_start_token_id=null;generation_kwargs={};constructor(e){Object.assign(this,(0,r.pick)(e,Object.getOwnPropertyNames(this)))}}},"./src/generation/logits_process.js":(e,t,n)=>{n.r(t),n.d(t,{ClassifierFreeGuidanceLogitsProcessor:()=>v,ForcedBOSTokenLogitsProcessor:()=>l,ForcedEOSTokenLogitsProcessor:()=>u,LogitsProcessor:()=>o,LogitsProcessorList:()=>c,LogitsWarper:()=>s,MinLengthLogitsProcessor:()=>h,MinNewTokensLengthLogitsProcessor:()=>g,NoBadWordsLogitsProcessor:()=>_,NoRepeatNGramLogitsProcessor:()=>p,RepetitionPenaltyLogitsProcessor:()=>m,SuppressTokensAtBeginLogitsProcessor:()=>d,TemperatureLogitsWarper:()=>y,TopKLogitsWarper:()=>x,TopPLogitsWarper:()=>b,WhisperTimeStampLogitsProcessor:()=>f});var r=n( /*! ../utils/generic.js */ @@ -2952,7 +2952,7 @@ var af={"onnxruntime-common":e=>{e.exports=ne},"onnxruntime-web":e=>{e.exports=j /*! ../env.js */ `./src/env.js`);class o{put(e){throw Error(`Not implemented`)}end(){throw Error(`Not implemented`)}}let s=a.apis.IS_PROCESS_AVAILABLE?e=>process.stdout.write(e):e=>console.log(e);class c extends o{constructor(e,{skip_prompt:t=!1,callback_function:n=null,token_callback_function:r=null,skip_special_tokens:i=!0,decode_kwargs:a={},...o}={}){super(),this.tokenizer=e,this.skip_prompt=t,this.callback_function=n??s,this.token_callback_function=r,this.decode_kwargs={skip_special_tokens:i,...a,...o},this.token_cache=[],this.print_len=0,this.next_tokens_are_prompt=!0}put(e){if(e.length>1)throw Error(`TextStreamer only supports batch size of 1`);let t=this.next_tokens_are_prompt;if(t&&(this.next_tokens_are_prompt=!1,this.skip_prompt))return;let n=e[0];this.token_callback_function?.(n),this.token_cache=(0,r.mergeArrays)(this.token_cache,n);let a=this.tokenizer.decode(this.token_cache,this.decode_kwargs),o;t||a.endsWith(` `)?(o=a.slice(this.print_len),this.token_cache=[],this.print_len=0):a.length>0&&(0,i.is_chinese_char)(a.charCodeAt(a.length-1))?(o=a.slice(this.print_len),this.print_len+=o.length):(o=a.slice(this.print_len,a.lastIndexOf(` `)+1),this.print_len+=o.length),this.on_finalized_text(o,!1)}end(){let e;if(this.token_cache.length>0){let t=this.tokenizer.decode(this.token_cache,this.decode_kwargs);e=t.slice(this.print_len),this.token_cache=[],this.print_len=0}else e=``;this.next_tokens_are_prompt=!0,this.on_finalized_text(e,!0)}on_finalized_text(e,t){e.length>0&&this.callback_function?.(e),t&&this.callback_function===s&&a.apis.IS_PROCESS_AVAILABLE&&this.callback_function?.(` -`)}}class l extends c{constructor(e,{skip_prompt:t=!1,callback_function:n=null,token_callback_function:r=null,on_chunk_start:i=null,on_chunk_end:a=null,on_finalize:o=null,time_precision:s=.02,skip_special_tokens:c=!0,decode_kwargs:l={}}={}){super(e,{skip_prompt:t,skip_special_tokens:c,callback_function:n,token_callback_function:r,decode_kwargs:l}),this.timestamp_begin=e.timestamp_begin,this.on_chunk_start=i,this.on_chunk_end=a,this.on_finalize=o,this.time_precision=s,this.waiting_for_timestamp=!1}put(e){if(e.length>1)throw Error(`WhisperTextStreamer only supports batch size of 1`);let t=e[0];if(t.length===1){let e=Number(t[0])-this.timestamp_begin;if(e>=0){let n=e*this.time_precision;this.waiting_for_timestamp?this.on_chunk_end?.(n):this.on_chunk_start?.(n),this.waiting_for_timestamp=!this.waiting_for_timestamp,this.token_callback_function?.(t);return}}return super.put(e)}end(){super.end(),this.on_finalize?.()}}},"./src/models.js":(e,t,n)=>{n.r(t),n.d(t,{ASTForAudioClassification:()=>jn,ASTModel:()=>An,ASTPreTrainedModel:()=>kn,AlbertForMaskedLM:()=>Ut,AlbertForQuestionAnswering:()=>Ht,AlbertForSequenceClassification:()=>Vt,AlbertModel:()=>Bt,AlbertPreTrainedModel:()=>zt,AutoModel:()=>lu,AutoModelForAudioClassification:()=>Ou,AutoModelForAudioFrameClassification:()=>Au,AutoModelForAudioTextToText:()=>zu,AutoModelForCTC:()=>Du,AutoModelForCausalLM:()=>gu,AutoModelForDepthEstimation:()=>Pu,AutoModelForDocumentQuestionAnswering:()=>ju,AutoModelForImageClassification:()=>bu,AutoModelForImageFeatureExtraction:()=>Lu,AutoModelForImageMatting:()=>Mu,AutoModelForImageSegmentation:()=>xu,AutoModelForImageTextToText:()=>Ru,AutoModelForImageToImage:()=>Nu,AutoModelForMaskGeneration:()=>Eu,AutoModelForMaskedLM:()=>_u,AutoModelForNormalEstimation:()=>Fu,AutoModelForObjectDetection:()=>wu,AutoModelForPoseEstimation:()=>Iu,AutoModelForQuestionAnswering:()=>vu,AutoModelForSemanticSegmentation:()=>Su,AutoModelForSeq2SeqLM:()=>fu,AutoModelForSequenceClassification:()=>uu,AutoModelForSpeechSeq2Seq:()=>pu,AutoModelForTextToSpectrogram:()=>mu,AutoModelForTextToWaveform:()=>hu,AutoModelForTokenClassification:()=>du,AutoModelForUniversalSegmentation:()=>Cu,AutoModelForVision2Seq:()=>yu,AutoModelForXVector:()=>ku,AutoModelForZeroShotObjectDetection:()=>Tu,BartForConditionalGeneration:()=>tn,BartForSequenceClassification:()=>nn,BartModel:()=>en,BartPretrainedModel:()=>$t,BaseModelOutput:()=>me,BeitForImageClassification:()=>Da,BeitModel:()=>Ea,BeitPreTrainedModel:()=>Ta,BertForMaskedLM:()=>_e,BertForQuestionAnswering:()=>ye,BertForSequenceClassification:()=>ve,BertForTokenClassification:()=>L,BertModel:()=>ge,BertPreTrainedModel:()=>he,BlenderbotForConditionalGeneration:()=>un,BlenderbotModel:()=>ln,BlenderbotPreTrainedModel:()=>cn,BlenderbotSmallForConditionalGeneration:()=>H,BlenderbotSmallModel:()=>fn,BlenderbotSmallPreTrainedModel:()=>dn,BloomForCausalLM:()=>Li,BloomModel:()=>Ii,BloomPreTrainedModel:()=>Fi,CLIPModel:()=>nr,CLIPPreTrainedModel:()=>tr,CLIPSegForImageSegmentation:()=>mr,CLIPSegModel:()=>pr,CLIPSegPreTrainedModel:()=>X,CLIPTextModel:()=>rr,CLIPTextModelWithProjection:()=>ir,CLIPVisionModel:()=>K,CLIPVisionModelWithProjection:()=>ar,CamembertForMaskedLM:()=>Xe,CamembertForQuestionAnswering:()=>$e,CamembertForSequenceClassification:()=>Ze,CamembertForTokenClassification:()=>Qe,CamembertModel:()=>Ye,CamembertPreTrainedModel:()=>Je,CausalLMOutput:()=>Gu,CausalLMOutputWithPast:()=>Ku,ChineseCLIPModel:()=>lr,ChineseCLIPPreTrainedModel:()=>cr,ClapAudioModelWithProjection:()=>mc,ClapModel:()=>fc,ClapPreTrainedModel:()=>dc,ClapTextModelWithProjection:()=>pc,CodeGenForCausalLM:()=>Fr,CodeGenModel:()=>Pr,CodeGenPreTrainedModel:()=>Nr,CohereForCausalLM:()=>ci,CohereModel:()=>si,CoherePreTrainedModel:()=>oi,ConvBertForMaskedLM:()=>Be,ConvBertForQuestionAnswering:()=>He,ConvBertForSequenceClassification:()=>z,ConvBertForTokenClassification:()=>Ve,ConvBertModel:()=>ze,ConvBertPreTrainedModel:()=>Re,ConvNextForImageClassification:()=>Vo,ConvNextModel:()=>Bo,ConvNextPreTrainedModel:()=>zo,ConvNextV2ForImageClassification:()=>Wo,ConvNextV2Model:()=>Uo,ConvNextV2PreTrainedModel:()=>Ho,DFineForObjectDetection:()=>Ja,DFineModel:()=>qa,DFinePreTrainedModel:()=>Ka,DPTForDepthEstimation:()=>vo,DPTModel:()=>_o,DPTPreTrainedModel:()=>go,DacDecoderModel:()=>yl,DacDecoderOutput:()=>gl,DacEncoderModel:()=>vl,DacEncoderOutput:()=>hl,DacModel:()=>_l,DacPreTrainedModel:()=>ml,DebertaForMaskedLM:()=>nt,DebertaForQuestionAnswering:()=>at,DebertaForSequenceClassification:()=>rt,DebertaForTokenClassification:()=>it,DebertaModel:()=>tt,DebertaPreTrainedModel:()=>et,DebertaV2ForMaskedLM:()=>ct,DebertaV2ForQuestionAnswering:()=>dt,DebertaV2ForSequenceClassification:()=>lt,DebertaV2ForTokenClassification:()=>ut,DebertaV2Model:()=>st,DebertaV2PreTrainedModel:()=>ot,DecisionTransformerModel:()=>Jc,DecisionTransformerPreTrainedModel:()=>qc,DeiTForImageClassification:()=>to,DeiTModel:()=>eo,DeiTPreTrainedModel:()=>$a,DepthAnythingForDepthEstimation:()=>bo,DepthAnythingPreTrainedModel:()=>yo,DepthProForDepthEstimation:()=>Eo,DepthProPreTrainedModel:()=>To,DetrForObjectDetection:()=>Aa,DetrForSegmentation:()=>ja,DetrModel:()=>ka,DetrObjectDetectionOutput:()=>Ma,DetrPreTrainedModel:()=>Oa,DetrSegmentationOutput:()=>Na,Dinov2ForImageClassification:()=>qo,Dinov2Model:()=>Ko,Dinov2PreTrainedModel:()=>Go,Dinov2WithRegistersForImageClassification:()=>Xo,Dinov2WithRegistersModel:()=>Yo,Dinov2WithRegistersPreTrainedModel:()=>Jo,DistilBertForMaskedLM:()=>_t,DistilBertForQuestionAnswering:()=>gt,DistilBertForSequenceClassification:()=>mt,DistilBertForTokenClassification:()=>ht,DistilBertModel:()=>pt,DistilBertPreTrainedModel:()=>ft,DonutSwinModel:()=>Ro,DonutSwinPreTrainedModel:()=>Lo,EfficientNetForImageClassification:()=>Ec,EfficientNetModel:()=>Tc,EfficientNetPreTrainedModel:()=>wc,ElectraForMaskedLM:()=>We,ElectraForQuestionAnswering:()=>qe,ElectraForSequenceClassification:()=>Ge,ElectraForTokenClassification:()=>Ke,ElectraModel:()=>Ue,ElectraPreTrainedModel:()=>B,EsmForMaskedLM:()=>bt,EsmForSequenceClassification:()=>xt,EsmForTokenClassification:()=>St,EsmModel:()=>yt,EsmPreTrainedModel:()=>vt,ExaoneForCausalLM:()=>qr,ExaoneModel:()=>Kr,ExaonePreTrainedModel:()=>Gr,FalconForCausalLM:()=>uc,FalconModel:()=>lc,FalconPreTrainedModel:()=>cc,FastViTForImageClassification:()=>ua,FastViTModel:()=>la,FastViTPreTrainedModel:()=>ca,Florence2ForConditionalGeneration:()=>Gn,Florence2PreTrainedModel:()=>Wn,GLPNForDepthEstimation:()=>Io,GLPNModel:()=>Fo,GLPNPreTrainedModel:()=>Po,GPT2LMHeadModel:()=>_r,GPT2Model:()=>gr,GPT2PreTrainedModel:()=>hr,GPTBigCodeForCausalLM:()=>Mr,GPTBigCodeModel:()=>jr,GPTBigCodePreTrainedModel:()=>Ar,GPTJForCausalLM:()=>kr,GPTJModel:()=>Or,GPTJPreTrainedModel:()=>Dr,GPTNeoForCausalLM:()=>Cr,GPTNeoModel:()=>Sr,GPTNeoPreTrainedModel:()=>xr,GPTNeoXForCausalLM:()=>Er,GPTNeoXModel:()=>Tr,GPTNeoXPreTrainedModel:()=>wr,Gemma2ForCausalLM:()=>mi,Gemma2Model:()=>pi,Gemma2PreTrainedModel:()=>fi,Gemma3ForCausalLM:()=>_i,Gemma3Model:()=>gi,Gemma3PreTrainedModel:()=>hi,Gemma3nForConditionalGeneration:()=>Xn,Gemma3nPreTrainedModel:()=>Yn,GemmaForCausalLM:()=>di,GemmaModel:()=>ui,GemmaPreTrainedModel:()=>li,GlmForCausalLM:()=>Wr,GlmModel:()=>Ur,GlmPreTrainedModel:()=>Hr,GraniteForCausalLM:()=>ai,GraniteModel:()=>ii,GranitePreTrainedModel:()=>ri,GroundingDinoForObjectDetection:()=>Qo,GroundingDinoPreTrainedModel:()=>Zo,GroupViTModel:()=>sa,GroupViTPreTrainedModel:()=>oa,HeliumForCausalLM:()=>Vr,HeliumModel:()=>Br,HeliumPreTrainedModel:()=>zr,HieraForImageClassification:()=>io,HieraModel:()=>ro,HieraPreTrainedModel:()=>no,HubertForCTC:()=>zs,HubertForSequenceClassification:()=>Bs,HubertModel:()=>Rs,HubertPreTrainedModel:()=>Ls,IJepaForImageClassification:()=>Yi,IJepaModel:()=>Ji,IJepaPreTrainedModel:()=>qi,Idefics3ForConditionalGeneration:()=>Qn,Idefics3PreTrainedModel:()=>Zn,ImageMattingOutput:()=>qu,JAISLMHeadModel:()=>br,JAISModel:()=>yr,JAISPreTrainedModel:()=>vr,JinaCLIPModel:()=>ur,JinaCLIPPreTrainedModel:()=>Y,JinaCLIPTextModel:()=>dr,JinaCLIPVisionModel:()=>fr,LiteWhisperForConditionalGeneration:()=>Fn,LlamaForCausalLM:()=>Rr,LlamaModel:()=>Lr,LlamaPreTrainedModel:()=>Ir,LlavaForConditionalGeneration:()=>Vn,LlavaOnevisionForConditionalGeneration:()=>Hn,LlavaPreTrainedModel:()=>Bn,LlavaQwen2ForCausalLM:()=>Jn,LongT5ForConditionalGeneration:()=>Yt,LongT5Model:()=>Jt,LongT5PreTrainedModel:()=>qt,M2M100ForConditionalGeneration:()=>ps,M2M100Model:()=>fs,M2M100PreTrainedModel:()=>ds,MBartForCausalLM:()=>sn,MBartForConditionalGeneration:()=>an,MBartForSequenceClassification:()=>on,MBartModel:()=>V,MBartPreTrainedModel:()=>rn,MPNetForMaskedLM:()=>At,MPNetForQuestionAnswering:()=>Nt,MPNetForSequenceClassification:()=>jt,MPNetForTokenClassification:()=>Mt,MPNetModel:()=>kt,MPNetPreTrainedModel:()=>Ot,MT5ForConditionalGeneration:()=>Qt,MT5Model:()=>Zt,MT5PreTrainedModel:()=>Xt,MarianMTModel:()=>us,MarianModel:()=>ls,MarianPreTrainedModel:()=>cs,MaskFormerForInstanceSegmentation:()=>No,MaskFormerModel:()=>Mo,MaskFormerPreTrainedModel:()=>jo,MaskedLMOutput:()=>Uu,Metric3DForDepthEstimation:()=>Oo,Metric3DPreTrainedModel:()=>Do,Metric3Dv2ForDepthEstimation:()=>Ao,Metric3Dv2PreTrainedModel:()=>ko,MgpstrForSceneTextRecognition:()=>$c,MgpstrModelOutput:()=>Zc,MgpstrPreTrainedModel:()=>Qc,MimiDecoderModel:()=>pl,MimiDecoderOutput:()=>ul,MimiEncoderModel:()=>fl,MimiEncoderOutput:()=>ll,MimiModel:()=>dl,MimiPreTrainedModel:()=>cl,MistralForCausalLM:()=>ic,MistralModel:()=>rc,MistralPreTrainedModel:()=>nc,MobileBertForMaskedLM:()=>Tt,MobileBertForQuestionAnswering:()=>Dt,MobileBertForSequenceClassification:()=>Et,MobileBertModel:()=>wt,MobileBertPreTrainedModel:()=>Ct,MobileLLMForCausalLM:()=>Xr,MobileLLMModel:()=>Yr,MobileLLMPreTrainedModel:()=>Jr,MobileNetV1ForImageClassification:()=>Nc,MobileNetV1ForSemanticSegmentation:()=>Pc,MobileNetV1Model:()=>Mc,MobileNetV1PreTrainedModel:()=>jc,MobileNetV2ForImageClassification:()=>Lc,MobileNetV2ForSemanticSegmentation:()=>Rc,MobileNetV2Model:()=>Ic,MobileNetV2PreTrainedModel:()=>Fc,MobileNetV3ForImageClassification:()=>Vc,MobileNetV3ForSemanticSegmentation:()=>Hc,MobileNetV3Model:()=>Bc,MobileNetV3PreTrainedModel:()=>zc,MobileNetV4ForImageClassification:()=>Gc,MobileNetV4ForSemanticSegmentation:()=>Kc,MobileNetV4Model:()=>Wc,MobileNetV4PreTrainedModel:()=>Uc,MobileViTForImageClassification:()=>ha,MobileViTModel:()=>ma,MobileViTPreTrainedModel:()=>pa,MobileViTV2ForImageClassification:()=>va,MobileViTV2Model:()=>_a,MobileViTV2PreTrainedModel:()=>ga,ModelOutput:()=>pe,ModernBertForMaskedLM:()=>Oe,ModernBertForSequenceClassification:()=>ke,ModernBertForTokenClassification:()=>Ae,ModernBertModel:()=>De,ModernBertPreTrainedModel:()=>Ee,Moondream1ForConditionalGeneration:()=>Un,MoonshineForConditionalGeneration:()=>Rn,MoonshineModel:()=>Ln,MoonshinePreTrainedModel:()=>In,MptForCausalLM:()=>Bi,MptModel:()=>zi,MptPreTrainedModel:()=>Ri,MultiModalityCausalLM:()=>Xc,MultiModalityPreTrainedModel:()=>Yc,MusicgenForCausalLM:()=>kc,MusicgenForConditionalGeneration:()=>Ac,MusicgenModel:()=>Oc,MusicgenPreTrainedModel:()=>Dc,NeoBertForMaskedLM:()=>Se,NeoBertForQuestionAnswering:()=>Te,NeoBertForSequenceClassification:()=>Ce,NeoBertForTokenClassification:()=>we,NeoBertModel:()=>xe,NeoBertPreTrainedModel:()=>be,NomicBertModel:()=>Me,NomicBertPreTrainedModel:()=>je,OPTForCausalLM:()=>Ui,OPTModel:()=>Hi,OPTPreTrainedModel:()=>Vi,Olmo2ForCausalLM:()=>ni,Olmo2Model:()=>ti,Olmo2PreTrainedModel:()=>ei,OlmoForCausalLM:()=>$r,OlmoModel:()=>Qr,OlmoPreTrainedModel:()=>Zr,OpenELMForCausalLM:()=>bi,OpenELMModel:()=>yi,OpenELMPreTrainedModel:()=>vi,OwlViTForObjectDetection:()=>xa,OwlViTModel:()=>ba,OwlViTPreTrainedModel:()=>ya,Owlv2ForObjectDetection:()=>wa,Owlv2Model:()=>Ca,Owlv2PreTrainedModel:()=>Sa,PaliGemmaForConditionalGeneration:()=>qn,PaliGemmaPreTrainedModel:()=>Kn,PatchTSMixerForPrediction:()=>al,PatchTSMixerModel:()=>il,PatchTSMixerPreTrainedModel:()=>rl,PatchTSTForPrediction:()=>nl,PatchTSTModel:()=>tl,PatchTSTPreTrainedModel:()=>el,Phi3ForCausalLM:()=>Pi,Phi3Model:()=>Ni,Phi3PreTrainedModel:()=>Mi,Phi3VForCausalLM:()=>G,Phi3VPreTrainedModel:()=>er,PhiForCausalLM:()=>ji,PhiModel:()=>Ai,PhiPreTrainedModel:()=>ki,PreTrainedModel:()=>I,PretrainedMixin:()=>Z,PvtForImageClassification:()=>ea,PvtModel:()=>$i,PvtPreTrainedModel:()=>Qi,PyAnnoteForAudioFrameClassification:()=>xs,PyAnnoteModel:()=>bs,PyAnnotePreTrainedModel:()=>ys,QuestionAnsweringModelOutput:()=>Wu,Qwen2ForCausalLM:()=>Ci,Qwen2Model:()=>Si,Qwen2PreTrainedModel:()=>xi,Qwen2VLForConditionalGeneration:()=>Oi,Qwen2VLPreTrainedModel:()=>Di,Qwen3ForCausalLM:()=>Ei,Qwen3Model:()=>Ti,Qwen3PreTrainedModel:()=>wi,RFDetrForObjectDetection:()=>Wa,RFDetrModel:()=>Ua,RFDetrObjectDetectionOutput:()=>Ga,RFDetrPreTrainedModel:()=>Ha,RTDetrForObjectDetection:()=>Ia,RTDetrModel:()=>Fa,RTDetrObjectDetectionOutput:()=>La,RTDetrPreTrainedModel:()=>Pa,RTDetrV2ForObjectDetection:()=>Ba,RTDetrV2Model:()=>za,RTDetrV2ObjectDetectionOutput:()=>Va,RTDetrV2PreTrainedModel:()=>Ra,ResNetForImageClassification:()=>so,ResNetModel:()=>oo,ResNetPreTrainedModel:()=>ao,RoFormerForMaskedLM:()=>Pe,RoFormerForQuestionAnswering:()=>Le,RoFormerForSequenceClassification:()=>Fe,RoFormerForTokenClassification:()=>Ie,RoFormerModel:()=>R,RoFormerPreTrainedModel:()=>Ne,RobertaForMaskedLM:()=>hn,RobertaForQuestionAnswering:()=>_n,RobertaForSequenceClassification:()=>U,RobertaForTokenClassification:()=>gn,RobertaModel:()=>mn,RobertaPreTrainedModel:()=>pn,SamImageSegmentationOutput:()=>ss,SamModel:()=>os,SamPreTrainedModel:()=>rs,SapiensForDepthEstimation:()=>Co,SapiensForNormalEstimation:()=>wo,SapiensForSemanticSegmentation:()=>So,SapiensPreTrainedModel:()=>xo,SegformerForImageClassification:()=>yc,SegformerForSemanticSegmentation:()=>bc,SegformerModel:()=>vc,SegformerPreTrainedModel:()=>_c,Seq2SeqLMOutput:()=>Bu,SequenceClassifierOutput:()=>Q,SiglipModel:()=>J,SiglipPreTrainedModel:()=>q,SiglipTextModel:()=>or,SiglipVisionModel:()=>sr,SmolVLMForConditionalGeneration:()=>$n,SnacDecoderModel:()=>Cl,SnacEncoderModel:()=>Sl,SnacModel:()=>xl,SnacPreTrainedModel:()=>bl,SpeechT5ForSpeechToText:()=>Zs,SpeechT5ForTextToSpeech:()=>Qs,SpeechT5HifiGan:()=>$s,SpeechT5Model:()=>Xs,SpeechT5PreTrainedModel:()=>Ys,SqueezeBertForMaskedLM:()=>It,SqueezeBertForQuestionAnswering:()=>Rt,SqueezeBertForSequenceClassification:()=>Lt,SqueezeBertModel:()=>Ft,SqueezeBertPreTrainedModel:()=>Pt,StableLmForCausalLM:()=>Cc,StableLmModel:()=>Sc,StableLmPreTrainedModel:()=>xc,Starcoder2ForCausalLM:()=>sc,Starcoder2Model:()=>oc,Starcoder2PreTrainedModel:()=>ac,StyleTextToSpeech2Model:()=>Js,StyleTextToSpeech2PreTrainedModel:()=>qs,Swin2SRForImageSuperResolution:()=>ho,Swin2SRModel:()=>mo,Swin2SRPreTrainedModel:()=>po,SwinForImageClassification:()=>uo,SwinForSemanticSegmentation:()=>fo,SwinModel:()=>lo,SwinPreTrainedModel:()=>co,T5ForConditionalGeneration:()=>Kt,T5Model:()=>Gt,T5PreTrainedModel:()=>Wt,TableTransformerForObjectDetection:()=>Za,TableTransformerModel:()=>Xa,TableTransformerObjectDetectionOutput:()=>Qa,TableTransformerPreTrainedModel:()=>Ya,TokenClassifierOutput:()=>Hu,TrOCRForCausalLM:()=>tc,TrOCRPreTrainedModel:()=>ec,UltravoxModel:()=>sl,UltravoxPreTrainedModel:()=>ol,UniSpeechForCTC:()=>Es,UniSpeechForSequenceClassification:()=>Ds,UniSpeechModel:()=>Ts,UniSpeechPreTrainedModel:()=>ws,UniSpeechSatForAudioFrameClassification:()=>Ms,UniSpeechSatForCTC:()=>As,UniSpeechSatForSequenceClassification:()=>js,UniSpeechSatModel:()=>ks,UniSpeechSatPreTrainedModel:()=>Os,ViTForImageClassification:()=>Ki,ViTMAEModel:()=>na,ViTMAEPreTrainedModel:()=>ta,ViTMSNForImageClassification:()=>aa,ViTMSNModel:()=>ia,ViTMSNPreTrainedModel:()=>ra,ViTModel:()=>Gi,ViTPreTrainedModel:()=>Wi,VisionEncoderDecoderModel:()=>zn,VitMatteForImageMatting:()=>fa,VitMattePreTrainedModel:()=>da,VitPoseForPoseEstimation:()=>Zi,VitPosePreTrainedModel:()=>Xi,VitsModel:()=>gc,VitsModelOutput:()=>Ju,VitsPreTrainedModel:()=>hc,Wav2Vec2BertForCTC:()=>Fs,Wav2Vec2BertForSequenceClassification:()=>Is,Wav2Vec2BertModel:()=>Ps,Wav2Vec2BertPreTrainedModel:()=>Ns,Wav2Vec2ForAudioFrameClassification:()=>vs,Wav2Vec2ForCTC:()=>gs,Wav2Vec2ForSequenceClassification:()=>_s,Wav2Vec2Model:()=>hs,Wav2Vec2PreTrainedModel:()=>ms,WavLMForAudioFrameClassification:()=>Ks,WavLMForCTC:()=>Us,WavLMForSequenceClassification:()=>Ws,WavLMForXVector:()=>Gs,WavLMModel:()=>Hs,WavLMPreTrainedModel:()=>Vs,WeSpeakerResNetModel:()=>Cs,WeSpeakerResNetPreTrainedModel:()=>Ss,WhisperForConditionalGeneration:()=>Pn,WhisperModel:()=>Nn,WhisperPreTrainedModel:()=>Mn,XLMForQuestionAnswering:()=>Sn,XLMForSequenceClassification:()=>bn,XLMForTokenClassification:()=>xn,XLMModel:()=>yn,XLMPreTrainedModel:()=>vn,XLMRobertaForMaskedLM:()=>Tn,XLMRobertaForQuestionAnswering:()=>On,XLMRobertaForSequenceClassification:()=>En,XLMRobertaForTokenClassification:()=>Dn,XLMRobertaModel:()=>wn,XLMRobertaPreTrainedModel:()=>Cn,XLMWithLMHeadModel:()=>W,XVectorOutput:()=>Vu,YolosForObjectDetection:()=>ts,YolosModel:()=>es,YolosObjectDetectionOutput:()=>ns,YolosPreTrainedModel:()=>$o});var r=n( +`)}}class l extends c{constructor(e,{skip_prompt:t=!1,callback_function:n=null,token_callback_function:r=null,on_chunk_start:i=null,on_chunk_end:a=null,on_finalize:o=null,time_precision:s=.02,skip_special_tokens:c=!0,decode_kwargs:l={}}={}){super(e,{skip_prompt:t,skip_special_tokens:c,callback_function:n,token_callback_function:r,decode_kwargs:l}),this.timestamp_begin=e.timestamp_begin,this.on_chunk_start=i,this.on_chunk_end=a,this.on_finalize=o,this.time_precision=s,this.waiting_for_timestamp=!1}put(e){if(e.length>1)throw Error(`WhisperTextStreamer only supports batch size of 1`);let t=e[0];if(t.length===1){let e=Number(t[0])-this.timestamp_begin;if(e>=0){let n=e*this.time_precision;this.waiting_for_timestamp?this.on_chunk_end?.(n):this.on_chunk_start?.(n),this.waiting_for_timestamp=!this.waiting_for_timestamp,this.token_callback_function?.(t);return}}return super.put(e)}end(){super.end(),this.on_finalize?.()}}},"./src/models.js":(e,t,n)=>{n.r(t),n.d(t,{ASTForAudioClassification:()=>An,ASTModel:()=>kn,ASTPreTrainedModel:()=>On,AlbertForMaskedLM:()=>Vt,AlbertForQuestionAnswering:()=>Bt,AlbertForSequenceClassification:()=>zt,AlbertModel:()=>Rt,AlbertPreTrainedModel:()=>Lt,AutoModel:()=>hu,AutoModelForAudioClassification:()=>Pu,AutoModelForAudioFrameClassification:()=>Iu,AutoModelForAudioTextToText:()=>Gu,AutoModelForCTC:()=>Nu,AutoModelForCausalLM:()=>Su,AutoModelForDepthEstimation:()=>Bu,AutoModelForDocumentQuestionAnswering:()=>Lu,AutoModelForImageClassification:()=>Eu,AutoModelForImageFeatureExtraction:()=>Uu,AutoModelForImageMatting:()=>Ru,AutoModelForImageSegmentation:()=>Du,AutoModelForImageTextToText:()=>Wu,AutoModelForImageToImage:()=>zu,AutoModelForMaskGeneration:()=>Mu,AutoModelForMaskedLM:()=>Cu,AutoModelForNormalEstimation:()=>Vu,AutoModelForObjectDetection:()=>Au,AutoModelForPoseEstimation:()=>Hu,AutoModelForQuestionAnswering:()=>wu,AutoModelForSemanticSegmentation:()=>Ou,AutoModelForSeq2SeqLM:()=>vu,AutoModelForSequenceClassification:()=>gu,AutoModelForSpeechSeq2Seq:()=>yu,AutoModelForTextToSpectrogram:()=>bu,AutoModelForTextToWaveform:()=>xu,AutoModelForTokenClassification:()=>_u,AutoModelForUniversalSegmentation:()=>ku,AutoModelForVision2Seq:()=>Tu,AutoModelForXVector:()=>Fu,AutoModelForZeroShotObjectDetection:()=>ju,BartForConditionalGeneration:()=>$t,BartForSequenceClassification:()=>en,BartModel:()=>Qt,BartPretrainedModel:()=>Zt,BaseModelOutput:()=>he,BeitForImageClassification:()=>ka,BeitModel:()=>Oa,BeitPreTrainedModel:()=>Da,BertForMaskedLM:()=>_e,BertForQuestionAnswering:()=>ve,BertForSequenceClassification:()=>L,BertForTokenClassification:()=>R,BertModel:()=>I,BertPreTrainedModel:()=>ge,BlenderbotForConditionalGeneration:()=>cn,BlenderbotModel:()=>sn,BlenderbotPreTrainedModel:()=>on,BlenderbotSmallForConditionalGeneration:()=>dn,BlenderbotSmallModel:()=>un,BlenderbotSmallPreTrainedModel:()=>ln,BloomForCausalLM:()=>zi,BloomModel:()=>Ri,BloomPreTrainedModel:()=>Li,CLIPModel:()=>tr,CLIPPreTrainedModel:()=>er,CLIPSegForImageSegmentation:()=>pr,CLIPSegModel:()=>fr,CLIPSegPreTrainedModel:()=>Z,CLIPTextModel:()=>nr,CLIPTextModelWithProjection:()=>rr,CLIPVisionModel:()=>q,CLIPVisionModelWithProjection:()=>ir,CamembertForMaskedLM:()=>Je,CamembertForQuestionAnswering:()=>Ze,CamembertForSequenceClassification:()=>Ye,CamembertForTokenClassification:()=>Xe,CamembertModel:()=>qe,CamembertPreTrainedModel:()=>Ke,CausalLMOutput:()=>Zu,CausalLMOutputWithPast:()=>Qu,ChineseCLIPModel:()=>cr,ChineseCLIPPreTrainedModel:()=>sr,ClapAudioModelWithProjection:()=>yc,ClapModel:()=>_c,ClapPreTrainedModel:()=>gc,ClapTextModelWithProjection:()=>vc,CodeGenForCausalLM:()=>Pr,CodeGenModel:()=>Nr,CodeGenPreTrainedModel:()=>Mr,CohereForCausalLM:()=>ui,CohereModel:()=>li,CoherePreTrainedModel:()=>ci,ConvBertForMaskedLM:()=>Re,ConvBertForQuestionAnswering:()=>Be,ConvBertForSequenceClassification:()=>V,ConvBertForTokenClassification:()=>ze,ConvBertModel:()=>Le,ConvBertPreTrainedModel:()=>Ie,ConvNextForImageClassification:()=>Uo,ConvNextModel:()=>Ho,ConvNextPreTrainedModel:()=>Vo,ConvNextV2ForImageClassification:()=>Ko,ConvNextV2Model:()=>Go,ConvNextV2PreTrainedModel:()=>Wo,DFineForObjectDetection:()=>Xa,DFineModel:()=>Ya,DFinePreTrainedModel:()=>Ja,DPTForDepthEstimation:()=>bo,DPTModel:()=>yo,DPTPreTrainedModel:()=>vo,DacDecoderModel:()=>wl,DacDecoderOutput:()=>xl,DacEncoderModel:()=>Cl,DacEncoderOutput:()=>bl,DacModel:()=>Sl,DacPreTrainedModel:()=>yl,DebertaForMaskedLM:()=>et,DebertaForQuestionAnswering:()=>rt,DebertaForSequenceClassification:()=>tt,DebertaForTokenClassification:()=>nt,DebertaModel:()=>$e,DebertaPreTrainedModel:()=>Qe,DebertaV2ForMaskedLM:()=>ot,DebertaV2ForQuestionAnswering:()=>lt,DebertaV2ForSequenceClassification:()=>st,DebertaV2ForTokenClassification:()=>ct,DebertaV2Model:()=>at,DebertaV2PreTrainedModel:()=>it,DecisionTransformerModel:()=>$c,DecisionTransformerPreTrainedModel:()=>Qc,DeiTForImageClassification:()=>ro,DeiTModel:()=>no,DeiTPreTrainedModel:()=>to,DepthAnythingForDepthEstimation:()=>So,DepthAnythingPreTrainedModel:()=>xo,DepthProForDepthEstimation:()=>Oo,DepthProPreTrainedModel:()=>Do,DetrForObjectDetection:()=>Ma,DetrForSegmentation:()=>Na,DetrModel:()=>ja,DetrObjectDetectionOutput:()=>Pa,DetrPreTrainedModel:()=>Aa,DetrSegmentationOutput:()=>Fa,Dinov2ForImageClassification:()=>Yo,Dinov2Model:()=>Jo,Dinov2PreTrainedModel:()=>qo,Dinov2WithRegistersForImageClassification:()=>Qo,Dinov2WithRegistersModel:()=>Zo,Dinov2WithRegistersPreTrainedModel:()=>Xo,DistilBertForMaskedLM:()=>ht,DistilBertForQuestionAnswering:()=>mt,DistilBertForSequenceClassification:()=>ft,DistilBertForTokenClassification:()=>pt,DistilBertModel:()=>dt,DistilBertPreTrainedModel:()=>ut,DonutSwinModel:()=>Bo,DonutSwinPreTrainedModel:()=>zo,EfficientNetForImageClassification:()=>jc,EfficientNetModel:()=>Ac,EfficientNetPreTrainedModel:()=>kc,ElectraForMaskedLM:()=>He,ElectraForQuestionAnswering:()=>Ge,ElectraForSequenceClassification:()=>Ue,ElectraForTokenClassification:()=>We,ElectraModel:()=>Ve,ElectraPreTrainedModel:()=>H,Ernie4_5_ForCausalLM:()=>lc,Ernie4_5_Model:()=>cc,Ernie4_5_PretrainedModel:()=>sc,EsmForMaskedLM:()=>vt,EsmForSequenceClassification:()=>yt,EsmForTokenClassification:()=>bt,EsmModel:()=>_t,EsmPreTrainedModel:()=>gt,ExaoneForCausalLM:()=>Yr,ExaoneModel:()=>Jr,ExaonePreTrainedModel:()=>qr,FalconForCausalLM:()=>hc,FalconModel:()=>mc,FalconPreTrainedModel:()=>pc,FastViTForImageClassification:()=>fa,FastViTModel:()=>da,FastViTPreTrainedModel:()=>ua,Florence2ForConditionalGeneration:()=>Wn,Florence2PreTrainedModel:()=>Un,GLPNForDepthEstimation:()=>Ro,GLPNModel:()=>Lo,GLPNPreTrainedModel:()=>Io,GPT2LMHeadModel:()=>gr,GPT2Model:()=>hr,GPT2PreTrainedModel:()=>mr,GPTBigCodeForCausalLM:()=>jr,GPTBigCodeModel:()=>Ar,GPTBigCodePreTrainedModel:()=>kr,GPTJForCausalLM:()=>Or,GPTJModel:()=>Dr,GPTJPreTrainedModel:()=>Er,GPTNeoForCausalLM:()=>Sr,GPTNeoModel:()=>xr,GPTNeoPreTrainedModel:()=>br,GPTNeoXForCausalLM:()=>Tr,GPTNeoXModel:()=>wr,GPTNeoXPreTrainedModel:()=>Cr,Gemma2ForCausalLM:()=>gi,Gemma2Model:()=>hi,Gemma2PreTrainedModel:()=>mi,Gemma3ForCausalLM:()=>yi,Gemma3Model:()=>vi,Gemma3PreTrainedModel:()=>_i,Gemma3nForConditionalGeneration:()=>Yn,Gemma3nPreTrainedModel:()=>Jn,GemmaForCausalLM:()=>pi,GemmaModel:()=>fi,GemmaPreTrainedModel:()=>di,GlmForCausalLM:()=>Kr,GlmModel:()=>Gr,GlmPreTrainedModel:()=>Wr,GraniteForCausalLM:()=>si,GraniteModel:()=>oi,GranitePreTrainedModel:()=>ai,GroundingDinoForObjectDetection:()=>es,GroundingDinoPreTrainedModel:()=>$o,GroupViTModel:()=>la,GroupViTPreTrainedModel:()=>ca,HeliumForCausalLM:()=>Ur,HeliumModel:()=>Hr,HeliumPreTrainedModel:()=>Vr,HieraForImageClassification:()=>oo,HieraModel:()=>ao,HieraPreTrainedModel:()=>io,HubertForCTC:()=>Vs,HubertForSequenceClassification:()=>Hs,HubertModel:()=>Bs,HubertPreTrainedModel:()=>zs,IJepaForImageClassification:()=>Zi,IJepaModel:()=>Xi,IJepaPreTrainedModel:()=>Yi,Idefics3ForConditionalGeneration:()=>Zn,Idefics3PreTrainedModel:()=>Xn,ImageMattingOutput:()=>$u,JAISLMHeadModel:()=>yr,JAISModel:()=>vr,JAISPreTrainedModel:()=>_r,JinaCLIPModel:()=>lr,JinaCLIPPreTrainedModel:()=>X,JinaCLIPTextModel:()=>ur,JinaCLIPVisionModel:()=>dr,LiteWhisperForConditionalGeneration:()=>Pn,LlamaForCausalLM:()=>Lr,LlamaModel:()=>Ir,LlamaPreTrainedModel:()=>Fr,LlavaForConditionalGeneration:()=>Bn,LlavaOnevisionForConditionalGeneration:()=>Vn,LlavaPreTrainedModel:()=>zn,LlavaQwen2ForCausalLM:()=>qn,LongT5ForConditionalGeneration:()=>qt,LongT5Model:()=>Kt,LongT5PreTrainedModel:()=>Gt,M2M100ForConditionalGeneration:()=>hs,M2M100Model:()=>ms,M2M100PreTrainedModel:()=>ps,MBartForCausalLM:()=>an,MBartForConditionalGeneration:()=>nn,MBartForSequenceClassification:()=>rn,MBartModel:()=>U,MBartPreTrainedModel:()=>tn,MPNetForMaskedLM:()=>Ot,MPNetForQuestionAnswering:()=>jt,MPNetForSequenceClassification:()=>kt,MPNetForTokenClassification:()=>At,MPNetModel:()=>Dt,MPNetPreTrainedModel:()=>Et,MT5ForConditionalGeneration:()=>Xt,MT5Model:()=>Yt,MT5PreTrainedModel:()=>Jt,MarianMTModel:()=>fs,MarianModel:()=>ds,MarianPreTrainedModel:()=>us,MaskFormerForInstanceSegmentation:()=>Fo,MaskFormerModel:()=>Po,MaskFormerPreTrainedModel:()=>No,MaskedLMOutput:()=>Yu,Metric3DForDepthEstimation:()=>Ao,Metric3DPreTrainedModel:()=>ko,Metric3Dv2ForDepthEstimation:()=>Mo,Metric3Dv2PreTrainedModel:()=>jo,MgpstrForSceneTextRecognition:()=>il,MgpstrModelOutput:()=>nl,MgpstrPreTrainedModel:()=>rl,MimiDecoderModel:()=>vl,MimiDecoderOutput:()=>hl,MimiEncoderModel:()=>_l,MimiEncoderOutput:()=>ml,MimiModel:()=>gl,MimiPreTrainedModel:()=>pl,MistralForCausalLM:()=>oc,MistralModel:()=>ac,MistralPreTrainedModel:()=>ic,MobileBertForMaskedLM:()=>Ct,MobileBertForQuestionAnswering:()=>Tt,MobileBertForSequenceClassification:()=>wt,MobileBertModel:()=>St,MobileBertPreTrainedModel:()=>xt,MobileLLMForCausalLM:()=>Qr,MobileLLMModel:()=>Zr,MobileLLMPreTrainedModel:()=>Xr,MobileNetV1ForImageClassification:()=>Rc,MobileNetV1ForSemanticSegmentation:()=>zc,MobileNetV1Model:()=>Lc,MobileNetV1PreTrainedModel:()=>Ic,MobileNetV2ForImageClassification:()=>Hc,MobileNetV2ForSemanticSegmentation:()=>Uc,MobileNetV2Model:()=>Vc,MobileNetV2PreTrainedModel:()=>Bc,MobileNetV3ForImageClassification:()=>Kc,MobileNetV3ForSemanticSegmentation:()=>qc,MobileNetV3Model:()=>Gc,MobileNetV3PreTrainedModel:()=>Wc,MobileNetV4ForImageClassification:()=>Xc,MobileNetV4ForSemanticSegmentation:()=>Zc,MobileNetV4Model:()=>Yc,MobileNetV4PreTrainedModel:()=>Jc,MobileViTForImageClassification:()=>_a,MobileViTModel:()=>ga,MobileViTPreTrainedModel:()=>ha,MobileViTV2ForImageClassification:()=>ba,MobileViTV2Model:()=>ya,MobileViTV2PreTrainedModel:()=>va,ModelOutput:()=>me,ModernBertForMaskedLM:()=>Te,ModernBertForSequenceClassification:()=>Ee,ModernBertForTokenClassification:()=>De,ModernBertModel:()=>we,ModernBertPreTrainedModel:()=>Ce,Moondream1ForConditionalGeneration:()=>Hn,MoonshineForConditionalGeneration:()=>Ln,MoonshineModel:()=>In,MoonshinePreTrainedModel:()=>Fn,MptForCausalLM:()=>Hi,MptModel:()=>Vi,MptPreTrainedModel:()=>Bi,MultiModalityCausalLM:()=>tl,MultiModalityPreTrainedModel:()=>el,MusicgenForCausalLM:()=>Pc,MusicgenForConditionalGeneration:()=>Fc,MusicgenModel:()=>Nc,MusicgenPreTrainedModel:()=>Mc,NeoBertForMaskedLM:()=>be,NeoBertForQuestionAnswering:()=>B,NeoBertForSequenceClassification:()=>xe,NeoBertForTokenClassification:()=>Se,NeoBertModel:()=>z,NeoBertPreTrainedModel:()=>ye,NomicBertModel:()=>ke,NomicBertPreTrainedModel:()=>Oe,OPTForCausalLM:()=>Gi,OPTModel:()=>Wi,OPTPreTrainedModel:()=>Ui,Olmo2ForCausalLM:()=>ii,Olmo2Model:()=>ri,Olmo2PreTrainedModel:()=>ni,OlmoForCausalLM:()=>ti,OlmoModel:()=>ei,OlmoPreTrainedModel:()=>$r,OpenELMForCausalLM:()=>Si,OpenELMModel:()=>xi,OpenELMPreTrainedModel:()=>bi,OwlViTForObjectDetection:()=>Ca,OwlViTModel:()=>Sa,OwlViTPreTrainedModel:()=>xa,Owlv2ForObjectDetection:()=>Ea,Owlv2Model:()=>Ta,Owlv2PreTrainedModel:()=>wa,PaliGemmaForConditionalGeneration:()=>Kn,PaliGemmaPreTrainedModel:()=>Gn,PatchTSMixerForPrediction:()=>ul,PatchTSMixerModel:()=>ll,PatchTSMixerPreTrainedModel:()=>cl,PatchTSTForPrediction:()=>sl,PatchTSTModel:()=>ol,PatchTSTPreTrainedModel:()=>al,Phi3ForCausalLM:()=>Ii,Phi3Model:()=>Fi,Phi3PreTrainedModel:()=>Pi,Phi3VForCausalLM:()=>K,Phi3VPreTrainedModel:()=>$n,PhiForCausalLM:()=>Ni,PhiModel:()=>Mi,PhiPreTrainedModel:()=>ji,PreTrainedModel:()=>F,PretrainedMixin:()=>kl,PvtForImageClassification:()=>na,PvtModel:()=>ta,PvtPreTrainedModel:()=>ea,PyAnnoteForAudioFrameClassification:()=>Cs,PyAnnoteModel:()=>Ss,PyAnnotePreTrainedModel:()=>xs,QuestionAnsweringModelOutput:()=>Xu,Qwen2ForCausalLM:()=>Ti,Qwen2Model:()=>wi,Qwen2PreTrainedModel:()=>Ci,Qwen2VLForConditionalGeneration:()=>Ai,Qwen2VLPreTrainedModel:()=>ki,Qwen3ForCausalLM:()=>Oi,Qwen3Model:()=>Di,Qwen3PreTrainedModel:()=>Ei,RFDetrForObjectDetection:()=>Ka,RFDetrModel:()=>Ga,RFDetrObjectDetectionOutput:()=>qa,RFDetrPreTrainedModel:()=>Wa,RTDetrForObjectDetection:()=>Ra,RTDetrModel:()=>La,RTDetrObjectDetectionOutput:()=>za,RTDetrPreTrainedModel:()=>Ia,RTDetrV2ForObjectDetection:()=>Ha,RTDetrV2Model:()=>Va,RTDetrV2ObjectDetectionOutput:()=>Ua,RTDetrV2PreTrainedModel:()=>Ba,ResNetForImageClassification:()=>lo,ResNetModel:()=>co,ResNetPreTrainedModel:()=>so,RoFormerForMaskedLM:()=>Me,RoFormerForQuestionAnswering:()=>Fe,RoFormerForSequenceClassification:()=>Ne,RoFormerForTokenClassification:()=>Pe,RoFormerModel:()=>je,RoFormerPreTrainedModel:()=>Ae,RobertaForMaskedLM:()=>mn,RobertaForQuestionAnswering:()=>gn,RobertaForSequenceClassification:()=>W,RobertaForTokenClassification:()=>hn,RobertaModel:()=>pn,RobertaPreTrainedModel:()=>fn,SamImageSegmentationOutput:()=>ls,SamModel:()=>cs,SamPreTrainedModel:()=>ss,SapiensForDepthEstimation:()=>To,SapiensForNormalEstimation:()=>Eo,SapiensForSemanticSegmentation:()=>wo,SapiensPreTrainedModel:()=>Co,SegformerForImageClassification:()=>wc,SegformerForSemanticSegmentation:()=>Tc,SegformerModel:()=>Cc,SegformerPreTrainedModel:()=>Sc,Seq2SeqLMOutput:()=>Ku,SequenceClassifierOutput:()=>Q,SiglipModel:()=>Y,SiglipPreTrainedModel:()=>J,SiglipTextModel:()=>ar,SiglipVisionModel:()=>or,SmolLM3ForCausalLM:()=>Br,SmolLM3Model:()=>zr,SmolLM3PreTrainedModel:()=>Rr,SmolVLMForConditionalGeneration:()=>Qn,SnacDecoderModel:()=>Ol,SnacEncoderModel:()=>Dl,SnacModel:()=>El,SnacPreTrainedModel:()=>Tl,SpeechT5ForSpeechToText:()=>$s,SpeechT5ForTextToSpeech:()=>ec,SpeechT5HifiGan:()=>tc,SpeechT5Model:()=>Qs,SpeechT5PreTrainedModel:()=>Zs,SqueezeBertForMaskedLM:()=>Pt,SqueezeBertForQuestionAnswering:()=>It,SqueezeBertForSequenceClassification:()=>Ft,SqueezeBertModel:()=>Nt,SqueezeBertPreTrainedModel:()=>Mt,StableLmForCausalLM:()=>Oc,StableLmModel:()=>Dc,StableLmPreTrainedModel:()=>Ec,Starcoder2ForCausalLM:()=>fc,Starcoder2Model:()=>dc,Starcoder2PreTrainedModel:()=>uc,StyleTextToSpeech2Model:()=>Xs,StyleTextToSpeech2PreTrainedModel:()=>Ys,Swin2SRForImageSuperResolution:()=>_o,Swin2SRModel:()=>go,Swin2SRPreTrainedModel:()=>ho,SwinForImageClassification:()=>po,SwinForSemanticSegmentation:()=>mo,SwinModel:()=>fo,SwinPreTrainedModel:()=>uo,T5ForConditionalGeneration:()=>Wt,T5Model:()=>Ut,T5PreTrainedModel:()=>Ht,TableTransformerForObjectDetection:()=>$a,TableTransformerModel:()=>Qa,TableTransformerObjectDetectionOutput:()=>eo,TableTransformerPreTrainedModel:()=>Za,TokenClassifierOutput:()=>Ju,TrOCRForCausalLM:()=>rc,TrOCRPreTrainedModel:()=>nc,UltravoxModel:()=>fl,UltravoxPreTrainedModel:()=>dl,UniSpeechForCTC:()=>Os,UniSpeechForSequenceClassification:()=>ks,UniSpeechModel:()=>Ds,UniSpeechPreTrainedModel:()=>Es,UniSpeechSatForAudioFrameClassification:()=>Ps,UniSpeechSatForCTC:()=>Ms,UniSpeechSatForSequenceClassification:()=>Ns,UniSpeechSatModel:()=>js,UniSpeechSatPreTrainedModel:()=>As,ViTForImageClassification:()=>Ji,ViTMAEModel:()=>ia,ViTMAEPreTrainedModel:()=>ra,ViTMSNForImageClassification:()=>sa,ViTMSNModel:()=>oa,ViTMSNPreTrainedModel:()=>aa,ViTModel:()=>qi,ViTPreTrainedModel:()=>Ki,VisionEncoderDecoderModel:()=>Rn,VitMatteForImageMatting:()=>ma,VitMattePreTrainedModel:()=>pa,VitPoseForPoseEstimation:()=>$i,VitPosePreTrainedModel:()=>Qi,VitsModel:()=>xc,VitsModelOutput:()=>ed,VitsPreTrainedModel:()=>bc,Wav2Vec2BertForCTC:()=>Ls,Wav2Vec2BertForSequenceClassification:()=>Rs,Wav2Vec2BertModel:()=>Is,Wav2Vec2BertPreTrainedModel:()=>Fs,Wav2Vec2ForAudioFrameClassification:()=>bs,Wav2Vec2ForCTC:()=>vs,Wav2Vec2ForSequenceClassification:()=>ys,Wav2Vec2Model:()=>_s,Wav2Vec2PreTrainedModel:()=>gs,WavLMForAudioFrameClassification:()=>Js,WavLMForCTC:()=>Gs,WavLMForSequenceClassification:()=>Ks,WavLMForXVector:()=>qs,WavLMModel:()=>Ws,WavLMPreTrainedModel:()=>Us,WeSpeakerResNetModel:()=>Ts,WeSpeakerResNetPreTrainedModel:()=>ws,WhisperForConditionalGeneration:()=>Nn,WhisperModel:()=>Mn,WhisperPreTrainedModel:()=>jn,XLMForQuestionAnswering:()=>xn,XLMForSequenceClassification:()=>yn,XLMForTokenClassification:()=>bn,XLMModel:()=>vn,XLMPreTrainedModel:()=>_n,XLMRobertaForMaskedLM:()=>wn,XLMRobertaForQuestionAnswering:()=>Dn,XLMRobertaForSequenceClassification:()=>Tn,XLMRobertaForTokenClassification:()=>En,XLMRobertaModel:()=>Cn,XLMRobertaPreTrainedModel:()=>Sn,XLMWithLMHeadModel:()=>G,XVectorOutput:()=>qu,YolosForObjectDetection:()=>rs,YolosModel:()=>ns,YolosObjectDetectionOutput:()=>os,YolosPreTrainedModel:()=>ts});var r=n( /*! ./configs.js */ `./src/configs.js`),i=n( /*! ./backends/onnx.js */ @@ -2986,7 +2986,7 @@ var af={"onnxruntime-common":e=>{e.exports=ne},"onnxruntime-web":e=>{e.exports=j /*! ./models/whisper/generation_whisper.js */ `./src/models/whisper/generation_whisper.js`),y=n( /*! ./models/whisper/common_whisper.js */ -`./src/models/whisper/common_whisper.js`);let b={EncoderOnly:0,EncoderDecoder:1,Seq2Seq:2,Vision2Seq:3,DecoderOnly:4,MaskGeneration:5,ImageTextToText:6,Musicgen:7,MultiModality:8,Phi3V:9,AudioTextToText:10,AutoEncoder:11,ImageAudioTextToText:12},x=new Map,S=new Map,C=new Map;async function w(e,t,n){let o=n.config?.[`transformers.js_config`]??{},s=n.device??o.device;s&&typeof s!=`string`&&(s.hasOwnProperty(t)?s=s[t]:(console.warn(`device not specified for "${t}". Using the default device.`),s=null));let l=s??(_.apis.IS_NODE_ENV?`cpu`:`wasm`),u=(0,i.deviceToExecutionProviders)(l),d=o.device_config??{};d.hasOwnProperty(l)&&(o={...o,...d[l]});let f=n.dtype??o.dtype;if(typeof f!=`string`&&(f&&f.hasOwnProperty(t)?f=f[t]:(f=a.DEFAULT_DEVICE_DTYPE_MAPPING[l]??a.DATA_TYPES.fp32,console.warn(`dtype not specified for "${t}". Using the default dtype (${f}) for this device (${l}).`))),f===a.DATA_TYPES.auto){let e=o.dtype;typeof e!=`string`&&(e=e?.[t]),f=e&&e!==a.DATA_TYPES.auto&&a.DATA_TYPES.hasOwnProperty(e)?e:a.DEFAULT_DEVICE_DTYPE_MAPPING[l]??a.DATA_TYPES.fp32}let p=f;if(a.DEFAULT_DTYPE_SUFFIX_MAPPING.hasOwnProperty(p)){if(p===a.DATA_TYPES.fp16&&l===`webgpu`&&!await(0,a.isWebGpuFp16Supported)())throw Error(`The device (${l}) does not support fp16.`)}else throw Error(`Invalid dtype: ${p}. Should be one of: ${Object.keys(a.DATA_TYPES).join(`, `)}`);let m=o.kv_cache_dtype,h=m?typeof m==`string`?m:m[p]??`float32`:void 0;if(h&&![`float32`,`float16`].includes(h))throw Error(`Invalid kv_cache_dtype: ${h}. Should be one of: float32, float16`);let g={dtype:p,kv_cache_dtype:h,device:l},v=a.DEFAULT_DTYPE_SUFFIX_MAPPING[p],y=`${t}${v}.onnx`,b=`${n.subfolder??``}/${y}`,x={...n.session_options};x.executionProviders??=u;let S=o.free_dimension_overrides;S?x.freeDimensionOverrides??=S:l.startsWith(`webnn`)&&!x.freeDimensionOverrides&&console.warn(`WebNN does not currently support dynamic shapes and requires 'free_dimension_overrides' to be set in config.json, preferably as a field within config["transformers.js_config"]["device_config"]["${l}"]. When 'free_dimension_overrides' is not set, you may experience significant performance degradation.`);let C=_.apis.IS_NODE_ENV&&_.env.useFSCache,w=(0,c.getModelFile)(e,b,!0,n,C),T=n.use_external_data_format??o.use_external_data_format,E=[];if(T){let r;r=typeof T==`object`?T.hasOwnProperty(y)?T[y]:T.hasOwnProperty(t)?T[t]:!1:T;let i=+r;if(i>c.MAX_EXTERNAL_DATA_CHUNKS)throw Error(`The number of external data chunks (${i}) exceeds the maximum allowed value (${c.MAX_EXTERNAL_DATA_CHUNKS}).`);for(let t=0;t{let o=await(0,c.getModelFile)(e,i,!0,n,C);t(o instanceof Uint8Array?{path:r,data:o}:r)}))}}else x.externalData!==void 0&&(E=x.externalData.map(async t=>{if(typeof t.data==`string`){let r=await(0,c.getModelFile)(e,t.data,!0,n);return{...t,data:r}}return t}));if(E.length>0){let e=await Promise.all(E);_.apis.IS_NODE_ENV||(x.externalData=e)}if(l===`webgpu`){let e=(0,r.getKeyValueShapes)(n.config,{prefix:`present`});if(Object.keys(e).length>0&&!(0,i.isONNXProxy)()){let t={};for(let n in e)t[n]=`gpu-buffer`;x.preferredOutputLocation=t}}let D=await w;return{buffer_or_path:D,session_options:x,session_config:g}}async function T(e,t,n){return Object.fromEntries(await Promise.all(Object.keys(t).map(async r=>{let{buffer_or_path:a,session_options:o,session_config:s}=await w(e,t[r],n),c=await(0,i.createInferenceSession)(a,o,s);return[r,c]})))}async function E(e,t,n){return Object.fromEntries(await Promise.all(Object.keys(t).map(async r=>{let i=await(0,c.getModelJSON)(e,t[r],!1,n);return[r,i]})))}function D(e,t){let n=Object.create(null),r=[];for(let a of e.inputNames){let e=t[a];if(!(e instanceof f.Tensor)){r.push(a);continue}n[a]=(0,i.isONNXProxy)()?e.clone():e}if(r.length>0)throw Error(`An error occurred during model execution: "Missing the following inputs: ${r.join(`, `)}.`);let a=Object.keys(t).length,o=e.inputNames.length;if(a>o){let n=Object.keys(t).filter(t=>!e.inputNames.includes(t));console.warn(`WARNING: Too many inputs were provided (${a} > ${o}). The following inputs will be ignored: "${n.join(`, `)}".`)}return n}let O=Promise.resolve();async function k(e,t){let n=D(e,t);try{let t=Object.fromEntries(Object.entries(n).map(([e,t])=>[e,t.ort_tensor])),r=()=>e.run(t),i=await(_.apis.IS_BROWSER_ENV||_.apis.IS_WEBWORKER_ENV?O=O.then(r):r());return A(i)}catch(e){let t=Object.fromEntries(Object.entries(n).map(([e,t])=>{let n={type:t.type,dims:t.dims,location:t.location};return n.location!==`gpu-buffer`&&(n.data=t.data),[e,n]}));throw console.error(`An error occurred during model execution: "${e}".`),console.error(`Inputs given to model:`,t),e}}function A(e){for(let t in e)(0,i.isONNXTensor)(e[t])?e[t]=new f.Tensor(e[t]):typeof e[t]==`object`&&A(e[t]);return e}function ee(e){if(e instanceof f.Tensor)return e;if(e.length===0)throw Error(`items must be non-empty`);if(Array.isArray(e[0])){if(e.some(t=>t.length!==e[0].length))throw Error(`Unable to create tensor, you should probably activate truncation and/or padding with 'padding=True' and/or 'truncation=True' to have batched tensors with the same length.`);return new f.Tensor(`int64`,BigInt64Array.from(e.flat().map(e=>BigInt(e))),[e.length,e[0].length])}else return new f.Tensor(`int64`,BigInt64Array.from(e.map(e=>BigInt(e))),[1,e.length])}function te(e){return new f.Tensor(`bool`,[e],[1])}async function ne(e,t){let{encoder_outputs:n,input_ids:r,decoder_input_ids:i,...a}=t;if(!n){let r=(0,s.pick)(t,e.sessions.model.inputNames);n=(await j(e,r)).last_hidden_state}a.input_ids=i,a.encoder_hidden_states=n,e.sessions.decoder_model_merged.inputNames.includes(`encoder_attention_mask`)&&(a.encoder_attention_mask=t.attention_mask);let o=await ie(e,a,!0);return o}async function j(e,t){let n=e.sessions.model,r=(0,s.pick)(t,n.inputNames);if(n.inputNames.includes(`inputs_embeds`)&&!r.inputs_embeds){if(!t.input_ids)throw Error("Both `input_ids` and `inputs_embeds` are missing in the model inputs.");r.inputs_embeds=await e.encode_text({input_ids:t.input_ids})}if(n.inputNames.includes(`token_type_ids`)&&!r.token_type_ids){if(!r.input_ids)throw Error("Both `input_ids` and `token_type_ids` are missing in the model inputs.");r.token_type_ids=(0,f.zeros_like)(r.input_ids)}if(n.inputNames.includes(`pixel_mask`)&&!r.pixel_mask){if(!r.pixel_values)throw Error("Both `pixel_values` and `pixel_mask` are missing in the model inputs.");let e=r.pixel_values.dims;r.pixel_mask=(0,f.ones)([e[0],e[2],e[3]])}return await k(n,r)}async function re(e,t){let n=await e.encode(t),r=await e.decode(n);return r}async function ie(e,t,n=!1){let r=e.sessions[n?`decoder_model_merged`:`model`],{past_key_values:i,...a}=t;if(r.inputNames.includes(`use_cache_branch`)&&(a.use_cache_branch=te(!!i)),r.inputNames.includes(`position_ids`)&&a.attention_mask&&!a.position_ids){let t=[`paligemma`,`gemma3_text`,`gemma3`].includes(e.config.model_type)?1:0;a.position_ids=ue(a,i,t)}e.addPastKeyValues(a,i);let o=(0,s.pick)(a,r.inputNames);return await k(r,o)}function ae({modality_token_id:e,inputs_embeds:t,modality_features:n,input_ids:r,attention_mask:i}){let a=r.tolist().map(t=>t.reduce((t,n,r)=>(n==e&&t.push(r),t),[])),o=a.reduce((e,t)=>e+t.length,0),s=n.dims[0];if(o!==s)throw Error(`Number of tokens and features do not match: tokens: ${o}, features ${s}`);let c=0;for(let e=0;ee.dims[1]||i[e.at(-1)])),{...n,decoder_input_ids:ee(t)}}function F(e,...t){return e.config.is_encoder_decoder?P(e,...t):de(e,...t)}function fe(e,t,n,r){let i=!!n.past_key_values;if(r.guidance_scale!==null&&r.guidance_scale>1&&(i?n.input_ids=(0,f.cat)([n.input_ids,n.input_ids],0):(n.input_ids=(0,f.cat)([n.input_ids,(0,f.full_like)(n.input_ids,BigInt(r.pad_token_id))],0),n.attention_mask=(0,f.cat)([n.attention_mask,(0,f.full_like)(n.attention_mask,0n)],0))),(i||!n.pixel_values)&&(n.pixel_values=(0,f.full)([0,0,3,384,384],1)),i){let e=0,t=1,r=e>0?1:0,i=1;n.images_seq_mask=new f.Tensor(`bool`,Array(e+t).fill(!0).fill(!1,0,t),[i,e+t]),n.images_emb_mask=new f.Tensor(`bool`,Array(e).fill(!!r),[i,1,e])}return n}class I extends o.Callable{main_input_name=`input_ids`;forward_params=[`input_ids`,`attention_mask`];constructor(e,t,n){super(),this.config=e,this.sessions=t,this.configs=n;let r=C.get(this.constructor),i=x.get(r);switch(this.can_generate=!1,this._forward=null,this._prepare_inputs_for_generation=null,i){case b.DecoderOnly:this.can_generate=!0,this._forward=ie,this._prepare_inputs_for_generation=de;break;case b.Seq2Seq:case b.Vision2Seq:case b.Musicgen:this.can_generate=!0,this._forward=ne,this._prepare_inputs_for_generation=P;break;case b.EncoderDecoder:this._forward=ne;break;case b.ImageTextToText:this.can_generate=!0,this._forward=ce,this._prepare_inputs_for_generation=F;break;case b.AudioTextToText:this.can_generate=!0,this._forward=N,this._prepare_inputs_for_generation=F;break;case b.Phi3V:case b.ImageAudioTextToText:this.can_generate=!0,this._prepare_inputs_for_generation=F;break;case b.MultiModality:this.can_generate=!0,this._prepare_inputs_for_generation=fe;break;case b.AutoEncoder:this._forward=re;break;default:this._forward=j;break}this.can_generate&&this.forward_params.push(`past_key_values`),this.custom_config=this.config[`transformers.js_config`]??{}}async dispose(){let e=[];for(let t of Object.values(this.sessions))t?.handler?.dispose&&e.push(t.handler.dispose());return await Promise.all(e)}static async from_pretrained(e,{progress_callback:t=null,config:n=null,cache_dir:i=null,local_files_only:a=!1,revision:o=`main`,model_file_name:s=null,subfolder:c=`onnx`,device:u=null,dtype:d=null,use_external_data_format:f=null,session_options:p={}}={}){let m={progress_callback:t,config:n,cache_dir:i,local_files_only:a,revision:o,model_file_name:s,subfolder:c,device:u,dtype:d,use_external_data_format:f,session_options:p},h=C.get(this),g=x.get(h);n=m.config=await r.AutoConfig.from_pretrained(e,m);let _;if(g===b.DecoderOnly)_=await Promise.all([T(e,{model:m.model_file_name??`model`},m),E(e,{generation_config:`generation_config.json`},m)]);else if(g===b.Seq2Seq||g===b.Vision2Seq)_=await Promise.all([T(e,{model:`encoder_model`,decoder_model_merged:`decoder_model_merged`},m),E(e,{generation_config:`generation_config.json`},m)]);else if(g===b.MaskGeneration)_=await Promise.all([T(e,{model:`vision_encoder`,prompt_encoder_mask_decoder:`prompt_encoder_mask_decoder`},m)]);else if(g===b.EncoderDecoder)_=await Promise.all([T(e,{model:`encoder_model`,decoder_model_merged:`decoder_model_merged`},m)]);else if(g===b.ImageTextToText){let t={embed_tokens:`embed_tokens`,vision_encoder:`vision_encoder`,decoder_model_merged:`decoder_model_merged`};n.is_encoder_decoder&&(t.model=`encoder_model`),_=await Promise.all([T(e,t,m),E(e,{generation_config:`generation_config.json`},m)])}else if(g===b.AudioTextToText){let t={embed_tokens:`embed_tokens`,audio_encoder:`audio_encoder`,decoder_model_merged:`decoder_model_merged`};_=await Promise.all([T(e,t,m),E(e,{generation_config:`generation_config.json`},m)])}else if(g===b.ImageAudioTextToText){let t={embed_tokens:`embed_tokens`,audio_encoder:`audio_encoder`,vision_encoder:`vision_encoder`,decoder_model_merged:`decoder_model_merged`};_=await Promise.all([T(e,t,m),E(e,{generation_config:`generation_config.json`},m)])}else if(g===b.Musicgen)_=await Promise.all([T(e,{model:`text_encoder`,decoder_model_merged:`decoder_model_merged`,encodec_decode:`encodec_decode`},m),E(e,{generation_config:`generation_config.json`},m)]);else if(g===b.MultiModality)_=await Promise.all([T(e,{prepare_inputs_embeds:`prepare_inputs_embeds`,model:`language_model`,lm_head:`lm_head`,gen_head:`gen_head`,gen_img_embeds:`gen_img_embeds`,image_decode:`image_decode`},m),E(e,{generation_config:`generation_config.json`},m)]);else if(g===b.Phi3V)_=await Promise.all([T(e,{prepare_inputs_embeds:`prepare_inputs_embeds`,model:`model`,vision_encoder:`vision_encoder`},m),E(e,{generation_config:`generation_config.json`},m)]);else if(g===b.AutoEncoder)_=await Promise.all([T(e,{encoder_model:`encoder_model`,decoder_model:`decoder_model`},m)]);else{if(g!==b.EncoderOnly){let e=h??n?.model_type;e!==`custom`&&console.warn(`Model type for '${e}' not found, assuming encoder-only architecture. Please report this at ${l.GITHUB_ISSUE_URL}.`)}_=await Promise.all([T(e,{model:m.model_file_name??`model`},m)])}return new this(n,..._)}async _call(e){return await this.forward(e)}async forward(e){return await this._forward(this,e)}get generation_config(){return this.configs?.generation_config??null}_get_logits_warper(e){let t=new u.LogitsProcessorList;return e.temperature!==null&&e.temperature!==1&&t.push(new u.TemperatureLogitsWarper(e.temperature)),e.top_k!==null&&e.top_k!==0&&t.push(new u.TopKLogitsWarper(e.top_k)),e.top_p!==null&&e.top_p<1&&t.push(new u.TopPLogitsWarper(e.top_p)),t}_get_logits_processor(e,t,n=null){let r=new u.LogitsProcessorList;if(e.repetition_penalty!==null&&e.repetition_penalty!==1&&r.push(new u.RepetitionPenaltyLogitsProcessor(e.repetition_penalty)),e.no_repeat_ngram_size!==null&&e.no_repeat_ngram_size>0&&r.push(new u.NoRepeatNGramLogitsProcessor(e.no_repeat_ngram_size)),e.bad_words_ids!==null&&r.push(new u.NoBadWordsLogitsProcessor(e.bad_words_ids,e.eos_token_id)),e.min_length!==null&&e.eos_token_id!==null&&e.min_length>0&&r.push(new u.MinLengthLogitsProcessor(e.min_length,e.eos_token_id)),e.min_new_tokens!==null&&e.eos_token_id!==null&&e.min_new_tokens>0&&r.push(new u.MinNewTokensLengthLogitsProcessor(t,e.min_new_tokens,e.eos_token_id)),e.forced_bos_token_id!==null&&r.push(new u.ForcedBOSTokenLogitsProcessor(e.forced_bos_token_id)),e.forced_eos_token_id!==null&&r.push(new u.ForcedEOSTokenLogitsProcessor(e.max_length,e.forced_eos_token_id)),e.begin_suppress_tokens!==null){let n=t>1||e.forced_bos_token_id===null?t:t+1;r.push(new u.SuppressTokensAtBeginLogitsProcessor(e.begin_suppress_tokens,n))}return e.guidance_scale!==null&&e.guidance_scale>1&&r.push(new u.ClassifierFreeGuidanceLogitsProcessor(e.guidance_scale)),n!==null&&r.extend(n),r}_prepare_generation_config(e,t,n=d.GenerationConfig){let r={...this.config};for(let e of[`decoder`,`generator`,`text_config`])e in r&&Object.assign(r,r[e]);let i=new n(r);return Object.assign(i,this.generation_config??{}),e&&Object.assign(i,e),t&&Object.assign(i,(0,s.pick)(t,Object.getOwnPropertyNames(i))),i}_get_stopping_criteria(e,t=null){let n=new h.StoppingCriteriaList;return e.max_length!==null&&n.push(new h.MaxLengthCriteria(e.max_length,this.config.max_position_embeddings??null)),e.eos_token_id!==null&&n.push(new h.EosTokenCriteria(e.eos_token_id)),t&&n.extend(t),n}_validate_model_class(){if(!this.can_generate){let e=[Pl,Rl,Nl,Ol],t=C.get(this.constructor),n=new Set,r=this.config.model_type;for(let t of e){let e=t.get(r);e&&n.add(e[0])}let i=`The current model class (${t}) is not compatible with \`.generate()\`, as it doesn't have a language model head.`;throw n.size>0&&(i+=` Please use the following class instead: ${[...n].join(`, `)}`),Error(i)}}prepare_inputs_for_generation(...e){return this._prepare_inputs_for_generation(this,...e)}_update_model_kwargs_for_generation({generated_input_ids:e,outputs:t,model_inputs:n,is_encoder_decoder:r}){return n.past_key_values=this.getPastKeyValues(t,n.past_key_values),n.input_ids=new f.Tensor(`int64`,e.flat(),[e.length,1]),r?`decoder_attention_mask`in n:n.attention_mask=(0,f.cat)([n.attention_mask,(0,f.ones)([n.attention_mask.dims[0],1])],1),n.position_ids=null,n}_prepare_model_inputs({inputs:e,bos_token_id:t,model_kwargs:n}){let r=(0,s.pick)(n,this.forward_params),i=this.main_input_name;if(i in r){if(e)throw Error("`inputs`: {inputs}` were passed alongside {input_name} which is not allowed. Make sure to either pass {inputs} or {input_name}=...")}else r[i]=e;let a=r[i];return{inputs_tensor:a,model_inputs:r,model_input_name:i}}async _prepare_encoder_decoder_kwargs_for_generation({inputs_tensor:e,model_inputs:t,model_input_name:n,generation_config:r}){if(this.sessions.model.inputNames.includes(`inputs_embeds`)&&!t.inputs_embeds&&`_prepare_inputs_embeds`in this){let{input_ids:e,pixel_values:n,attention_mask:r,...i}=t,a=await this._prepare_inputs_embeds(t);t={...i,...(0,s.pick)(a,[`inputs_embeds`,`attention_mask`])}}let{last_hidden_state:i}=await j(this,t);if(r.guidance_scale!==null&&r.guidance_scale>1)i=(0,f.cat)([i,(0,f.full_like)(i,0)],0),`attention_mask`in t&&(t.attention_mask=(0,f.cat)([t.attention_mask,(0,f.zeros_like)(t.attention_mask)],0));else if(t.decoder_input_ids){let e=ee(t.decoder_input_ids).dims[0];if(e!==i.dims[0]){if(i.dims[0]!==1)throw Error(`The encoder outputs have a different batch size (${i.dims[0]}) than the decoder inputs (${e}).`);i=(0,f.cat)(Array.from({length:e},()=>i),0)}}return t.encoder_outputs=i,t}_prepare_decoder_input_ids_for_generation({batch_size:e,model_input_name:t,model_kwargs:n,decoder_start_token_id:r,bos_token_id:i,generation_config:a}){let{decoder_input_ids:o,...s}=n;if(!(o instanceof f.Tensor)){if(o)Array.isArray(o[0])||(o=Array.from({length:e},()=>o));else if(r??=i,this.config.model_type===`musicgen`)o=Array.from({length:e*this.config.decoder.num_codebooks},()=>[r]);else if(Array.isArray(r)){if(r.length!==e)throw Error(`\`decoder_start_token_id\` expcted to have length ${e} but got ${r.length}`);o=r}else o=Array.from({length:e},()=>[r]);o=ee(o)}return n.decoder_attention_mask=(0,f.ones_like)(o),{input_ids:o,model_inputs:s}}async generate({inputs:e=null,generation_config:t=null,logits_processor:n=null,stopping_criteria:r=null,streamer:i=null,...a}){this._validate_model_class(),t=this._prepare_generation_config(t,a);let{inputs_tensor:o,model_inputs:s,model_input_name:c}=this._prepare_model_inputs({inputs:e,model_kwargs:a}),l=this.config.is_encoder_decoder;l&&(`encoder_outputs`in s||(s=await this._prepare_encoder_decoder_kwargs_for_generation({inputs_tensor:o,model_inputs:s,model_input_name:c,generation_config:t})));let u;l?{input_ids:u,model_inputs:s}=this._prepare_decoder_input_ids_for_generation({batch_size:s[c].dims.at(0),model_input_name:c,model_kwargs:s,decoder_start_token_id:t.decoder_start_token_id,bos_token_id:t.bos_token_id,generation_config:t}):u=s[c];let d=u.dims.at(-1);t.max_new_tokens!==null&&(t.max_length=d+t.max_new_tokens);let p=this._get_logits_processor(t,d,n),m=this._get_stopping_criteria(t,r),h=s[c].dims.at(0),_=g.LogitsSampler.getSampler(t),v=Array(h).fill(0),y=u.tolist();i&&i.put(y);let b,x={};for(;;){if(s=this.prepare_inputs_for_generation(y,s,t),b=await this.forward(s),t.output_attentions&&t.return_dict_in_generate){let e=this.getAttentions(b);for(let t in e)t in x||(x[t]=[]),x[t].push(e[t])}let e=b.logits.slice(null,-1,null),n=p(y,e),r=[];for(let e=0;ee))break;s=this._update_model_kwargs_for_generation({generated_input_ids:r,outputs:b,model_inputs:s,is_encoder_decoder:l})}i&&i.end();let S=this.getPastKeyValues(b,s.past_key_values,!0),C=new f.Tensor(`int64`,y.flat(),[y.length,y[0].length]);if(t.return_dict_in_generate)return{sequences:C,past_key_values:S,...x};for(let e of Object.values(b))e.location===`gpu-buffer`&&e.dispose();return C}getPastKeyValues(e,t,n=!1){let r=Object.create(null);for(let i in e)if(i.startsWith(`present`)){let a=i.replace(`present`,`past_key_values`),o=i.includes(`encoder`);if(o&&t?r[a]=t[a]:r[a]=e[i],t&&(!o||n)){let e=t[a];e.location===`gpu-buffer`&&e.dispose()}}return r}getAttentions(e){let t={};for(let n of[`cross_attentions`,`encoder_attentions`,`decoder_attentions`])for(let r in e)r.startsWith(n)&&(n in t||(t[n]=[]),t[n].push(e[r]));return t}addPastKeyValues(e,t){if(t)Object.assign(e,t);else{let t=this.sessions.decoder_model_merged??this.sessions.model,n=t?.config?.kv_cache_dtype??`float32`,i=n===`float16`?new f.DataTypeMap.float16:[],a=(e[this.main_input_name]??e.attention_mask)?.dims?.[0]??1,o=(0,r.getKeyValueShapes)(this.config,{batch_size:a});for(let t in o)e[t]=new f.Tensor(n,i,o[t])}}async encode_image({pixel_values:e}){return(await k(this.sessions.vision_encoder,{pixel_values:e})).image_features}async encode_text({input_ids:e}){return(await k(this.sessions.embed_tokens,{input_ids:e})).inputs_embeds}async encode_audio({audio_values:e}){return(await k(this.sessions.audio_encoder,{audio_values:e})).audio_features}}class pe{}class me extends pe{constructor({last_hidden_state:e,hidden_states:t=null,attentions:n=null}){super(),this.last_hidden_state=e,this.hidden_states=t,this.attentions=n}}class he extends I{}class ge extends he{}class _e extends he{async _call(e){return new Uu(await super._call(e))}}class ve extends he{async _call(e){return new Q(await super._call(e))}}class L extends he{async _call(e){return new Hu(await super._call(e))}}class ye extends he{async _call(e){return new Wu(await super._call(e))}}class be extends I{}class xe extends be{}class Se extends be{async _call(e){return new Uu(await super._call(e))}}class Ce extends be{async _call(e){return new Q(await super._call(e))}}class we extends be{async _call(e){return new Hu(await super._call(e))}}class Te extends be{async _call(e){return new Wu(await super._call(e))}}class Ee extends I{}class De extends Ee{}class Oe extends Ee{async _call(e){return new Uu(await super._call(e))}}class ke extends Ee{async _call(e){return new Q(await super._call(e))}}class Ae extends Ee{async _call(e){return new Hu(await super._call(e))}}class je extends I{}class Me extends je{}class Ne extends I{}class R extends Ne{}class Pe extends Ne{async _call(e){return new Uu(await super._call(e))}}class Fe extends Ne{async _call(e){return new Q(await super._call(e))}}class Ie extends Ne{async _call(e){return new Hu(await super._call(e))}}class Le extends Ne{async _call(e){return new Wu(await super._call(e))}}class Re extends I{}class ze extends Re{}class Be extends Re{async _call(e){return new Uu(await super._call(e))}}class z extends Re{async _call(e){return new Q(await super._call(e))}}class Ve extends Re{async _call(e){return new Hu(await super._call(e))}}class He extends Re{async _call(e){return new Wu(await super._call(e))}}class B extends I{}class Ue extends B{}class We extends B{async _call(e){return new Uu(await super._call(e))}}class Ge extends B{async _call(e){return new Q(await super._call(e))}}class Ke extends B{async _call(e){return new Hu(await super._call(e))}}class qe extends B{async _call(e){return new Wu(await super._call(e))}}class Je extends I{}class Ye extends Je{}class Xe extends Je{async _call(e){return new Uu(await super._call(e))}}class Ze extends Je{async _call(e){return new Q(await super._call(e))}}class Qe extends Je{async _call(e){return new Hu(await super._call(e))}}class $e extends Je{async _call(e){return new Wu(await super._call(e))}}class et extends I{}class tt extends et{}class nt extends et{async _call(e){return new Uu(await super._call(e))}}class rt extends et{async _call(e){return new Q(await super._call(e))}}class it extends et{async _call(e){return new Hu(await super._call(e))}}class at extends et{async _call(e){return new Wu(await super._call(e))}}class ot extends I{}class st extends ot{}class ct extends ot{async _call(e){return new Uu(await super._call(e))}}class lt extends ot{async _call(e){return new Q(await super._call(e))}}class ut extends ot{async _call(e){return new Hu(await super._call(e))}}class dt extends ot{async _call(e){return new Wu(await super._call(e))}}class ft extends I{}class pt extends ft{}class mt extends ft{async _call(e){return new Q(await super._call(e))}}class ht extends ft{async _call(e){return new Hu(await super._call(e))}}class gt extends ft{async _call(e){return new Wu(await super._call(e))}}class _t extends ft{async _call(e){return new Uu(await super._call(e))}}class vt extends I{}class yt extends vt{}class bt extends vt{async _call(e){return new Uu(await super._call(e))}}class xt extends vt{async _call(e){return new Q(await super._call(e))}}class St extends vt{async _call(e){return new Hu(await super._call(e))}}class Ct extends I{}class wt extends Ct{}class Tt extends Ct{async _call(e){return new Uu(await super._call(e))}}class Et extends Ct{async _call(e){return new Q(await super._call(e))}}class Dt extends Ct{async _call(e){return new Wu(await super._call(e))}}class Ot extends I{}class kt extends Ot{}class At extends Ot{async _call(e){return new Uu(await super._call(e))}}class jt extends Ot{async _call(e){return new Q(await super._call(e))}}class Mt extends Ot{async _call(e){return new Hu(await super._call(e))}}class Nt extends Ot{async _call(e){return new Wu(await super._call(e))}}class Pt extends I{}class Ft extends Pt{}class It extends Pt{async _call(e){return new Uu(await super._call(e))}}class Lt extends Pt{async _call(e){return new Q(await super._call(e))}}class Rt extends Pt{async _call(e){return new Wu(await super._call(e))}}class zt extends I{}class Bt extends zt{}class Vt extends zt{async _call(e){return new Q(await super._call(e))}}class Ht extends zt{async _call(e){return new Wu(await super._call(e))}}class Ut extends zt{async _call(e){return new Uu(await super._call(e))}}class Wt extends I{forward_params=[`input_ids`,`attention_mask`,`encoder_outputs`,`decoder_input_ids`,`decoder_attention_mask`,`past_key_values`]}class Gt extends Wt{}class Kt extends Wt{}class qt extends I{}class Jt extends qt{}class Yt extends qt{}class Xt extends I{}class Zt extends Xt{}class Qt extends Xt{}class $t extends I{}class en extends $t{}class tn extends $t{}class nn extends $t{async _call(e){return new Q(await super._call(e))}}class rn extends I{}class V extends rn{}class an extends rn{}class on extends rn{async _call(e){return new Q(await super._call(e))}}class sn extends rn{}class cn extends I{}class ln extends cn{}class un extends cn{}class dn extends I{}class fn extends dn{}class H extends dn{}class pn extends I{}class mn extends pn{}class hn extends pn{async _call(e){return new Uu(await super._call(e))}}class U extends pn{async _call(e){return new Q(await super._call(e))}}class gn extends pn{async _call(e){return new Hu(await super._call(e))}}class _n extends pn{async _call(e){return new Wu(await super._call(e))}}class vn extends I{}class yn extends vn{}class W extends vn{async _call(e){return new Uu(await super._call(e))}}class bn extends vn{async _call(e){return new Q(await super._call(e))}}class xn extends vn{async _call(e){return new Hu(await super._call(e))}}class Sn extends vn{async _call(e){return new Wu(await super._call(e))}}class Cn extends I{}class wn extends Cn{}class Tn extends Cn{async _call(e){return new Uu(await super._call(e))}}class En extends Cn{async _call(e){return new Q(await super._call(e))}}class Dn extends Cn{async _call(e){return new Hu(await super._call(e))}}class On extends Cn{async _call(e){return new Wu(await super._call(e))}}class kn extends I{}class An extends kn{}class jn extends kn{}class Mn extends I{requires_attention_mask=!1;main_input_name=`input_features`;forward_params=[`input_features`,`attention_mask`,`decoder_input_ids`,`decoder_attention_mask`,`past_key_values`]}class Nn extends Mn{}class Pn extends Mn{_prepare_generation_config(e,t){return super._prepare_generation_config(e,t,v.WhisperGenerationConfig)}_retrieve_init_tokens(e){let t=[e.decoder_start_token_id],n=e.language,r=e.task;if(e.is_multilingual){n||(console.warn(`No language specified - defaulting to English (en).`),n=`en`);let i=(0,y.whisper_language_to_code)(n),a=`<|${i}|>`;t.push(e.lang_to_id[a]),t.push(e.task_to_id[r??`transcribe`])}else if(n||r)throw Error("Cannot specify `task` or `language` for an English-only model. If the model is intended to be multilingual, pass `is_multilingual=true` to generate, or update the generation config.");return!e.return_timestamps&&e.no_timestamps_token_id&&t.at(-1)!==e.no_timestamps_token_id?t.push(e.no_timestamps_token_id):e.return_timestamps&&t.at(-1)===e.no_timestamps_token_id&&(console.warn("<|notimestamps|> prompt token is removed from generation_config since `return_timestamps` is set to `true`."),t.pop()),t.filter(e=>e!=null)}async generate({inputs:e=null,generation_config:t=null,logits_processor:n=null,stopping_criteria:r=null,...i}){t=this._prepare_generation_config(t,i);let a=i.decoder_input_ids??this._retrieve_init_tokens(t);if(t.return_timestamps&&(n??=new u.LogitsProcessorList,n.push(new u.WhisperTimeStampLogitsProcessor(t,a))),t.begin_suppress_tokens&&(n??=new u.LogitsProcessorList,n.push(new u.SuppressTokensAtBeginLogitsProcessor(t.begin_suppress_tokens,a.length))),t.return_token_timestamps){if(!t.alignment_heads)throw Error("Model generation config has no `alignment_heads`, token-level timestamps not available. See https://gist.github.com/hollance/42e32852f24243b748ae6bc1f985b13a on how to add this property to the generation config.");t.task===`translate`&&console.warn(`Token-level timestamps may not be reliable for task 'translate'.`),t.output_attentions=!0,t.return_dict_in_generate=!0}let o=await super.generate({inputs:e,generation_config:t,logits_processor:n,decoder_input_ids:a,...i});return t.return_token_timestamps&&(o.token_timestamps=this._extract_token_timestamps(o,t.alignment_heads,t.num_frames)),o}_extract_token_timestamps(e,t,n=null,r=.02){if(!e.cross_attentions)throw Error("Model outputs must contain cross attentions to extract timestamps. This is most likely because the model was not exported with `output_attentions=True`.");n??console.warn("`num_frames` has not been set, meaning the entire audio will be analyzed. This may lead to inaccurate token-level timestamps for short audios (< 30 seconds).");let i=this.config.median_filter_width;i===void 0&&(console.warn("Model config has no `median_filter_width`, using default value of 7."),i=7);let a=e.cross_attentions,o=Array.from({length:this.config.decoder_layers},(e,t)=>(0,f.cat)(a.map(e=>e[t]),2)),c=(0,f.stack)(t.map(([e,t])=>{if(e>=o.length)throw Error(`Layer index ${e} is out of bounds for cross attentions (length ${o.length}).`);return n?o[e].slice(null,t,null,[0,n]):o[e].slice(null,t)})).transpose(1,0,2,3),[l,u]=(0,f.std_mean)(c,-2,0,!0),d=c.clone();for(let e=0;en[t+1]-n[t]),o=(0,s.mergeArrays)([1],a).map(e=>!!e),c=[];for(let e=0;eArray.from({length:e.dims[0]},t=>Array.from({length:e.dims[1]},e=>1))),p=t?t.tolist():[],h=n?n.tolist():[],g=0,_=0;for(let e=0;eu[e][n]==1),n=t.reduce((e,t,n)=>(t==s&&e.push(n),e),[]),r=n.map(e=>t[e+1]),f=r.filter(e=>e==a).length,v=r.filter(e=>e==o).length,y=[],b=0,x=f,S=v;for(let e=0;et>b&&e==a),n=t.findIndex((e,t)=>t>b&&e==o),r=x>0&&e!==-1?e:t.length+1,i=S>0&&n!==-1?n:t.length+1,s,l,u,d;r0?(0,m.max)(y.at(-1))[0]+1:0;y.push(Array.from({length:3*w},(e,t)=>T+t%w));let E=w+T,D=f*v*C,O=Array.from({length:D},(e,t)=>E+Math.floor(t/(v*C))),k=Array.from({length:D},(e,t)=>E+Math.floor(t/C)%v),A=Array.from({length:D},(e,t)=>E+t%C);y.push([O,k,A].flat()),b=s+D}if(b0?(0,m.max)(y.at(-1))[0]+1:0,n=t.length-b;y.push(Array.from({length:3*n},(t,r)=>e+r%n))}let C=y.reduce((e,t)=>e+t.length,0),w=Array(C),T=0;for(let e=0;e<3;++e)for(let t=0;te[n%e.length]),i=Array.from({length:t[0]},(n,r)=>(0,m.max)(e.subarray(t[1]*r,t[1]*(r+1)))[0]+1n+BigInt(t[1]));return[new f.Tensor(`int64`,n,[3,...t]),new f.Tensor(`int64`,i,[i.length,1])]}else{let[t,n]=e.dims,r=BigInt64Array.from({length:3*t*n},(e,r)=>BigInt(Math.floor(r%n/t)));return[new f.Tensor(`int64`,r,[3,...e.dims]),(0,f.zeros)([t,1])]}}async encode_image({pixel_values:e,image_grid_thw:t}){let n=(await k(this.sessions.vision_encoder,{pixel_values:e,grid_thw:t})).image_features;return n}_merge_input_ids_with_image_features(e){return oe({image_token_id:this.config.image_token_id,...e})}prepare_inputs_for_generation(e,t,n){if(t.attention_mask&&!t.position_ids)if(!t.past_key_values)[t.position_ids,t.rope_deltas]=this.get_rope_index(t.input_ids,t.image_grid_thw,t.video_grid_thw,t.attention_mask);else{t.pixel_values=null;let e=BigInt(Object.values(t.past_key_values)[0].dims.at(-2)),n=t.rope_deltas.map(t=>e+t);t.position_ids=(0,f.stack)([n,n,n],0)}return t}}class ki extends I{}class Ai extends ki{}class ji extends ki{}class Mi extends I{}class Ni extends Mi{}class Pi extends Mi{}class Fi extends I{}class Ii extends Fi{}class Li extends Fi{}class Ri extends I{}class zi extends Ri{}class Bi extends Ri{}class Vi extends I{}class Hi extends Vi{}class Ui extends Vi{}class Wi extends I{}class Gi extends Wi{}class Ki extends Wi{async _call(e){return new Q(await super._call(e))}}class qi extends I{}class Ji extends qi{}class Yi extends qi{async _call(e){return new Q(await super._call(e))}}class Xi extends I{}class Zi extends Xi{}class Qi extends I{}class $i extends Qi{}class ea extends Qi{async _call(e){return new Q(await super._call(e))}}class ta extends I{}class na extends ta{}class ra extends I{}class ia extends ra{}class aa extends ra{async _call(e){return new Q(await super._call(e))}}class oa extends I{}class sa extends oa{}class ca extends I{}class la extends ca{}class ua extends ca{async _call(e){return new Q(await super._call(e))}}class da extends I{}class fa extends da{async _call(e){return new qu(await super._call(e))}}class pa extends I{}class ma extends pa{}class ha extends pa{async _call(e){return new Q(await super._call(e))}}class ga extends I{}class _a extends ga{}class va extends ga{async _call(e){return new Q(await super._call(e))}}class ya extends I{}class ba extends ya{}class xa extends ya{}class Sa extends I{}class Ca extends Sa{}class wa extends Sa{}class Ta extends I{}class Ea extends Ta{}class Da extends Ta{async _call(e){return new Q(await super._call(e))}}class Oa extends I{}class ka extends Oa{}class Aa extends Oa{async _call(e){return new Ma(await super._call(e))}}class ja extends Oa{async _call(e){return new Na(await super._call(e))}}class Ma extends pe{constructor({logits:e,pred_boxes:t}){super(),this.logits=e,this.pred_boxes=t}}class Na extends pe{constructor({logits:e,pred_boxes:t,pred_masks:n}){super(),this.logits=e,this.pred_boxes=t,this.pred_masks=n}}class Pa extends I{}class Fa extends Pa{}class Ia extends Pa{async _call(e){return new La(await super._call(e))}}class La extends pe{constructor({logits:e,pred_boxes:t}){super(),this.logits=e,this.pred_boxes=t}}class Ra extends I{}class za extends Ra{}class Ba extends Ra{async _call(e){return new Va(await super._call(e))}}class Va extends La{}class Ha extends I{}class Ua extends Ha{}class Wa extends Ha{async _call(e){return new Ga(await super._call(e))}}class Ga extends La{}class Ka extends I{}class qa extends Ka{}class Ja extends Ka{async _call(e){return new La(await super._call(e))}}class Ya extends I{}class Xa extends Ya{}class Za extends Ya{async _call(e){return new Qa(await super._call(e))}}class Qa extends Ma{}class $a extends I{}class eo extends $a{}class to extends $a{async _call(e){return new Q(await super._call(e))}}class no extends I{}class ro extends no{}class io extends no{async _call(e){return new Q(await super._call(e))}}class ao extends I{}class oo extends ao{}class so extends ao{async _call(e){return new Q(await super._call(e))}}class co extends I{}class lo extends co{}class uo extends co{async _call(e){return new Q(await super._call(e))}}class fo extends co{}class po extends I{}class mo extends po{}class ho extends po{}class go extends I{}class _o extends go{}class vo extends go{}class yo extends I{}class bo extends yo{}class xo extends I{}class So extends xo{}class Co extends xo{}class wo extends xo{}class To extends I{}class Eo extends To{}class Do extends I{}class Oo extends Do{}class ko extends I{}class Ao extends ko{}class jo extends I{}class Mo extends jo{}class No extends jo{}class Po extends I{}class Fo extends Po{}class Io extends Po{}class Lo extends I{}class Ro extends Lo{}class zo extends I{}class Bo extends zo{}class Vo extends zo{async _call(e){return new Q(await super._call(e))}}class Ho extends I{}class Uo extends Ho{}class Wo extends Ho{async _call(e){return new Q(await super._call(e))}}class Go extends I{}class Ko extends Go{}class qo extends Go{async _call(e){return new Q(await super._call(e))}}class Jo extends I{}class Yo extends Jo{}class Xo extends Jo{async _call(e){return new Q(await super._call(e))}}class Zo extends I{}class Qo extends Zo{}class $o extends I{}class es extends $o{}class ts extends $o{async _call(e){return new ns(await super._call(e))}}class ns extends pe{constructor({logits:e,pred_boxes:t}){super(),this.logits=e,this.pred_boxes=t}}class rs extends I{}class os extends rs{async get_image_embeddings({pixel_values:e}){return await j(this,{pixel_values:e})}async forward(e){if((!e.image_embeddings||!e.image_positional_embeddings)&&(e={...e,...await this.get_image_embeddings(e)}),!e.input_labels&&e.input_points){let t=e.input_points.dims.slice(0,-1),n=t.reduce((e,t)=>e*t,1);e.input_labels=new f.Tensor(`int64`,new BigInt64Array(n).fill(1n),t)}let t={image_embeddings:e.image_embeddings,image_positional_embeddings:e.image_positional_embeddings};return e.input_points&&(t.input_points=e.input_points),e.input_labels&&(t.input_labels=e.input_labels),e.input_boxes&&(t.input_boxes=e.input_boxes),await k(this.sessions.prompt_encoder_mask_decoder,t)}async _call(e){return new ss(await super._call(e))}}class ss extends pe{constructor({iou_scores:e,pred_masks:t}){super(),this.iou_scores=e,this.pred_masks=t}}class cs extends I{}class ls extends cs{}class us extends cs{}class ds extends I{}class fs extends ds{}class ps extends ds{}class ms extends I{}class hs extends ms{}class gs extends ms{async _call(e){return new Gu(await super._call(e))}}class _s extends ms{async _call(e){return new Q(await super._call(e))}}class vs extends ms{async _call(e){return new Hu(await super._call(e))}}class ys extends I{}class bs extends ys{}class xs extends ys{async _call(e){return new Hu(await super._call(e))}}class Ss extends I{}class Cs extends Ss{}class ws extends I{}class Ts extends ws{}class Es extends ws{async _call(e){return new Gu(await super._call(e))}}class Ds extends ws{async _call(e){return new Q(await super._call(e))}}class Os extends I{}class ks extends Os{}class As extends Os{async _call(e){return new Gu(await super._call(e))}}class js extends Os{async _call(e){return new Q(await super._call(e))}}class Ms extends Os{async _call(e){return new Hu(await super._call(e))}}class Ns extends I{}class Ps extends Ns{}class Fs extends Ns{async _call(e){return new Gu(await super._call(e))}}class Is extends Ns{async _call(e){return new Q(await super._call(e))}}class Ls extends I{}class Rs extends ms{}class zs extends ms{async _call(e){return new Gu(await super._call(e))}}class Bs extends ms{async _call(e){return new Q(await super._call(e))}}class Vs extends I{}class Hs extends Vs{}class Us extends Vs{async _call(e){return new Gu(await super._call(e))}}class Ws extends Vs{async _call(e){return new Q(await super._call(e))}}class Gs extends Vs{async _call(e){return new Vu(await super._call(e))}}class Ks extends Vs{async _call(e){return new Hu(await super._call(e))}}class qs extends I{}class Js extends qs{}class Ys extends I{}class Xs extends Ys{}class Zs extends Ys{}class Qs extends Ys{async generate_speech(e,t,{threshold:n=.5,minlenratio:r=0,maxlenratio:i=20,vocoder:a=null}={}){let o={input_ids:e},{encoder_outputs:s,encoder_attention_mask:c}=await j(this,o),l=s.dims[1]/this.config.reduction_factor,u=Math.floor(l*i),d=Math.floor(l*r),p=this.config.num_mel_bins,m=[],h=null,g=null,_=0;for(;;){++_;let e=te(!!g),r;r=g?g.output_sequence_out:new f.Tensor(`float32`,new Float32Array(p),[1,1,p]);let i={use_cache_branch:e,output_sequence:r,encoder_attention_mask:c,speaker_embeddings:t,encoder_hidden_states:s};this.addPastKeyValues(i,h),g=await k(this.sessions.decoder_model_merged,i),h=this.getPastKeyValues(g,h);let{prob:a,spectrum:o}=g;if(m.push(o),_>=d&&(Array.from(a.data).filter(e=>e>=n).length>0||_>=u))break}let v=(0,f.cat)(m),{waveform:y}=await k(a.sessions.model,{spectrogram:v});return{spectrogram:v,waveform:y}}}class $s extends I{main_input_name=`spectrogram`}class ec extends I{}class tc extends ec{}class nc extends I{}class rc extends nc{}class ic extends nc{}class ac extends I{}class oc extends ac{}class sc extends ac{}class cc extends I{}class lc extends cc{}class uc extends cc{}class dc extends I{}class fc extends dc{}class pc extends dc{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`text_model`})}}class mc extends dc{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`audio_model`})}}class hc extends I{}class gc extends hc{async _call(e){return new Ju(await super._call(e))}}class _c extends I{}class vc extends _c{}class yc extends _c{}class bc extends _c{}class xc extends I{}class Sc extends xc{}class Cc extends xc{}class wc extends I{}class Tc extends wc{}class Ec extends wc{async _call(e){return new Q(await super._call(e))}}class Dc extends I{}class Oc extends Dc{}class kc extends Dc{}class Ac extends I{forward_params=[`input_ids`,`attention_mask`,`encoder_outputs`,`decoder_input_ids`,`decoder_attention_mask`,`past_key_values`];_apply_and_filter_by_delay_pattern_mask(e){let[t,n]=e.dims,r=this.config.decoder.num_codebooks,i=n-r,a=0;for(let t=0;t0&&c<=i&&(e.data[a++]=e.data[t])}let o=Math.floor(t/r),s=a/(o*r);return new f.Tensor(e.type,e.data.slice(0,a),[o,r,s])}prepare_inputs_for_generation(e,t,n){let r=structuredClone(e);for(let e=0;e=t&&(r[e][t]=BigInt(this.config.decoder.pad_token_id));n.guidance_scale!==null&&n.guidance_scale>1&&(r=r.concat(r));let i=super.prepare_inputs_for_generation(r,t,n);return i}async generate(e){let t=await super.generate(e),n=this._apply_and_filter_by_delay_pattern_mask(t).unsqueeze_(0),{audio_values:r}=await k(this.sessions.encodec_decode,{audio_codes:n});return r}}class jc extends I{}class Mc extends jc{}class Nc extends jc{async _call(e){return new Q(await super._call(e))}}class Pc extends jc{}class Fc extends I{}class Ic extends Fc{}class Lc extends Fc{async _call(e){return new Q(await super._call(e))}}class Rc extends Fc{}class zc extends I{}class Bc extends zc{}class Vc extends zc{async _call(e){return new Q(await super._call(e))}}class Hc extends zc{}class Uc extends I{}class Wc extends Uc{}class Gc extends Uc{async _call(e){return new Q(await super._call(e))}}class Kc extends Uc{}class qc extends I{}class Jc extends qc{}class Yc extends I{}class Xc extends Yc{forward_params=[`input_ids`,`pixel_values`,`images_seq_mask`,`images_emb_mask`,`attention_mask`,`position_ids`,`past_key_values`];constructor(...e){super(...e),this._generation_mode=`text`}async forward(e){let t=this._generation_mode??`text`,n;if(t===`text`||!e.past_key_values){let t=this.sessions.prepare_inputs_embeds,r=(0,s.pick)(e,t.inputNames);n=await k(t,r)}else{let t=this.sessions.gen_img_embeds,r=(0,s.pick)({image_ids:e.input_ids},t.inputNames);n=await k(t,r)}let r={...e,...n},i=await ie(this,r),a=this.sessions[t===`text`?`lm_head`:`gen_head`];if(!a)throw Error(`Unable to find "${a}" generation head`);let o=await k(a,(0,s.pick)(i,a.inputNames));return{...n,...i,...o}}async generate(e){return this._generation_mode=`text`,super.generate(e)}async generate_images(e){this._generation_mode=`image`;let t=(e.inputs??e[this.main_input_name]).dims[1],n=await super.generate(e),r=n.slice(null,[t,null]),i=this.sessions.image_decode,{decoded_image:a}=await k(i,{generated_tokens:r}),o=a.add_(1).mul_(255/2).clamp_(0,255).to(`uint8`),s=[];for(let e of o){let t=p.RawImage.fromTensor(e);s.push(t)}return s}}class Zc extends pe{constructor({char_logits:e,bpe_logits:t,wp_logits:n}){super(),this.char_logits=e,this.bpe_logits=t,this.wp_logits=n}get logits(){return[this.char_logits,this.bpe_logits,this.wp_logits]}}class Qc extends I{}class $c extends Qc{async _call(e){return new Zc(await super._call(e))}}class el extends I{}class tl extends el{}class nl extends el{}class rl extends I{}class il extends rl{}class al extends rl{}class ol extends I{forward_params=[`input_ids`,`attention_mask`,`position_ids`,`audio_values`,`past_key_values`]}class sl extends ol{_merge_input_ids_with_audio_features(e){let t=e.audio_features.dims.at(-1),n=e.audio_features.view(-1,t);return se({audio_token_id:this.config.ignore_index,...e,audio_features:n})}}class cl extends I{main_input_name=`input_values`;forward_params=[`input_values`]}class ll extends pe{constructor({audio_codes:e}){super(),this.audio_codes=e}}class ul extends pe{constructor({audio_values:e}){super(),this.audio_values=e}}class dl extends cl{async encode(e){return new ll(await k(this.sessions.encoder_model,e))}async decode(e){return new ul(await k(this.sessions.decoder_model,e))}}class fl extends cl{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`encoder_model`})}}class pl extends cl{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`decoder_model`})}}class ml extends I{main_input_name=`input_values`;forward_params=[`input_values`]}class hl extends pe{constructor({audio_codes:e}){super(),this.audio_codes=e}}class gl extends pe{constructor({audio_values:e}){super(),this.audio_values=e}}class _l extends ml{async encode(e){return new hl(await k(this.sessions.encoder_model,e))}async decode(e){return new gl(await k(this.sessions.decoder_model,e))}}class vl extends ml{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`encoder_model`})}}class yl extends ml{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`decoder_model`})}}class bl extends I{main_input_name=`input_values`;forward_params=[`input_values`]}class xl extends bl{async encode(e){return await k(this.sessions.encoder_model,e)}async decode(e){return await k(this.sessions.decoder_model,e)}}class Sl extends bl{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`encoder_model`})}}class Cl extends bl{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`decoder_model`})}}class Z{static MODEL_CLASS_MAPPINGS=null;static BASE_IF_FAIL=!1;static async from_pretrained(e,{progress_callback:t=null,config:n=null,cache_dir:i=null,local_files_only:a=!1,revision:o=`main`,model_file_name:s=null,subfolder:c=`onnx`,device:l=null,dtype:u=null,use_external_data_format:d=null,session_options:f={}}={}){let p={progress_callback:t,config:n,cache_dir:i,local_files_only:a,revision:o,model_file_name:s,subfolder:c,device:l,dtype:u,use_external_data_format:d,session_options:f};if(p.config=await r.AutoConfig.from_pretrained(e,p),!this.MODEL_CLASS_MAPPINGS)throw Error("`MODEL_CLASS_MAPPINGS` not implemented for this type of `AutoClass`: "+this.name);let m=p.config.model_type;for(let t of this.MODEL_CLASS_MAPPINGS){let n=t.get(m);if(!n){for(let e of t.values())if(e[0]===m){n=e;break}if(!n)continue}return await n[1].from_pretrained(e,p)}if(this.BASE_IF_FAIL)return cu.has(m)||console.warn(`Unknown model class "${m}", attempting to construct from base class.`),await I.from_pretrained(e,p);throw Error(`Unsupported model type: ${m}`)}}let wl=new Map([[`bert`,[`BertModel`,ge]],[`neobert`,[`NeoBertModel`,xe]],[`modernbert`,[`ModernBertModel`,De]],[`nomic_bert`,[`NomicBertModel`,Me]],[`roformer`,[`RoFormerModel`,R]],[`electra`,[`ElectraModel`,Ue]],[`esm`,[`EsmModel`,yt]],[`convbert`,[`ConvBertModel`,ze]],[`camembert`,[`CamembertModel`,Ye]],[`deberta`,[`DebertaModel`,tt]],[`deberta-v2`,[`DebertaV2Model`,st]],[`mpnet`,[`MPNetModel`,kt]],[`albert`,[`AlbertModel`,Bt]],[`distilbert`,[`DistilBertModel`,pt]],[`roberta`,[`RobertaModel`,mn]],[`xlm`,[`XLMModel`,yn]],[`xlm-roberta`,[`XLMRobertaModel`,wn]],[`clap`,[`ClapModel`,fc]],[`clip`,[`CLIPModel`,nr]],[`clipseg`,[`CLIPSegModel`,pr]],[`chinese_clip`,[`ChineseCLIPModel`,lr]],[`siglip`,[`SiglipModel`,J]],[`jina_clip`,[`JinaCLIPModel`,ur]],[`mobilebert`,[`MobileBertModel`,wt]],[`squeezebert`,[`SqueezeBertModel`,Ft]],[`wav2vec2`,[`Wav2Vec2Model`,hs]],[`wav2vec2-bert`,[`Wav2Vec2BertModel`,Ps]],[`unispeech`,[`UniSpeechModel`,Ts]],[`unispeech-sat`,[`UniSpeechSatModel`,ks]],[`hubert`,[`HubertModel`,Rs]],[`wavlm`,[`WavLMModel`,Hs]],[`audio-spectrogram-transformer`,[`ASTModel`,An]],[`vits`,[`VitsModel`,gc]],[`pyannote`,[`PyAnnoteModel`,bs]],[`wespeaker-resnet`,[`WeSpeakerResNetModel`,Cs]],[`detr`,[`DetrModel`,ka]],[`rt_detr`,[`RTDetrModel`,Fa]],[`rt_detr_v2`,[`RTDetrV2Model`,za]],[`rf_detr`,[`RFDetrModel`,Ua]],[`d_fine`,[`DFineModel`,qa]],[`table-transformer`,[`TableTransformerModel`,Xa]],[`vit`,[`ViTModel`,Gi]],[`ijepa`,[`IJepaModel`,Ji]],[`pvt`,[`PvtModel`,$i]],[`vit_msn`,[`ViTMSNModel`,ia]],[`vit_mae`,[`ViTMAEModel`,na]],[`groupvit`,[`GroupViTModel`,sa]],[`fastvit`,[`FastViTModel`,la]],[`mobilevit`,[`MobileViTModel`,ma]],[`mobilevitv2`,[`MobileViTV2Model`,_a]],[`owlvit`,[`OwlViTModel`,ba]],[`owlv2`,[`Owlv2Model`,Ca]],[`beit`,[`BeitModel`,Ea]],[`deit`,[`DeiTModel`,eo]],[`hiera`,[`HieraModel`,ro]],[`convnext`,[`ConvNextModel`,Bo]],[`convnextv2`,[`ConvNextV2Model`,Uo]],[`dinov2`,[`Dinov2Model`,Ko]],[`dinov2_with_registers`,[`Dinov2WithRegistersModel`,Yo]],[`resnet`,[`ResNetModel`,oo]],[`swin`,[`SwinModel`,lo]],[`swin2sr`,[`Swin2SRModel`,mo]],[`donut-swin`,[`DonutSwinModel`,Ro]],[`yolos`,[`YolosModel`,es]],[`dpt`,[`DPTModel`,_o]],[`glpn`,[`GLPNModel`,Fo]],[`hifigan`,[`SpeechT5HifiGan`,$s]],[`efficientnet`,[`EfficientNetModel`,Tc]],[`decision_transformer`,[`DecisionTransformerModel`,Jc]],[`patchtst`,[`PatchTSTForPrediction`,tl]],[`patchtsmixer`,[`PatchTSMixerForPrediction`,il]],[`mobilenet_v1`,[`MobileNetV1Model`,Mc]],[`mobilenet_v2`,[`MobileNetV2Model`,Ic]],[`mobilenet_v3`,[`MobileNetV3Model`,Bc]],[`mobilenet_v4`,[`MobileNetV4Model`,Wc]],[`maskformer`,[`MaskFormerModel`,Mo]],[`mgp-str`,[`MgpstrForSceneTextRecognition`,$c]],[`style_text_to_speech_2`,[`StyleTextToSpeech2Model`,Js]]]),Tl=new Map([[`t5`,[`T5Model`,Gt]],[`longt5`,[`LongT5Model`,Jt]],[`mt5`,[`MT5Model`,Zt]],[`bart`,[`BartModel`,en]],[`mbart`,[`MBartModel`,V]],[`marian`,[`MarianModel`,ls]],[`whisper`,[`WhisperModel`,Nn]],[`m2m_100`,[`M2M100Model`,fs]],[`blenderbot`,[`BlenderbotModel`,ln]],[`blenderbot-small`,[`BlenderbotSmallModel`,fn]]]),El=new Map([[`mimi`,[`MimiModel`,dl]],[`dac`,[`DacModel`,_l]],[`snac`,[`SnacModel`,xl]]]),Dl=new Map([[`bloom`,[`BloomModel`,Ii]],[`jais`,[`JAISModel`,yr]],[`gpt2`,[`GPT2Model`,gr]],[`gptj`,[`GPTJModel`,Or]],[`gpt_bigcode`,[`GPTBigCodeModel`,jr]],[`gpt_neo`,[`GPTNeoModel`,Sr]],[`gpt_neox`,[`GPTNeoXModel`,Tr]],[`codegen`,[`CodeGenModel`,Pr]],[`llama`,[`LlamaModel`,Lr]],[`exaone`,[`ExaoneModel`,Kr]],[`olmo`,[`OlmoModel`,Qr]],[`olmo2`,[`Olmo2Model`,ti]],[`mobilellm`,[`MobileLLMModel`,Yr]],[`granite`,[`GraniteModel`,ii]],[`cohere`,[`CohereModel`,si]],[`gemma`,[`GemmaModel`,ui]],[`gemma2`,[`Gemma2Model`,pi]],[`gemma3_text`,[`Gemma3Model`,gi]],[`helium`,[`HeliumModel`,Br]],[`glm`,[`GlmModel`,Ur]],[`openelm`,[`OpenELMModel`,yi]],[`qwen2`,[`Qwen2Model`,Si]],[`qwen3`,[`Qwen3Model`,Ti]],[`phi`,[`PhiModel`,Ai]],[`phi3`,[`Phi3Model`,Ni]],[`mpt`,[`MptModel`,zi]],[`opt`,[`OPTModel`,Hi]],[`mistral`,[`MistralModel`,rc]],[`starcoder2`,[`Starcoder2Model`,oc]],[`falcon`,[`FalconModel`,lc]],[`stablelm`,[`StableLmModel`,Sc]]]),Ol=new Map([[`speecht5`,[`SpeechT5ForSpeechToText`,Zs]],[`whisper`,[`WhisperForConditionalGeneration`,Pn]],[`lite-whisper`,[`LiteWhisperForConditionalGeneration`,Fn]],[`moonshine`,[`MoonshineForConditionalGeneration`,Rn]]]),kl=new Map([[`speecht5`,[`SpeechT5ForTextToSpeech`,Qs]]]),Al=new Map([[`vits`,[`VitsModel`,gc]],[`musicgen`,[`MusicgenForConditionalGeneration`,Ac]]]),jl=new Map([[`bert`,[`BertForSequenceClassification`,ve]],[`neobert`,[`NeoBertForSequenceClassification`,Ce]],[`modernbert`,[`ModernBertForSequenceClassification`,ke]],[`roformer`,[`RoFormerForSequenceClassification`,Fe]],[`electra`,[`ElectraForSequenceClassification`,Ge]],[`esm`,[`EsmForSequenceClassification`,xt]],[`convbert`,[`ConvBertForSequenceClassification`,z]],[`camembert`,[`CamembertForSequenceClassification`,Ze]],[`deberta`,[`DebertaForSequenceClassification`,rt]],[`deberta-v2`,[`DebertaV2ForSequenceClassification`,lt]],[`mpnet`,[`MPNetForSequenceClassification`,jt]],[`albert`,[`AlbertForSequenceClassification`,Vt]],[`distilbert`,[`DistilBertForSequenceClassification`,mt]],[`roberta`,[`RobertaForSequenceClassification`,U]],[`xlm`,[`XLMForSequenceClassification`,bn]],[`xlm-roberta`,[`XLMRobertaForSequenceClassification`,En]],[`bart`,[`BartForSequenceClassification`,nn]],[`mbart`,[`MBartForSequenceClassification`,on]],[`mobilebert`,[`MobileBertForSequenceClassification`,Et]],[`squeezebert`,[`SqueezeBertForSequenceClassification`,Lt]]]),Ml=new Map([[`bert`,[`BertForTokenClassification`,L]],[`neobert`,[`NeoBertForTokenClassification`,we]],[`modernbert`,[`ModernBertForTokenClassification`,Ae]],[`roformer`,[`RoFormerForTokenClassification`,Ie]],[`electra`,[`ElectraForTokenClassification`,Ke]],[`esm`,[`EsmForTokenClassification`,St]],[`convbert`,[`ConvBertForTokenClassification`,Ve]],[`camembert`,[`CamembertForTokenClassification`,Qe]],[`deberta`,[`DebertaForTokenClassification`,it]],[`deberta-v2`,[`DebertaV2ForTokenClassification`,ut]],[`mpnet`,[`MPNetForTokenClassification`,Mt]],[`distilbert`,[`DistilBertForTokenClassification`,ht]],[`roberta`,[`RobertaForTokenClassification`,gn]],[`xlm`,[`XLMForTokenClassification`,xn]],[`xlm-roberta`,[`XLMRobertaForTokenClassification`,Dn]]]),Nl=new Map([[`t5`,[`T5ForConditionalGeneration`,Kt]],[`longt5`,[`LongT5ForConditionalGeneration`,Yt]],[`mt5`,[`MT5ForConditionalGeneration`,Qt]],[`bart`,[`BartForConditionalGeneration`,tn]],[`mbart`,[`MBartForConditionalGeneration`,an]],[`marian`,[`MarianMTModel`,us]],[`m2m_100`,[`M2M100ForConditionalGeneration`,ps]],[`blenderbot`,[`BlenderbotForConditionalGeneration`,un]],[`blenderbot-small`,[`BlenderbotSmallForConditionalGeneration`,H]]]),Pl=new Map([[`bloom`,[`BloomForCausalLM`,Li]],[`gpt2`,[`GPT2LMHeadModel`,_r]],[`jais`,[`JAISLMHeadModel`,br]],[`gptj`,[`GPTJForCausalLM`,kr]],[`gpt_bigcode`,[`GPTBigCodeForCausalLM`,Mr]],[`gpt_neo`,[`GPTNeoForCausalLM`,Cr]],[`gpt_neox`,[`GPTNeoXForCausalLM`,Er]],[`codegen`,[`CodeGenForCausalLM`,Fr]],[`llama`,[`LlamaForCausalLM`,Rr]],[`exaone`,[`ExaoneForCausalLM`,qr]],[`olmo`,[`OlmoForCausalLM`,$r]],[`olmo2`,[`Olmo2ForCausalLM`,ni]],[`mobilellm`,[`MobileLLMForCausalLM`,Xr]],[`granite`,[`GraniteForCausalLM`,ai]],[`cohere`,[`CohereForCausalLM`,ci]],[`gemma`,[`GemmaForCausalLM`,di]],[`gemma2`,[`Gemma2ForCausalLM`,mi]],[`gemma3_text`,[`Gemma3ForCausalLM`,_i]],[`helium`,[`HeliumForCausalLM`,Vr]],[`glm`,[`GlmForCausalLM`,Wr]],[`openelm`,[`OpenELMForCausalLM`,bi]],[`qwen2`,[`Qwen2ForCausalLM`,Ci]],[`qwen3`,[`Qwen3ForCausalLM`,Ei]],[`phi`,[`PhiForCausalLM`,ji]],[`phi3`,[`Phi3ForCausalLM`,Pi]],[`mpt`,[`MptForCausalLM`,Bi]],[`opt`,[`OPTForCausalLM`,Ui]],[`mbart`,[`MBartForCausalLM`,sn]],[`mistral`,[`MistralForCausalLM`,ic]],[`starcoder2`,[`Starcoder2ForCausalLM`,sc]],[`falcon`,[`FalconForCausalLM`,uc]],[`trocr`,[`TrOCRForCausalLM`,tc]],[`stablelm`,[`StableLmForCausalLM`,Cc]],[`phi3_v`,[`Phi3VForCausalLM`,G]]]),Fl=new Map([[`multi_modality`,[`MultiModalityCausalLM`,Xc]]]),Il=new Map([[`bert`,[`BertForMaskedLM`,_e]],[`neobert`,[`NeoBertForMaskedLM`,Se]],[`modernbert`,[`ModernBertForMaskedLM`,Oe]],[`roformer`,[`RoFormerForMaskedLM`,Pe]],[`electra`,[`ElectraForMaskedLM`,We]],[`esm`,[`EsmForMaskedLM`,bt]],[`convbert`,[`ConvBertForMaskedLM`,Be]],[`camembert`,[`CamembertForMaskedLM`,Xe]],[`deberta`,[`DebertaForMaskedLM`,nt]],[`deberta-v2`,[`DebertaV2ForMaskedLM`,ct]],[`mpnet`,[`MPNetForMaskedLM`,At]],[`albert`,[`AlbertForMaskedLM`,Ut]],[`distilbert`,[`DistilBertForMaskedLM`,_t]],[`roberta`,[`RobertaForMaskedLM`,hn]],[`xlm`,[`XLMWithLMHeadModel`,W]],[`xlm-roberta`,[`XLMRobertaForMaskedLM`,Tn]],[`mobilebert`,[`MobileBertForMaskedLM`,Tt]],[`squeezebert`,[`SqueezeBertForMaskedLM`,It]]]),Ll=new Map([[`bert`,[`BertForQuestionAnswering`,ye]],[`neobert`,[`NeoBertForQuestionAnswering`,Te]],[`roformer`,[`RoFormerForQuestionAnswering`,Le]],[`electra`,[`ElectraForQuestionAnswering`,qe]],[`convbert`,[`ConvBertForQuestionAnswering`,He]],[`camembert`,[`CamembertForQuestionAnswering`,$e]],[`deberta`,[`DebertaForQuestionAnswering`,at]],[`deberta-v2`,[`DebertaV2ForQuestionAnswering`,dt]],[`mpnet`,[`MPNetForQuestionAnswering`,Nt]],[`albert`,[`AlbertForQuestionAnswering`,Ht]],[`distilbert`,[`DistilBertForQuestionAnswering`,gt]],[`roberta`,[`RobertaForQuestionAnswering`,_n]],[`xlm`,[`XLMForQuestionAnswering`,Sn]],[`xlm-roberta`,[`XLMRobertaForQuestionAnswering`,On]],[`mobilebert`,[`MobileBertForQuestionAnswering`,Dt]],[`squeezebert`,[`SqueezeBertForQuestionAnswering`,Rt]]]),Rl=new Map([[`vision-encoder-decoder`,[`VisionEncoderDecoderModel`,zn]],[`idefics3`,[`Idefics3ForConditionalGeneration`,Qn]],[`smolvlm`,[`SmolVLMForConditionalGeneration`,$n]]]),zl=new Map([[`llava`,[`LlavaForConditionalGeneration`,Vn]],[`llava_onevision`,[`LlavaOnevisionForConditionalGeneration`,Hn]],[`moondream1`,[`Moondream1ForConditionalGeneration`,Un]],[`florence2`,[`Florence2ForConditionalGeneration`,Gn]],[`qwen2-vl`,[`Qwen2VLForConditionalGeneration`,Oi]],[`idefics3`,[`Idefics3ForConditionalGeneration`,Qn]],[`smolvlm`,[`SmolVLMForConditionalGeneration`,$n]],[`paligemma`,[`PaliGemmaForConditionalGeneration`,qn]],[`llava_qwen2`,[`LlavaQwen2ForCausalLM`,Jn]],[`gemma3n`,[`Gemma3nForConditionalGeneration`,Xn]]]),Bl=new Map([[`ultravox`,[`UltravoxModel`,sl]]]),Vl=new Map([[`vision-encoder-decoder`,[`VisionEncoderDecoderModel`,zn]]]),Hl=new Map([[`vit`,[`ViTForImageClassification`,Ki]],[`ijepa`,[`IJepaForImageClassification`,Yi]],[`pvt`,[`PvtForImageClassification`,ea]],[`vit_msn`,[`ViTMSNForImageClassification`,aa]],[`fastvit`,[`FastViTForImageClassification`,ua]],[`mobilevit`,[`MobileViTForImageClassification`,ha]],[`mobilevitv2`,[`MobileViTV2ForImageClassification`,va]],[`beit`,[`BeitForImageClassification`,Da]],[`deit`,[`DeiTForImageClassification`,to]],[`hiera`,[`HieraForImageClassification`,io]],[`convnext`,[`ConvNextForImageClassification`,Vo]],[`convnextv2`,[`ConvNextV2ForImageClassification`,Wo]],[`dinov2`,[`Dinov2ForImageClassification`,qo]],[`dinov2_with_registers`,[`Dinov2WithRegistersForImageClassification`,Xo]],[`resnet`,[`ResNetForImageClassification`,so]],[`swin`,[`SwinForImageClassification`,uo]],[`segformer`,[`SegformerForImageClassification`,yc]],[`efficientnet`,[`EfficientNetForImageClassification`,Ec]],[`mobilenet_v1`,[`MobileNetV1ForImageClassification`,Nc]],[`mobilenet_v2`,[`MobileNetV2ForImageClassification`,Lc]],[`mobilenet_v3`,[`MobileNetV3ForImageClassification`,Vc]],[`mobilenet_v4`,[`MobileNetV4ForImageClassification`,Gc]]]),Ul=new Map([[`detr`,[`DetrForObjectDetection`,Aa]],[`rt_detr`,[`RTDetrForObjectDetection`,Ia]],[`rt_detr_v2`,[`RTDetrV2ForObjectDetection`,Ba]],[`rf_detr`,[`RFDetrForObjectDetection`,Wa]],[`d_fine`,[`DFineForObjectDetection`,Ja]],[`table-transformer`,[`TableTransformerForObjectDetection`,Za]],[`yolos`,[`YolosForObjectDetection`,ts]]]),Wl=new Map([[`owlvit`,[`OwlViTForObjectDetection`,xa]],[`owlv2`,[`Owlv2ForObjectDetection`,wa]],[`grounding-dino`,[`GroundingDinoForObjectDetection`,Qo]]]),Gl=new Map([[`detr`,[`DetrForSegmentation`,ja]],[`clipseg`,[`CLIPSegForImageSegmentation`,mr]]]),Kl=new Map([[`segformer`,[`SegformerForSemanticSegmentation`,bc]],[`sapiens`,[`SapiensForSemanticSegmentation`,So]],[`swin`,[`SwinForSemanticSegmentation`,fo]],[`mobilenet_v1`,[`MobileNetV1ForSemanticSegmentation`,Pc]],[`mobilenet_v2`,[`MobileNetV2ForSemanticSegmentation`,Rc]],[`mobilenet_v3`,[`MobileNetV3ForSemanticSegmentation`,Hc]],[`mobilenet_v4`,[`MobileNetV4ForSemanticSegmentation`,Kc]]]),ql=new Map([[`detr`,[`DetrForSegmentation`,ja]],[`maskformer`,[`MaskFormerForInstanceSegmentation`,No]]]),Jl=new Map([[`sam`,[`SamModel`,os]]]),Yl=new Map([[`wav2vec2`,[`Wav2Vec2ForCTC`,gs]],[`wav2vec2-bert`,[`Wav2Vec2BertForCTC`,Fs]],[`unispeech`,[`UniSpeechForCTC`,Es]],[`unispeech-sat`,[`UniSpeechSatForCTC`,As]],[`wavlm`,[`WavLMForCTC`,Us]],[`hubert`,[`HubertForCTC`,zs]]]),Xl=new Map([[`wav2vec2`,[`Wav2Vec2ForSequenceClassification`,_s]],[`wav2vec2-bert`,[`Wav2Vec2BertForSequenceClassification`,Is]],[`unispeech`,[`UniSpeechForSequenceClassification`,Ds]],[`unispeech-sat`,[`UniSpeechSatForSequenceClassification`,js]],[`wavlm`,[`WavLMForSequenceClassification`,Ws]],[`hubert`,[`HubertForSequenceClassification`,Bs]],[`audio-spectrogram-transformer`,[`ASTForAudioClassification`,jn]]]),Zl=new Map([[`wavlm`,[`WavLMForXVector`,Gs]]]),Ql=new Map([[`unispeech-sat`,[`UniSpeechSatForAudioFrameClassification`,Ms]],[`wavlm`,[`WavLMForAudioFrameClassification`,Ks]],[`wav2vec2`,[`Wav2Vec2ForAudioFrameClassification`,vs]],[`pyannote`,[`PyAnnoteForAudioFrameClassification`,xs]]]),$l=new Map([[`vitmatte`,[`VitMatteForImageMatting`,fa]]]),eu=new Map([[`patchtst`,[`PatchTSTForPrediction`,nl]],[`patchtsmixer`,[`PatchTSMixerForPrediction`,al]]]),tu=new Map([[`swin2sr`,[`Swin2SRForImageSuperResolution`,ho]]]),nu=new Map([[`dpt`,[`DPTForDepthEstimation`,vo]],[`depth_anything`,[`DepthAnythingForDepthEstimation`,bo]],[`glpn`,[`GLPNForDepthEstimation`,Io]],[`sapiens`,[`SapiensForDepthEstimation`,Co]],[`depth_pro`,[`DepthProForDepthEstimation`,Eo]],[`metric3d`,[`Metric3DForDepthEstimation`,Oo]],[`metric3dv2`,[`Metric3Dv2ForDepthEstimation`,Ao]]]),ru=new Map([[`sapiens`,[`SapiensForNormalEstimation`,wo]]]),iu=new Map([[`vitpose`,[`VitPoseForPoseEstimation`,Zi]]]),au=new Map([[`clip`,[`CLIPVisionModelWithProjection`,ar]],[`siglip`,[`SiglipVisionModel`,sr]],[`jina_clip`,[`JinaCLIPVisionModel`,fr]]]),ou=[[wl,b.EncoderOnly],[Tl,b.EncoderDecoder],[Dl,b.DecoderOnly],[El,b.AutoEncoder],[jl,b.EncoderOnly],[Ml,b.EncoderOnly],[Nl,b.Seq2Seq],[Ol,b.Seq2Seq],[Pl,b.DecoderOnly],[Fl,b.MultiModality],[Il,b.EncoderOnly],[Ll,b.EncoderOnly],[Rl,b.Vision2Seq],[zl,b.ImageTextToText],[Bl,b.AudioTextToText],[Hl,b.EncoderOnly],[Gl,b.EncoderOnly],[ql,b.EncoderOnly],[Kl,b.EncoderOnly],[$l,b.EncoderOnly],[eu,b.EncoderOnly],[tu,b.EncoderOnly],[nu,b.EncoderOnly],[ru,b.EncoderOnly],[iu,b.EncoderOnly],[Ul,b.EncoderOnly],[Wl,b.EncoderOnly],[Jl,b.MaskGeneration],[Yl,b.EncoderOnly],[Xl,b.EncoderOnly],[kl,b.Seq2Seq],[Al,b.EncoderOnly],[Zl,b.EncoderOnly],[Ql,b.EncoderOnly],[au,b.EncoderOnly]];for(let[e,t]of ou)for(let[n,r]of e.values())x.set(n,t),C.set(r,n),S.set(n,r);let su=[[`MusicgenForConditionalGeneration`,Ac,b.Musicgen],[`Phi3VForCausalLM`,G,b.Phi3V],[`CLIPTextModelWithProjection`,ir,b.EncoderOnly],[`SiglipTextModel`,or,b.EncoderOnly],[`JinaCLIPTextModel`,dr,b.EncoderOnly],[`ClapTextModelWithProjection`,pc,b.EncoderOnly],[`ClapAudioModelWithProjection`,mc,b.EncoderOnly],[`DacEncoderModel`,vl,b.EncoderOnly],[`DacDecoderModel`,yl,b.EncoderOnly],[`MimiEncoderModel`,fl,b.EncoderOnly],[`MimiDecoderModel`,pl,b.EncoderOnly],[`SnacEncoderModel`,Sl,b.EncoderOnly],[`SnacDecoderModel`,Cl,b.EncoderOnly],[`Gemma3nForConditionalGeneration`,Xn,b.ImageAudioTextToText]];for(let[e,t,n]of su)x.set(e,n),C.set(t,e),S.set(e,t);let cu=new Map([[`modnet`,Gl],[`birefnet`,Gl],[`isnet`,Gl],[`ben`,Gl]]);for(let[e,t]of cu.entries())t.set(e,[`PreTrainedModel`,I]),x.set(e,b.EncoderOnly),C.set(I,e),S.set(e,I);class lu extends Z{static MODEL_CLASS_MAPPINGS=ou.map(e=>e[0]);static BASE_IF_FAIL=!0}class uu extends Z{static MODEL_CLASS_MAPPINGS=[jl]}class du extends Z{static MODEL_CLASS_MAPPINGS=[Ml]}class fu extends Z{static MODEL_CLASS_MAPPINGS=[Nl]}class pu extends Z{static MODEL_CLASS_MAPPINGS=[Ol]}class mu extends Z{static MODEL_CLASS_MAPPINGS=[kl]}class hu extends Z{static MODEL_CLASS_MAPPINGS=[Al]}class gu extends Z{static MODEL_CLASS_MAPPINGS=[Pl]}class _u extends Z{static MODEL_CLASS_MAPPINGS=[Il]}class vu extends Z{static MODEL_CLASS_MAPPINGS=[Ll]}class yu extends Z{static MODEL_CLASS_MAPPINGS=[Rl]}class bu extends Z{static MODEL_CLASS_MAPPINGS=[Hl]}class xu extends Z{static MODEL_CLASS_MAPPINGS=[Gl]}class Su extends Z{static MODEL_CLASS_MAPPINGS=[Kl]}class Cu extends Z{static MODEL_CLASS_MAPPINGS=[ql]}class wu extends Z{static MODEL_CLASS_MAPPINGS=[Ul]}class Tu extends Z{static MODEL_CLASS_MAPPINGS=[Wl]}class Eu extends Z{static MODEL_CLASS_MAPPINGS=[Jl]}class Du extends Z{static MODEL_CLASS_MAPPINGS=[Yl]}class Ou extends Z{static MODEL_CLASS_MAPPINGS=[Xl]}class ku extends Z{static MODEL_CLASS_MAPPINGS=[Zl]}class Au extends Z{static MODEL_CLASS_MAPPINGS=[Ql]}class ju extends Z{static MODEL_CLASS_MAPPINGS=[Vl]}class Mu extends Z{static MODEL_CLASS_MAPPINGS=[$l]}class Nu extends Z{static MODEL_CLASS_MAPPINGS=[tu]}class Pu extends Z{static MODEL_CLASS_MAPPINGS=[nu]}class Fu extends Z{static MODEL_CLASS_MAPPINGS=[ru]}class Iu extends Z{static MODEL_CLASS_MAPPINGS=[iu]}class Lu extends Z{static MODEL_CLASS_MAPPINGS=[au]}class Ru extends Z{static MODEL_CLASS_MAPPINGS=[zl]}class zu extends Z{static MODEL_CLASS_MAPPINGS=[Bl]}class Bu extends pe{constructor({logits:e,past_key_values:t,encoder_outputs:n,decoder_attentions:r=null,cross_attentions:i=null}){super(),this.logits=e,this.past_key_values=t,this.encoder_outputs=n,this.decoder_attentions=r,this.cross_attentions=i}}class Q extends pe{constructor({logits:e,...t}){super(),this.logits=e;let n=Object.values(t);n.length>0&&(this.attentions=n)}}class Vu extends pe{constructor({logits:e,embeddings:t}){super(),this.logits=e,this.embeddings=t}}class Hu extends pe{constructor({logits:e}){super(),this.logits=e}}class Uu extends pe{constructor({logits:e}){super(),this.logits=e}}class Wu extends pe{constructor({start_logits:e,end_logits:t}){super(),this.start_logits=e,this.end_logits=t}}class Gu extends pe{constructor({logits:e}){super(),this.logits=e}}class Ku extends pe{constructor({logits:e,past_key_values:t}){super(),this.logits=e,this.past_key_values=t}}class qu extends pe{constructor({alphas:e}){super(),this.alphas=e}}class Ju extends pe{constructor({waveform:e,spectrogram:t}){super(),this.waveform=e,this.spectrogram=t}}},"./src/models/audio_spectrogram_transformer/feature_extraction_audio_spectrogram_transformer.js":(e,t,n)=>{n.r(t),n.d(t,{ASTFeatureExtractor:()=>o});var r=n( +`./src/models/whisper/common_whisper.js`);let b={EncoderOnly:0,EncoderDecoder:1,Seq2Seq:2,Vision2Seq:3,DecoderOnly:4,MaskGeneration:5,ImageTextToText:6,Musicgen:7,MultiModality:8,Phi3V:9,AudioTextToText:10,AutoEncoder:11,ImageAudioTextToText:12},x=new Map,S=new Map,C=new Map;async function w(e,t,n){let o=n.config?.[`transformers.js_config`]??{},s=n.device??o.device;s&&typeof s!=`string`&&(s.hasOwnProperty(t)?s=s[t]:(console.warn(`device not specified for "${t}". Using the default device.`),s=null));let l=s??(_.apis.IS_NODE_ENV?`cpu`:`wasm`),u=(0,i.deviceToExecutionProviders)(l),d=o.device_config??{};d.hasOwnProperty(l)&&(o={...o,...d[l]});let f=n.dtype??o.dtype;if(typeof f!=`string`&&(f&&f.hasOwnProperty(t)?f=f[t]:(f=a.DEFAULT_DEVICE_DTYPE_MAPPING[l]??a.DATA_TYPES.fp32,console.warn(`dtype not specified for "${t}". Using the default dtype (${f}) for this device (${l}).`))),f===a.DATA_TYPES.auto){let e=o.dtype;typeof e!=`string`&&(e=e?.[t]),f=e&&e!==a.DATA_TYPES.auto&&a.DATA_TYPES.hasOwnProperty(e)?e:a.DEFAULT_DEVICE_DTYPE_MAPPING[l]??a.DATA_TYPES.fp32}let p=f;if(a.DEFAULT_DTYPE_SUFFIX_MAPPING.hasOwnProperty(p)){if(p===a.DATA_TYPES.fp16&&l===`webgpu`&&!await(0,a.isWebGpuFp16Supported)())throw Error(`The device (${l}) does not support fp16.`)}else throw Error(`Invalid dtype: ${p}. Should be one of: ${Object.keys(a.DATA_TYPES).join(`, `)}`);let m=o.kv_cache_dtype,h=m?typeof m==`string`?m:m[p]??`float32`:void 0;if(h&&![`float32`,`float16`].includes(h))throw Error(`Invalid kv_cache_dtype: ${h}. Should be one of: float32, float16`);let g={dtype:p,kv_cache_dtype:h,device:l},v=a.DEFAULT_DTYPE_SUFFIX_MAPPING[p],y=`${t}${v}.onnx`,b=`${n.subfolder??``}/${y}`,x={...n.session_options};x.executionProviders??=u;let S=o.free_dimension_overrides;S?x.freeDimensionOverrides??=S:l.startsWith(`webnn`)&&!x.freeDimensionOverrides&&console.warn(`WebNN does not currently support dynamic shapes and requires 'free_dimension_overrides' to be set in config.json, preferably as a field within config["transformers.js_config"]["device_config"]["${l}"]. When 'free_dimension_overrides' is not set, you may experience significant performance degradation.`);let C=_.apis.IS_NODE_ENV&&_.env.useFSCache,w=(0,c.getModelFile)(e,b,!0,n,C),T=n.use_external_data_format??o.use_external_data_format,E=[];if(T){let r;r=typeof T==`object`?T.hasOwnProperty(y)?T[y]:T.hasOwnProperty(t)?T[t]:!1:T;let i=+r;if(i>c.MAX_EXTERNAL_DATA_CHUNKS)throw Error(`The number of external data chunks (${i}) exceeds the maximum allowed value (${c.MAX_EXTERNAL_DATA_CHUNKS}).`);for(let t=0;t{let o=await(0,c.getModelFile)(e,i,!0,n,C);t(o instanceof Uint8Array?{path:r,data:o}:r)}))}}else x.externalData!==void 0&&(E=x.externalData.map(async t=>{if(typeof t.data==`string`){let r=await(0,c.getModelFile)(e,t.data,!0,n);return{...t,data:r}}return t}));if(E.length>0){let e=await Promise.all(E);_.apis.IS_NODE_ENV||(x.externalData=e)}if(l===`webgpu`){let e=(0,r.getKeyValueShapes)(n.config,{prefix:`present`});if(Object.keys(e).length>0&&!(0,i.isONNXProxy)()){let t={};for(let n in e)t[n]=`gpu-buffer`;x.preferredOutputLocation=t}}let D=await w;return{buffer_or_path:D,session_options:x,session_config:g}}async function T(e,t,n){return Object.fromEntries(await Promise.all(Object.keys(t).map(async r=>{let{buffer_or_path:a,session_options:o,session_config:s}=await w(e,t[r],n),c=await(0,i.createInferenceSession)(a,o,s);return[r,c]})))}async function E(e,t,n){return Object.fromEntries(await Promise.all(Object.keys(t).map(async r=>{let i=await(0,c.getModelJSON)(e,t[r],!1,n);return[r,i]})))}function D(e,t){let n=Object.create(null),r=[];for(let a of e.inputNames){let e=t[a];if(!(e instanceof f.Tensor)){r.push(a);continue}n[a]=(0,i.isONNXProxy)()?e.clone():e}if(r.length>0)throw Error(`An error occurred during model execution: "Missing the following inputs: ${r.join(`, `)}.`);let a=Object.keys(t).length,o=e.inputNames.length;if(a>o){let n=Object.keys(t).filter(t=>!e.inputNames.includes(t));console.warn(`WARNING: Too many inputs were provided (${a} > ${o}). The following inputs will be ignored: "${n.join(`, `)}".`)}return n}let O=Promise.resolve();async function k(e,t){let n=D(e,t);try{let t=Object.fromEntries(Object.entries(n).map(([e,t])=>[e,t.ort_tensor])),r=()=>e.run(t),i=await(_.apis.IS_BROWSER_ENV||_.apis.IS_WEBWORKER_ENV?O=O.then(r):r());return A(i)}catch(e){let t=Object.fromEntries(Object.entries(n).map(([e,t])=>{let n={type:t.type,dims:t.dims,location:t.location};return n.location!==`gpu-buffer`&&(n.data=t.data),[e,n]}));throw console.error(`An error occurred during model execution: "${e}".`),console.error(`Inputs given to model:`,t),e}}function A(e){for(let t in e)(0,i.isONNXTensor)(e[t])?e[t]=new f.Tensor(e[t]):typeof e[t]==`object`&&A(e[t]);return e}function ee(e){if(e instanceof f.Tensor)return e;if(e.length===0)throw Error(`items must be non-empty`);if(Array.isArray(e[0])){if(e.some(t=>t.length!==e[0].length))throw Error(`Unable to create tensor, you should probably activate truncation and/or padding with 'padding=True' and/or 'truncation=True' to have batched tensors with the same length.`);return new f.Tensor(`int64`,BigInt64Array.from(e.flat().map(e=>BigInt(e))),[e.length,e[0].length])}else return new f.Tensor(`int64`,BigInt64Array.from(e.map(e=>BigInt(e))),[1,e.length])}function te(e){return new f.Tensor(`bool`,[e],[1])}async function ne(e,t){let{encoder_outputs:n,input_ids:r,decoder_input_ids:i,...a}=t;if(!n){let r=(0,s.pick)(t,e.sessions.model.inputNames);n=(await j(e,r)).last_hidden_state}a.input_ids=i,a.encoder_hidden_states=n,e.sessions.decoder_model_merged.inputNames.includes(`encoder_attention_mask`)&&(a.encoder_attention_mask=t.attention_mask);let o=await ie(e,a,!0);return o}async function j(e,t){let n=e.sessions.model,r=(0,s.pick)(t,n.inputNames);if(n.inputNames.includes(`inputs_embeds`)&&!r.inputs_embeds){if(!t.input_ids)throw Error("Both `input_ids` and `inputs_embeds` are missing in the model inputs.");r.inputs_embeds=await e.encode_text({input_ids:t.input_ids})}if(n.inputNames.includes(`token_type_ids`)&&!r.token_type_ids){if(!r.input_ids)throw Error("Both `input_ids` and `token_type_ids` are missing in the model inputs.");r.token_type_ids=(0,f.zeros_like)(r.input_ids)}if(n.inputNames.includes(`pixel_mask`)&&!r.pixel_mask){if(!r.pixel_values)throw Error("Both `pixel_values` and `pixel_mask` are missing in the model inputs.");let e=r.pixel_values.dims;r.pixel_mask=(0,f.ones)([e[0],e[2],e[3]])}return await k(n,r)}async function re(e,t){let n=await e.encode(t),r=await e.decode(n);return r}async function ie(e,t,n=!1){let r=e.sessions[n?`decoder_model_merged`:`model`],{past_key_values:i,...a}=t;if(r.inputNames.includes(`use_cache_branch`)&&(a.use_cache_branch=te(!!i)),r.inputNames.includes(`position_ids`)&&a.attention_mask&&!a.position_ids){let t=[`paligemma`,`gemma3_text`,`gemma3`].includes(e.config.model_type)?1:0;a.position_ids=ue(a,i,t)}e.addPastKeyValues(a,i);let o=(0,s.pick)(a,r.inputNames);return await k(r,o)}function ae({modality_token_id:e,inputs_embeds:t,modality_features:n,input_ids:r,attention_mask:i}){let a=r.tolist().map(t=>t.reduce((t,n,r)=>(n==e&&t.push(r),t),[])),o=a.reduce((e,t)=>e+t.length,0),s=n.dims[0];if(o!==s)throw Error(`Number of tokens and features do not match: tokens: ${o}, features ${s}`);let c=0;for(let e=0;ee.dims[1]||i[e.at(-1)])),{...n,decoder_input_ids:ee(t)}}function P(e,...t){return e.config.is_encoder_decoder?fe(e,...t):de(e,...t)}function pe(e,t,n,r){let i=!!n.past_key_values;if(r.guidance_scale!==null&&r.guidance_scale>1&&(i?n.input_ids=(0,f.cat)([n.input_ids,n.input_ids],0):(n.input_ids=(0,f.cat)([n.input_ids,(0,f.full_like)(n.input_ids,BigInt(r.pad_token_id))],0),n.attention_mask=(0,f.cat)([n.attention_mask,(0,f.full_like)(n.attention_mask,0n)],0))),(i||!n.pixel_values)&&(n.pixel_values=(0,f.full)([0,0,3,384,384],1)),i){let e=0,t=1,r=e>0?1:0,i=1;n.images_seq_mask=new f.Tensor(`bool`,Array(e+t).fill(!0).fill(!1,0,t),[i,e+t]),n.images_emb_mask=new f.Tensor(`bool`,Array(e).fill(!!r),[i,1,e])}return n}class F extends o.Callable{main_input_name=`input_ids`;forward_params=[`input_ids`,`attention_mask`];constructor(e,t,n){super(),this.config=e,this.sessions=t,this.configs=n;let r=C.get(this.constructor),i=x.get(r);switch(this.can_generate=!1,this._forward=null,this._prepare_inputs_for_generation=null,i){case b.DecoderOnly:this.can_generate=!0,this._forward=ie,this._prepare_inputs_for_generation=de;break;case b.Seq2Seq:case b.Vision2Seq:case b.Musicgen:this.can_generate=!0,this._forward=ne,this._prepare_inputs_for_generation=fe;break;case b.EncoderDecoder:this._forward=ne;break;case b.ImageTextToText:this.can_generate=!0,this._forward=ce,this._prepare_inputs_for_generation=P;break;case b.AudioTextToText:this.can_generate=!0,this._forward=N,this._prepare_inputs_for_generation=P;break;case b.Phi3V:case b.ImageAudioTextToText:this.can_generate=!0,this._prepare_inputs_for_generation=P;break;case b.MultiModality:this.can_generate=!0,this._prepare_inputs_for_generation=pe;break;case b.AutoEncoder:this._forward=re;break;default:this._forward=j;break}this.can_generate&&this.forward_params.push(`past_key_values`),this.custom_config=this.config[`transformers.js_config`]??{}}async dispose(){let e=[];for(let t of Object.values(this.sessions))t?.handler?.dispose&&e.push(t.handler.dispose());return await Promise.all(e)}static async from_pretrained(e,{progress_callback:t=null,config:n=null,cache_dir:i=null,local_files_only:a=!1,revision:o=`main`,model_file_name:s=null,subfolder:c=`onnx`,device:u=null,dtype:d=null,use_external_data_format:f=null,session_options:p={}}={}){let m={progress_callback:t,config:n,cache_dir:i,local_files_only:a,revision:o,model_file_name:s,subfolder:c,device:u,dtype:d,use_external_data_format:f,session_options:p},h=C.get(this),g=x.get(h);n=m.config=await r.AutoConfig.from_pretrained(e,m);let _;if(g===b.DecoderOnly)_=await Promise.all([T(e,{model:m.model_file_name??`model`},m),E(e,{generation_config:`generation_config.json`},m)]);else if(g===b.Seq2Seq||g===b.Vision2Seq)_=await Promise.all([T(e,{model:`encoder_model`,decoder_model_merged:`decoder_model_merged`},m),E(e,{generation_config:`generation_config.json`},m)]);else if(g===b.MaskGeneration)_=await Promise.all([T(e,{model:`vision_encoder`,prompt_encoder_mask_decoder:`prompt_encoder_mask_decoder`},m)]);else if(g===b.EncoderDecoder)_=await Promise.all([T(e,{model:`encoder_model`,decoder_model_merged:`decoder_model_merged`},m)]);else if(g===b.ImageTextToText){let t={embed_tokens:`embed_tokens`,vision_encoder:`vision_encoder`,decoder_model_merged:`decoder_model_merged`};n.is_encoder_decoder&&(t.model=`encoder_model`),_=await Promise.all([T(e,t,m),E(e,{generation_config:`generation_config.json`},m)])}else if(g===b.AudioTextToText){let t={embed_tokens:`embed_tokens`,audio_encoder:`audio_encoder`,decoder_model_merged:`decoder_model_merged`};_=await Promise.all([T(e,t,m),E(e,{generation_config:`generation_config.json`},m)])}else if(g===b.ImageAudioTextToText){let t={embed_tokens:`embed_tokens`,audio_encoder:`audio_encoder`,vision_encoder:`vision_encoder`,decoder_model_merged:`decoder_model_merged`};_=await Promise.all([T(e,t,m),E(e,{generation_config:`generation_config.json`},m)])}else if(g===b.Musicgen)_=await Promise.all([T(e,{model:`text_encoder`,decoder_model_merged:`decoder_model_merged`,encodec_decode:`encodec_decode`},m),E(e,{generation_config:`generation_config.json`},m)]);else if(g===b.MultiModality)_=await Promise.all([T(e,{prepare_inputs_embeds:`prepare_inputs_embeds`,model:`language_model`,lm_head:`lm_head`,gen_head:`gen_head`,gen_img_embeds:`gen_img_embeds`,image_decode:`image_decode`},m),E(e,{generation_config:`generation_config.json`},m)]);else if(g===b.Phi3V)_=await Promise.all([T(e,{prepare_inputs_embeds:`prepare_inputs_embeds`,model:`model`,vision_encoder:`vision_encoder`},m),E(e,{generation_config:`generation_config.json`},m)]);else if(g===b.AutoEncoder)_=await Promise.all([T(e,{encoder_model:`encoder_model`,decoder_model:`decoder_model`},m)]);else{if(g!==b.EncoderOnly){let e=h??n?.model_type;e!==`custom`&&console.warn(`Model type for '${e}' not found, assuming encoder-only architecture. Please report this at ${l.GITHUB_ISSUE_URL}.`)}_=await Promise.all([T(e,{model:m.model_file_name??`model`},m)])}return new this(n,..._)}async _call(e){return await this.forward(e)}async forward(e){return await this._forward(this,e)}get generation_config(){return this.configs?.generation_config??null}_get_logits_warper(e){let t=new u.LogitsProcessorList;return e.temperature!==null&&e.temperature!==1&&t.push(new u.TemperatureLogitsWarper(e.temperature)),e.top_k!==null&&e.top_k!==0&&t.push(new u.TopKLogitsWarper(e.top_k)),e.top_p!==null&&e.top_p<1&&t.push(new u.TopPLogitsWarper(e.top_p)),t}_get_logits_processor(e,t,n=null){let r=new u.LogitsProcessorList;if(e.repetition_penalty!==null&&e.repetition_penalty!==1&&r.push(new u.RepetitionPenaltyLogitsProcessor(e.repetition_penalty)),e.no_repeat_ngram_size!==null&&e.no_repeat_ngram_size>0&&r.push(new u.NoRepeatNGramLogitsProcessor(e.no_repeat_ngram_size)),e.bad_words_ids!==null&&r.push(new u.NoBadWordsLogitsProcessor(e.bad_words_ids,e.eos_token_id)),e.min_length!==null&&e.eos_token_id!==null&&e.min_length>0&&r.push(new u.MinLengthLogitsProcessor(e.min_length,e.eos_token_id)),e.min_new_tokens!==null&&e.eos_token_id!==null&&e.min_new_tokens>0&&r.push(new u.MinNewTokensLengthLogitsProcessor(t,e.min_new_tokens,e.eos_token_id)),e.forced_bos_token_id!==null&&r.push(new u.ForcedBOSTokenLogitsProcessor(e.forced_bos_token_id)),e.forced_eos_token_id!==null&&r.push(new u.ForcedEOSTokenLogitsProcessor(e.max_length,e.forced_eos_token_id)),e.begin_suppress_tokens!==null){let n=t>1||e.forced_bos_token_id===null?t:t+1;r.push(new u.SuppressTokensAtBeginLogitsProcessor(e.begin_suppress_tokens,n))}return e.guidance_scale!==null&&e.guidance_scale>1&&r.push(new u.ClassifierFreeGuidanceLogitsProcessor(e.guidance_scale)),n!==null&&r.extend(n),r}_prepare_generation_config(e,t,n=d.GenerationConfig){let r={...this.config};for(let e of[`decoder`,`generator`,`text_config`])e in r&&Object.assign(r,r[e]);let i=new n(r);return Object.assign(i,this.generation_config??{}),e&&Object.assign(i,e),t&&Object.assign(i,(0,s.pick)(t,Object.getOwnPropertyNames(i))),i}_get_stopping_criteria(e,t=null){let n=new h.StoppingCriteriaList;return e.max_length!==null&&n.push(new h.MaxLengthCriteria(e.max_length,this.config.max_position_embeddings??null)),e.eos_token_id!==null&&n.push(new h.EosTokenCriteria(e.eos_token_id)),t&&n.extend(t),n}_validate_model_class(){if(!this.can_generate){let e=[Bl,Wl,zl,Pl],t=C.get(this.constructor),n=new Set,r=this.config.model_type;for(let t of e){let e=t.get(r);e&&n.add(e[0])}let i=`The current model class (${t}) is not compatible with \`.generate()\`, as it doesn't have a language model head.`;throw n.size>0&&(i+=` Please use the following class instead: ${[...n].join(`, `)}`),Error(i)}}prepare_inputs_for_generation(...e){return this._prepare_inputs_for_generation(this,...e)}_update_model_kwargs_for_generation({generated_input_ids:e,outputs:t,model_inputs:n,is_encoder_decoder:r}){return n.past_key_values=this.getPastKeyValues(t,n.past_key_values),n.input_ids=new f.Tensor(`int64`,e.flat(),[e.length,1]),r?`decoder_attention_mask`in n:n.attention_mask=(0,f.cat)([n.attention_mask,(0,f.ones)([n.attention_mask.dims[0],1])],1),n.position_ids=null,n}_prepare_model_inputs({inputs:e,bos_token_id:t,model_kwargs:n}){let r=(0,s.pick)(n,this.forward_params),i=this.main_input_name;if(i in r){if(e)throw Error("`inputs`: {inputs}` were passed alongside {input_name} which is not allowed. Make sure to either pass {inputs} or {input_name}=...")}else r[i]=e;let a=r[i];return{inputs_tensor:a,model_inputs:r,model_input_name:i}}async _prepare_encoder_decoder_kwargs_for_generation({inputs_tensor:e,model_inputs:t,model_input_name:n,generation_config:r}){if(this.sessions.model.inputNames.includes(`inputs_embeds`)&&!t.inputs_embeds&&`_prepare_inputs_embeds`in this){let{input_ids:e,pixel_values:n,attention_mask:r,...i}=t,a=await this._prepare_inputs_embeds(t);t={...i,...(0,s.pick)(a,[`inputs_embeds`,`attention_mask`])}}let{last_hidden_state:i}=await j(this,t);if(r.guidance_scale!==null&&r.guidance_scale>1)i=(0,f.cat)([i,(0,f.full_like)(i,0)],0),`attention_mask`in t&&(t.attention_mask=(0,f.cat)([t.attention_mask,(0,f.zeros_like)(t.attention_mask)],0));else if(t.decoder_input_ids){let e=ee(t.decoder_input_ids).dims[0];if(e!==i.dims[0]){if(i.dims[0]!==1)throw Error(`The encoder outputs have a different batch size (${i.dims[0]}) than the decoder inputs (${e}).`);i=(0,f.cat)(Array.from({length:e},()=>i),0)}}return t.encoder_outputs=i,t}_prepare_decoder_input_ids_for_generation({batch_size:e,model_input_name:t,model_kwargs:n,decoder_start_token_id:r,bos_token_id:i,generation_config:a}){let{decoder_input_ids:o,...s}=n;if(!(o instanceof f.Tensor)){if(o)Array.isArray(o[0])||(o=Array.from({length:e},()=>o));else if(r??=i,this.config.model_type===`musicgen`)o=Array.from({length:e*this.config.decoder.num_codebooks},()=>[r]);else if(Array.isArray(r)){if(r.length!==e)throw Error(`\`decoder_start_token_id\` expcted to have length ${e} but got ${r.length}`);o=r}else o=Array.from({length:e},()=>[r]);o=ee(o)}return n.decoder_attention_mask=(0,f.ones_like)(o),{input_ids:o,model_inputs:s}}async generate({inputs:e=null,generation_config:t=null,logits_processor:n=null,stopping_criteria:r=null,streamer:i=null,...a}){this._validate_model_class(),t=this._prepare_generation_config(t,a);let{inputs_tensor:o,model_inputs:s,model_input_name:c}=this._prepare_model_inputs({inputs:e,model_kwargs:a}),l=this.config.is_encoder_decoder;l&&(`encoder_outputs`in s||(s=await this._prepare_encoder_decoder_kwargs_for_generation({inputs_tensor:o,model_inputs:s,model_input_name:c,generation_config:t})));let u;l?{input_ids:u,model_inputs:s}=this._prepare_decoder_input_ids_for_generation({batch_size:s[c].dims.at(0),model_input_name:c,model_kwargs:s,decoder_start_token_id:t.decoder_start_token_id,bos_token_id:t.bos_token_id,generation_config:t}):u=s[c];let d=u.dims.at(-1);t.max_new_tokens!==null&&(t.max_length=d+t.max_new_tokens);let p=this._get_logits_processor(t,d,n),m=this._get_stopping_criteria(t,r),h=s[c].dims.at(0),_=g.LogitsSampler.getSampler(t),v=Array(h).fill(0),y=u.tolist();i&&i.put(y);let b,x={};for(;;){if(s=this.prepare_inputs_for_generation(y,s,t),b=await this.forward(s),t.output_attentions&&t.return_dict_in_generate){let e=this.getAttentions(b);for(let t in e)t in x||(x[t]=[]),x[t].push(e[t])}let e=b.logits.slice(null,-1,null),n=p(y,e),r=[];for(let e=0;ee))break;s=this._update_model_kwargs_for_generation({generated_input_ids:r,outputs:b,model_inputs:s,is_encoder_decoder:l})}i&&i.end();let S=this.getPastKeyValues(b,s.past_key_values,!0),C=new f.Tensor(`int64`,y.flat(),[y.length,y[0].length]);if(t.return_dict_in_generate)return{sequences:C,past_key_values:S,...x};for(let e of Object.values(b))e.location===`gpu-buffer`&&e.dispose();return C}getPastKeyValues(e,t,n=!1){let r=Object.create(null);for(let i in e)if(i.startsWith(`present`)){let a=i.replace(`present`,`past_key_values`),o=i.includes(`encoder`);if(o&&t?r[a]=t[a]:r[a]=e[i],t&&(!o||n)){let e=t[a];e.location===`gpu-buffer`&&e.dispose()}}return r}getAttentions(e){let t={};for(let n of[`cross_attentions`,`encoder_attentions`,`decoder_attentions`])for(let r in e)r.startsWith(n)&&(n in t||(t[n]=[]),t[n].push(e[r]));return t}addPastKeyValues(e,t){if(t)Object.assign(e,t);else{let t=this.sessions.decoder_model_merged??this.sessions.model,n=t?.config?.kv_cache_dtype??`float32`,i=n===`float16`?new f.DataTypeMap.float16:[],a=(e[this.main_input_name]??e.attention_mask)?.dims?.[0]??1,o=(0,r.getKeyValueShapes)(this.config,{batch_size:a});for(let t in o)e[t]=new f.Tensor(n,i,o[t])}}async encode_image({pixel_values:e}){return(await k(this.sessions.vision_encoder,{pixel_values:e})).image_features}async encode_text({input_ids:e}){return(await k(this.sessions.embed_tokens,{input_ids:e})).inputs_embeds}async encode_audio({audio_values:e}){return(await k(this.sessions.audio_encoder,{audio_values:e})).audio_features}}class me{}class he extends me{constructor({last_hidden_state:e,hidden_states:t=null,attentions:n=null}){super(),this.last_hidden_state=e,this.hidden_states=t,this.attentions=n}}class ge extends F{}class I extends ge{}class _e extends ge{async _call(e){return new Yu(await super._call(e))}}class L extends ge{async _call(e){return new Q(await super._call(e))}}class R extends ge{async _call(e){return new Ju(await super._call(e))}}class ve extends ge{async _call(e){return new Xu(await super._call(e))}}class ye extends F{}class z extends ye{}class be extends ye{async _call(e){return new Yu(await super._call(e))}}class xe extends ye{async _call(e){return new Q(await super._call(e))}}class Se extends ye{async _call(e){return new Ju(await super._call(e))}}class B extends ye{async _call(e){return new Xu(await super._call(e))}}class Ce extends F{}class we extends Ce{}class Te extends Ce{async _call(e){return new Yu(await super._call(e))}}class Ee extends Ce{async _call(e){return new Q(await super._call(e))}}class De extends Ce{async _call(e){return new Ju(await super._call(e))}}class Oe extends F{}class ke extends Oe{}class Ae extends F{}class je extends Ae{}class Me extends Ae{async _call(e){return new Yu(await super._call(e))}}class Ne extends Ae{async _call(e){return new Q(await super._call(e))}}class Pe extends Ae{async _call(e){return new Ju(await super._call(e))}}class Fe extends Ae{async _call(e){return new Xu(await super._call(e))}}class Ie extends F{}class Le extends Ie{}class Re extends Ie{async _call(e){return new Yu(await super._call(e))}}class V extends Ie{async _call(e){return new Q(await super._call(e))}}class ze extends Ie{async _call(e){return new Ju(await super._call(e))}}class Be extends Ie{async _call(e){return new Xu(await super._call(e))}}class H extends F{}class Ve extends H{}class He extends H{async _call(e){return new Yu(await super._call(e))}}class Ue extends H{async _call(e){return new Q(await super._call(e))}}class We extends H{async _call(e){return new Ju(await super._call(e))}}class Ge extends H{async _call(e){return new Xu(await super._call(e))}}class Ke extends F{}class qe extends Ke{}class Je extends Ke{async _call(e){return new Yu(await super._call(e))}}class Ye extends Ke{async _call(e){return new Q(await super._call(e))}}class Xe extends Ke{async _call(e){return new Ju(await super._call(e))}}class Ze extends Ke{async _call(e){return new Xu(await super._call(e))}}class Qe extends F{}class $e extends Qe{}class et extends Qe{async _call(e){return new Yu(await super._call(e))}}class tt extends Qe{async _call(e){return new Q(await super._call(e))}}class nt extends Qe{async _call(e){return new Ju(await super._call(e))}}class rt extends Qe{async _call(e){return new Xu(await super._call(e))}}class it extends F{}class at extends it{}class ot extends it{async _call(e){return new Yu(await super._call(e))}}class st extends it{async _call(e){return new Q(await super._call(e))}}class ct extends it{async _call(e){return new Ju(await super._call(e))}}class lt extends it{async _call(e){return new Xu(await super._call(e))}}class ut extends F{}class dt extends ut{}class ft extends ut{async _call(e){return new Q(await super._call(e))}}class pt extends ut{async _call(e){return new Ju(await super._call(e))}}class mt extends ut{async _call(e){return new Xu(await super._call(e))}}class ht extends ut{async _call(e){return new Yu(await super._call(e))}}class gt extends F{}class _t extends gt{}class vt extends gt{async _call(e){return new Yu(await super._call(e))}}class yt extends gt{async _call(e){return new Q(await super._call(e))}}class bt extends gt{async _call(e){return new Ju(await super._call(e))}}class xt extends F{}class St extends xt{}class Ct extends xt{async _call(e){return new Yu(await super._call(e))}}class wt extends xt{async _call(e){return new Q(await super._call(e))}}class Tt extends xt{async _call(e){return new Xu(await super._call(e))}}class Et extends F{}class Dt extends Et{}class Ot extends Et{async _call(e){return new Yu(await super._call(e))}}class kt extends Et{async _call(e){return new Q(await super._call(e))}}class At extends Et{async _call(e){return new Ju(await super._call(e))}}class jt extends Et{async _call(e){return new Xu(await super._call(e))}}class Mt extends F{}class Nt extends Mt{}class Pt extends Mt{async _call(e){return new Yu(await super._call(e))}}class Ft extends Mt{async _call(e){return new Q(await super._call(e))}}class It extends Mt{async _call(e){return new Xu(await super._call(e))}}class Lt extends F{}class Rt extends Lt{}class zt extends Lt{async _call(e){return new Q(await super._call(e))}}class Bt extends Lt{async _call(e){return new Xu(await super._call(e))}}class Vt extends Lt{async _call(e){return new Yu(await super._call(e))}}class Ht extends F{forward_params=[`input_ids`,`attention_mask`,`encoder_outputs`,`decoder_input_ids`,`decoder_attention_mask`,`past_key_values`]}class Ut extends Ht{}class Wt extends Ht{}class Gt extends F{}class Kt extends Gt{}class qt extends Gt{}class Jt extends F{}class Yt extends Jt{}class Xt extends Jt{}class Zt extends F{}class Qt extends Zt{}class $t extends Zt{}class en extends Zt{async _call(e){return new Q(await super._call(e))}}class tn extends F{}class U extends tn{}class nn extends tn{}class rn extends tn{async _call(e){return new Q(await super._call(e))}}class an extends tn{}class on extends F{}class sn extends on{}class cn extends on{}class ln extends F{}class un extends ln{}class dn extends ln{}class fn extends F{}class pn extends fn{}class mn extends fn{async _call(e){return new Yu(await super._call(e))}}class W extends fn{async _call(e){return new Q(await super._call(e))}}class hn extends fn{async _call(e){return new Ju(await super._call(e))}}class gn extends fn{async _call(e){return new Xu(await super._call(e))}}class _n extends F{}class vn extends _n{}class G extends _n{async _call(e){return new Yu(await super._call(e))}}class yn extends _n{async _call(e){return new Q(await super._call(e))}}class bn extends _n{async _call(e){return new Ju(await super._call(e))}}class xn extends _n{async _call(e){return new Xu(await super._call(e))}}class Sn extends F{}class Cn extends Sn{}class wn extends Sn{async _call(e){return new Yu(await super._call(e))}}class Tn extends Sn{async _call(e){return new Q(await super._call(e))}}class En extends Sn{async _call(e){return new Ju(await super._call(e))}}class Dn extends Sn{async _call(e){return new Xu(await super._call(e))}}class On extends F{}class kn extends On{}class An extends On{}class jn extends F{requires_attention_mask=!1;main_input_name=`input_features`;forward_params=[`input_features`,`attention_mask`,`decoder_input_ids`,`decoder_attention_mask`,`past_key_values`]}class Mn extends jn{}class Nn extends jn{_prepare_generation_config(e,t){return super._prepare_generation_config(e,t,v.WhisperGenerationConfig)}_retrieve_init_tokens(e){let t=[e.decoder_start_token_id],n=e.language,r=e.task;if(e.is_multilingual){n||(console.warn(`No language specified - defaulting to English (en).`),n=`en`);let i=(0,y.whisper_language_to_code)(n),a=`<|${i}|>`;t.push(e.lang_to_id[a]),t.push(e.task_to_id[r??`transcribe`])}else if(n||r)throw Error("Cannot specify `task` or `language` for an English-only model. If the model is intended to be multilingual, pass `is_multilingual=true` to generate, or update the generation config.");return!e.return_timestamps&&e.no_timestamps_token_id&&t.at(-1)!==e.no_timestamps_token_id?t.push(e.no_timestamps_token_id):e.return_timestamps&&t.at(-1)===e.no_timestamps_token_id&&(console.warn("<|notimestamps|> prompt token is removed from generation_config since `return_timestamps` is set to `true`."),t.pop()),t.filter(e=>e!=null)}async generate({inputs:e=null,generation_config:t=null,logits_processor:n=null,stopping_criteria:r=null,...i}){t=this._prepare_generation_config(t,i);let a=i.decoder_input_ids??this._retrieve_init_tokens(t);if(t.return_timestamps&&(n??=new u.LogitsProcessorList,n.push(new u.WhisperTimeStampLogitsProcessor(t,a))),t.begin_suppress_tokens&&(n??=new u.LogitsProcessorList,n.push(new u.SuppressTokensAtBeginLogitsProcessor(t.begin_suppress_tokens,a.length))),t.return_token_timestamps){if(!t.alignment_heads)throw Error("Model generation config has no `alignment_heads`, token-level timestamps not available. See https://gist.github.com/hollance/42e32852f24243b748ae6bc1f985b13a on how to add this property to the generation config.");t.task===`translate`&&console.warn(`Token-level timestamps may not be reliable for task 'translate'.`),t.output_attentions=!0,t.return_dict_in_generate=!0}let o=await super.generate({inputs:e,generation_config:t,logits_processor:n,decoder_input_ids:a,...i});return t.return_token_timestamps&&(o.token_timestamps=this._extract_token_timestamps(o,t.alignment_heads,t.num_frames)),o}_extract_token_timestamps(e,t,n=null,r=.02){if(!e.cross_attentions)throw Error("Model outputs must contain cross attentions to extract timestamps. This is most likely because the model was not exported with `output_attentions=True`.");n??console.warn("`num_frames` has not been set, meaning the entire audio will be analyzed. This may lead to inaccurate token-level timestamps for short audios (< 30 seconds).");let i=this.config.median_filter_width;i===void 0&&(console.warn("Model config has no `median_filter_width`, using default value of 7."),i=7);let a=e.cross_attentions,o=Array.from({length:this.config.decoder_layers},(e,t)=>(0,f.cat)(a.map(e=>e[t]),2)),c=(0,f.stack)(t.map(([e,t])=>{if(e>=o.length)throw Error(`Layer index ${e} is out of bounds for cross attentions (length ${o.length}).`);return n?o[e].slice(null,t,null,[0,n]):o[e].slice(null,t)})).transpose(1,0,2,3),[l,u]=(0,f.std_mean)(c,-2,0,!0),d=c.clone();for(let e=0;en[t+1]-n[t]),o=(0,s.mergeArrays)([1],a).map(e=>!!e),c=[];for(let e=0;eArray.from({length:e.dims[0]},t=>Array.from({length:e.dims[1]},e=>1))),p=t?t.tolist():[],h=n?n.tolist():[],g=0,_=0;for(let e=0;eu[e][n]==1),n=t.reduce((e,t,n)=>(t==s&&e.push(n),e),[]),r=n.map(e=>t[e+1]),f=r.filter(e=>e==a).length,v=r.filter(e=>e==o).length,y=[],b=0,x=f,S=v;for(let e=0;et>b&&e==a),n=t.findIndex((e,t)=>t>b&&e==o),r=x>0&&e!==-1?e:t.length+1,i=S>0&&n!==-1?n:t.length+1,s,l,u,d;r0?(0,m.max)(y.at(-1))[0]+1:0;y.push(Array.from({length:3*w},(e,t)=>T+t%w));let E=w+T,D=f*v*C,O=Array.from({length:D},(e,t)=>E+Math.floor(t/(v*C))),k=Array.from({length:D},(e,t)=>E+Math.floor(t/C)%v),A=Array.from({length:D},(e,t)=>E+t%C);y.push([O,k,A].flat()),b=s+D}if(b0?(0,m.max)(y.at(-1))[0]+1:0,n=t.length-b;y.push(Array.from({length:3*n},(t,r)=>e+r%n))}let C=y.reduce((e,t)=>e+t.length,0),w=Array(C),T=0;for(let e=0;e<3;++e)for(let t=0;te[n%e.length]),i=Array.from({length:t[0]},(n,r)=>(0,m.max)(e.subarray(t[1]*r,t[1]*(r+1)))[0]+1n+BigInt(t[1]));return[new f.Tensor(`int64`,n,[3,...t]),new f.Tensor(`int64`,i,[i.length,1])]}else{let[t,n]=e.dims,r=BigInt64Array.from({length:3*t*n},(e,r)=>BigInt(Math.floor(r%n/t)));return[new f.Tensor(`int64`,r,[3,...e.dims]),(0,f.zeros)([t,1])]}}async encode_image({pixel_values:e,image_grid_thw:t}){let n=(await k(this.sessions.vision_encoder,{pixel_values:e,grid_thw:t})).image_features;return n}_merge_input_ids_with_image_features(e){return oe({image_token_id:this.config.image_token_id,...e})}prepare_inputs_for_generation(e,t,n){if(t.attention_mask&&!t.position_ids)if(!t.past_key_values)[t.position_ids,t.rope_deltas]=this.get_rope_index(t.input_ids,t.image_grid_thw,t.video_grid_thw,t.attention_mask);else{t.pixel_values=null;let e=BigInt(Object.values(t.past_key_values)[0].dims.at(-2)),n=t.rope_deltas.map(t=>e+t);t.position_ids=(0,f.stack)([n,n,n],0)}return t}}class ji extends F{}class Mi extends ji{}class Ni extends ji{}class Pi extends F{}class Fi extends Pi{}class Ii extends Pi{}class Li extends F{}class Ri extends Li{}class zi extends Li{}class Bi extends F{}class Vi extends Bi{}class Hi extends Bi{}class Ui extends F{}class Wi extends Ui{}class Gi extends Ui{}class Ki extends F{}class qi extends Ki{}class Ji extends Ki{async _call(e){return new Q(await super._call(e))}}class Yi extends F{}class Xi extends Yi{}class Zi extends Yi{async _call(e){return new Q(await super._call(e))}}class Qi extends F{}class $i extends Qi{}class ea extends F{}class ta extends ea{}class na extends ea{async _call(e){return new Q(await super._call(e))}}class ra extends F{}class ia extends ra{}class aa extends F{}class oa extends aa{}class sa extends aa{async _call(e){return new Q(await super._call(e))}}class ca extends F{}class la extends ca{}class ua extends F{}class da extends ua{}class fa extends ua{async _call(e){return new Q(await super._call(e))}}class pa extends F{}class ma extends pa{async _call(e){return new $u(await super._call(e))}}class ha extends F{}class ga extends ha{}class _a extends ha{async _call(e){return new Q(await super._call(e))}}class va extends F{}class ya extends va{}class ba extends va{async _call(e){return new Q(await super._call(e))}}class xa extends F{}class Sa extends xa{}class Ca extends xa{}class wa extends F{}class Ta extends wa{}class Ea extends wa{}class Da extends F{}class Oa extends Da{}class ka extends Da{async _call(e){return new Q(await super._call(e))}}class Aa extends F{}class ja extends Aa{}class Ma extends Aa{async _call(e){return new Pa(await super._call(e))}}class Na extends Aa{async _call(e){return new Fa(await super._call(e))}}class Pa extends me{constructor({logits:e,pred_boxes:t}){super(),this.logits=e,this.pred_boxes=t}}class Fa extends me{constructor({logits:e,pred_boxes:t,pred_masks:n}){super(),this.logits=e,this.pred_boxes=t,this.pred_masks=n}}class Ia extends F{}class La extends Ia{}class Ra extends Ia{async _call(e){return new za(await super._call(e))}}class za extends me{constructor({logits:e,pred_boxes:t}){super(),this.logits=e,this.pred_boxes=t}}class Ba extends F{}class Va extends Ba{}class Ha extends Ba{async _call(e){return new Ua(await super._call(e))}}class Ua extends za{}class Wa extends F{}class Ga extends Wa{}class Ka extends Wa{async _call(e){return new qa(await super._call(e))}}class qa extends za{}class Ja extends F{}class Ya extends Ja{}class Xa extends Ja{async _call(e){return new za(await super._call(e))}}class Za extends F{}class Qa extends Za{}class $a extends Za{async _call(e){return new eo(await super._call(e))}}class eo extends Pa{}class to extends F{}class no extends to{}class ro extends to{async _call(e){return new Q(await super._call(e))}}class io extends F{}class ao extends io{}class oo extends io{async _call(e){return new Q(await super._call(e))}}class so extends F{}class co extends so{}class lo extends so{async _call(e){return new Q(await super._call(e))}}class uo extends F{}class fo extends uo{}class po extends uo{async _call(e){return new Q(await super._call(e))}}class mo extends uo{}class ho extends F{}class go extends ho{}class _o extends ho{}class vo extends F{}class yo extends vo{}class bo extends vo{}class xo extends F{}class So extends xo{}class Co extends F{}class wo extends Co{}class To extends Co{}class Eo extends Co{}class Do extends F{}class Oo extends Do{}class ko extends F{}class Ao extends ko{}class jo extends F{}class Mo extends jo{}class No extends F{}class Po extends No{}class Fo extends No{}class Io extends F{}class Lo extends Io{}class Ro extends Io{}class zo extends F{}class Bo extends zo{}class Vo extends F{}class Ho extends Vo{}class Uo extends Vo{async _call(e){return new Q(await super._call(e))}}class Wo extends F{}class Go extends Wo{}class Ko extends Wo{async _call(e){return new Q(await super._call(e))}}class qo extends F{}class Jo extends qo{}class Yo extends qo{async _call(e){return new Q(await super._call(e))}}class Xo extends F{}class Zo extends Xo{}class Qo extends Xo{async _call(e){return new Q(await super._call(e))}}class $o extends F{}class es extends $o{}class ts extends F{}class ns extends ts{}class rs extends ts{async _call(e){return new os(await super._call(e))}}class os extends me{constructor({logits:e,pred_boxes:t}){super(),this.logits=e,this.pred_boxes=t}}class ss extends F{}class cs extends ss{async get_image_embeddings({pixel_values:e}){return await j(this,{pixel_values:e})}async forward(e){if((!e.image_embeddings||!e.image_positional_embeddings)&&(e={...e,...await this.get_image_embeddings(e)}),!e.input_labels&&e.input_points){let t=e.input_points.dims.slice(0,-1),n=t.reduce((e,t)=>e*t,1);e.input_labels=new f.Tensor(`int64`,new BigInt64Array(n).fill(1n),t)}let t={image_embeddings:e.image_embeddings,image_positional_embeddings:e.image_positional_embeddings};return e.input_points&&(t.input_points=e.input_points),e.input_labels&&(t.input_labels=e.input_labels),e.input_boxes&&(t.input_boxes=e.input_boxes),await k(this.sessions.prompt_encoder_mask_decoder,t)}async _call(e){return new ls(await super._call(e))}}class ls extends me{constructor({iou_scores:e,pred_masks:t}){super(),this.iou_scores=e,this.pred_masks=t}}class us extends F{}class ds extends us{}class fs extends us{}class ps extends F{}class ms extends ps{}class hs extends ps{}class gs extends F{}class _s extends gs{}class vs extends gs{async _call(e){return new Zu(await super._call(e))}}class ys extends gs{async _call(e){return new Q(await super._call(e))}}class bs extends gs{async _call(e){return new Ju(await super._call(e))}}class xs extends F{}class Ss extends xs{}class Cs extends xs{async _call(e){return new Ju(await super._call(e))}}class ws extends F{}class Ts extends ws{}class Es extends F{}class Ds extends Es{}class Os extends Es{async _call(e){return new Zu(await super._call(e))}}class ks extends Es{async _call(e){return new Q(await super._call(e))}}class As extends F{}class js extends As{}class Ms extends As{async _call(e){return new Zu(await super._call(e))}}class Ns extends As{async _call(e){return new Q(await super._call(e))}}class Ps extends As{async _call(e){return new Ju(await super._call(e))}}class Fs extends F{}class Is extends Fs{}class Ls extends Fs{async _call(e){return new Zu(await super._call(e))}}class Rs extends Fs{async _call(e){return new Q(await super._call(e))}}class zs extends F{}class Bs extends gs{}class Vs extends gs{async _call(e){return new Zu(await super._call(e))}}class Hs extends gs{async _call(e){return new Q(await super._call(e))}}class Us extends F{}class Ws extends Us{}class Gs extends Us{async _call(e){return new Zu(await super._call(e))}}class Ks extends Us{async _call(e){return new Q(await super._call(e))}}class qs extends Us{async _call(e){return new qu(await super._call(e))}}class Js extends Us{async _call(e){return new Ju(await super._call(e))}}class Ys extends F{}class Xs extends Ys{}class Zs extends F{}class Qs extends Zs{}class $s extends Zs{}class ec extends Zs{async generate_speech(e,t,{threshold:n=.5,minlenratio:r=0,maxlenratio:i=20,vocoder:a=null}={}){let o={input_ids:e},{encoder_outputs:s,encoder_attention_mask:c}=await j(this,o),l=s.dims[1]/this.config.reduction_factor,u=Math.floor(l*i),d=Math.floor(l*r),p=this.config.num_mel_bins,m=[],h=null,g=null,_=0;for(;;){++_;let e=te(!!g),r;r=g?g.output_sequence_out:new f.Tensor(`float32`,new Float32Array(p),[1,1,p]);let i={use_cache_branch:e,output_sequence:r,encoder_attention_mask:c,speaker_embeddings:t,encoder_hidden_states:s};this.addPastKeyValues(i,h),g=await k(this.sessions.decoder_model_merged,i),h=this.getPastKeyValues(g,h);let{prob:a,spectrum:o}=g;if(m.push(o),_>=d&&(Array.from(a.data).filter(e=>e>=n).length>0||_>=u))break}let v=(0,f.cat)(m),{waveform:y}=await k(a.sessions.model,{spectrogram:v});return{spectrogram:v,waveform:y}}}class tc extends F{main_input_name=`spectrogram`}class nc extends F{}class rc extends nc{}class ic extends F{}class ac extends ic{}class oc extends ic{}class sc extends F{}class cc extends sc{}class lc extends sc{}class uc extends F{}class dc extends uc{}class fc extends uc{}class pc extends F{}class mc extends pc{}class hc extends pc{}class gc extends F{}class _c extends gc{}class vc extends gc{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`text_model`})}}class yc extends gc{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`audio_model`})}}class bc extends F{}class xc extends bc{async _call(e){return new ed(await super._call(e))}}class Sc extends F{}class Cc extends Sc{}class wc extends Sc{}class Tc extends Sc{}class Ec extends F{}class Dc extends Ec{}class Oc extends Ec{}class kc extends F{}class Ac extends kc{}class jc extends kc{async _call(e){return new Q(await super._call(e))}}class Mc extends F{}class Nc extends Mc{}class Pc extends Mc{}class Fc extends F{forward_params=[`input_ids`,`attention_mask`,`encoder_outputs`,`decoder_input_ids`,`decoder_attention_mask`,`past_key_values`];_apply_and_filter_by_delay_pattern_mask(e){let[t,n]=e.dims,r=this.config.decoder.num_codebooks,i=n-r,a=0;for(let t=0;t0&&c<=i&&(e.data[a++]=e.data[t])}let o=Math.floor(t/r),s=a/(o*r);return new f.Tensor(e.type,e.data.slice(0,a),[o,r,s])}prepare_inputs_for_generation(e,t,n){let r=structuredClone(e);for(let e=0;e=t&&(r[e][t]=BigInt(this.config.decoder.pad_token_id));n.guidance_scale!==null&&n.guidance_scale>1&&(r=r.concat(r));let i=super.prepare_inputs_for_generation(r,t,n);return i}async generate(e){let t=await super.generate(e),n=this._apply_and_filter_by_delay_pattern_mask(t).unsqueeze_(0),{audio_values:r}=await k(this.sessions.encodec_decode,{audio_codes:n});return r}}class Ic extends F{}class Lc extends Ic{}class Rc extends Ic{async _call(e){return new Q(await super._call(e))}}class zc extends Ic{}class Bc extends F{}class Vc extends Bc{}class Hc extends Bc{async _call(e){return new Q(await super._call(e))}}class Uc extends Bc{}class Wc extends F{}class Gc extends Wc{}class Kc extends Wc{async _call(e){return new Q(await super._call(e))}}class qc extends Wc{}class Jc extends F{}class Yc extends Jc{}class Xc extends Jc{async _call(e){return new Q(await super._call(e))}}class Zc extends Jc{}class Qc extends F{}class $c extends Qc{}class el extends F{}class tl extends el{forward_params=[`input_ids`,`pixel_values`,`images_seq_mask`,`images_emb_mask`,`attention_mask`,`position_ids`,`past_key_values`];constructor(...e){super(...e),this._generation_mode=`text`}async forward(e){let t=this._generation_mode??`text`,n;if(t===`text`||!e.past_key_values){let t=this.sessions.prepare_inputs_embeds,r=(0,s.pick)(e,t.inputNames);n=await k(t,r)}else{let t=this.sessions.gen_img_embeds,r=(0,s.pick)({image_ids:e.input_ids},t.inputNames);n=await k(t,r)}let r={...e,...n},i=await ie(this,r),a=this.sessions[t===`text`?`lm_head`:`gen_head`];if(!a)throw Error(`Unable to find "${a}" generation head`);let o=await k(a,(0,s.pick)(i,a.inputNames));return{...n,...i,...o}}async generate(e){return this._generation_mode=`text`,super.generate(e)}async generate_images(e){this._generation_mode=`image`;let t=(e.inputs??e[this.main_input_name]).dims[1],n=await super.generate(e),r=n.slice(null,[t,null]),i=this.sessions.image_decode,{decoded_image:a}=await k(i,{generated_tokens:r}),o=a.add_(1).mul_(255/2).clamp_(0,255).to(`uint8`),s=[];for(let e of o){let t=p.RawImage.fromTensor(e);s.push(t)}return s}}class nl extends me{constructor({char_logits:e,bpe_logits:t,wp_logits:n}){super(),this.char_logits=e,this.bpe_logits=t,this.wp_logits=n}get logits(){return[this.char_logits,this.bpe_logits,this.wp_logits]}}class rl extends F{}class il extends rl{async _call(e){return new nl(await super._call(e))}}class al extends F{}class ol extends al{}class sl extends al{}class cl extends F{}class ll extends cl{}class ul extends cl{}class dl extends F{forward_params=[`input_ids`,`attention_mask`,`position_ids`,`audio_values`,`past_key_values`]}class fl extends dl{_merge_input_ids_with_audio_features(e){let t=e.audio_features.dims.at(-1),n=e.audio_features.view(-1,t);return se({audio_token_id:this.config.ignore_index,...e,audio_features:n})}}class pl extends F{main_input_name=`input_values`;forward_params=[`input_values`]}class ml extends me{constructor({audio_codes:e}){super(),this.audio_codes=e}}class hl extends me{constructor({audio_values:e}){super(),this.audio_values=e}}class gl extends pl{async encode(e){return new ml(await k(this.sessions.encoder_model,e))}async decode(e){return new hl(await k(this.sessions.decoder_model,e))}}class _l extends pl{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`encoder_model`})}}class vl extends pl{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`decoder_model`})}}class yl extends F{main_input_name=`input_values`;forward_params=[`input_values`]}class bl extends me{constructor({audio_codes:e}){super(),this.audio_codes=e}}class xl extends me{constructor({audio_values:e}){super(),this.audio_values=e}}class Sl extends yl{async encode(e){return new bl(await k(this.sessions.encoder_model,e))}async decode(e){return new xl(await k(this.sessions.decoder_model,e))}}class Cl extends yl{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`encoder_model`})}}class wl extends yl{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`decoder_model`})}}class Tl extends F{main_input_name=`input_values`;forward_params=[`input_values`]}class El extends Tl{async encode(e){return await k(this.sessions.encoder_model,e)}async decode(e){return await k(this.sessions.decoder_model,e)}}class Dl extends Tl{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`encoder_model`})}}class Ol extends Tl{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`decoder_model`})}}class kl{static MODEL_CLASS_MAPPINGS=null;static BASE_IF_FAIL=!1;static async from_pretrained(e,{progress_callback:t=null,config:n=null,cache_dir:i=null,local_files_only:a=!1,revision:o=`main`,model_file_name:s=null,subfolder:c=`onnx`,device:l=null,dtype:u=null,use_external_data_format:d=null,session_options:f={}}={}){let p={progress_callback:t,config:n,cache_dir:i,local_files_only:a,revision:o,model_file_name:s,subfolder:c,device:l,dtype:u,use_external_data_format:d,session_options:f};if(p.config=await r.AutoConfig.from_pretrained(e,p),!this.MODEL_CLASS_MAPPINGS)throw Error("`MODEL_CLASS_MAPPINGS` not implemented for this type of `AutoClass`: "+this.name);let m=p.config.model_type;for(let t of this.MODEL_CLASS_MAPPINGS){let n=t.get(m);if(!n){for(let e of t.values())if(e[0]===m){n=e;break}if(!n)continue}return await n[1].from_pretrained(e,p)}if(this.BASE_IF_FAIL)return mu.has(m)||console.warn(`Unknown model class "${m}", attempting to construct from base class.`),await F.from_pretrained(e,p);throw Error(`Unsupported model type: ${m}`)}}let Al=new Map([[`bert`,[`BertModel`,I]],[`neobert`,[`NeoBertModel`,z]],[`modernbert`,[`ModernBertModel`,we]],[`nomic_bert`,[`NomicBertModel`,ke]],[`roformer`,[`RoFormerModel`,je]],[`electra`,[`ElectraModel`,Ve]],[`esm`,[`EsmModel`,_t]],[`convbert`,[`ConvBertModel`,Le]],[`camembert`,[`CamembertModel`,qe]],[`deberta`,[`DebertaModel`,$e]],[`deberta-v2`,[`DebertaV2Model`,at]],[`mpnet`,[`MPNetModel`,Dt]],[`albert`,[`AlbertModel`,Rt]],[`distilbert`,[`DistilBertModel`,dt]],[`roberta`,[`RobertaModel`,pn]],[`xlm`,[`XLMModel`,vn]],[`xlm-roberta`,[`XLMRobertaModel`,Cn]],[`clap`,[`ClapModel`,_c]],[`clip`,[`CLIPModel`,tr]],[`clipseg`,[`CLIPSegModel`,fr]],[`chinese_clip`,[`ChineseCLIPModel`,cr]],[`siglip`,[`SiglipModel`,Y]],[`jina_clip`,[`JinaCLIPModel`,lr]],[`mobilebert`,[`MobileBertModel`,St]],[`squeezebert`,[`SqueezeBertModel`,Nt]],[`wav2vec2`,[`Wav2Vec2Model`,_s]],[`wav2vec2-bert`,[`Wav2Vec2BertModel`,Is]],[`unispeech`,[`UniSpeechModel`,Ds]],[`unispeech-sat`,[`UniSpeechSatModel`,js]],[`hubert`,[`HubertModel`,Bs]],[`wavlm`,[`WavLMModel`,Ws]],[`audio-spectrogram-transformer`,[`ASTModel`,kn]],[`vits`,[`VitsModel`,xc]],[`pyannote`,[`PyAnnoteModel`,Ss]],[`wespeaker-resnet`,[`WeSpeakerResNetModel`,Ts]],[`detr`,[`DetrModel`,ja]],[`rt_detr`,[`RTDetrModel`,La]],[`rt_detr_v2`,[`RTDetrV2Model`,Va]],[`rf_detr`,[`RFDetrModel`,Ga]],[`d_fine`,[`DFineModel`,Ya]],[`table-transformer`,[`TableTransformerModel`,Qa]],[`vit`,[`ViTModel`,qi]],[`ijepa`,[`IJepaModel`,Xi]],[`pvt`,[`PvtModel`,ta]],[`vit_msn`,[`ViTMSNModel`,oa]],[`vit_mae`,[`ViTMAEModel`,ia]],[`groupvit`,[`GroupViTModel`,la]],[`fastvit`,[`FastViTModel`,da]],[`mobilevit`,[`MobileViTModel`,ga]],[`mobilevitv2`,[`MobileViTV2Model`,ya]],[`owlvit`,[`OwlViTModel`,Sa]],[`owlv2`,[`Owlv2Model`,Ta]],[`beit`,[`BeitModel`,Oa]],[`deit`,[`DeiTModel`,no]],[`hiera`,[`HieraModel`,ao]],[`convnext`,[`ConvNextModel`,Ho]],[`convnextv2`,[`ConvNextV2Model`,Go]],[`dinov2`,[`Dinov2Model`,Jo]],[`dinov2_with_registers`,[`Dinov2WithRegistersModel`,Zo]],[`resnet`,[`ResNetModel`,co]],[`swin`,[`SwinModel`,fo]],[`swin2sr`,[`Swin2SRModel`,go]],[`donut-swin`,[`DonutSwinModel`,Bo]],[`yolos`,[`YolosModel`,ns]],[`dpt`,[`DPTModel`,yo]],[`glpn`,[`GLPNModel`,Lo]],[`hifigan`,[`SpeechT5HifiGan`,tc]],[`efficientnet`,[`EfficientNetModel`,Ac]],[`decision_transformer`,[`DecisionTransformerModel`,$c]],[`patchtst`,[`PatchTSTForPrediction`,ol]],[`patchtsmixer`,[`PatchTSMixerForPrediction`,ll]],[`mobilenet_v1`,[`MobileNetV1Model`,Lc]],[`mobilenet_v2`,[`MobileNetV2Model`,Vc]],[`mobilenet_v3`,[`MobileNetV3Model`,Gc]],[`mobilenet_v4`,[`MobileNetV4Model`,Yc]],[`maskformer`,[`MaskFormerModel`,Po]],[`mgp-str`,[`MgpstrForSceneTextRecognition`,il]],[`style_text_to_speech_2`,[`StyleTextToSpeech2Model`,Xs]]]),jl=new Map([[`t5`,[`T5Model`,Ut]],[`longt5`,[`LongT5Model`,Kt]],[`mt5`,[`MT5Model`,Yt]],[`bart`,[`BartModel`,Qt]],[`mbart`,[`MBartModel`,U]],[`marian`,[`MarianModel`,ds]],[`whisper`,[`WhisperModel`,Mn]],[`m2m_100`,[`M2M100Model`,ms]],[`blenderbot`,[`BlenderbotModel`,sn]],[`blenderbot-small`,[`BlenderbotSmallModel`,un]]]),Ml=new Map([[`mimi`,[`MimiModel`,gl]],[`dac`,[`DacModel`,Sl]],[`snac`,[`SnacModel`,El]]]),Nl=new Map([[`bloom`,[`BloomModel`,Ri]],[`jais`,[`JAISModel`,vr]],[`gpt2`,[`GPT2Model`,hr]],[`gptj`,[`GPTJModel`,Dr]],[`gpt_bigcode`,[`GPTBigCodeModel`,Ar]],[`gpt_neo`,[`GPTNeoModel`,xr]],[`gpt_neox`,[`GPTNeoXModel`,wr]],[`codegen`,[`CodeGenModel`,Nr]],[`llama`,[`LlamaModel`,Ir]],[`smollm3`,[`SmolLM3Model`,zr]],[`exaone`,[`ExaoneModel`,Jr]],[`olmo`,[`OlmoModel`,ei]],[`olmo2`,[`Olmo2Model`,ri]],[`mobilellm`,[`MobileLLMModel`,Zr]],[`granite`,[`GraniteModel`,oi]],[`cohere`,[`CohereModel`,li]],[`gemma`,[`GemmaModel`,fi]],[`gemma2`,[`Gemma2Model`,hi]],[`gemma3_text`,[`Gemma3Model`,vi]],[`helium`,[`HeliumModel`,Hr]],[`glm`,[`GlmModel`,Gr]],[`openelm`,[`OpenELMModel`,xi]],[`qwen2`,[`Qwen2Model`,wi]],[`qwen3`,[`Qwen3Model`,Di]],[`phi`,[`PhiModel`,Mi]],[`phi3`,[`Phi3Model`,Fi]],[`mpt`,[`MptModel`,Vi]],[`opt`,[`OPTModel`,Wi]],[`mistral`,[`MistralModel`,ac]],[`ernie4_5`,[`Ernie4_5_Model`,cc]],[`starcoder2`,[`Starcoder2Model`,dc]],[`falcon`,[`FalconModel`,mc]],[`stablelm`,[`StableLmModel`,Dc]]]),Pl=new Map([[`speecht5`,[`SpeechT5ForSpeechToText`,$s]],[`whisper`,[`WhisperForConditionalGeneration`,Nn]],[`lite-whisper`,[`LiteWhisperForConditionalGeneration`,Pn]],[`moonshine`,[`MoonshineForConditionalGeneration`,Ln]]]),Fl=new Map([[`speecht5`,[`SpeechT5ForTextToSpeech`,ec]]]),Il=new Map([[`vits`,[`VitsModel`,xc]],[`musicgen`,[`MusicgenForConditionalGeneration`,Fc]]]),Ll=new Map([[`bert`,[`BertForSequenceClassification`,L]],[`neobert`,[`NeoBertForSequenceClassification`,xe]],[`modernbert`,[`ModernBertForSequenceClassification`,Ee]],[`roformer`,[`RoFormerForSequenceClassification`,Ne]],[`electra`,[`ElectraForSequenceClassification`,Ue]],[`esm`,[`EsmForSequenceClassification`,yt]],[`convbert`,[`ConvBertForSequenceClassification`,V]],[`camembert`,[`CamembertForSequenceClassification`,Ye]],[`deberta`,[`DebertaForSequenceClassification`,tt]],[`deberta-v2`,[`DebertaV2ForSequenceClassification`,st]],[`mpnet`,[`MPNetForSequenceClassification`,kt]],[`albert`,[`AlbertForSequenceClassification`,zt]],[`distilbert`,[`DistilBertForSequenceClassification`,ft]],[`roberta`,[`RobertaForSequenceClassification`,W]],[`xlm`,[`XLMForSequenceClassification`,yn]],[`xlm-roberta`,[`XLMRobertaForSequenceClassification`,Tn]],[`bart`,[`BartForSequenceClassification`,en]],[`mbart`,[`MBartForSequenceClassification`,rn]],[`mobilebert`,[`MobileBertForSequenceClassification`,wt]],[`squeezebert`,[`SqueezeBertForSequenceClassification`,Ft]]]),Rl=new Map([[`bert`,[`BertForTokenClassification`,R]],[`neobert`,[`NeoBertForTokenClassification`,Se]],[`modernbert`,[`ModernBertForTokenClassification`,De]],[`roformer`,[`RoFormerForTokenClassification`,Pe]],[`electra`,[`ElectraForTokenClassification`,We]],[`esm`,[`EsmForTokenClassification`,bt]],[`convbert`,[`ConvBertForTokenClassification`,ze]],[`camembert`,[`CamembertForTokenClassification`,Xe]],[`deberta`,[`DebertaForTokenClassification`,nt]],[`deberta-v2`,[`DebertaV2ForTokenClassification`,ct]],[`mpnet`,[`MPNetForTokenClassification`,At]],[`distilbert`,[`DistilBertForTokenClassification`,pt]],[`roberta`,[`RobertaForTokenClassification`,hn]],[`xlm`,[`XLMForTokenClassification`,bn]],[`xlm-roberta`,[`XLMRobertaForTokenClassification`,En]]]),zl=new Map([[`t5`,[`T5ForConditionalGeneration`,Wt]],[`longt5`,[`LongT5ForConditionalGeneration`,qt]],[`mt5`,[`MT5ForConditionalGeneration`,Xt]],[`bart`,[`BartForConditionalGeneration`,$t]],[`mbart`,[`MBartForConditionalGeneration`,nn]],[`marian`,[`MarianMTModel`,fs]],[`m2m_100`,[`M2M100ForConditionalGeneration`,hs]],[`blenderbot`,[`BlenderbotForConditionalGeneration`,cn]],[`blenderbot-small`,[`BlenderbotSmallForConditionalGeneration`,dn]]]),Bl=new Map([[`bloom`,[`BloomForCausalLM`,zi]],[`gpt2`,[`GPT2LMHeadModel`,gr]],[`jais`,[`JAISLMHeadModel`,yr]],[`gptj`,[`GPTJForCausalLM`,Or]],[`gpt_bigcode`,[`GPTBigCodeForCausalLM`,jr]],[`gpt_neo`,[`GPTNeoForCausalLM`,Sr]],[`gpt_neox`,[`GPTNeoXForCausalLM`,Tr]],[`codegen`,[`CodeGenForCausalLM`,Pr]],[`llama`,[`LlamaForCausalLM`,Lr]],[`smollm3`,[`SmolLM3ForCausalLM`,Br]],[`exaone`,[`ExaoneForCausalLM`,Yr]],[`olmo`,[`OlmoForCausalLM`,ti]],[`olmo2`,[`Olmo2ForCausalLM`,ii]],[`mobilellm`,[`MobileLLMForCausalLM`,Qr]],[`granite`,[`GraniteForCausalLM`,si]],[`cohere`,[`CohereForCausalLM`,ui]],[`gemma`,[`GemmaForCausalLM`,pi]],[`gemma2`,[`Gemma2ForCausalLM`,gi]],[`gemma3_text`,[`Gemma3ForCausalLM`,yi]],[`helium`,[`HeliumForCausalLM`,Ur]],[`glm`,[`GlmForCausalLM`,Kr]],[`openelm`,[`OpenELMForCausalLM`,Si]],[`qwen2`,[`Qwen2ForCausalLM`,Ti]],[`qwen3`,[`Qwen3ForCausalLM`,Oi]],[`phi`,[`PhiForCausalLM`,Ni]],[`phi3`,[`Phi3ForCausalLM`,Ii]],[`mpt`,[`MptForCausalLM`,Hi]],[`opt`,[`OPTForCausalLM`,Gi]],[`mbart`,[`MBartForCausalLM`,an]],[`mistral`,[`MistralForCausalLM`,oc]],[`ernie4_5`,[`Ernie4_5_ForCausalLM`,lc]],[`starcoder2`,[`Starcoder2ForCausalLM`,fc]],[`falcon`,[`FalconForCausalLM`,hc]],[`trocr`,[`TrOCRForCausalLM`,rc]],[`stablelm`,[`StableLmForCausalLM`,Oc]],[`phi3_v`,[`Phi3VForCausalLM`,K]]]),Vl=new Map([[`multi_modality`,[`MultiModalityCausalLM`,tl]]]),Hl=new Map([[`bert`,[`BertForMaskedLM`,_e]],[`neobert`,[`NeoBertForMaskedLM`,be]],[`modernbert`,[`ModernBertForMaskedLM`,Te]],[`roformer`,[`RoFormerForMaskedLM`,Me]],[`electra`,[`ElectraForMaskedLM`,He]],[`esm`,[`EsmForMaskedLM`,vt]],[`convbert`,[`ConvBertForMaskedLM`,Re]],[`camembert`,[`CamembertForMaskedLM`,Je]],[`deberta`,[`DebertaForMaskedLM`,et]],[`deberta-v2`,[`DebertaV2ForMaskedLM`,ot]],[`mpnet`,[`MPNetForMaskedLM`,Ot]],[`albert`,[`AlbertForMaskedLM`,Vt]],[`distilbert`,[`DistilBertForMaskedLM`,ht]],[`roberta`,[`RobertaForMaskedLM`,mn]],[`xlm`,[`XLMWithLMHeadModel`,G]],[`xlm-roberta`,[`XLMRobertaForMaskedLM`,wn]],[`mobilebert`,[`MobileBertForMaskedLM`,Ct]],[`squeezebert`,[`SqueezeBertForMaskedLM`,Pt]]]),Ul=new Map([[`bert`,[`BertForQuestionAnswering`,ve]],[`neobert`,[`NeoBertForQuestionAnswering`,B]],[`roformer`,[`RoFormerForQuestionAnswering`,Fe]],[`electra`,[`ElectraForQuestionAnswering`,Ge]],[`convbert`,[`ConvBertForQuestionAnswering`,Be]],[`camembert`,[`CamembertForQuestionAnswering`,Ze]],[`deberta`,[`DebertaForQuestionAnswering`,rt]],[`deberta-v2`,[`DebertaV2ForQuestionAnswering`,lt]],[`mpnet`,[`MPNetForQuestionAnswering`,jt]],[`albert`,[`AlbertForQuestionAnswering`,Bt]],[`distilbert`,[`DistilBertForQuestionAnswering`,mt]],[`roberta`,[`RobertaForQuestionAnswering`,gn]],[`xlm`,[`XLMForQuestionAnswering`,xn]],[`xlm-roberta`,[`XLMRobertaForQuestionAnswering`,Dn]],[`mobilebert`,[`MobileBertForQuestionAnswering`,Tt]],[`squeezebert`,[`SqueezeBertForQuestionAnswering`,It]]]),Wl=new Map([[`vision-encoder-decoder`,[`VisionEncoderDecoderModel`,Rn]],[`idefics3`,[`Idefics3ForConditionalGeneration`,Zn]],[`smolvlm`,[`SmolVLMForConditionalGeneration`,Qn]]]),Gl=new Map([[`llava`,[`LlavaForConditionalGeneration`,Bn]],[`llava_onevision`,[`LlavaOnevisionForConditionalGeneration`,Vn]],[`moondream1`,[`Moondream1ForConditionalGeneration`,Hn]],[`florence2`,[`Florence2ForConditionalGeneration`,Wn]],[`qwen2-vl`,[`Qwen2VLForConditionalGeneration`,Ai]],[`idefics3`,[`Idefics3ForConditionalGeneration`,Zn]],[`smolvlm`,[`SmolVLMForConditionalGeneration`,Qn]],[`paligemma`,[`PaliGemmaForConditionalGeneration`,Kn]],[`llava_qwen2`,[`LlavaQwen2ForCausalLM`,qn]],[`gemma3n`,[`Gemma3nForConditionalGeneration`,Yn]]]),Kl=new Map([[`ultravox`,[`UltravoxModel`,fl]]]),ql=new Map([[`vision-encoder-decoder`,[`VisionEncoderDecoderModel`,Rn]]]),Jl=new Map([[`vit`,[`ViTForImageClassification`,Ji]],[`ijepa`,[`IJepaForImageClassification`,Zi]],[`pvt`,[`PvtForImageClassification`,na]],[`vit_msn`,[`ViTMSNForImageClassification`,sa]],[`fastvit`,[`FastViTForImageClassification`,fa]],[`mobilevit`,[`MobileViTForImageClassification`,_a]],[`mobilevitv2`,[`MobileViTV2ForImageClassification`,ba]],[`beit`,[`BeitForImageClassification`,ka]],[`deit`,[`DeiTForImageClassification`,ro]],[`hiera`,[`HieraForImageClassification`,oo]],[`convnext`,[`ConvNextForImageClassification`,Uo]],[`convnextv2`,[`ConvNextV2ForImageClassification`,Ko]],[`dinov2`,[`Dinov2ForImageClassification`,Yo]],[`dinov2_with_registers`,[`Dinov2WithRegistersForImageClassification`,Qo]],[`resnet`,[`ResNetForImageClassification`,lo]],[`swin`,[`SwinForImageClassification`,po]],[`segformer`,[`SegformerForImageClassification`,wc]],[`efficientnet`,[`EfficientNetForImageClassification`,jc]],[`mobilenet_v1`,[`MobileNetV1ForImageClassification`,Rc]],[`mobilenet_v2`,[`MobileNetV2ForImageClassification`,Hc]],[`mobilenet_v3`,[`MobileNetV3ForImageClassification`,Kc]],[`mobilenet_v4`,[`MobileNetV4ForImageClassification`,Xc]]]),Yl=new Map([[`detr`,[`DetrForObjectDetection`,Ma]],[`rt_detr`,[`RTDetrForObjectDetection`,Ra]],[`rt_detr_v2`,[`RTDetrV2ForObjectDetection`,Ha]],[`rf_detr`,[`RFDetrForObjectDetection`,Ka]],[`d_fine`,[`DFineForObjectDetection`,Xa]],[`table-transformer`,[`TableTransformerForObjectDetection`,$a]],[`yolos`,[`YolosForObjectDetection`,rs]]]),Xl=new Map([[`owlvit`,[`OwlViTForObjectDetection`,Ca]],[`owlv2`,[`Owlv2ForObjectDetection`,Ea]],[`grounding-dino`,[`GroundingDinoForObjectDetection`,es]]]),Zl=new Map([[`detr`,[`DetrForSegmentation`,Na]],[`clipseg`,[`CLIPSegForImageSegmentation`,pr]]]),Ql=new Map([[`segformer`,[`SegformerForSemanticSegmentation`,Tc]],[`sapiens`,[`SapiensForSemanticSegmentation`,wo]],[`swin`,[`SwinForSemanticSegmentation`,mo]],[`mobilenet_v1`,[`MobileNetV1ForSemanticSegmentation`,zc]],[`mobilenet_v2`,[`MobileNetV2ForSemanticSegmentation`,Uc]],[`mobilenet_v3`,[`MobileNetV3ForSemanticSegmentation`,qc]],[`mobilenet_v4`,[`MobileNetV4ForSemanticSegmentation`,Zc]]]),$l=new Map([[`detr`,[`DetrForSegmentation`,Na]],[`maskformer`,[`MaskFormerForInstanceSegmentation`,Fo]]]),eu=new Map([[`sam`,[`SamModel`,cs]]]),tu=new Map([[`wav2vec2`,[`Wav2Vec2ForCTC`,vs]],[`wav2vec2-bert`,[`Wav2Vec2BertForCTC`,Ls]],[`unispeech`,[`UniSpeechForCTC`,Os]],[`unispeech-sat`,[`UniSpeechSatForCTC`,Ms]],[`wavlm`,[`WavLMForCTC`,Gs]],[`hubert`,[`HubertForCTC`,Vs]]]),nu=new Map([[`wav2vec2`,[`Wav2Vec2ForSequenceClassification`,ys]],[`wav2vec2-bert`,[`Wav2Vec2BertForSequenceClassification`,Rs]],[`unispeech`,[`UniSpeechForSequenceClassification`,ks]],[`unispeech-sat`,[`UniSpeechSatForSequenceClassification`,Ns]],[`wavlm`,[`WavLMForSequenceClassification`,Ks]],[`hubert`,[`HubertForSequenceClassification`,Hs]],[`audio-spectrogram-transformer`,[`ASTForAudioClassification`,An]]]),ru=new Map([[`wavlm`,[`WavLMForXVector`,qs]]]),iu=new Map([[`unispeech-sat`,[`UniSpeechSatForAudioFrameClassification`,Ps]],[`wavlm`,[`WavLMForAudioFrameClassification`,Js]],[`wav2vec2`,[`Wav2Vec2ForAudioFrameClassification`,bs]],[`pyannote`,[`PyAnnoteForAudioFrameClassification`,Cs]]]),au=new Map([[`vitmatte`,[`VitMatteForImageMatting`,ma]]]),ou=new Map([[`patchtst`,[`PatchTSTForPrediction`,sl]],[`patchtsmixer`,[`PatchTSMixerForPrediction`,ul]]]),su=new Map([[`swin2sr`,[`Swin2SRForImageSuperResolution`,_o]]]),cu=new Map([[`dpt`,[`DPTForDepthEstimation`,bo]],[`depth_anything`,[`DepthAnythingForDepthEstimation`,So]],[`glpn`,[`GLPNForDepthEstimation`,Ro]],[`sapiens`,[`SapiensForDepthEstimation`,To]],[`depth_pro`,[`DepthProForDepthEstimation`,Oo]],[`metric3d`,[`Metric3DForDepthEstimation`,Ao]],[`metric3dv2`,[`Metric3Dv2ForDepthEstimation`,Mo]]]),lu=new Map([[`sapiens`,[`SapiensForNormalEstimation`,Eo]]]),uu=new Map([[`vitpose`,[`VitPoseForPoseEstimation`,$i]]]),du=new Map([[`clip`,[`CLIPVisionModelWithProjection`,ir]],[`siglip`,[`SiglipVisionModel`,or]],[`jina_clip`,[`JinaCLIPVisionModel`,dr]]]),fu=[[Al,b.EncoderOnly],[jl,b.EncoderDecoder],[Nl,b.DecoderOnly],[Ml,b.AutoEncoder],[Ll,b.EncoderOnly],[Rl,b.EncoderOnly],[zl,b.Seq2Seq],[Pl,b.Seq2Seq],[Bl,b.DecoderOnly],[Vl,b.MultiModality],[Hl,b.EncoderOnly],[Ul,b.EncoderOnly],[Wl,b.Vision2Seq],[Gl,b.ImageTextToText],[Kl,b.AudioTextToText],[Jl,b.EncoderOnly],[Zl,b.EncoderOnly],[$l,b.EncoderOnly],[Ql,b.EncoderOnly],[au,b.EncoderOnly],[ou,b.EncoderOnly],[su,b.EncoderOnly],[cu,b.EncoderOnly],[lu,b.EncoderOnly],[uu,b.EncoderOnly],[Yl,b.EncoderOnly],[Xl,b.EncoderOnly],[eu,b.MaskGeneration],[tu,b.EncoderOnly],[nu,b.EncoderOnly],[Fl,b.Seq2Seq],[Il,b.EncoderOnly],[ru,b.EncoderOnly],[iu,b.EncoderOnly],[du,b.EncoderOnly]];for(let[e,t]of fu)for(let[n,r]of e.values())x.set(n,t),C.set(r,n),S.set(n,r);let pu=[[`MusicgenForConditionalGeneration`,Fc,b.Musicgen],[`Phi3VForCausalLM`,K,b.Phi3V],[`CLIPTextModelWithProjection`,rr,b.EncoderOnly],[`SiglipTextModel`,ar,b.EncoderOnly],[`JinaCLIPTextModel`,ur,b.EncoderOnly],[`ClapTextModelWithProjection`,vc,b.EncoderOnly],[`ClapAudioModelWithProjection`,yc,b.EncoderOnly],[`DacEncoderModel`,Cl,b.EncoderOnly],[`DacDecoderModel`,wl,b.EncoderOnly],[`MimiEncoderModel`,_l,b.EncoderOnly],[`MimiDecoderModel`,vl,b.EncoderOnly],[`SnacEncoderModel`,Dl,b.EncoderOnly],[`SnacDecoderModel`,Ol,b.EncoderOnly],[`Gemma3nForConditionalGeneration`,Yn,b.ImageAudioTextToText]];for(let[e,t,n]of pu)x.set(e,n),C.set(t,e),S.set(e,t);let mu=new Map([[`modnet`,Zl],[`birefnet`,Zl],[`isnet`,Zl],[`ben`,Zl]]);for(let[e,t]of mu.entries())t.set(e,[`PreTrainedModel`,F]),x.set(e,b.EncoderOnly),C.set(F,e),S.set(e,F);class hu extends kl{static MODEL_CLASS_MAPPINGS=fu.map(e=>e[0]);static BASE_IF_FAIL=!0}class gu extends kl{static MODEL_CLASS_MAPPINGS=[Ll]}class _u extends kl{static MODEL_CLASS_MAPPINGS=[Rl]}class vu extends kl{static MODEL_CLASS_MAPPINGS=[zl]}class yu extends kl{static MODEL_CLASS_MAPPINGS=[Pl]}class bu extends kl{static MODEL_CLASS_MAPPINGS=[Fl]}class xu extends kl{static MODEL_CLASS_MAPPINGS=[Il]}class Su extends kl{static MODEL_CLASS_MAPPINGS=[Bl]}class Cu extends kl{static MODEL_CLASS_MAPPINGS=[Hl]}class wu extends kl{static MODEL_CLASS_MAPPINGS=[Ul]}class Tu extends kl{static MODEL_CLASS_MAPPINGS=[Wl]}class Eu extends kl{static MODEL_CLASS_MAPPINGS=[Jl]}class Du extends kl{static MODEL_CLASS_MAPPINGS=[Zl]}class Ou extends kl{static MODEL_CLASS_MAPPINGS=[Ql]}class ku extends kl{static MODEL_CLASS_MAPPINGS=[$l]}class Au extends kl{static MODEL_CLASS_MAPPINGS=[Yl]}class ju extends kl{static MODEL_CLASS_MAPPINGS=[Xl]}class Mu extends kl{static MODEL_CLASS_MAPPINGS=[eu]}class Nu extends kl{static MODEL_CLASS_MAPPINGS=[tu]}class Pu extends kl{static MODEL_CLASS_MAPPINGS=[nu]}class Fu extends kl{static MODEL_CLASS_MAPPINGS=[ru]}class Iu extends kl{static MODEL_CLASS_MAPPINGS=[iu]}class Lu extends kl{static MODEL_CLASS_MAPPINGS=[ql]}class Ru extends kl{static MODEL_CLASS_MAPPINGS=[au]}class zu extends kl{static MODEL_CLASS_MAPPINGS=[su]}class Bu extends kl{static MODEL_CLASS_MAPPINGS=[cu]}class Vu extends kl{static MODEL_CLASS_MAPPINGS=[lu]}class Hu extends kl{static MODEL_CLASS_MAPPINGS=[uu]}class Uu extends kl{static MODEL_CLASS_MAPPINGS=[du]}class Wu extends kl{static MODEL_CLASS_MAPPINGS=[Gl]}class Gu extends kl{static MODEL_CLASS_MAPPINGS=[Kl]}class Ku extends me{constructor({logits:e,past_key_values:t,encoder_outputs:n,decoder_attentions:r=null,cross_attentions:i=null}){super(),this.logits=e,this.past_key_values=t,this.encoder_outputs=n,this.decoder_attentions=r,this.cross_attentions=i}}class Q extends me{constructor({logits:e,...t}){super(),this.logits=e;let n=Object.values(t);n.length>0&&(this.attentions=n)}}class qu extends me{constructor({logits:e,embeddings:t}){super(),this.logits=e,this.embeddings=t}}class Ju extends me{constructor({logits:e}){super(),this.logits=e}}class Yu extends me{constructor({logits:e}){super(),this.logits=e}}class Xu extends me{constructor({start_logits:e,end_logits:t}){super(),this.start_logits=e,this.end_logits=t}}class Zu extends me{constructor({logits:e}){super(),this.logits=e}}class Qu extends me{constructor({logits:e,past_key_values:t}){super(),this.logits=e,this.past_key_values=t}}class $u extends me{constructor({alphas:e}){super(),this.alphas=e}}class ed extends me{constructor({waveform:e,spectrogram:t}){super(),this.waveform=e,this.spectrogram=t}}},"./src/models/audio_spectrogram_transformer/feature_extraction_audio_spectrogram_transformer.js":(e,t,n)=>{n.r(t),n.d(t,{ASTFeatureExtractor:()=>o});var r=n( /*! ../../base/feature_extraction_utils.js */ `./src/base/feature_extraction_utils.js`),i=n( /*! ../../utils/tensor.js */ @@ -3490,7 +3490,7 @@ var af={"onnxruntime-common":e=>{e.exports=ne},"onnxruntime-web":e=>{e.exports=j /*! ./utils/tensor.js */ `./src/utils/tensor.js`),f=n( /*! ./utils/image.js */ -`./src/utils/image.js`);async function p(e){return Array.isArray(e)||(e=[e]),await Promise.all(e.map(e=>f.RawImage.read(e)))}async function m(e,t){return Array.isArray(e)||(e=[e]),await Promise.all(e.map(e=>typeof e==`string`||e instanceof URL?(0,u.read_audio)(e,t):e instanceof Float64Array?new Float32Array(e):e))}function h(e,t){t&&(e=e.map(e=>e|0));let[n,r,i,a]=e;return{xmin:n,ymin:r,xmax:i,ymax:a}}class g extends s.Callable{constructor({task:e,model:t,tokenizer:n=null,processor:r=null}){super(),this.task=e,this.model=t,this.tokenizer=n,this.processor=r}async dispose(){await this.model.dispose()}}class _ extends g{constructor(e){super(e)}async _call(e,{top_k:t=1}={}){let n=this.tokenizer(e,{padding:!0,truncation:!0}),r=await this.model(n),i=this.model.config.problem_type===`multi_label_classification`?e=>e.sigmoid():e=>new d.Tensor(`float32`,(0,l.softmax)(e.data),e.dims),a=this.model.config.id2label,o=[];for(let e of r.logits){let n=i(e),r=await(0,d.topk)(n,t),s=r[0].tolist(),c=r[1].tolist(),l=c.map((e,t)=>({label:a?a[e]:`LABEL_${e}`,score:s[t]}));t===1?o.push(...l):o.push(l)}return Array.isArray(e)||t===1?o:o[0]}}class v extends g{constructor(e){super(e)}async _call(e,{ignore_labels:t=[`O`]}={}){let n=Array.isArray(e),r=this.tokenizer(n?e:[e],{padding:!0,truncation:!0}),i=await this.model(r),a=i.logits,o=this.model.config.id2label,s=[];for(let e=0;ee==this.tokenizer.sep_token_id),f=s[e].map((e,n)=>e==1&&(n===0||n>r&&u.findIndex(e=>e==t[n])===-1)),p=i[e].tolist(),m=a[e].tolist();for(let n=1;ne==t[n])!==-1)&&(p[n]=-1/0,m[n]=-1/0);let h=(0,l.softmax)(p).map((e,t)=>[e,t]),g=(0,l.softmax)(m).map((e,t)=>[e,t]);h[0][0]=0,g[0][0]=0;let _=(0,c.product)(h,g).filter(e=>e[0][1]<=e[1][1]).map(e=>[e[0][1],e[1][1],e[0][0]*e[1][0]]).sort((e,t)=>t[2]-e[2]);for(let e=0;ee==this.tokenizer.mask_token_id);if(o===-1)throw Error(`Mask token (${this.tokenizer.mask_token}) not found in text.`);let s=r[e][o],c=await(0,d.topk)(new d.Tensor(`float32`,(0,l.softmax)(s.data),s.dims),t),u=c[0].tolist(),f=c[1].tolist();i.push(f.map((e,t)=>{let r=n.slice();return r[o]=e,{score:u[t],token:Number(e),token_str:this.tokenizer.decode([e]),sequence:this.tokenizer.decode(r,{skip_special_tokens:!0})}}))}return Array.isArray(e)?i:i[0]}}class x extends g{_key=`generated_text`;constructor(e){super(e)}async _call(e,t={}){Array.isArray(e)||(e=[e]),this.model.config.prefix&&(e=e.map(e=>this.model.config.prefix+e));let n=this.model.config.task_specific_params;n&&n[this.task]&&n[this.task].prefix&&(e=e.map(e=>n[this.task].prefix+e));let r=this.tokenizer,i={padding:!0,truncation:!0},a;a=this instanceof C&&`_build_translation_inputs`in r?r._build_translation_inputs(e,i,t):r(e,i);let o=await this.model.generate({...a,...t});return r.batch_decode(o,{skip_special_tokens:!0}).map(e=>({[this._key]:e}))}}class S extends x{_key=`summary_text`;constructor(e){super(e)}}class C extends x{_key=`translation_text`;constructor(e){super(e)}}function w(e){return Array.isArray(e)&&e.every(e=>`role`in e&&`content`in e)}class T extends g{constructor(e){super(e)}async _call(e,t={}){let n=!1,r=!1,i;if(typeof e==`string`)i=e=[e];else if(Array.isArray(e)&&e.every(e=>typeof e==`string`))n=!0,i=e;else{if(w(e))e=[e];else if(Array.isArray(e)&&e.every(w))n=!0;else throw Error(`Input must be a string, an array of strings, a Chat, or an array of Chats`);r=!0,i=e.map(e=>this.tokenizer.apply_chat_template(e,{tokenize:!1,add_generation_prompt:!0}))}let a=t.add_special_tokens??!1,o=r?!1:t.return_full_text??!0;this.tokenizer.padding_side=`left`;let s=this.tokenizer(i,{add_special_tokens:a,padding:!0,truncation:!0}),c=await this.model.generate({...s,...t}),l=this.tokenizer.batch_decode(c,{skip_special_tokens:!0}),u;!o&&s.input_ids.dims.at(-1)>0&&(u=this.tokenizer.batch_decode(s.input_ids,{skip_special_tokens:!0}).map(e=>e.length));let d=Array.from({length:e.length},e=>[]);for(let t=0;t[e.toLowerCase(),t])),this.entailment_id=this.label2id.entailment,this.entailment_id===void 0&&(console.warn(`Could not find 'entailment' in label2id mapping. Using 2 as entailment_id.`),this.entailment_id=2),this.contradiction_id=this.label2id.contradiction??this.label2id.not_entailment,this.contradiction_id===void 0&&(console.warn(`Could not find 'contradiction' in label2id mapping. Using 0 as contradiction_id.`),this.contradiction_id=0)}async _call(e,t,{hypothesis_template:n=`This example is {}.`,multi_label:r=!1}={}){let i=Array.isArray(e);i||(e=[e]),Array.isArray(t)||(t=[t]);let a=t.map(e=>n.replace(`{}`,e)),o=r||t.length===1,s=[];for(let n of e){let e=[];for(let t of a){let r=this.tokenizer(n,{text_pair:t,padding:!0,truncation:!0}),i=await this.model(r);o?e.push([i.logits.data[this.contradiction_id],i.logits.data[this.entailment_id]]):e.push(i.logits.data[this.entailment_id])}let r=o?e.map(e=>(0,l.softmax)(e)[1]):(0,l.softmax)(e),i=r.map((e,t)=>[e,t]).sort((e,t)=>t[0]-e[0]);s.push({sequence:n,labels:i.map(e=>t[e[1]]),scores:i.map(e=>e[0])})}return i?s:s[0]}}class D extends g{constructor(e){super(e)}async _call(e,{pooling:t=`none`,normalize:n=!1,quantize:r=!1,precision:i=`binary`}={}){let a=this.tokenizer(e,{padding:!0,truncation:!0}),o=await this.model(a),s=o.last_hidden_state??o.logits??o.token_embeddings;switch(t){case`none`:break;case`mean`:s=(0,d.mean_pooling)(s,a.attention_mask);break;case`first_token`:case`cls`:s=s.slice(null,0);break;case`last_token`:case`eos`:s=s.slice(null,-1);break;default:throw Error(`Pooling method '${t}' not supported.`)}return n&&(s=s.normalize(2,-1)),r&&(s=(0,d.quantize_embeddings)(s,i)),s}}class O extends g{constructor(e){super(e)}async _call(e,{pool:t=null}={}){let n=await p(e),{pixel_values:r}=await this.processor(n),i=await this.model({pixel_values:r}),a;if(t){if(!(`pooler_output`in i))throw Error(`No pooled output was returned. Make sure the model has a 'pooler' layer when using the 'pool' option.`);a=i.pooler_output}else a=i.last_hidden_state??i.logits??i.image_embeds;return a}}class k extends g{constructor(e){super(e)}async _call(e,{top_k:t=5}={}){let n=this.processor.feature_extractor.config.sampling_rate,r=await m(e,n),i=this.model.config.id2label,a=[];for(let e of r){let n=await this.processor(e),r=await this.model(n),o=r.logits[0],s=await(0,d.topk)(new d.Tensor(`float32`,(0,l.softmax)(o.data),o.dims),t),c=s[0].tolist(),u=s[1].tolist(),f=u.map((e,t)=>({label:i?i[e]:`LABEL_${e}`,score:c[t]}));a.push(f)}return Array.isArray(e)?a:a[0]}}class A extends g{constructor(e){super(e)}async _call(e,t,{hypothesis_template:n=`This is a sound of {}.`}={}){let r=!Array.isArray(e);r&&(e=[e]);let i=t.map(e=>n.replace(`{}`,e)),a=this.tokenizer(i,{padding:!0,truncation:!0}),o=this.processor.feature_extractor.config.sampling_rate,s=await m(e,o),c=[];for(let e of s){let n=await this.processor(e),r=await this.model({...a,...n}),i=(0,l.softmax)(r.logits_per_audio.data);c.push([...i].map((e,n)=>({score:e,label:t[n]})))}return r?c[0]:c}}class ee extends g{constructor(e){super(e)}async _call(e,t={}){switch(this.model.config.model_type){case`whisper`:case`lite-whisper`:return this._call_whisper(e,t);case`wav2vec2`:case`wav2vec2-bert`:case`unispeech`:case`unispeech-sat`:case`hubert`:return this._call_wav2vec2(e,t);case`moonshine`:return this._call_moonshine(e,t);default:throw Error(`AutomaticSpeechRecognitionPipeline does not support model type '${this.model.config.model_type}'.`)}}async _call_wav2vec2(e,t){t.language&&console.warn('`language` parameter is not yet supported for `wav2vec2` models, defaulting to "English".'),t.task&&console.warn('`task` parameter is not yet supported for `wav2vec2` models, defaulting to "transcribe".');let n=!Array.isArray(e);n&&(e=[e]);let r=this.processor.feature_extractor.config.sampling_rate,i=await m(e,r),a=[];for(let e of i){let t=await this.processor(e),n=await this.model(t),r=n.logits[0],i=[];for(let e of r)i.push((0,l.max)(e.data)[1]);let o=this.tokenizer.decode(i);a.push({text:o})}return n?a[0]:a}async _call_whisper(e,t){let n=t.return_timestamps??!1,r=t.chunk_length_s??0,i=t.force_full_sequences??!1,a=t.stride_length_s??null,o={...t};n===`word`&&(o.return_token_timestamps=!0,o.return_timestamps=!1);let s=!Array.isArray(e);s&&(e=[e]);let c=this.processor.feature_extractor.config.chunk_length/this.model.config.max_source_positions,u=this.processor.feature_extractor.config.hop_length,d=this.processor.feature_extractor.config.sampling_rate,f=await m(e,d),p=[];for(let e of f){let t=[];if(r>0){if(a===null)a=r/6;else if(r<=a)throw Error("`chunk_length_s` must be larger than `stride_length_s`.");let n=d*r,i=d*a,o=n-2*i,s=0;for(;;){let r=s+n,a=e.subarray(s,r),c=await this.processor(a),l=s===0,u=r>=e.length;if(t.push({stride:[a.length,l?0:i,u?0:i],input_features:c.input_features,is_last:u}),u)break;s+=o}}else t=[{stride:[e.length,0,0],input_features:(await this.processor(e)).input_features,is_last:!0}];for(let e of t){o.num_frames=Math.floor(e.stride[0]/u);let t=await this.model.generate({inputs:e.input_features,...o});n===`word`?(e.tokens=t.sequences.tolist()[0],e.token_timestamps=t.token_timestamps.tolist()[0].map(e=>(0,l.round)(e,2))):e.tokens=t[0].tolist(),e.stride=e.stride.map(e=>e/d)}let[s,f]=this.tokenizer._decode_asr(t,{time_precision:c,return_timestamps:n,force_full_sequences:i});p.push({text:s,...f})}return s?p[0]:p}async _call_moonshine(e,t){let n=!Array.isArray(e);n&&(e=[e]);let r=this.processor.feature_extractor.config.sampling_rate,i=await m(e,r),a=[];for(let e of i){let n=await this.processor(e),i=Math.floor(e.length/r)*6,o=await this.model.generate({max_new_tokens:i,...t,...n}),s=this.processor.batch_decode(o,{skip_special_tokens:!0})[0];a.push({text:s})}return n?a[0]:a}}class te extends g{constructor(e){super(e)}async _call(e,t={}){let n=Array.isArray(e),r=await p(e),{pixel_values:i}=await this.processor(r),a=[];for(let e of i){e.dims=[1,...e.dims];let n=await this.model.generate({inputs:e,...t}),r=this.tokenizer.batch_decode(n,{skip_special_tokens:!0}).map(e=>({generated_text:e.trim()}));a.push(r)}return n?a:a[0]}}class ne extends g{constructor(e){super(e)}async _call(e,{top_k:t=5}={}){let n=await p(e),{pixel_values:r}=await this.processor(n),i=await this.model({pixel_values:r}),a=this.model.config.id2label,o=[];for(let e of i.logits){let n=await(0,d.topk)(new d.Tensor(`float32`,(0,l.softmax)(e.data),e.dims),t),r=n[0].tolist(),i=n[1].tolist(),s=i.map((e,t)=>({label:a?a[e]:`LABEL_${e}`,score:r[t]}));o.push(s)}return Array.isArray(e)?o:o[0]}}class j extends g{constructor(e){super(e),this.subtasks_mapping={panoptic:`post_process_panoptic_segmentation`,instance:`post_process_instance_segmentation`,semantic:`post_process_semantic_segmentation`}}async _call(e,{threshold:t=.5,mask_threshold:n=.5,overlap_mask_area_threshold:r=.8,label_ids_to_fuse:i=null,target_sizes:a=null,subtask:o=null}={}){let s=Array.isArray(e);if(s&&e.length!==1)throw Error(`Image segmentation pipeline currently only supports a batch size of 1.`);let c=await p(e),l=c.map(e=>[e.height,e.width]),u=await this.processor(c),{inputNames:d,outputNames:m}=this.model.sessions.model;if(!d.includes(`pixel_values`)){if(d.length!==1)throw Error(`Expected a single input name, but got ${d.length} inputs: ${d}.`);let e=d[0];if(e in u)throw Error(`Input name ${e} already exists in the inputs.`);u[e]=u.pixel_values}let h=await this.model(u),g=null;if(o!==null)g=this.subtasks_mapping[o];else if(this.processor.image_processor){for(let[e,t]of Object.entries(this.subtasks_mapping))if(t in this.processor.image_processor){g=this.processor.image_processor[t].bind(this.processor.image_processor),o=e;break}}let _=this.model.config.id2label,v=[];if(o)if(o===`panoptic`||o===`instance`){let e=g(h,t,n,r,i,a??l)[0],o=e.segmentation;for(let t of e.segments_info){let e=new Uint8ClampedArray(o.data.length);for(let n=0;nt<-e||t>1+e)&&i.sigmoid_();let a=await f.RawImage.fromTensor(i.mul_(255).to(`uint8`)).resize(r[1],r[0]);v.push({label:null,score:null,mask:a})}}return v}}class re extends j{constructor(e){super(e)}async _call(e,t={}){let n=Array.isArray(e);if(n&&e.length!==1)throw Error(`Background removal pipeline currently only supports a batch size of 1.`);let r=await p(e),i=await super._call(e,t),a=r.map((e,t)=>{let n=e.clone();return n.putAlpha(i[t].mask),n});return a}}class ie extends g{constructor(e){super(e)}async _call(e,t,{hypothesis_template:n=`This is a photo of {}`}={}){let r=Array.isArray(e),i=await p(e),a=t.map(e=>n.replace(`{}`,e)),o=this.tokenizer(a,{padding:this.model.config.model_type===`siglip`?`max_length`:!0,truncation:!0}),{pixel_values:s}=await this.processor(i),c=await this.model({...o,pixel_values:s}),u=this.model.config.model_type===`siglip`?e=>e.sigmoid().data:e=>(0,l.softmax)(e.data),d=[];for(let e of c.logits_per_image){let n=u(e),r=[...n].map((e,n)=>({score:e,label:t[n]}));r.sort((e,t)=>t.score-e.score),d.push(r)}return r?d:d[0]}}class ae extends g{constructor(e){super(e)}async _call(e,{threshold:t=.9,percentage:n=!1}={}){let r=Array.isArray(e);if(r&&e.length!==1)throw Error(`Object detection pipeline currently only supports a batch size of 1.`);let i=await p(e),a=n?null:i.map(e=>[e.height,e.width]),{pixel_values:o,pixel_mask:s}=await this.processor(i),c=await this.model({pixel_values:o,pixel_mask:s}),l=this.processor.image_processor.post_process_object_detection(c,t,a),u=this.model.config.id2label,d=l.map(e=>e.boxes.map((t,r)=>({score:e.scores[r],label:u[e.classes[r]],box:h(t,!n)})));return r?d:d[0]}}class oe extends g{constructor(e){super(e)}async _call(e,t,{threshold:n=.1,top_k:r=null,percentage:i=!1}={}){let a=Array.isArray(e),o=await p(e),s=this.tokenizer(t,{padding:!0,truncation:!0}),c=await this.processor(o),l=[];for(let e=0;e({score:e.scores[n],label:e.labels[n],box:h(t,!i)}))}else{let e=this.processor.image_processor.post_process_object_detection(f,n,u,!0)[0];p=e.boxes.map((n,r)=>({score:e.scores[r],label:t[e.classes[r]],box:h(n,!i)}))}p.sort((e,t)=>t.score-e.score),r!==null&&(p=p.slice(0,r)),l.push(p)}return a?l:l[0]}}class se extends g{constructor(e){super(e)}async _call(e,t,n={}){let r=(await p(e))[0],{pixel_values:i}=await this.processor(r),a=`${t}`,o=this.tokenizer(a,{add_special_tokens:!1,padding:!0,truncation:!0}).input_ids,s=await this.model.generate({inputs:i,max_length:this.model.config.decoder.max_position_embeddings,decoder_input_ids:o,...n}),c=this.tokenizer.batch_decode(s)[0],l=c.match(/(.*?)<\/s_answer>/),u=null;return l&&l.length>=2&&(u=l[1].trim()),[{answer:u}]}}class M extends g{DEFAULT_VOCODER_ID=`Xenova/speecht5_hifigan`;constructor(e){super(e),this.vocoder=e.vocoder??null}async _call(e,{speaker_embeddings:t=null}={}){return this.processor?this._call_text_to_spectrogram(e,{speaker_embeddings:t}):this._call_text_to_waveform(e)}async _call_text_to_waveform(e){let t=this.tokenizer(e,{padding:!0,truncation:!0}),{waveform:n}=await this.model(t),r=this.model.config.sampling_rate;return new u.RawAudio(n.data,r)}async _call_text_to_spectrogram(e,{speaker_embeddings:t}){if(this.vocoder||(console.log(`No vocoder specified, using default HifiGan vocoder.`),this.vocoder=await i.AutoModel.from_pretrained(this.DEFAULT_VOCODER_ID,{dtype:`fp32`})),(typeof t==`string`||t instanceof URL)&&(t=new Float32Array(await(await fetch(t)).arrayBuffer())),t instanceof Float32Array)t=new d.Tensor(`float32`,t,[1,t.length]);else if(!(t instanceof d.Tensor))throw Error("Speaker embeddings must be a `Tensor`, `Float32Array`, `string`, or `URL`.");let{input_ids:n}=this.tokenizer(e,{padding:!0,truncation:!0}),{waveform:r}=await this.model.generate_speech(n,t,{vocoder:this.vocoder}),a=this.processor.feature_extractor.config.sampling_rate;return new u.RawAudio(r.data,a)}}class N extends g{constructor(e){super(e)}async _call(e){let t=await p(e),n=await this.processor(t),r=await this.model(n),i=[];for(let e of r.reconstruction){let t=e.squeeze().clamp_(0,1).mul_(255).round_().to(`uint8`);i.push(f.RawImage.fromTensor(t))}return i.length>1?i:i[0]}}class ce extends g{constructor(e){super(e)}async _call(e){let t=await p(e),n=await this.processor(t),{predicted_depth:r}=await this.model(n),i=[];for(let e=0;e1?i:i[0]}}let le=Object.freeze({"text-classification":{tokenizer:r.AutoTokenizer,pipeline:_,model:i.AutoModelForSequenceClassification,default:{model:`Xenova/distilbert-base-uncased-finetuned-sst-2-english`},type:`text`},"token-classification":{tokenizer:r.AutoTokenizer,pipeline:v,model:i.AutoModelForTokenClassification,default:{model:`Xenova/bert-base-multilingual-cased-ner-hrl`},type:`text`},"question-answering":{tokenizer:r.AutoTokenizer,pipeline:y,model:i.AutoModelForQuestionAnswering,default:{model:`Xenova/distilbert-base-cased-distilled-squad`},type:`text`},"fill-mask":{tokenizer:r.AutoTokenizer,pipeline:b,model:i.AutoModelForMaskedLM,default:{model:`Xenova/bert-base-uncased`},type:`text`},summarization:{tokenizer:r.AutoTokenizer,pipeline:S,model:i.AutoModelForSeq2SeqLM,default:{model:`Xenova/distilbart-cnn-6-6`},type:`text`},translation:{tokenizer:r.AutoTokenizer,pipeline:C,model:i.AutoModelForSeq2SeqLM,default:{model:`Xenova/t5-small`},type:`text`},"text2text-generation":{tokenizer:r.AutoTokenizer,pipeline:x,model:i.AutoModelForSeq2SeqLM,default:{model:`Xenova/flan-t5-small`},type:`text`},"text-generation":{tokenizer:r.AutoTokenizer,pipeline:T,model:i.AutoModelForCausalLM,default:{model:`Xenova/gpt2`},type:`text`},"zero-shot-classification":{tokenizer:r.AutoTokenizer,pipeline:E,model:i.AutoModelForSequenceClassification,default:{model:`Xenova/distilbert-base-uncased-mnli`},type:`text`},"audio-classification":{pipeline:k,model:i.AutoModelForAudioClassification,processor:a.AutoProcessor,default:{model:`Xenova/wav2vec2-base-superb-ks`},type:`audio`},"zero-shot-audio-classification":{tokenizer:r.AutoTokenizer,pipeline:A,model:i.AutoModel,processor:a.AutoProcessor,default:{model:`Xenova/clap-htsat-unfused`},type:`multimodal`},"automatic-speech-recognition":{tokenizer:r.AutoTokenizer,pipeline:ee,model:[i.AutoModelForSpeechSeq2Seq,i.AutoModelForCTC],processor:a.AutoProcessor,default:{model:`Xenova/whisper-tiny.en`},type:`multimodal`},"text-to-audio":{tokenizer:r.AutoTokenizer,pipeline:M,model:[i.AutoModelForTextToWaveform,i.AutoModelForTextToSpectrogram],processor:[a.AutoProcessor,null],default:{model:`Xenova/speecht5_tts`},type:`text`},"image-to-text":{tokenizer:r.AutoTokenizer,pipeline:te,model:i.AutoModelForVision2Seq,processor:a.AutoProcessor,default:{model:`Xenova/vit-gpt2-image-captioning`},type:`multimodal`},"image-classification":{pipeline:ne,model:i.AutoModelForImageClassification,processor:a.AutoProcessor,default:{model:`Xenova/vit-base-patch16-224`},type:`multimodal`},"image-segmentation":{pipeline:j,model:[i.AutoModelForImageSegmentation,i.AutoModelForSemanticSegmentation,i.AutoModelForUniversalSegmentation],processor:a.AutoProcessor,default:{model:`Xenova/detr-resnet-50-panoptic`},type:`multimodal`},"background-removal":{pipeline:re,model:[i.AutoModelForImageSegmentation,i.AutoModelForSemanticSegmentation,i.AutoModelForUniversalSegmentation],processor:a.AutoProcessor,default:{model:`Xenova/modnet`},type:`image`},"zero-shot-image-classification":{tokenizer:r.AutoTokenizer,pipeline:ie,model:i.AutoModel,processor:a.AutoProcessor,default:{model:`Xenova/clip-vit-base-patch32`},type:`multimodal`},"object-detection":{pipeline:ae,model:i.AutoModelForObjectDetection,processor:a.AutoProcessor,default:{model:`Xenova/detr-resnet-50`},type:`multimodal`},"zero-shot-object-detection":{tokenizer:r.AutoTokenizer,pipeline:oe,model:i.AutoModelForZeroShotObjectDetection,processor:a.AutoProcessor,default:{model:`Xenova/owlvit-base-patch32`},type:`multimodal`},"document-question-answering":{tokenizer:r.AutoTokenizer,pipeline:se,model:i.AutoModelForDocumentQuestionAnswering,processor:a.AutoProcessor,default:{model:`Xenova/donut-base-finetuned-docvqa`},type:`multimodal`},"image-to-image":{pipeline:N,model:i.AutoModelForImageToImage,processor:a.AutoProcessor,default:{model:`Xenova/swin2SR-classical-sr-x2-64`},type:`image`},"depth-estimation":{pipeline:ce,model:i.AutoModelForDepthEstimation,processor:a.AutoProcessor,default:{model:`Xenova/dpt-large`},type:`image`},"feature-extraction":{tokenizer:r.AutoTokenizer,pipeline:D,model:i.AutoModel,default:{model:`Xenova/all-MiniLM-L6-v2`},type:`text`},"image-feature-extraction":{processor:a.AutoProcessor,pipeline:O,model:[i.AutoModelForImageFeatureExtraction,i.AutoModel],default:{model:`Xenova/vit-base-patch16-224-in21k`},type:`image`}}),ue=Object.freeze({"sentiment-analysis":`text-classification`,ner:`token-classification`,asr:`automatic-speech-recognition`,"text-to-speech":`text-to-audio`,embeddings:`feature-extraction`});async function de(e,t=null,{progress_callback:n=null,config:r=null,cache_dir:i=null,local_files_only:a=!1,revision:o=`main`,device:s=null,dtype:l=null,subfolder:u=`onnx`,use_external_data_format:d=null,model_file_name:f=null,session_options:p={}}={}){e=ue[e]??e;let m=le[e.split(`_`,1)[0]];if(!m)throw Error(`Unsupported pipeline: ${e}. Must be one of [${Object.keys(le)}]`);t||(t=m.default.model,console.log(`No model specified. Using default model: "${t}".`));let h={progress_callback:n,config:r,cache_dir:i,local_files_only:a,revision:o,device:s,dtype:l,subfolder:u,use_external_data_format:d,model_file_name:f,session_options:p},g=new Map([[`tokenizer`,m.tokenizer],[`model`,m.model],[`processor`,m.processor]]),_=await P(g,t,h);_.task=e,(0,c.dispatchCallback)(n,{status:`ready`,task:e,model:t});let v=m.pipeline;return new v(_)}async function P(e,t,n){let r=Object.create(null),i=[];for(let[a,o]of e.entries()){if(!o)continue;let e;e=Array.isArray(o)?new Promise(async(e,r)=>{let i;for(let a of o){if(a===null){e(null);return}try{e(await a.from_pretrained(t,n));return}catch(e){if(e.message?.includes(`Unsupported model type`))i=e;else if(e.message?.includes(`Could not locate file`))i=e;else{r(e);return}}}r(i)}):o.from_pretrained(t,n),r[a]=e,i.push(e)}await Promise.all(i);for(let[e,t]of Object.entries(r))r[e]=await t;return r}},"./src/tokenizers.js":(e,t,n)=>{n.r(t),n.d(t,{AlbertTokenizer:()=>He,AutoTokenizer:()=>Nt,BartTokenizer:()=>tt,BertTokenizer:()=>Ve,BlenderbotSmallTokenizer:()=>Dt,BlenderbotTokenizer:()=>Et,BloomTokenizer:()=>at,CLIPTokenizer:()=>St,CamembertTokenizer:()=>Xe,CodeGenTokenizer:()=>xt,CodeLlamaTokenizer:()=>ct,CohereTokenizer:()=>jt,ConvBertTokenizer:()=>qe,DebertaTokenizer:()=>We,DebertaV2Tokenizer:()=>Ge,DistilBertTokenizer:()=>Ye,ElectraTokenizer:()=>Qe,EsmTokenizer:()=>pt,FalconTokenizer:()=>dt,GPT2Tokenizer:()=>et,GPTNeoXTokenizer:()=>ft,GemmaTokenizer:()=>ht,Grok1Tokenizer:()=>gt,HerbertTokenizer:()=>Ke,LlamaTokenizer:()=>st,M2M100Tokenizer:()=>yt,MBart50Tokenizer:()=>rt,MBartTokenizer:()=>nt,MPNetTokenizer:()=>ut,MarianTokenizer:()=>wt,MgpstrTokenizer:()=>Mt,MobileBertTokenizer:()=>B,NllbTokenizer:()=>vt,NougatTokenizer:()=>kt,PreTrainedTokenizer:()=>z,Qwen2Tokenizer:()=>mt,RoFormerTokenizer:()=>Je,RobertaTokenizer:()=>it,SiglipTokenizer:()=>Ct,SpeechT5Tokenizer:()=>Ot,SqueezeBertTokenizer:()=>Ue,T5Tokenizer:()=>$e,TokenizerModel:()=>D,VitsTokenizer:()=>At,Wav2Vec2CTCTokenizer:()=>Tt,WhisperTokenizer:()=>bt,XLMRobertaTokenizer:()=>lt,XLMTokenizer:()=>Ze,is_chinese_char:()=>y});var r=n( +`./src/utils/image.js`);async function p(e){return Array.isArray(e)||(e=[e]),await Promise.all(e.map(e=>f.RawImage.read(e)))}async function m(e,t){return Array.isArray(e)||(e=[e]),await Promise.all(e.map(e=>typeof e==`string`||e instanceof URL?(0,u.read_audio)(e,t):e instanceof Float64Array?new Float32Array(e):e))}function h(e,t){t&&(e=e.map(e=>e|0));let[n,r,i,a]=e;return{xmin:n,ymin:r,xmax:i,ymax:a}}class g extends s.Callable{constructor({task:e,model:t,tokenizer:n=null,processor:r=null}){super(),this.task=e,this.model=t,this.tokenizer=n,this.processor=r}async dispose(){await this.model.dispose()}}class _ extends g{constructor(e){super(e)}async _call(e,{top_k:t=1}={}){let n=this.tokenizer(e,{padding:!0,truncation:!0}),r=await this.model(n),i=this.model.config.problem_type===`multi_label_classification`?e=>e.sigmoid():e=>new d.Tensor(`float32`,(0,l.softmax)(e.data),e.dims),a=this.model.config.id2label,o=[];for(let e of r.logits){let n=i(e),r=await(0,d.topk)(n,t),s=r[0].tolist(),c=r[1].tolist(),l=c.map((e,t)=>({label:a?a[e]:`LABEL_${e}`,score:s[t]}));t===1?o.push(...l):o.push(l)}return Array.isArray(e)||t===1?o:o[0]}}class v extends g{constructor(e){super(e)}async _call(e,{ignore_labels:t=[`O`]}={}){let n=Array.isArray(e),r=this.tokenizer(n?e:[e],{padding:!0,truncation:!0}),i=await this.model(r),a=i.logits,o=this.model.config.id2label,s=[];for(let e=0;ee==this.tokenizer.sep_token_id),f=s[e].map((e,n)=>e==1&&(n===0||n>r&&u.findIndex(e=>e==t[n])===-1)),p=i[e].tolist(),m=a[e].tolist();for(let n=1;ne==t[n])!==-1)&&(p[n]=-1/0,m[n]=-1/0);let h=(0,l.softmax)(p).map((e,t)=>[e,t]),g=(0,l.softmax)(m).map((e,t)=>[e,t]);h[0][0]=0,g[0][0]=0;let _=(0,c.product)(h,g).filter(e=>e[0][1]<=e[1][1]).map(e=>[e[0][1],e[1][1],e[0][0]*e[1][0]]).sort((e,t)=>t[2]-e[2]);for(let e=0;ee==this.tokenizer.mask_token_id);if(o===-1)throw Error(`Mask token (${this.tokenizer.mask_token}) not found in text.`);let s=r[e][o],c=await(0,d.topk)(new d.Tensor(`float32`,(0,l.softmax)(s.data),s.dims),t),u=c[0].tolist(),f=c[1].tolist();i.push(f.map((e,t)=>{let r=n.slice();return r[o]=e,{score:u[t],token:Number(e),token_str:this.tokenizer.decode([e]),sequence:this.tokenizer.decode(r,{skip_special_tokens:!0})}}))}return Array.isArray(e)?i:i[0]}}class x extends g{_key=`generated_text`;constructor(e){super(e)}async _call(e,t={}){Array.isArray(e)||(e=[e]),this.model.config.prefix&&(e=e.map(e=>this.model.config.prefix+e));let n=this.model.config.task_specific_params;n&&n[this.task]&&n[this.task].prefix&&(e=e.map(e=>n[this.task].prefix+e));let r=this.tokenizer,i={padding:!0,truncation:!0},a;a=this instanceof C&&`_build_translation_inputs`in r?r._build_translation_inputs(e,i,t):r(e,i);let o=await this.model.generate({...a,...t});return r.batch_decode(o,{skip_special_tokens:!0}).map(e=>({[this._key]:e}))}}class S extends x{_key=`summary_text`;constructor(e){super(e)}}class C extends x{_key=`translation_text`;constructor(e){super(e)}}function w(e){return Array.isArray(e)&&e.every(e=>`role`in e&&`content`in e)}class T extends g{constructor(e){super(e)}async _call(e,t={}){let n=!1,r=!1,i;if(typeof e==`string`)i=e=[e];else if(Array.isArray(e)&&e.every(e=>typeof e==`string`))n=!0,i=e;else{if(w(e))e=[e];else if(Array.isArray(e)&&e.every(w))n=!0;else throw Error(`Input must be a string, an array of strings, a Chat, or an array of Chats`);r=!0,i=e.map(e=>this.tokenizer.apply_chat_template(e,{tokenize:!1,add_generation_prompt:!0}))}let a=t.add_special_tokens??!1,o=r?!1:t.return_full_text??!0;this.tokenizer.padding_side=`left`;let s=this.tokenizer(i,{add_special_tokens:a,padding:!0,truncation:!0}),c=await this.model.generate({...s,...t}),l=this.tokenizer.batch_decode(c,{skip_special_tokens:!0}),u;!o&&s.input_ids.dims.at(-1)>0&&(u=this.tokenizer.batch_decode(s.input_ids,{skip_special_tokens:!0}).map(e=>e.length));let d=Array.from({length:e.length},e=>[]);for(let t=0;t[e.toLowerCase(),t])),this.entailment_id=this.label2id.entailment,this.entailment_id===void 0&&(console.warn(`Could not find 'entailment' in label2id mapping. Using 2 as entailment_id.`),this.entailment_id=2),this.contradiction_id=this.label2id.contradiction??this.label2id.not_entailment,this.contradiction_id===void 0&&(console.warn(`Could not find 'contradiction' in label2id mapping. Using 0 as contradiction_id.`),this.contradiction_id=0)}async _call(e,t,{hypothesis_template:n=`This example is {}.`,multi_label:r=!1}={}){let i=Array.isArray(e);i||(e=[e]),Array.isArray(t)||(t=[t]);let a=t.map(e=>n.replace(`{}`,e)),o=r||t.length===1,s=[];for(let n of e){let e=[];for(let t of a){let r=this.tokenizer(n,{text_pair:t,padding:!0,truncation:!0}),i=await this.model(r);o?e.push([i.logits.data[this.contradiction_id],i.logits.data[this.entailment_id]]):e.push(i.logits.data[this.entailment_id])}let r=o?e.map(e=>(0,l.softmax)(e)[1]):(0,l.softmax)(e),i=r.map((e,t)=>[e,t]).sort((e,t)=>t[0]-e[0]);s.push({sequence:n,labels:i.map(e=>t[e[1]]),scores:i.map(e=>e[0])})}return i?s:s[0]}}class D extends g{constructor(e){super(e)}async _call(e,{pooling:t=`none`,normalize:n=!1,quantize:r=!1,precision:i=`binary`}={}){let a=this.tokenizer(e,{padding:!0,truncation:!0}),o=await this.model(a),s=o.last_hidden_state??o.logits??o.token_embeddings;switch(t){case`none`:break;case`mean`:s=(0,d.mean_pooling)(s,a.attention_mask);break;case`first_token`:case`cls`:s=s.slice(null,0);break;case`last_token`:case`eos`:s=s.slice(null,-1);break;default:throw Error(`Pooling method '${t}' not supported.`)}return n&&(s=s.normalize(2,-1)),r&&(s=(0,d.quantize_embeddings)(s,i)),s}}class O extends g{constructor(e){super(e)}async _call(e,{pool:t=null}={}){let n=await p(e),{pixel_values:r}=await this.processor(n),i=await this.model({pixel_values:r}),a;if(t){if(!(`pooler_output`in i))throw Error(`No pooled output was returned. Make sure the model has a 'pooler' layer when using the 'pool' option.`);a=i.pooler_output}else a=i.last_hidden_state??i.logits??i.image_embeds;return a}}class k extends g{constructor(e){super(e)}async _call(e,{top_k:t=5}={}){let n=this.processor.feature_extractor.config.sampling_rate,r=await m(e,n),i=this.model.config.id2label,a=[];for(let e of r){let n=await this.processor(e),r=await this.model(n),o=r.logits[0],s=await(0,d.topk)(new d.Tensor(`float32`,(0,l.softmax)(o.data),o.dims),t),c=s[0].tolist(),u=s[1].tolist(),f=u.map((e,t)=>({label:i?i[e]:`LABEL_${e}`,score:c[t]}));a.push(f)}return Array.isArray(e)?a:a[0]}}class A extends g{constructor(e){super(e)}async _call(e,t,{hypothesis_template:n=`This is a sound of {}.`}={}){let r=!Array.isArray(e);r&&(e=[e]);let i=t.map(e=>n.replace(`{}`,e)),a=this.tokenizer(i,{padding:!0,truncation:!0}),o=this.processor.feature_extractor.config.sampling_rate,s=await m(e,o),c=[];for(let e of s){let n=await this.processor(e),r=await this.model({...a,...n}),i=(0,l.softmax)(r.logits_per_audio.data);c.push([...i].map((e,n)=>({score:e,label:t[n]})))}return r?c[0]:c}}class ee extends g{constructor(e){super(e)}async _call(e,t={}){switch(this.model.config.model_type){case`whisper`:case`lite-whisper`:return this._call_whisper(e,t);case`wav2vec2`:case`wav2vec2-bert`:case`unispeech`:case`unispeech-sat`:case`hubert`:return this._call_wav2vec2(e,t);case`moonshine`:return this._call_moonshine(e,t);default:throw Error(`AutomaticSpeechRecognitionPipeline does not support model type '${this.model.config.model_type}'.`)}}async _call_wav2vec2(e,t){t.language&&console.warn('`language` parameter is not yet supported for `wav2vec2` models, defaulting to "English".'),t.task&&console.warn('`task` parameter is not yet supported for `wav2vec2` models, defaulting to "transcribe".');let n=!Array.isArray(e);n&&(e=[e]);let r=this.processor.feature_extractor.config.sampling_rate,i=await m(e,r),a=[];for(let e of i){let t=await this.processor(e),n=await this.model(t),r=n.logits[0],i=[];for(let e of r)i.push((0,l.max)(e.data)[1]);let o=this.tokenizer.decode(i);a.push({text:o})}return n?a[0]:a}async _call_whisper(e,t){let n=t.return_timestamps??!1,r=t.chunk_length_s??0,i=t.force_full_sequences??!1,a=t.stride_length_s??null,o={...t};n===`word`&&(o.return_token_timestamps=!0,o.return_timestamps=!1);let s=!Array.isArray(e);s&&(e=[e]);let c=this.processor.feature_extractor.config.chunk_length/this.model.config.max_source_positions,u=this.processor.feature_extractor.config.hop_length,d=this.processor.feature_extractor.config.sampling_rate,f=await m(e,d),p=[];for(let e of f){let t=[];if(r>0){if(a===null)a=r/6;else if(r<=a)throw Error("`chunk_length_s` must be larger than `stride_length_s`.");let n=d*r,i=d*a,o=n-2*i,s=0;for(;;){let r=s+n,a=e.subarray(s,r),c=await this.processor(a),l=s===0,u=r>=e.length;if(t.push({stride:[a.length,l?0:i,u?0:i],input_features:c.input_features,is_last:u}),u)break;s+=o}}else t=[{stride:[e.length,0,0],input_features:(await this.processor(e)).input_features,is_last:!0}];for(let e of t){o.num_frames=Math.floor(e.stride[0]/u);let t=await this.model.generate({inputs:e.input_features,...o});n===`word`?(e.tokens=t.sequences.tolist()[0],e.token_timestamps=t.token_timestamps.tolist()[0].map(e=>(0,l.round)(e,2))):e.tokens=t[0].tolist(),e.stride=e.stride.map(e=>e/d)}let[s,f]=this.tokenizer._decode_asr(t,{time_precision:c,return_timestamps:n,force_full_sequences:i});p.push({text:s,...f})}return s?p[0]:p}async _call_moonshine(e,t){let n=!Array.isArray(e);n&&(e=[e]);let r=this.processor.feature_extractor.config.sampling_rate,i=await m(e,r),a=[];for(let e of i){let n=await this.processor(e),i=Math.floor(e.length/r)*6,o=await this.model.generate({max_new_tokens:i,...t,...n}),s=this.processor.batch_decode(o,{skip_special_tokens:!0})[0];a.push({text:s})}return n?a[0]:a}}class te extends g{constructor(e){super(e)}async _call(e,t={}){let n=Array.isArray(e),r=await p(e),{pixel_values:i}=await this.processor(r),a=[];for(let e of i){e.dims=[1,...e.dims];let n=await this.model.generate({inputs:e,...t}),r=this.tokenizer.batch_decode(n,{skip_special_tokens:!0}).map(e=>({generated_text:e.trim()}));a.push(r)}return n?a:a[0]}}class ne extends g{constructor(e){super(e)}async _call(e,{top_k:t=5}={}){let n=await p(e),{pixel_values:r}=await this.processor(n),i=await this.model({pixel_values:r}),a=this.model.config.id2label,o=[];for(let e of i.logits){let n=await(0,d.topk)(new d.Tensor(`float32`,(0,l.softmax)(e.data),e.dims),t),r=n[0].tolist(),i=n[1].tolist(),s=i.map((e,t)=>({label:a?a[e]:`LABEL_${e}`,score:r[t]}));o.push(s)}return Array.isArray(e)?o:o[0]}}class j extends g{constructor(e){super(e),this.subtasks_mapping={panoptic:`post_process_panoptic_segmentation`,instance:`post_process_instance_segmentation`,semantic:`post_process_semantic_segmentation`}}async _call(e,{threshold:t=.5,mask_threshold:n=.5,overlap_mask_area_threshold:r=.8,label_ids_to_fuse:i=null,target_sizes:a=null,subtask:o=null}={}){let s=Array.isArray(e);if(s&&e.length!==1)throw Error(`Image segmentation pipeline currently only supports a batch size of 1.`);let c=await p(e),l=c.map(e=>[e.height,e.width]),u=await this.processor(c),{inputNames:d,outputNames:m}=this.model.sessions.model;if(!d.includes(`pixel_values`)){if(d.length!==1)throw Error(`Expected a single input name, but got ${d.length} inputs: ${d}.`);let e=d[0];if(e in u)throw Error(`Input name ${e} already exists in the inputs.`);u[e]=u.pixel_values}let h=await this.model(u),g=null;if(o!==null)g=this.subtasks_mapping[o];else if(this.processor.image_processor){for(let[e,t]of Object.entries(this.subtasks_mapping))if(t in this.processor.image_processor){g=this.processor.image_processor[t].bind(this.processor.image_processor),o=e;break}}let _=this.model.config.id2label,v=[];if(o)if(o===`panoptic`||o===`instance`){let e=g(h,t,n,r,i,a??l)[0],o=e.segmentation;for(let t of e.segments_info){let e=new Uint8ClampedArray(o.data.length);for(let n=0;nt<-e||t>1+e)&&i.sigmoid_();let a=await f.RawImage.fromTensor(i.mul_(255).to(`uint8`)).resize(r[1],r[0]);v.push({label:null,score:null,mask:a})}}return v}}class re extends j{constructor(e){super(e)}async _call(e,t={}){let n=Array.isArray(e);if(n&&e.length!==1)throw Error(`Background removal pipeline currently only supports a batch size of 1.`);let r=await p(e),i=await super._call(e,t),a=r.map((e,t)=>{let n=e.clone();return n.putAlpha(i[t].mask),n});return a}}class ie extends g{constructor(e){super(e)}async _call(e,t,{hypothesis_template:n=`This is a photo of {}`}={}){let r=Array.isArray(e),i=await p(e),a=t.map(e=>n.replace(`{}`,e)),o=this.tokenizer(a,{padding:this.model.config.model_type===`siglip`?`max_length`:!0,truncation:!0}),{pixel_values:s}=await this.processor(i),c=await this.model({...o,pixel_values:s}),u=this.model.config.model_type===`siglip`?e=>e.sigmoid().data:e=>(0,l.softmax)(e.data),d=[];for(let e of c.logits_per_image){let n=u(e),r=[...n].map((e,n)=>({score:e,label:t[n]}));r.sort((e,t)=>t.score-e.score),d.push(r)}return r?d:d[0]}}class ae extends g{constructor(e){super(e)}async _call(e,{threshold:t=.9,percentage:n=!1}={}){let r=Array.isArray(e);if(r&&e.length!==1)throw Error(`Object detection pipeline currently only supports a batch size of 1.`);let i=await p(e),a=n?null:i.map(e=>[e.height,e.width]),{pixel_values:o,pixel_mask:s}=await this.processor(i),c=await this.model({pixel_values:o,pixel_mask:s}),l=this.processor.image_processor.post_process_object_detection(c,t,a),u=this.model.config.id2label,d=l.map(e=>e.boxes.map((t,r)=>({score:e.scores[r],label:u[e.classes[r]],box:h(t,!n)})));return r?d:d[0]}}class oe extends g{constructor(e){super(e)}async _call(e,t,{threshold:n=.1,top_k:r=null,percentage:i=!1}={}){let a=Array.isArray(e),o=await p(e),s=this.tokenizer(t,{padding:!0,truncation:!0}),c=await this.processor(o),l=[];for(let e=0;e({score:e.scores[n],label:e.labels[n],box:h(t,!i)}))}else{let e=this.processor.image_processor.post_process_object_detection(f,n,u,!0)[0];p=e.boxes.map((n,r)=>({score:e.scores[r],label:t[e.classes[r]],box:h(n,!i)}))}p.sort((e,t)=>t.score-e.score),r!==null&&(p=p.slice(0,r)),l.push(p)}return a?l:l[0]}}class se extends g{constructor(e){super(e)}async _call(e,t,n={}){let r=(await p(e))[0],{pixel_values:i}=await this.processor(r),a=`${t}`,o=this.tokenizer(a,{add_special_tokens:!1,padding:!0,truncation:!0}).input_ids,s=await this.model.generate({inputs:i,max_length:this.model.config.decoder.max_position_embeddings,decoder_input_ids:o,...n}),c=this.tokenizer.batch_decode(s)[0],l=c.match(/(.*?)<\/s_answer>/),u=null;return l&&l.length>=2&&(u=l[1].trim()),[{answer:u}]}}class M extends g{DEFAULT_VOCODER_ID=`Xenova/speecht5_hifigan`;constructor(e){super(e),this.vocoder=e.vocoder??null}async _call(e,{speaker_embeddings:t=null}={}){return this.processor?this._call_text_to_spectrogram(e,{speaker_embeddings:t}):this._call_text_to_waveform(e)}async _call_text_to_waveform(e){let t=this.tokenizer(e,{padding:!0,truncation:!0}),{waveform:n}=await this.model(t),r=this.model.config.sampling_rate;return new u.RawAudio(n.data,r)}async _call_text_to_spectrogram(e,{speaker_embeddings:t}){if(this.vocoder||(console.log(`No vocoder specified, using default HifiGan vocoder.`),this.vocoder=await i.AutoModel.from_pretrained(this.DEFAULT_VOCODER_ID,{dtype:`fp32`})),(typeof t==`string`||t instanceof URL)&&(t=new Float32Array(await(await fetch(t)).arrayBuffer())),t instanceof Float32Array)t=new d.Tensor(`float32`,t,[1,t.length]);else if(!(t instanceof d.Tensor))throw Error("Speaker embeddings must be a `Tensor`, `Float32Array`, `string`, or `URL`.");let{input_ids:n}=this.tokenizer(e,{padding:!0,truncation:!0}),{waveform:r}=await this.model.generate_speech(n,t,{vocoder:this.vocoder}),a=this.processor.feature_extractor.config.sampling_rate;return new u.RawAudio(r.data,a)}}class N extends g{constructor(e){super(e)}async _call(e){let t=await p(e),n=await this.processor(t),r=await this.model(n),i=[];for(let e of r.reconstruction){let t=e.squeeze().clamp_(0,1).mul_(255).round_().to(`uint8`);i.push(f.RawImage.fromTensor(t))}return i.length>1?i:i[0]}}class ce extends g{constructor(e){super(e)}async _call(e){let t=await p(e),n=await this.processor(t),{predicted_depth:r}=await this.model(n),i=[];for(let e=0;e1?i:i[0]}}let le=Object.freeze({"text-classification":{tokenizer:r.AutoTokenizer,pipeline:_,model:i.AutoModelForSequenceClassification,default:{model:`Xenova/distilbert-base-uncased-finetuned-sst-2-english`},type:`text`},"token-classification":{tokenizer:r.AutoTokenizer,pipeline:v,model:i.AutoModelForTokenClassification,default:{model:`Xenova/bert-base-multilingual-cased-ner-hrl`},type:`text`},"question-answering":{tokenizer:r.AutoTokenizer,pipeline:y,model:i.AutoModelForQuestionAnswering,default:{model:`Xenova/distilbert-base-cased-distilled-squad`},type:`text`},"fill-mask":{tokenizer:r.AutoTokenizer,pipeline:b,model:i.AutoModelForMaskedLM,default:{model:`Xenova/bert-base-uncased`},type:`text`},summarization:{tokenizer:r.AutoTokenizer,pipeline:S,model:i.AutoModelForSeq2SeqLM,default:{model:`Xenova/distilbart-cnn-6-6`},type:`text`},translation:{tokenizer:r.AutoTokenizer,pipeline:C,model:i.AutoModelForSeq2SeqLM,default:{model:`Xenova/t5-small`},type:`text`},"text2text-generation":{tokenizer:r.AutoTokenizer,pipeline:x,model:i.AutoModelForSeq2SeqLM,default:{model:`Xenova/flan-t5-small`},type:`text`},"text-generation":{tokenizer:r.AutoTokenizer,pipeline:T,model:i.AutoModelForCausalLM,default:{model:`Xenova/gpt2`},type:`text`},"zero-shot-classification":{tokenizer:r.AutoTokenizer,pipeline:E,model:i.AutoModelForSequenceClassification,default:{model:`Xenova/distilbert-base-uncased-mnli`},type:`text`},"audio-classification":{pipeline:k,model:i.AutoModelForAudioClassification,processor:a.AutoProcessor,default:{model:`Xenova/wav2vec2-base-superb-ks`},type:`audio`},"zero-shot-audio-classification":{tokenizer:r.AutoTokenizer,pipeline:A,model:i.AutoModel,processor:a.AutoProcessor,default:{model:`Xenova/clap-htsat-unfused`},type:`multimodal`},"automatic-speech-recognition":{tokenizer:r.AutoTokenizer,pipeline:ee,model:[i.AutoModelForSpeechSeq2Seq,i.AutoModelForCTC],processor:a.AutoProcessor,default:{model:`Xenova/whisper-tiny.en`},type:`multimodal`},"text-to-audio":{tokenizer:r.AutoTokenizer,pipeline:M,model:[i.AutoModelForTextToWaveform,i.AutoModelForTextToSpectrogram],processor:[a.AutoProcessor,null],default:{model:`Xenova/speecht5_tts`},type:`text`},"image-to-text":{tokenizer:r.AutoTokenizer,pipeline:te,model:i.AutoModelForVision2Seq,processor:a.AutoProcessor,default:{model:`Xenova/vit-gpt2-image-captioning`},type:`multimodal`},"image-classification":{pipeline:ne,model:i.AutoModelForImageClassification,processor:a.AutoProcessor,default:{model:`Xenova/vit-base-patch16-224`},type:`multimodal`},"image-segmentation":{pipeline:j,model:[i.AutoModelForImageSegmentation,i.AutoModelForSemanticSegmentation,i.AutoModelForUniversalSegmentation],processor:a.AutoProcessor,default:{model:`Xenova/detr-resnet-50-panoptic`},type:`multimodal`},"background-removal":{pipeline:re,model:[i.AutoModelForImageSegmentation,i.AutoModelForSemanticSegmentation,i.AutoModelForUniversalSegmentation],processor:a.AutoProcessor,default:{model:`Xenova/modnet`},type:`image`},"zero-shot-image-classification":{tokenizer:r.AutoTokenizer,pipeline:ie,model:i.AutoModel,processor:a.AutoProcessor,default:{model:`Xenova/clip-vit-base-patch32`},type:`multimodal`},"object-detection":{pipeline:ae,model:i.AutoModelForObjectDetection,processor:a.AutoProcessor,default:{model:`Xenova/detr-resnet-50`},type:`multimodal`},"zero-shot-object-detection":{tokenizer:r.AutoTokenizer,pipeline:oe,model:i.AutoModelForZeroShotObjectDetection,processor:a.AutoProcessor,default:{model:`Xenova/owlvit-base-patch32`},type:`multimodal`},"document-question-answering":{tokenizer:r.AutoTokenizer,pipeline:se,model:i.AutoModelForDocumentQuestionAnswering,processor:a.AutoProcessor,default:{model:`Xenova/donut-base-finetuned-docvqa`},type:`multimodal`},"image-to-image":{pipeline:N,model:i.AutoModelForImageToImage,processor:a.AutoProcessor,default:{model:`Xenova/swin2SR-classical-sr-x2-64`},type:`image`},"depth-estimation":{pipeline:ce,model:i.AutoModelForDepthEstimation,processor:a.AutoProcessor,default:{model:`Xenova/dpt-large`},type:`image`},"feature-extraction":{tokenizer:r.AutoTokenizer,pipeline:D,model:i.AutoModel,default:{model:`Xenova/all-MiniLM-L6-v2`},type:`text`},"image-feature-extraction":{processor:a.AutoProcessor,pipeline:O,model:[i.AutoModelForImageFeatureExtraction,i.AutoModel],default:{model:`Xenova/vit-base-patch16-224-in21k`},type:`image`}}),ue=Object.freeze({"sentiment-analysis":`text-classification`,ner:`token-classification`,asr:`automatic-speech-recognition`,"text-to-speech":`text-to-audio`,embeddings:`feature-extraction`});async function de(e,t=null,{progress_callback:n=null,config:r=null,cache_dir:i=null,local_files_only:a=!1,revision:o=`main`,device:s=null,dtype:l=null,subfolder:u=`onnx`,use_external_data_format:d=null,model_file_name:f=null,session_options:p={}}={}){e=ue[e]??e;let m=le[e.split(`_`,1)[0]];if(!m)throw Error(`Unsupported pipeline: ${e}. Must be one of [${Object.keys(le)}]`);t||(t=m.default.model,console.log(`No model specified. Using default model: "${t}".`));let h={progress_callback:n,config:r,cache_dir:i,local_files_only:a,revision:o,device:s,dtype:l,subfolder:u,use_external_data_format:d,model_file_name:f,session_options:p},g=new Map([[`tokenizer`,m.tokenizer],[`model`,m.model],[`processor`,m.processor]]),_=await fe(g,t,h);_.task=e,(0,c.dispatchCallback)(n,{status:`ready`,task:e,model:t});let v=m.pipeline;return new v(_)}async function fe(e,t,n){let r=Object.create(null),i=[];for(let[a,o]of e.entries()){if(!o)continue;let e;e=Array.isArray(o)?new Promise(async(e,r)=>{let i;for(let a of o){if(a===null){e(null);return}try{e(await a.from_pretrained(t,n));return}catch(e){if(e.message?.includes(`Unsupported model type`))i=e;else if(e.message?.includes(`Could not locate file`))i=e;else{r(e);return}}}r(i)}):o.from_pretrained(t,n),r[a]=e,i.push(e)}await Promise.all(i);for(let[e,t]of Object.entries(r))r[e]=await t;return r}},"./src/tokenizers.js":(e,t,n)=>{n.r(t),n.d(t,{AlbertTokenizer:()=>Be,AutoTokenizer:()=>Mt,BartTokenizer:()=>$e,BertTokenizer:()=>ze,BlenderbotSmallTokenizer:()=>Tt,BlenderbotTokenizer:()=>wt,BloomTokenizer:()=>rt,CLIPTokenizer:()=>bt,CamembertTokenizer:()=>Je,CodeGenTokenizer:()=>yt,CodeLlamaTokenizer:()=>ot,CohereTokenizer:()=>kt,ConvBertTokenizer:()=>Ge,DebertaTokenizer:()=>He,DebertaV2Tokenizer:()=>Ue,DistilBertTokenizer:()=>qe,ElectraTokenizer:()=>Xe,Ernie4_5_Tokenizer:()=>jt,EsmTokenizer:()=>dt,FalconTokenizer:()=>lt,GPT2Tokenizer:()=>Qe,GPTNeoXTokenizer:()=>ut,GemmaTokenizer:()=>pt,Grok1Tokenizer:()=>mt,HerbertTokenizer:()=>We,LlamaTokenizer:()=>at,M2M100Tokenizer:()=>_t,MBart50Tokenizer:()=>tt,MBartTokenizer:()=>et,MPNetTokenizer:()=>ct,MarianTokenizer:()=>St,MgpstrTokenizer:()=>At,MobileBertTokenizer:()=>H,NllbTokenizer:()=>gt,NougatTokenizer:()=>Dt,PreTrainedTokenizer:()=>V,Qwen2Tokenizer:()=>ft,RoFormerTokenizer:()=>Ke,RobertaTokenizer:()=>nt,SiglipTokenizer:()=>xt,SpeechT5Tokenizer:()=>Et,SqueezeBertTokenizer:()=>Ve,T5Tokenizer:()=>Ze,TokenizerModel:()=>D,VitsTokenizer:()=>Ot,Wav2Vec2CTCTokenizer:()=>Ct,WhisperTokenizer:()=>vt,XLMRobertaTokenizer:()=>st,XLMTokenizer:()=>Ye,is_chinese_char:()=>y});var r=n( /*! ./utils/generic.js */ `./src/utils/generic.js`),i=n( /*! ./utils/core.js */ @@ -3506,8 +3506,8 @@ var af={"onnxruntime-common":e=>{e.exports=ne},"onnxruntime-web":e=>{e.exports=j /*! @huggingface/jinja */ `./node_modules/@huggingface/jinja/dist/index.js`),u=n( /*! ./models/whisper/common_whisper.js */ -`./src/models/whisper/common_whisper.js`);async function d(e,t){let n=await Promise.all([(0,a.getModelJSON)(e,`tokenizer.json`,!0,t),(0,a.getModelJSON)(e,`tokenizer_config.json`,!0,t)]);return t.legacy!==null&&(n[1].legacy=t.legacy),n}function f(e,t){let n=[],r=0;for(let i of e.matchAll(t)){let t=i[0];r0&&n.push(t),r=i.index+t.length}return r=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=63744&&e<=64255||e>=194560&&e<=195103}function b(e,t,n){let r=[],i=0;for(;ithis.tokens_to_ids.get(e)??this.unk_token_id)}convert_ids_to_tokens(e){return e.map(e=>this.vocab[e]??this.unk_token)}}class O extends D{constructor(e){super(e),this.tokens_to_ids=m(e.vocab),this.unk_token_id=this.tokens_to_ids.get(e.unk_token),this.unk_token=e.unk_token,this.max_input_chars_per_word=e.max_input_chars_per_word??100,this.vocab=Array(this.tokens_to_ids.size);for(let[e,t]of this.tokens_to_ids)this.vocab[t]=e}encode(e){let t=[];for(let n of e){let e=[...n];if(e.length>this.max_input_chars_per_word){t.push(this.unk_token);continue}let r=!1,i=0,a=[];for(;i0&&(r=this.config.continuing_subword_prefix+r),this.tokens_to_ids.has(r)){n=r;break}--t}if(n===null){r=!0;break}a.push(n),i=t}r?t.push(this.unk_token):t.push(...a)}return t}}class k extends D{constructor(e,t){super(e);let n=e.vocab.length;this.vocab=Array(n),this.scores=Array(n);for(let t=0;t[e,t])),this.bos_token=` `,this.bos_token_id=this.tokens_to_ids.get(this.bos_token),this.eos_token=t.eos_token,this.eos_token_id=this.tokens_to_ids.get(this.eos_token),this.unk_token=this.vocab[this.unk_token_id],this.minScore=(0,o.min)(this.scores)[0],this.unk_score=this.minScore-10,this.scores[this.unk_token_id]=this.unk_score,this.trie=new c.CharTrie,this.trie.extend(this.vocab),this.fuse_unk=!0}populateNodes(e){let t=e.chars,n=1,r=0;for(;r{let e=[...Array.from({length:94},(e,t)=>t+33),...Array.from({length:12},(e,t)=>t+161),...Array.from({length:82},(e,t)=>t+174)],t=e.slice(),n=0;for(let r=0;r<256;++r)e.includes(r)||(e.push(r),t.push(256+n),n+=1);let r=t.map(e=>String.fromCharCode(e));return Object.fromEntries(e.map((e,t)=>[e,r[t]]))})(),ee=(0,i.reverseDictionary)(A);class te extends D{constructor(e){super(e),this.tokens_to_ids=m(e.vocab),this.unk_token_id=this.tokens_to_ids.get(e.unk_token),this.unk_token=e.unk_token,this.vocab=Array(this.tokens_to_ids.size);for(let[e,t]of this.tokens_to_ids)this.vocab[t]=e;let t=Array.isArray(e.merges[0]);this.merges=t?e.merges:e.merges.map(e=>e.split(` `,2)),this.bpe_ranks=new Map(this.merges.map((e,t)=>[JSON.stringify(e),t])),this.end_of_word_suffix=e.end_of_word_suffix,this.continuing_subword_suffix=e.continuing_subword_suffix??null,this.byte_fallback=this.config.byte_fallback??!1,this.byte_fallback&&(this.text_encoder=new TextEncoder),this.ignore_merges=this.config.ignore_merges??!1,this.max_length_to_cache=256,this.cache_capacity=1e4,this.cache=new c.LRUCache(this.cache_capacity)}clear_cache(){this.cache.clear()}bpe(e){if(e.length===0)return[];let t=this.cache.get(e);if(t!==void 0)return t;let n=Array.from(e);this.end_of_word_suffix&&(n[n.length-1]+=this.end_of_word_suffix);let r=[];if(n.length>1){let e=new c.PriorityQueue((e,t)=>e.score`<0x${e.toString(16).toUpperCase().padStart(2,`0`)}>`);e.every(e=>this.tokens_to_ids.has(e))?t.push(...e):t.push(this.unk_token)}else t.push(this.unk_token)}return t}}class ne extends D{constructor(e,t){super(e),this.tokens_to_ids=m(t.target_lang?e.vocab[t.target_lang]:e.vocab),this.bos_token=t.bos_token,this.bos_token_id=this.tokens_to_ids.get(this.bos_token),this.eos_token=t.eos_token,this.eos_token_id=this.tokens_to_ids.get(this.eos_token),this.pad_token=t.pad_token,this.pad_token_id=this.tokens_to_ids.get(this.pad_token),this.unk_token=t.unk_token,this.unk_token_id=this.tokens_to_ids.get(this.unk_token),this.vocab=Array(this.tokens_to_ids.size);for(let[e,t]of this.tokens_to_ids)this.vocab[t]=e}encode(e){return e}}class j extends r.Callable{constructor(e){super(),this.config=e}static fromConfig(e){if(e===null)return null;switch(e.type){case`BertNormalizer`:return new P(e);case`Precompiled`:return new R(e);case`Sequence`:return new de(e);case`Replace`:return new re(e);case`NFC`:return new ae(e);case`NFD`:return new oe(e);case`NFKC`:return new se(e);case`NFKD`:return new M(e);case`Strip`:return new N(e);case`StripAccents`:return new ce(e);case`Lowercase`:return new le(e);case`Prepend`:return new ue(e);default:throw Error(`Unknown Normalizer type: ${e.type}`)}}normalize(e){throw Error(`normalize should be implemented in subclass.`)}_call(e){return this.normalize(e)}}class re extends j{normalize(e){let t=p(this.config.pattern);return t===null?e:e.replaceAll(t,this.config.content)}}class ie extends j{form=void 0;normalize(e){return e=e.normalize(this.form),e}}class ae extends ie{form=`NFC`}class oe extends ie{form=`NFD`}class se extends ie{form=`NFKC`}class M extends ie{form=`NFKD`}class N extends j{normalize(e){return this.config.strip_left&&this.config.strip_right?e=e.trim():(this.config.strip_left&&(e=e.trimStart()),this.config.strip_right&&(e=e.trimEnd())),e}}class ce extends j{normalize(e){return e=_(e),e}}class le extends j{normalize(e){return e=e.toLowerCase(),e}}class ue extends j{normalize(e){return e=this.config.prepend+e,e}}class de extends j{constructor(e){super(e),this.normalizers=e.normalizers.map(e=>j.fromConfig(e))}normalize(e){return this.normalizers.reduce((e,t)=>t.normalize(e),e)}}class P extends j{_tokenize_chinese_chars(e){let t=[];for(let n=0;nthis.pre_tokenize_text(e,t)):this.pre_tokenize_text(e,t)).flat()}_call(e,t){return this.pre_tokenize(e,t)}}class fe extends F{constructor(e){super(),this.pattern=RegExp(`[^\\s${S}]+|[${S}]`,`gu`)}pre_tokenize_text(e,t){return e.trim().match(this.pattern)||[]}}class I extends F{constructor(e){super(),this.config=e,this.add_prefix_space=this.config.add_prefix_space,this.trim_offsets=this.config.trim_offsets,this.use_regex=this.config.use_regex??!0,this.pattern=/'s|'t|'re|'ve|'m|'ll|'d| ?\p{L}+| ?\p{N}+| ?[^\s\p{L}\p{N}]+|\s+(?!\S)|\s+/gu,this.byte_encoder=A,this.text_encoder=new TextEncoder}pre_tokenize_text(e,t){this.add_prefix_space&&!e.startsWith(` `)&&(e=` `+e);let n=this.use_regex?e.match(this.pattern)||[]:[e];return n.map(e=>Array.from(this.text_encoder.encode(e),e=>this.byte_encoder[e]).join(``))}}class pe extends F{constructor(e){super(),this.config=e,this.pattern=p(this.config.pattern,this.config.invert)}pre_tokenize_text(e,t){return this.pattern===null?[]:this.config.invert?e.match(this.pattern)||[]:this.config.behavior?.toLowerCase()===`removed`?e.split(this.pattern).filter(e=>e):f(e,this.pattern)}}class me extends F{constructor(e){super(),this.config=e,this.pattern=RegExp(`[^${S}]+|[${S}]+`,`gu`)}pre_tokenize_text(e,t){return e.match(this.pattern)||[]}}class he extends F{constructor(e){super(),this.config=e;let t=`[^\\d]+|\\d${this.config.individual_digits?``:`+`}`;this.pattern=new RegExp(t,`gu`)}pre_tokenize_text(e,t){return e.match(this.pattern)||[]}}class ge extends r.Callable{constructor(e){super(),this.config=e}static fromConfig(e){if(e===null)return null;switch(e.type){case`TemplateProcessing`:return new L(e);case`ByteLevel`:return new ye(e);case`RobertaProcessing`:return new ve(e);case`BertProcessing`:return new _e(e);case`Sequence`:return new be(e);default:throw Error(`Unknown PostProcessor type: ${e.type}`)}}post_process(e,...t){throw Error(`post_process should be implemented in subclass.`)}_call(e,...t){return this.post_process(e,...t)}}class _e extends ge{constructor(e){super(e),this.cls=e.cls[0],this.sep=e.sep[0]}post_process(e,t=null,{add_special_tokens:n=!0}={}){n&&(e=(0,i.mergeArrays)([this.cls],e,[this.sep]));let r=Array(e.length).fill(0);if(t!==null){let a=n&&this instanceof ve?[this.sep]:[],o=n?[this.sep]:[];e=(0,i.mergeArrays)(e,a,t,o),r=(0,i.mergeArrays)(r,Array(t.length+a.length+o.length).fill(1))}return{tokens:e,token_type_ids:r}}}class ve extends _e{}class L extends ge{constructor(e){super(e),this.single=e.single,this.pair=e.pair}post_process(e,t=null,{add_special_tokens:n=!0}={}){let r=t===null?this.single:this.pair,a=[],o=[];for(let s of r)`SpecialToken`in s?n&&(a.push(s.SpecialToken.id),o.push(s.SpecialToken.type_id)):`Sequence`in s&&(s.Sequence.id===`A`?(a=(0,i.mergeArrays)(a,e),o=(0,i.mergeArrays)(o,Array(e.length).fill(s.Sequence.type_id))):s.Sequence.id===`B`&&(a=(0,i.mergeArrays)(a,t),o=(0,i.mergeArrays)(o,Array(t.length).fill(s.Sequence.type_id))));return{tokens:a,token_type_ids:o}}}class ye extends ge{post_process(e,t=null){return t&&(e=(0,i.mergeArrays)(e,t)),{tokens:e}}}class be extends ge{constructor(e){super(e),this.processors=e.processors.map(e=>ge.fromConfig(e))}post_process(e,t=null,n={}){let r;for(let i of this.processors)if(i instanceof ye){let n=i.post_process(e);if(e=n.tokens,t){let e=i.post_process(t);t=e.tokens}}else{let a=i.post_process(e,t,n);e=a.tokens,r=a.token_type_ids}return{tokens:e,token_type_ids:r}}}class xe extends r.Callable{constructor(e){super(),this.config=e,this.added_tokens=[],this.end_of_word_suffix=null,this.trim_offsets=e.trim_offsets}static fromConfig(e){if(e===null)return null;switch(e.type){case`WordPiece`:return new Ee(e);case`Metaspace`:return new Ne(e);case`ByteLevel`:return new De(e);case`Replace`:return new Se(e);case`ByteFallback`:return new Ce(e);case`Fuse`:return new we(e);case`Strip`:return new Te(e);case`Sequence`:return new ke(e);case`CTC`:return new Oe(e);case`BPEDecoder`:return new Ae(e);default:throw Error(`Unknown Decoder type: ${e.type}`)}}_call(e){return this.decode(e)}decode(e){return this.decode_chain(e).join(``)}decode_chain(e){throw Error("`decode_chain` should be implemented in subclass.")}}class Se extends xe{decode_chain(e){let t=p(this.config.pattern);return t===null?e:e.map(e=>e.replaceAll(t,this.config.content))}}class Ce extends xe{constructor(e){super(e),this.text_decoder=new TextDecoder}decode_chain(e){let t=[],n=[];for(let r of e){let e=null;if(r.length===6&&r.startsWith(`<0x`)&&r.endsWith(`>`)){let t=parseInt(r.slice(3,5),16);isNaN(t)||(e=t)}if(e!==null)n.push(e);else{if(n.length>0){let e=this.text_decoder.decode(Uint8Array.from(n));t.push(e),n=[]}t.push(r)}}if(n.length>0){let e=this.text_decoder.decode(Uint8Array.from(n));t.push(e),n=[]}return t}}class we extends xe{decode_chain(e){return[e.join(``)]}}class Te extends xe{constructor(e){super(e),this.content=this.config.content,this.start=this.config.start,this.stop=this.config.stop}decode_chain(e){return e.map(e=>{let t=0;for(let n=0;n(t!==0&&(e=e.startsWith(this.config.prefix)?e.replace(this.config.prefix,``):` `+e),this.cleanup&&(e=g(e)),e))}}class De extends xe{constructor(e){super(e),this.byte_decoder=ee,this.text_decoder=new TextDecoder(`utf-8`,{fatal:!1,ignoreBOM:!0}),this.end_of_word_suffix=null}convert_tokens_to_string(e){let t=e.join(``),n=new Uint8Array([...t].map(e=>this.byte_decoder[e])),r=this.text_decoder.decode(n);return r}decode_chain(e){let t=[],n=[];for(let r of e)this.added_tokens.find(e=>e.content===r)===void 0?n.push(r):(n.length>0&&(t.push(this.convert_tokens_to_string(n)),n=[]),t.push(r));return n.length>0&&t.push(this.convert_tokens_to_string(n)),t}}class Oe extends xe{constructor(e){super(e),this.pad_token=this.config.pad_token,this.word_delimiter_token=this.config.word_delimiter_token,this.cleanup=this.config.cleanup}convert_tokens_to_string(e){if(e.length===0)return``;let t=[e[0]];for(let n=1;ne!==this.pad_token),r=n.join(``);return this.cleanup&&(r=g(r).replaceAll(this.word_delimiter_token,` `).trim()),r}decode_chain(e){return[this.convert_tokens_to_string(e)]}}class ke extends xe{constructor(e){super(e),this.decoders=e.decoders.map(e=>xe.fromConfig(e))}decode_chain(e){return this.decoders.reduce((e,t)=>t.decode_chain(e),e)}}class Ae extends xe{constructor(e){super(e),this.suffix=this.config.suffix}decode_chain(e){return e.map((t,n)=>t.replaceAll(this.suffix,n===e.length-1?``:` `))}}class je extends xe{decode_chain(e){let t=``;for(let n=1;ne.normalize(`NFKC`)).join(`~`)}else e=e.normalize(`NFKC`);return e}}class Pe extends F{constructor(e){super(),this.tokenizers=e.pretokenizers.map(e=>F.fromConfig(e))}pre_tokenize_text(e,t){return this.tokenizers.reduce((e,n)=>n.pre_tokenize(e,t),[e])}}class Fe extends F{constructor(e){super()}pre_tokenize_text(e,t){return e.match(/\w+|[^\w\s]+/g)||[]}}class Ie extends F{constructor(e){super()}pre_tokenize_text(e,t){return x(e)}}class Le extends F{constructor(e){super(),this.config=e,this.pattern=p(this.config.pattern),this.content=this.config.content}pre_tokenize_text(e,t){return this.pattern===null?[e]:[e.replaceAll(this.pattern,this.config.content)]}}let Re=[`bos_token`,`eos_token`,`unk_token`,`sep_token`,`pad_token`,`cls_token`,`mask_token`];function ze(e,t,n,r){for(let a of Object.keys(e)){let o=t-e[a].length,s=n(a),c=Array(o).fill(s);e[a]=r===`right`?(0,i.mergeArrays)(e[a],c):(0,i.mergeArrays)(c,e[a])}}function Be(e,t){for(let n of Object.keys(e))e[n].length=t}class z extends r.Callable{return_token_type_ids=!1;padding_side=`right`;constructor(e,t){super(),this.config=t,this.normalizer=j.fromConfig(e.normalizer),this.pre_tokenizer=F.fromConfig(e.pre_tokenizer),this.model=D.fromConfig(e.model,t),this.post_processor=ge.fromConfig(e.post_processor),this.decoder=xe.fromConfig(e.decoder),this.special_tokens=[],this.all_special_ids=[],this.added_tokens=[];for(let t of e.added_tokens){let e=new E(t);this.added_tokens.push(e),this.model.tokens_to_ids.set(e.content,e.id),this.model.vocab[e.id]=e.content,e.special&&(this.special_tokens.push(e.content),this.all_special_ids.push(e.id))}if(this.additional_special_tokens=t.additional_special_tokens??[],this.special_tokens.push(...this.additional_special_tokens),this.special_tokens=[...new Set(this.special_tokens)],this.decoder&&(this.decoder.added_tokens=this.added_tokens,this.decoder.end_of_word_suffix=this.model.end_of_word_suffix),this.added_tokens_splitter=new c.DictionarySplitter(this.added_tokens.map(e=>e.content)),this.added_tokens_map=new Map(this.added_tokens.map(e=>[e.content,e])),this.mask_token=this.getToken(`mask_token`),this.mask_token_id=this.model.tokens_to_ids.get(this.mask_token),this.pad_token=this.getToken(`pad_token`,`eos_token`),this.pad_token_id=this.model.tokens_to_ids.get(this.pad_token),this.sep_token=this.getToken(`sep_token`),this.sep_token_id=this.model.tokens_to_ids.get(this.sep_token),this.unk_token=this.getToken(`unk_token`),this.unk_token_id=this.model.tokens_to_ids.get(this.unk_token),this.bos_token=this.getToken(`bos_token`),this.bos_token_id=this.model.tokens_to_ids.get(this.bos_token),this.eos_token=this.getToken(`eos_token`),this.eos_token_id=this.model.tokens_to_ids.get(this.eos_token),this.model_max_length=t.model_max_length,this.remove_space=t.remove_space,this.clean_up_tokenization_spaces=t.clean_up_tokenization_spaces??!0,this.do_lowercase_and_remove_accent=t.do_lowercase_and_remove_accent??!1,t.padding_side&&(this.padding_side=t.padding_side),this.legacy=!1,this.chat_template=t.chat_template??null,Array.isArray(this.chat_template)){let e=Object.create(null);for(let{name:t,template:n}of this.chat_template){if(typeof t!=`string`||typeof n!=`string`)throw Error(`Chat template must be a list of objects with "name" and "template" properties`);e[t]=n}this.chat_template=e}this._compiled_template_cache=new Map}getToken(...e){for(let t of e){let e=this.config[t];if(!e)continue;if(typeof e==`object`){if(e.__type===`AddedToken`)return e.content;throw Error(`Unknown token: ${e}`)}else return e}return null}static async from_pretrained(e,{progress_callback:t=null,config:n=null,cache_dir:r=null,local_files_only:i=!1,revision:a=`main`,legacy:o=null}={}){let s=await d(e,{progress_callback:t,config:n,cache_dir:r,local_files_only:i,revision:a,legacy:o});return new this(...s)}_call(e,{text_pair:t=null,add_special_tokens:n=!0,padding:r=!1,truncation:i=null,max_length:a=null,return_tensor:c=!0,return_token_type_ids:l=null}={}){let u=Array.isArray(e),d;if(u){if(e.length===0)throw Error(`text array must be non-empty`);if(t!==null){if(Array.isArray(t)){if(e.length!==t.length)throw Error(`text and text_pair must have the same length`)}else throw Error(`text_pair must also be an array`);d=e.map((e,r)=>this._encode_plus(e,{text_pair:t[r],add_special_tokens:n,return_token_type_ids:l}))}else d=e.map(e=>this._encode_plus(e,{add_special_tokens:n,return_token_type_ids:l}))}else{if(e==null)throw Error(`text may not be null or undefined`);if(Array.isArray(t))throw Error("When specifying `text_pair`, since `text` is a string, `text_pair` must also be a string (i.e., not an array).");d=[this._encode_plus(e,{text_pair:t,add_special_tokens:n,return_token_type_ids:l})]}if(a===null?a=this.model_max_length:i===null&&(r===!0?(console.warn("`max_length` is ignored when `padding: true` and there is no truncation strategy. To pad to max length, use `padding: 'max_length'`."),a=this.model_max_length):r===!1&&(console.warn("Truncation was not explicitly activated but `max_length` is provided a specific value, please use `truncation: true` to explicitly truncate examples to max length."),i=!0)),r===!0&&(a=Math.min((0,o.max)(d.map(e=>e.input_ids.length))[0],a??1/0)),a=Math.min(a,this.model_max_length??1/0),r||i)for(let e=0;ea?i&&Be(d[e],a):r&&ze(d[e],a,e=>e===`input_ids`?this.pad_token_id:0,this.padding_side);let f={};if(c){if(!(r&&i)&&d.some(e=>{for(let t of Object.keys(e))if(e[t].length!==d[0][t]?.length)return!0;return!1}))throw Error(`Unable to create tensor, you should probably activate truncation and/or padding with 'padding=true' and 'truncation=true' to have batched tensors with the same length.`);let e=[d.length,d[0].input_ids.length];for(let t of Object.keys(d[0]))f[t]=new s.Tensor(`int64`,BigInt64Array.from(d.flatMap(e=>e[t]).map(BigInt)),e)}else{for(let e of Object.keys(d[0]))f[e]=d.map(t=>t[e]);if(!u)for(let e of Object.keys(f))f[e]=f[e][0]}return f}_encode_text(e){if(e===null)return null;let t=this.added_tokens_splitter.split(e);for(let e=0;e0&&(t[e-1]=t[e-1].trimEnd()),n.rstrip&&e{if(e.length===0)return[];if(this.added_tokens_map.has(e))return[e];if(this.remove_space===!0&&(e=e.trim().split(/\s+/).join(` `)),this.do_lowercase_and_remove_accent&&(e=v(e)),this.normalizer!==null&&(e=this.normalizer(e)),e.length===0)return[];let n=this.pre_tokenizer===null?[e]:this.pre_tokenizer(e,{section_index:t}),r=this.model(n);return r});return n}_encode_plus(e,{text_pair:t=null,add_special_tokens:n=!0,return_token_type_ids:r=null}={}){let{tokens:i,token_type_ids:a}=this._tokenize_helper(e,{pair:t,add_special_tokens:n}),o=this.model.convert_tokens_to_ids(i),s={input_ids:o,attention_mask:Array(o.length).fill(1)};return(r??this.return_token_type_ids)&&a&&(s.token_type_ids=a),s}_tokenize_helper(e,{pair:t=null,add_special_tokens:n=!1}={}){let r=this._encode_text(e),a=this._encode_text(t);return this.post_processor?this.post_processor(r,a,{add_special_tokens:n}):{tokens:(0,i.mergeArrays)(r??[],a??[])}}tokenize(e,{pair:t=null,add_special_tokens:n=!1}={}){return this._tokenize_helper(e,{pair:t,add_special_tokens:n}).tokens}encode(e,{text_pair:t=null,add_special_tokens:n=!0,return_token_type_ids:r=null}={}){return this._encode_plus(e,{text_pair:t,add_special_tokens:n,return_token_type_ids:r}).input_ids}batch_decode(e,t={}){return e instanceof s.Tensor&&(e=e.tolist()),e.map(e=>this.decode(e,t))}decode(e,t={}){if(e instanceof s.Tensor&&(e=h(e)),!Array.isArray(e)||e.length===0||!(0,i.isIntegralNumber)(e[0]))throw Error(`token_ids must be a non-empty array of integers.`);return this.decode_single(e,t)}decode_single(e,{skip_special_tokens:t=!1,clean_up_tokenization_spaces:n=null}){let r=this.model.convert_ids_to_tokens(e);t&&(r=r.filter(e=>!this.special_tokens.includes(e)));let i=this.decoder?this.decoder(r):r.join(` `);return this.decoder&&this.decoder.end_of_word_suffix&&(i=i.replaceAll(this.decoder.end_of_word_suffix,` `),t&&(i=i.trim())),(n??this.clean_up_tokenization_spaces)&&(i=g(i)),i}get_chat_template({chat_template:e=null,tools:t=null}={}){if(this.chat_template&&typeof this.chat_template==`object`){let n=this.chat_template;if(e!==null&&Object.hasOwn(n,e))e=n[e];else if(e===null)if(t!==null&&`tool_use`in n)e=n.tool_use;else if(`default`in n)e=n.default;else throw Error(`This model has multiple chat templates with no default specified! Please either pass a chat template or the name of the template you wish to use to the 'chat_template' argument. Available template names are ${Object.keys(n).sort()}.`)}else if(e===null)if(this.chat_template)e=this.chat_template;else throw Error(`Cannot use apply_chat_template() because tokenizer.chat_template is not set and no template argument was passed! For information about writing templates and setting the tokenizer.chat_template attribute, please see the documentation at https://huggingface.co/docs/transformers/main/en/chat_templating`);return e}apply_chat_template(e,{tools:t=null,documents:n=null,chat_template:r=null,add_generation_prompt:i=!1,tokenize:a=!0,padding:o=!1,truncation:s=!1,max_length:c=null,return_tensor:u=!0,return_dict:d=!1,tokenizer_kwargs:f={},...p}={}){if(r=this.get_chat_template({chat_template:r,tools:t}),typeof r!=`string`)throw Error(`chat_template must be a string, but got ${typeof r}`);let m=this._compiled_template_cache.get(r);m===void 0&&(m=new l.Template(r),this._compiled_template_cache.set(r,m));let h=Object.create(null);for(let e of Re){let t=this.getToken(e);t&&(h[e]=t)}let g=m.render({messages:e,add_generation_prompt:i,tools:t,documents:n,...h,...p});if(a){let e=this._call(g,{add_special_tokens:!1,padding:o,truncation:s,max_length:c,return_tensor:u,...f});return d?e:e.input_ids}return g}}class Ve extends z{return_token_type_ids=!0}class He extends z{return_token_type_ids=!0}class B extends z{return_token_type_ids=!0}class Ue extends z{return_token_type_ids=!0}class We extends z{return_token_type_ids=!0}class Ge extends z{return_token_type_ids=!0}class Ke extends z{return_token_type_ids=!0}class qe extends z{return_token_type_ids=!0}class Je extends z{return_token_type_ids=!0}class Ye extends z{}class Xe extends z{}class Ze extends z{return_token_type_ids=!0;constructor(e,t){super(e,t),console.warn('WARNING: `XLMTokenizer` is not yet supported by Hugging Face\'s "fast" tokenizers library. Therefore, you may experience slightly inaccurate results.')}}class Qe extends z{return_token_type_ids=!0}class $e extends z{}class et extends z{}class tt extends z{}class nt extends z{constructor(e,t){super(e,t),this.languageRegex=/^[a-z]{2}_[A-Z]{2}$/,this.language_codes=this.special_tokens.filter(e=>this.languageRegex.test(e)),this.lang_to_token=e=>e}_build_translation_inputs(e,t,n){return _t(this,e,t,n)}}class rt extends nt{}class it extends z{}class at extends z{}let ot=`▁`;class st extends z{padding_side=`left`;constructor(e,t){super(e,t),this.legacy=t.legacy??!0,this.legacy||(this.normalizer=null,this.pre_tokenizer=new Me({replacement:ot,add_prefix_space:!0,prepend_scheme:`first`}))}_encode_text(e){if(e===null)return null;if(this.legacy||e.length===0)return super._encode_text(e);let t=super._encode_text(ot+e.replaceAll(ot,` `));return t.length>1&&t[0]===ot&&this.special_tokens.includes(t[1])&&(t=t.slice(1)),t}}class ct extends z{}class lt extends z{}class ut extends z{}class dt extends z{}class ft extends z{}class pt extends z{}class mt extends z{}class ht extends z{}class gt extends z{}function _t(e,t,n,r){if(!(`language_codes`in e)||!Array.isArray(e.language_codes))throw Error("Tokenizer must have `language_codes` attribute set and it should be an array of language ids.");if(!(`languageRegex`in e)||!(e.languageRegex instanceof RegExp))throw Error("Tokenizer must have `languageRegex` attribute set and it should be a regular expression.");if(!(`lang_to_token`in e)||typeof e.lang_to_token!=`function`)throw Error("Tokenizer must have `lang_to_token` attribute set and it should be a function.");let i=r.src_lang,a=r.tgt_lang;if(!e.language_codes.includes(a))throw Error(`Target language code "${a}" is not valid. Must be one of: {${e.language_codes.join(`, `)}}`);if(i!==void 0){if(!e.language_codes.includes(i))throw Error(`Source language code "${i}" is not valid. Must be one of: {${e.language_codes.join(`, `)}}`);for(let t of e.post_processor.config.single)if(`SpecialToken`in t&&e.languageRegex.test(t.SpecialToken.id)){t.SpecialToken.id=e.lang_to_token(i);break}}return r.forced_bos_token_id=e.model.convert_tokens_to_ids([e.lang_to_token(a)])[0],e._call(t,n)}class vt extends z{constructor(e,t){super(e,t),this.languageRegex=/^[a-z]{3}_[A-Z][a-z]{3}$/,this.language_codes=this.special_tokens.filter(e=>this.languageRegex.test(e)),this.lang_to_token=e=>e}_build_translation_inputs(e,t,n){return _t(this,e,t,n)}}class yt extends z{constructor(e,t){super(e,t),this.languageRegex=/^__[a-z]{2,3}__$/,this.language_codes=this.special_tokens.filter(e=>this.languageRegex.test(e)).map(e=>e.slice(2,-2)),this.lang_to_token=e=>`__${e}__`}_build_translation_inputs(e,t,n){return _t(this,e,t,n)}}class bt extends z{get timestamp_begin(){return this.model.convert_tokens_to_ids([`<|notimestamps|>`])[0]+1}_decode_asr(e,{return_timestamps:t=!1,return_language:n=!1,time_precision:r=null,force_full_sequences:i=!0}={}){if(r===null)throw Error(`Must specify time_precision`);let a=null,s=t===`word`;function c(){return{language:a,timestamp:[null,null],text:``}}let l=[],d=c(),f=0,p=this.timestamp_begin,m=1500,h=p+m,g=[],_=[],v=!1,y=null,b=new Set(this.all_special_ids);for(let n of e){let e=n.tokens,i=s?n.token_timestamps:null,m=null,x=p;if(`stride`in n){let[t,i,a]=n.stride;if(f-=i,y=t-a,i&&(x=i/r+p),a)for(let t=e.length-1;t>=0;--t){let n=Number(e[t]);if(n>=p){if(m!==null&&(n-p)*r=p&&y<=h){let e=(y-p)*r+f,t=(0,o.round)(e,2);if(m!==null&&y>=m)v=!0;else if(v||g.length>0&&y0?(g.push(S),s&&_.push(w)):g.every(e=>e.length===0)&&(d=c(),g=[],S=[],_=[],w=[])}if(g.length>0){if(i&&t)throw Error(`Whisper did not predict an ending timestamp, which can happen if audio is cut off in the middle of a word. Also make sure WhisperTimeStampLogitsProcessor was used during generation.`);let[e,n]=this.findLongestCommonSequence(g,_),r=this.decode(e);d.text=r,s&&(d.words=this.collateWordTimestamps(e,n,a)),l.push(d)}let x=Object.create(null),S=l.map(e=>e.text).join(``);if(t||n){for(let e=0;e0,o=a?[]:null,s=a?t[0]:null;for(let c=1;ce===g[n]&&s[i+n]<=t[c][m+n]).length:p.filter((e,t)=>e===g[t]).length;let v=e/1e4,y=_/e+v;_>1&&y>u&&(u=y,d=[i,o,m,h])}let[p,m,h,g]=d,_=Math.floor((m+p)/2),v=Math.floor((g+h)/2);i.push(...n.slice(0,_)),n=l.slice(v),r=n.length,a&&(o.push(...s.slice(0,_)),s=t[c].slice(v))}return i.push(...n),a?(o.push(...s),[i,o]):[i,[]]}collateWordTimestamps(e,t,n){let[r,i,a]=this.combineTokensIntoWords(e,n),o=[];for(let e=0;e=r){let e=((t-r)*n).toFixed(2);i.push(`<|${e}|>`),i.push([])}else i[i.length-1].push(t);return i=i.map(e=>typeof e==`string`?e:super.decode(e,t)),i.join(``)}splitTokensOnUnicode(e){let t=this.decode(e,{decode_with_timestamps:!0}),n=`�`,r=[],i=[],a=[],o=[],s=[],c=0;for(let l=0;l=this.model.tokens_to_ids.get(`<|endoftext|>`),f=c.startsWith(` `),p=c.trim(),m=s.test(p);if(d||f||m||i.length===0)i.push(c),a.push(l),o.push(u);else{let e=i.length-1;i[e]+=c,a[e].push(...l),o[e].push(...u)}}return[i,a,o]}mergePunctuations(e,t,n,r,a){let o=structuredClone(e),s=structuredClone(t),c=structuredClone(n),l=o.length-2,u=o.length-1;for(;l>=0;)o[l].startsWith(` `)&&r.includes(o[l].trim())?(o[u]=o[l]+o[u],s[u]=(0,i.mergeArrays)(s[l],s[u]),c[u]=(0,i.mergeArrays)(c[l],c[u]),o[l]=``,s[l]=[],c[l]=[]):u=l,--l;for(l=0,u=1;ue),s.filter(e=>e.length>0),c.filter(e=>e.length>0)]}}class xt extends z{}class St extends z{}class Ct extends z{}class wt extends z{constructor(e,t){super(e,t),this.languageRegex=/^(>>\w+<<)\s*/g,this.supported_language_codes=this.model.vocab.filter(e=>this.languageRegex.test(e)),console.warn('WARNING: `MarianTokenizer` is not yet supported by Hugging Face\'s "fast" tokenizers library. Therefore, you may experience slightly inaccurate results.')}_encode_text(e){if(e===null)return null;let[t,...n]=e.trim().split(this.languageRegex);if(n.length===0)return super._encode_text(t);if(n.length===2){let[e,t]=n;return this.supported_language_codes.includes(e)||console.warn(`Unsupported language code "${e}" detected, which may lead to unexpected behavior. Should be one of: ${JSON.stringify(this.supported_language_codes)}`),(0,i.mergeArrays)([e],super._encode_text(t))}}}class Tt extends z{}class Et extends z{}class Dt extends z{}class Ot extends z{}class kt extends z{}class At extends z{constructor(e,t){super(e,t),this.decoder=new je({})}}class jt extends z{}class Mt extends z{}class Nt{static TOKENIZER_CLASS_MAPPING={T5Tokenizer:$e,DistilBertTokenizer:Ye,CamembertTokenizer:Xe,DebertaTokenizer:We,DebertaV2Tokenizer:Ge,BertTokenizer:Ve,HerbertTokenizer:Ke,ConvBertTokenizer:qe,RoFormerTokenizer:Je,XLMTokenizer:Ze,ElectraTokenizer:Qe,MobileBertTokenizer:B,SqueezeBertTokenizer:Ue,AlbertTokenizer:He,GPT2Tokenizer:et,BartTokenizer:tt,MBartTokenizer:nt,MBart50Tokenizer:rt,RobertaTokenizer:it,WhisperTokenizer:bt,CodeGenTokenizer:xt,CLIPTokenizer:St,SiglipTokenizer:Ct,MarianTokenizer:wt,BloomTokenizer:at,NllbTokenizer:vt,M2M100Tokenizer:yt,LlamaTokenizer:st,CodeLlamaTokenizer:ct,XLMRobertaTokenizer:lt,MPNetTokenizer:ut,FalconTokenizer:dt,GPTNeoXTokenizer:ft,EsmTokenizer:pt,Wav2Vec2CTCTokenizer:Tt,BlenderbotTokenizer:Et,BlenderbotSmallTokenizer:Dt,SpeechT5Tokenizer:Ot,NougatTokenizer:kt,VitsTokenizer:At,Qwen2Tokenizer:mt,GemmaTokenizer:ht,Grok1Tokenizer:gt,CohereTokenizer:jt,MgpstrTokenizer:Mt,PreTrainedTokenizer:z};static async from_pretrained(e,{progress_callback:t=null,config:n=null,cache_dir:r=null,local_files_only:i=!1,revision:a=`main`,legacy:o=null}={}){let[s,c]=await d(e,{progress_callback:t,config:n,cache_dir:r,local_files_only:i,revision:a,legacy:o}),l=c.tokenizer_class?.replace(/Fast$/,``)??`PreTrainedTokenizer`,u=this.TOKENIZER_CLASS_MAPPING[l];return u||(console.warn(`Unknown tokenizer class "${l}", attempting to construct from base class.`),u=z),new u(s,c)}}},"./src/utils/audio.js":(e,t,n)=>{n.r(t),n.d(t,{RawAudio:()=>O,hamming:()=>f,hanning:()=>d,mel_filter_bank:()=>y,read_audio:()=>l,spectrogram:()=>w,window_function:()=>T});var r=n( +`./src/models/whisper/common_whisper.js`);async function d(e,t){let n=await Promise.all([(0,a.getModelJSON)(e,`tokenizer.json`,!0,t),(0,a.getModelJSON)(e,`tokenizer_config.json`,!0,t)]);return t.legacy!==null&&(n[1].legacy=t.legacy),n}function f(e,t){let n=[],r=0;for(let i of e.matchAll(t)){let t=i[0];r0&&n.push(t),r=i.index+t.length}return r=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=63744&&e<=64255||e>=194560&&e<=195103}function b(e,t,n){let r=[],i=0;for(;ithis.tokens_to_ids.get(e)??this.unk_token_id)}convert_ids_to_tokens(e){return e.map(e=>this.vocab[e]??this.unk_token)}}class O extends D{constructor(e){super(e),this.tokens_to_ids=m(e.vocab),this.unk_token_id=this.tokens_to_ids.get(e.unk_token),this.unk_token=e.unk_token,this.max_input_chars_per_word=e.max_input_chars_per_word??100,this.vocab=Array(this.tokens_to_ids.size);for(let[e,t]of this.tokens_to_ids)this.vocab[t]=e}encode(e){let t=[];for(let n of e){let e=[...n];if(e.length>this.max_input_chars_per_word){t.push(this.unk_token);continue}let r=!1,i=0,a=[];for(;i0&&(r=this.config.continuing_subword_prefix+r),this.tokens_to_ids.has(r)){n=r;break}--t}if(n===null){r=!0;break}a.push(n),i=t}r?t.push(this.unk_token):t.push(...a)}return t}}class k extends D{constructor(e,t){super(e);let n=e.vocab.length;this.vocab=Array(n),this.scores=Array(n);for(let t=0;t[e,t])),this.bos_token=` `,this.bos_token_id=this.tokens_to_ids.get(this.bos_token),this.eos_token=t.eos_token,this.eos_token_id=this.tokens_to_ids.get(this.eos_token),this.unk_token=this.vocab[this.unk_token_id],this.minScore=(0,o.min)(this.scores)[0],this.unk_score=this.minScore-10,this.scores[this.unk_token_id]=this.unk_score,this.trie=new c.CharTrie,this.trie.extend(this.vocab),this.fuse_unk=!0}populateNodes(e){let t=e.chars,n=1,r=0;for(;r{let e=[...Array.from({length:94},(e,t)=>t+33),...Array.from({length:12},(e,t)=>t+161),...Array.from({length:82},(e,t)=>t+174)],t=e.slice(),n=0;for(let r=0;r<256;++r)e.includes(r)||(e.push(r),t.push(256+n),n+=1);let r=t.map(e=>String.fromCharCode(e));return Object.fromEntries(e.map((e,t)=>[e,r[t]]))})(),ee=(0,i.reverseDictionary)(A);class te extends D{constructor(e){super(e),this.tokens_to_ids=m(e.vocab),this.unk_token_id=this.tokens_to_ids.get(e.unk_token),this.unk_token=e.unk_token,this.vocab=Array(this.tokens_to_ids.size);for(let[e,t]of this.tokens_to_ids)this.vocab[t]=e;let t=Array.isArray(e.merges[0]);this.merges=t?e.merges:e.merges.map(e=>e.split(` `,2)),this.bpe_ranks=new Map(this.merges.map((e,t)=>[JSON.stringify(e),t])),this.end_of_word_suffix=e.end_of_word_suffix,this.continuing_subword_suffix=e.continuing_subword_suffix??null,this.byte_fallback=this.config.byte_fallback??!1,this.byte_fallback&&(this.text_encoder=new TextEncoder),this.ignore_merges=this.config.ignore_merges??!1,this.max_length_to_cache=256,this.cache_capacity=1e4,this.cache=new c.LRUCache(this.cache_capacity)}clear_cache(){this.cache.clear()}bpe(e){if(e.length===0)return[];let t=this.cache.get(e);if(t!==void 0)return t;let n=Array.from(e);this.end_of_word_suffix&&(n[n.length-1]+=this.end_of_word_suffix);let r=[];if(n.length>1){let e=new c.PriorityQueue((e,t)=>e.score`<0x${e.toString(16).toUpperCase().padStart(2,`0`)}>`);e.every(e=>this.tokens_to_ids.has(e))?t.push(...e):t.push(this.unk_token)}else t.push(this.unk_token)}return t}}class ne extends D{constructor(e,t){super(e),this.tokens_to_ids=m(t.target_lang?e.vocab[t.target_lang]:e.vocab),this.bos_token=t.bos_token,this.bos_token_id=this.tokens_to_ids.get(this.bos_token),this.eos_token=t.eos_token,this.eos_token_id=this.tokens_to_ids.get(this.eos_token),this.pad_token=t.pad_token,this.pad_token_id=this.tokens_to_ids.get(this.pad_token),this.unk_token=t.unk_token,this.unk_token_id=this.tokens_to_ids.get(this.unk_token),this.vocab=Array(this.tokens_to_ids.size);for(let[e,t]of this.tokens_to_ids)this.vocab[t]=e}encode(e){return e}}class j extends r.Callable{constructor(e){super(),this.config=e}static fromConfig(e){if(e===null)return null;switch(e.type){case`BertNormalizer`:return new fe(e);case`Precompiled`:return new je(e);case`Sequence`:return new de(e);case`Replace`:return new re(e);case`NFC`:return new ae(e);case`NFD`:return new oe(e);case`NFKC`:return new se(e);case`NFKD`:return new M(e);case`Strip`:return new N(e);case`StripAccents`:return new ce(e);case`Lowercase`:return new le(e);case`Prepend`:return new ue(e);default:throw Error(`Unknown Normalizer type: ${e.type}`)}}normalize(e){throw Error(`normalize should be implemented in subclass.`)}_call(e){return this.normalize(e)}}class re extends j{normalize(e){let t=p(this.config.pattern);return t===null?e:e.replaceAll(t,this.config.content)}}class ie extends j{form=void 0;normalize(e){return e=e.normalize(this.form),e}}class ae extends ie{form=`NFC`}class oe extends ie{form=`NFD`}class se extends ie{form=`NFKC`}class M extends ie{form=`NFKD`}class N extends j{normalize(e){return this.config.strip_left&&this.config.strip_right?e=e.trim():(this.config.strip_left&&(e=e.trimStart()),this.config.strip_right&&(e=e.trimEnd())),e}}class ce extends j{normalize(e){return e=_(e),e}}class le extends j{normalize(e){return e=e.toLowerCase(),e}}class ue extends j{normalize(e){return e=this.config.prepend+e,e}}class de extends j{constructor(e){super(e),this.normalizers=e.normalizers.map(e=>j.fromConfig(e))}normalize(e){return this.normalizers.reduce((e,t)=>t.normalize(e),e)}}class fe extends j{_tokenize_chinese_chars(e){let t=[];for(let n=0;nthis.pre_tokenize_text(e,t)):this.pre_tokenize_text(e,t)).flat()}_call(e,t){return this.pre_tokenize(e,t)}}class pe extends P{constructor(e){super(),this.pattern=RegExp(`[^\\s${S}]+|[${S}]`,`gu`)}pre_tokenize_text(e,t){return e.trim().match(this.pattern)||[]}}class F extends P{constructor(e){super(),this.config=e,this.add_prefix_space=this.config.add_prefix_space,this.trim_offsets=this.config.trim_offsets,this.use_regex=this.config.use_regex??!0,this.pattern=/'s|'t|'re|'ve|'m|'ll|'d| ?\p{L}+| ?\p{N}+| ?[^\s\p{L}\p{N}]+|\s+(?!\S)|\s+/gu,this.byte_encoder=A,this.text_encoder=new TextEncoder}pre_tokenize_text(e,t){this.add_prefix_space&&!e.startsWith(` `)&&(e=` `+e);let n=this.use_regex?e.match(this.pattern)||[]:[e];return n.map(e=>Array.from(this.text_encoder.encode(e),e=>this.byte_encoder[e]).join(``))}}class me extends P{constructor(e){super(),this.config=e,this.pattern=p(this.config.pattern,this.config.invert)}pre_tokenize_text(e,t){return this.pattern===null?[]:this.config.invert?e.match(this.pattern)||[]:this.config.behavior?.toLowerCase()===`removed`?e.split(this.pattern).filter(e=>e):f(e,this.pattern)}}class he extends P{constructor(e){super(),this.config=e,this.pattern=RegExp(`[^${S}]+|[${S}]+`,`gu`)}pre_tokenize_text(e,t){return e.match(this.pattern)||[]}}class ge extends P{constructor(e){super(),this.config=e;let t=`[^\\d]+|\\d${this.config.individual_digits?``:`+`}`;this.pattern=new RegExp(t,`gu`)}pre_tokenize_text(e,t){return e.match(this.pattern)||[]}}class I extends r.Callable{constructor(e){super(),this.config=e}static fromConfig(e){if(e===null)return null;switch(e.type){case`TemplateProcessing`:return new R(e);case`ByteLevel`:return new ve(e);case`RobertaProcessing`:return new L(e);case`BertProcessing`:return new _e(e);case`Sequence`:return new ye(e);default:throw Error(`Unknown PostProcessor type: ${e.type}`)}}post_process(e,...t){throw Error(`post_process should be implemented in subclass.`)}_call(e,...t){return this.post_process(e,...t)}}class _e extends I{constructor(e){super(e),this.cls=e.cls[0],this.sep=e.sep[0]}post_process(e,t=null,{add_special_tokens:n=!0}={}){n&&(e=(0,i.mergeArrays)([this.cls],e,[this.sep]));let r=Array(e.length).fill(0);if(t!==null){let a=n&&this instanceof L?[this.sep]:[],o=n?[this.sep]:[];e=(0,i.mergeArrays)(e,a,t,o),r=(0,i.mergeArrays)(r,Array(t.length+a.length+o.length).fill(1))}return{tokens:e,token_type_ids:r}}}class L extends _e{}class R extends I{constructor(e){super(e),this.single=e.single,this.pair=e.pair}post_process(e,t=null,{add_special_tokens:n=!0}={}){let r=t===null?this.single:this.pair,a=[],o=[];for(let s of r)`SpecialToken`in s?n&&(a.push(s.SpecialToken.id),o.push(s.SpecialToken.type_id)):`Sequence`in s&&(s.Sequence.id===`A`?(a=(0,i.mergeArrays)(a,e),o=(0,i.mergeArrays)(o,Array(e.length).fill(s.Sequence.type_id))):s.Sequence.id===`B`&&(a=(0,i.mergeArrays)(a,t),o=(0,i.mergeArrays)(o,Array(t.length).fill(s.Sequence.type_id))));return{tokens:a,token_type_ids:o}}}class ve extends I{post_process(e,t=null){return t&&(e=(0,i.mergeArrays)(e,t)),{tokens:e}}}class ye extends I{constructor(e){super(e),this.processors=e.processors.map(e=>I.fromConfig(e))}post_process(e,t=null,n={}){let r;for(let i of this.processors)if(i instanceof ve){let n=i.post_process(e);if(e=n.tokens,t){let e=i.post_process(t);t=e.tokens}}else{let a=i.post_process(e,t,n);e=a.tokens,r=a.token_type_ids}return{tokens:e,token_type_ids:r}}}class z extends r.Callable{constructor(e){super(),this.config=e,this.added_tokens=[],this.end_of_word_suffix=null,this.trim_offsets=e.trim_offsets}static fromConfig(e){if(e===null)return null;switch(e.type){case`WordPiece`:return new Ce(e);case`Metaspace`:return new Ae(e);case`ByteLevel`:return new we(e);case`Replace`:return new be(e);case`ByteFallback`:return new xe(e);case`Fuse`:return new Se(e);case`Strip`:return new B(e);case`Sequence`:return new Ee(e);case`CTC`:return new Te(e);case`BPEDecoder`:return new De(e);default:throw Error(`Unknown Decoder type: ${e.type}`)}}_call(e){return this.decode(e)}decode(e){return this.decode_chain(e).join(``)}decode_chain(e){throw Error("`decode_chain` should be implemented in subclass.")}}class be extends z{decode_chain(e){let t=p(this.config.pattern);return t===null?e:e.map(e=>e.replaceAll(t,this.config.content))}}class xe extends z{constructor(e){super(e),this.text_decoder=new TextDecoder}decode_chain(e){let t=[],n=[];for(let r of e){let e=null;if(r.length===6&&r.startsWith(`<0x`)&&r.endsWith(`>`)){let t=parseInt(r.slice(3,5),16);isNaN(t)||(e=t)}if(e!==null)n.push(e);else{if(n.length>0){let e=this.text_decoder.decode(Uint8Array.from(n));t.push(e),n=[]}t.push(r)}}if(n.length>0){let e=this.text_decoder.decode(Uint8Array.from(n));t.push(e),n=[]}return t}}class Se extends z{decode_chain(e){return[e.join(``)]}}class B extends z{constructor(e){super(e),this.content=this.config.content,this.start=this.config.start,this.stop=this.config.stop}decode_chain(e){return e.map(e=>{let t=0;for(let n=0;n(t!==0&&(e=e.startsWith(this.config.prefix)?e.replace(this.config.prefix,``):` `+e),this.cleanup&&(e=g(e)),e))}}class we extends z{constructor(e){super(e),this.byte_decoder=ee,this.text_decoder=new TextDecoder(`utf-8`,{fatal:!1,ignoreBOM:!0}),this.end_of_word_suffix=null}convert_tokens_to_string(e){let t=e.join(``),n=new Uint8Array([...t].map(e=>this.byte_decoder[e])),r=this.text_decoder.decode(n);return r}decode_chain(e){let t=[],n=[];for(let r of e)this.added_tokens.find(e=>e.content===r)===void 0?n.push(r):(n.length>0&&(t.push(this.convert_tokens_to_string(n)),n=[]),t.push(r));return n.length>0&&t.push(this.convert_tokens_to_string(n)),t}}class Te extends z{constructor(e){super(e),this.pad_token=this.config.pad_token,this.word_delimiter_token=this.config.word_delimiter_token,this.cleanup=this.config.cleanup}convert_tokens_to_string(e){if(e.length===0)return``;let t=[e[0]];for(let n=1;ne!==this.pad_token),r=n.join(``);return this.cleanup&&(r=g(r).replaceAll(this.word_delimiter_token,` `).trim()),r}decode_chain(e){return[this.convert_tokens_to_string(e)]}}class Ee extends z{constructor(e){super(e),this.decoders=e.decoders.map(e=>z.fromConfig(e))}decode_chain(e){return this.decoders.reduce((e,t)=>t.decode_chain(e),e)}}class De extends z{constructor(e){super(e),this.suffix=this.config.suffix}decode_chain(e){return e.map((t,n)=>t.replaceAll(this.suffix,n===e.length-1?``:` `))}}class Oe extends z{decode_chain(e){let t=``;for(let n=1;ne.normalize(`NFKC`)).join(`~`)}else e=e.normalize(`NFKC`);return e}}class Me extends P{constructor(e){super(),this.tokenizers=e.pretokenizers.map(e=>P.fromConfig(e))}pre_tokenize_text(e,t){return this.tokenizers.reduce((e,n)=>n.pre_tokenize(e,t),[e])}}class Ne extends P{constructor(e){super()}pre_tokenize_text(e,t){return e.match(/\w+|[^\w\s]+/g)||[]}}class Pe extends P{constructor(e){super()}pre_tokenize_text(e,t){return x(e)}}class Fe extends P{constructor(e){super(),this.config=e,this.pattern=p(this.config.pattern),this.content=this.config.content}pre_tokenize_text(e,t){return this.pattern===null?[e]:[e.replaceAll(this.pattern,this.config.content)]}}let Ie=[`bos_token`,`eos_token`,`unk_token`,`sep_token`,`pad_token`,`cls_token`,`mask_token`];function Le(e,t,n,r){for(let a of Object.keys(e)){let o=t-e[a].length,s=n(a),c=Array(o).fill(s);e[a]=r===`right`?(0,i.mergeArrays)(e[a],c):(0,i.mergeArrays)(c,e[a])}}function Re(e,t){for(let n of Object.keys(e))e[n].length=t}class V extends r.Callable{return_token_type_ids=!1;padding_side=`right`;constructor(e,t){super(),this.config=t,this.normalizer=j.fromConfig(e.normalizer),this.pre_tokenizer=P.fromConfig(e.pre_tokenizer),this.model=D.fromConfig(e.model,t),this.post_processor=I.fromConfig(e.post_processor),this.decoder=z.fromConfig(e.decoder),this.special_tokens=[],this.all_special_ids=[],this.added_tokens=[];for(let t of e.added_tokens){let e=new E(t);this.added_tokens.push(e),this.model.tokens_to_ids.set(e.content,e.id),this.model.vocab[e.id]=e.content,e.special&&(this.special_tokens.push(e.content),this.all_special_ids.push(e.id))}if(this.additional_special_tokens=t.additional_special_tokens??[],this.special_tokens.push(...this.additional_special_tokens),this.special_tokens=[...new Set(this.special_tokens)],this.decoder&&(this.decoder.added_tokens=this.added_tokens,this.decoder.end_of_word_suffix=this.model.end_of_word_suffix),this.added_tokens_splitter=new c.DictionarySplitter(this.added_tokens.map(e=>e.content)),this.added_tokens_map=new Map(this.added_tokens.map(e=>[e.content,e])),this.mask_token=this.getToken(`mask_token`),this.mask_token_id=this.model.tokens_to_ids.get(this.mask_token),this.pad_token=this.getToken(`pad_token`,`eos_token`),this.pad_token_id=this.model.tokens_to_ids.get(this.pad_token),this.sep_token=this.getToken(`sep_token`),this.sep_token_id=this.model.tokens_to_ids.get(this.sep_token),this.unk_token=this.getToken(`unk_token`),this.unk_token_id=this.model.tokens_to_ids.get(this.unk_token),this.bos_token=this.getToken(`bos_token`),this.bos_token_id=this.model.tokens_to_ids.get(this.bos_token),this.eos_token=this.getToken(`eos_token`),this.eos_token_id=this.model.tokens_to_ids.get(this.eos_token),this.model_max_length=t.model_max_length,this.remove_space=t.remove_space,this.clean_up_tokenization_spaces=t.clean_up_tokenization_spaces??!0,this.do_lowercase_and_remove_accent=t.do_lowercase_and_remove_accent??!1,t.padding_side&&(this.padding_side=t.padding_side),this.legacy=!1,this.chat_template=t.chat_template??null,Array.isArray(this.chat_template)){let e=Object.create(null);for(let{name:t,template:n}of this.chat_template){if(typeof t!=`string`||typeof n!=`string`)throw Error(`Chat template must be a list of objects with "name" and "template" properties`);e[t]=n}this.chat_template=e}this._compiled_template_cache=new Map}getToken(...e){for(let t of e){let e=this.config[t];if(!e)continue;if(typeof e==`object`){if(e.__type===`AddedToken`)return e.content;throw Error(`Unknown token: ${e}`)}else return e}return null}static async from_pretrained(e,{progress_callback:t=null,config:n=null,cache_dir:r=null,local_files_only:i=!1,revision:a=`main`,legacy:o=null}={}){let s=await d(e,{progress_callback:t,config:n,cache_dir:r,local_files_only:i,revision:a,legacy:o});return new this(...s)}_call(e,{text_pair:t=null,add_special_tokens:n=!0,padding:r=!1,truncation:i=null,max_length:a=null,return_tensor:c=!0,return_token_type_ids:l=null}={}){let u=Array.isArray(e),d;if(u){if(e.length===0)throw Error(`text array must be non-empty`);if(t!==null){if(Array.isArray(t)){if(e.length!==t.length)throw Error(`text and text_pair must have the same length`)}else throw Error(`text_pair must also be an array`);d=e.map((e,r)=>this._encode_plus(e,{text_pair:t[r],add_special_tokens:n,return_token_type_ids:l}))}else d=e.map(e=>this._encode_plus(e,{add_special_tokens:n,return_token_type_ids:l}))}else{if(e==null)throw Error(`text may not be null or undefined`);if(Array.isArray(t))throw Error("When specifying `text_pair`, since `text` is a string, `text_pair` must also be a string (i.e., not an array).");d=[this._encode_plus(e,{text_pair:t,add_special_tokens:n,return_token_type_ids:l})]}if(a===null?a=this.model_max_length:i===null&&(r===!0?(console.warn("`max_length` is ignored when `padding: true` and there is no truncation strategy. To pad to max length, use `padding: 'max_length'`."),a=this.model_max_length):r===!1&&(console.warn("Truncation was not explicitly activated but `max_length` is provided a specific value, please use `truncation: true` to explicitly truncate examples to max length."),i=!0)),r===!0&&(a=Math.min((0,o.max)(d.map(e=>e.input_ids.length))[0],a??1/0)),a=Math.min(a,this.model_max_length??1/0),r||i)for(let e=0;ea?i&&Re(d[e],a):r&&Le(d[e],a,e=>e===`input_ids`?this.pad_token_id:0,this.padding_side);let f={};if(c){if(!(r&&i)&&d.some(e=>{for(let t of Object.keys(e))if(e[t].length!==d[0][t]?.length)return!0;return!1}))throw Error(`Unable to create tensor, you should probably activate truncation and/or padding with 'padding=true' and 'truncation=true' to have batched tensors with the same length.`);let e=[d.length,d[0].input_ids.length];for(let t of Object.keys(d[0]))f[t]=new s.Tensor(`int64`,BigInt64Array.from(d.flatMap(e=>e[t]).map(BigInt)),e)}else{for(let e of Object.keys(d[0]))f[e]=d.map(t=>t[e]);if(!u)for(let e of Object.keys(f))f[e]=f[e][0]}return f}_encode_text(e){if(e===null)return null;let t=this.added_tokens_splitter.split(e);for(let e=0;e0&&(t[e-1]=t[e-1].trimEnd()),n.rstrip&&e{if(e.length===0)return[];if(this.added_tokens_map.has(e))return[e];if(this.remove_space===!0&&(e=e.trim().split(/\s+/).join(` `)),this.do_lowercase_and_remove_accent&&(e=v(e)),this.normalizer!==null&&(e=this.normalizer(e)),e.length===0)return[];let n=this.pre_tokenizer===null?[e]:this.pre_tokenizer(e,{section_index:t}),r=this.model(n);return r});return n}_encode_plus(e,{text_pair:t=null,add_special_tokens:n=!0,return_token_type_ids:r=null}={}){let{tokens:i,token_type_ids:a}=this._tokenize_helper(e,{pair:t,add_special_tokens:n}),o=this.model.convert_tokens_to_ids(i),s={input_ids:o,attention_mask:Array(o.length).fill(1)};return(r??this.return_token_type_ids)&&a&&(s.token_type_ids=a),s}_tokenize_helper(e,{pair:t=null,add_special_tokens:n=!1}={}){let r=this._encode_text(e),a=this._encode_text(t);return this.post_processor?this.post_processor(r,a,{add_special_tokens:n}):{tokens:(0,i.mergeArrays)(r??[],a??[])}}tokenize(e,{pair:t=null,add_special_tokens:n=!1}={}){return this._tokenize_helper(e,{pair:t,add_special_tokens:n}).tokens}encode(e,{text_pair:t=null,add_special_tokens:n=!0,return_token_type_ids:r=null}={}){return this._encode_plus(e,{text_pair:t,add_special_tokens:n,return_token_type_ids:r}).input_ids}batch_decode(e,t={}){return e instanceof s.Tensor&&(e=e.tolist()),e.map(e=>this.decode(e,t))}decode(e,t={}){if(e instanceof s.Tensor&&(e=h(e)),!Array.isArray(e)||e.length===0||!(0,i.isIntegralNumber)(e[0]))throw Error(`token_ids must be a non-empty array of integers.`);return this.decode_single(e,t)}decode_single(e,{skip_special_tokens:t=!1,clean_up_tokenization_spaces:n=null}){let r=this.model.convert_ids_to_tokens(e);t&&(r=r.filter(e=>!this.special_tokens.includes(e)));let i=this.decoder?this.decoder(r):r.join(` `);return this.decoder&&this.decoder.end_of_word_suffix&&(i=i.replaceAll(this.decoder.end_of_word_suffix,` `),t&&(i=i.trim())),(n??this.clean_up_tokenization_spaces)&&(i=g(i)),i}get_chat_template({chat_template:e=null,tools:t=null}={}){if(this.chat_template&&typeof this.chat_template==`object`){let n=this.chat_template;if(e!==null&&Object.hasOwn(n,e))e=n[e];else if(e===null)if(t!==null&&`tool_use`in n)e=n.tool_use;else if(`default`in n)e=n.default;else throw Error(`This model has multiple chat templates with no default specified! Please either pass a chat template or the name of the template you wish to use to the 'chat_template' argument. Available template names are ${Object.keys(n).sort()}.`)}else if(e===null)if(this.chat_template)e=this.chat_template;else throw Error(`Cannot use apply_chat_template() because tokenizer.chat_template is not set and no template argument was passed! For information about writing templates and setting the tokenizer.chat_template attribute, please see the documentation at https://huggingface.co/docs/transformers/main/en/chat_templating`);return e}apply_chat_template(e,{tools:t=null,documents:n=null,chat_template:r=null,add_generation_prompt:i=!1,tokenize:a=!0,padding:o=!1,truncation:s=!1,max_length:c=null,return_tensor:u=!0,return_dict:d=!1,tokenizer_kwargs:f={},...p}={}){if(r=this.get_chat_template({chat_template:r,tools:t}),typeof r!=`string`)throw Error(`chat_template must be a string, but got ${typeof r}`);let m=this._compiled_template_cache.get(r);m===void 0&&(m=new l.Template(r),this._compiled_template_cache.set(r,m));let h=Object.create(null);for(let e of Ie){let t=this.getToken(e);t&&(h[e]=t)}let g=m.render({messages:e,add_generation_prompt:i,tools:t,documents:n,...h,...p});if(a){let e=this._call(g,{add_special_tokens:!1,padding:o,truncation:s,max_length:c,return_tensor:u,...f});return d?e:e.input_ids}return g}}class ze extends V{return_token_type_ids=!0}class Be extends V{return_token_type_ids=!0}class H extends V{return_token_type_ids=!0}class Ve extends V{return_token_type_ids=!0}class He extends V{return_token_type_ids=!0}class Ue extends V{return_token_type_ids=!0}class We extends V{return_token_type_ids=!0}class Ge extends V{return_token_type_ids=!0}class Ke extends V{return_token_type_ids=!0}class qe extends V{}class Je extends V{}class Ye extends V{return_token_type_ids=!0;constructor(e,t){super(e,t),console.warn('WARNING: `XLMTokenizer` is not yet supported by Hugging Face\'s "fast" tokenizers library. Therefore, you may experience slightly inaccurate results.')}}class Xe extends V{return_token_type_ids=!0}class Ze extends V{}class Qe extends V{}class $e extends V{}class et extends V{constructor(e,t){super(e,t),this.languageRegex=/^[a-z]{2}_[A-Z]{2}$/,this.language_codes=this.special_tokens.filter(e=>this.languageRegex.test(e)),this.lang_to_token=e=>e}_build_translation_inputs(e,t,n){return ht(this,e,t,n)}}class tt extends et{}class nt extends V{}class rt extends V{}let it=`▁`;class at extends V{padding_side=`left`;constructor(e,t){super(e,t),this.legacy=t.legacy??!0,this.legacy||(this.normalizer=null,this.pre_tokenizer=new ke({replacement:it,add_prefix_space:!0,prepend_scheme:`first`}))}_encode_text(e){if(e===null)return null;if(this.legacy||e.length===0)return super._encode_text(e);let t=super._encode_text(it+e.replaceAll(it,` `));return t.length>1&&t[0]===it&&this.special_tokens.includes(t[1])&&(t=t.slice(1)),t}}class ot extends V{}class st extends V{}class ct extends V{}class lt extends V{}class ut extends V{}class dt extends V{}class ft extends V{}class pt extends V{}class mt extends V{}function ht(e,t,n,r){if(!(`language_codes`in e)||!Array.isArray(e.language_codes))throw Error("Tokenizer must have `language_codes` attribute set and it should be an array of language ids.");if(!(`languageRegex`in e)||!(e.languageRegex instanceof RegExp))throw Error("Tokenizer must have `languageRegex` attribute set and it should be a regular expression.");if(!(`lang_to_token`in e)||typeof e.lang_to_token!=`function`)throw Error("Tokenizer must have `lang_to_token` attribute set and it should be a function.");let i=r.src_lang,a=r.tgt_lang;if(!e.language_codes.includes(a))throw Error(`Target language code "${a}" is not valid. Must be one of: {${e.language_codes.join(`, `)}}`);if(i!==void 0){if(!e.language_codes.includes(i))throw Error(`Source language code "${i}" is not valid. Must be one of: {${e.language_codes.join(`, `)}}`);for(let t of e.post_processor.config.single)if(`SpecialToken`in t&&e.languageRegex.test(t.SpecialToken.id)){t.SpecialToken.id=e.lang_to_token(i);break}}return r.forced_bos_token_id=e.model.convert_tokens_to_ids([e.lang_to_token(a)])[0],e._call(t,n)}class gt extends V{constructor(e,t){super(e,t),this.languageRegex=/^[a-z]{3}_[A-Z][a-z]{3}$/,this.language_codes=this.special_tokens.filter(e=>this.languageRegex.test(e)),this.lang_to_token=e=>e}_build_translation_inputs(e,t,n){return ht(this,e,t,n)}}class _t extends V{constructor(e,t){super(e,t),this.languageRegex=/^__[a-z]{2,3}__$/,this.language_codes=this.special_tokens.filter(e=>this.languageRegex.test(e)).map(e=>e.slice(2,-2)),this.lang_to_token=e=>`__${e}__`}_build_translation_inputs(e,t,n){return ht(this,e,t,n)}}class vt extends V{get timestamp_begin(){return this.model.convert_tokens_to_ids([`<|notimestamps|>`])[0]+1}_decode_asr(e,{return_timestamps:t=!1,return_language:n=!1,time_precision:r=null,force_full_sequences:i=!0}={}){if(r===null)throw Error(`Must specify time_precision`);let a=null,s=t===`word`;function c(){return{language:a,timestamp:[null,null],text:``}}let l=[],d=c(),f=0,p=this.timestamp_begin,m=1500,h=p+m,g=[],_=[],v=!1,y=null,b=new Set(this.all_special_ids);for(let n of e){let e=n.tokens,i=s?n.token_timestamps:null,m=null,x=p;if(`stride`in n){let[t,i,a]=n.stride;if(f-=i,y=t-a,i&&(x=i/r+p),a)for(let t=e.length-1;t>=0;--t){let n=Number(e[t]);if(n>=p){if(m!==null&&(n-p)*r=p&&y<=h){let e=(y-p)*r+f,t=(0,o.round)(e,2);if(m!==null&&y>=m)v=!0;else if(v||g.length>0&&y0?(g.push(S),s&&_.push(w)):g.every(e=>e.length===0)&&(d=c(),g=[],S=[],_=[],w=[])}if(g.length>0){if(i&&t)throw Error(`Whisper did not predict an ending timestamp, which can happen if audio is cut off in the middle of a word. Also make sure WhisperTimeStampLogitsProcessor was used during generation.`);let[e,n]=this.findLongestCommonSequence(g,_),r=this.decode(e);d.text=r,s&&(d.words=this.collateWordTimestamps(e,n,a)),l.push(d)}let x=Object.create(null),S=l.map(e=>e.text).join(``);if(t||n){for(let e=0;e0,o=a?[]:null,s=a?t[0]:null;for(let c=1;ce===g[n]&&s[i+n]<=t[c][m+n]).length:p.filter((e,t)=>e===g[t]).length;let v=e/1e4,y=_/e+v;_>1&&y>u&&(u=y,d=[i,o,m,h])}let[p,m,h,g]=d,_=Math.floor((m+p)/2),v=Math.floor((g+h)/2);i.push(...n.slice(0,_)),n=l.slice(v),r=n.length,a&&(o.push(...s.slice(0,_)),s=t[c].slice(v))}return i.push(...n),a?(o.push(...s),[i,o]):[i,[]]}collateWordTimestamps(e,t,n){let[r,i,a]=this.combineTokensIntoWords(e,n),o=[];for(let e=0;e=r){let e=((t-r)*n).toFixed(2);i.push(`<|${e}|>`),i.push([])}else i[i.length-1].push(t);return i=i.map(e=>typeof e==`string`?e:super.decode(e,t)),i.join(``)}splitTokensOnUnicode(e){let t=this.decode(e,{decode_with_timestamps:!0}),n=`�`,r=[],i=[],a=[],o=[],s=[],c=0;for(let l=0;l=this.model.tokens_to_ids.get(`<|endoftext|>`),f=c.startsWith(` `),p=c.trim(),m=s.test(p);if(d||f||m||i.length===0)i.push(c),a.push(l),o.push(u);else{let e=i.length-1;i[e]+=c,a[e].push(...l),o[e].push(...u)}}return[i,a,o]}mergePunctuations(e,t,n,r,a){let o=structuredClone(e),s=structuredClone(t),c=structuredClone(n),l=o.length-2,u=o.length-1;for(;l>=0;)o[l].startsWith(` `)&&r.includes(o[l].trim())?(o[u]=o[l]+o[u],s[u]=(0,i.mergeArrays)(s[l],s[u]),c[u]=(0,i.mergeArrays)(c[l],c[u]),o[l]=``,s[l]=[],c[l]=[]):u=l,--l;for(l=0,u=1;ue),s.filter(e=>e.length>0),c.filter(e=>e.length>0)]}}class yt extends V{}class bt extends V{}class xt extends V{}class St extends V{constructor(e,t){super(e,t),this.languageRegex=/^(>>\w+<<)\s*/g,this.supported_language_codes=this.model.vocab.filter(e=>this.languageRegex.test(e)),console.warn('WARNING: `MarianTokenizer` is not yet supported by Hugging Face\'s "fast" tokenizers library. Therefore, you may experience slightly inaccurate results.')}_encode_text(e){if(e===null)return null;let[t,...n]=e.trim().split(this.languageRegex);if(n.length===0)return super._encode_text(t);if(n.length===2){let[e,t]=n;return this.supported_language_codes.includes(e)||console.warn(`Unsupported language code "${e}" detected, which may lead to unexpected behavior. Should be one of: ${JSON.stringify(this.supported_language_codes)}`),(0,i.mergeArrays)([e],super._encode_text(t))}}}class Ct extends V{}class wt extends V{}class Tt extends V{}class Et extends V{}class Dt extends V{}class Ot extends V{constructor(e,t){super(e,t),this.decoder=new Oe({})}}class kt extends V{}class At extends V{}class jt extends V{}class Mt{static TOKENIZER_CLASS_MAPPING={T5Tokenizer:Ze,DistilBertTokenizer:qe,CamembertTokenizer:Je,DebertaTokenizer:He,DebertaV2Tokenizer:Ue,BertTokenizer:ze,HerbertTokenizer:We,ConvBertTokenizer:Ge,RoFormerTokenizer:Ke,XLMTokenizer:Ye,ElectraTokenizer:Xe,MobileBertTokenizer:H,SqueezeBertTokenizer:Ve,AlbertTokenizer:Be,GPT2Tokenizer:Qe,BartTokenizer:$e,MBartTokenizer:et,MBart50Tokenizer:tt,RobertaTokenizer:nt,WhisperTokenizer:vt,CodeGenTokenizer:yt,CLIPTokenizer:bt,SiglipTokenizer:xt,MarianTokenizer:St,BloomTokenizer:rt,NllbTokenizer:gt,M2M100Tokenizer:_t,LlamaTokenizer:at,CodeLlamaTokenizer:ot,XLMRobertaTokenizer:st,MPNetTokenizer:ct,FalconTokenizer:lt,GPTNeoXTokenizer:ut,EsmTokenizer:dt,Wav2Vec2CTCTokenizer:Ct,BlenderbotTokenizer:wt,BlenderbotSmallTokenizer:Tt,SpeechT5Tokenizer:Et,NougatTokenizer:Dt,VitsTokenizer:Ot,Qwen2Tokenizer:ft,GemmaTokenizer:pt,Grok1Tokenizer:mt,CohereTokenizer:kt,MgpstrTokenizer:At,Ernie4_5_Tokenizer:jt,PreTrainedTokenizer:V};static async from_pretrained(e,{progress_callback:t=null,config:n=null,cache_dir:r=null,local_files_only:i=!1,revision:a=`main`,legacy:o=null}={}){let[s,c]=await d(e,{progress_callback:t,config:n,cache_dir:r,local_files_only:i,revision:a,legacy:o}),l=c.tokenizer_class?.replace(/Fast$/,``)??`PreTrainedTokenizer`,u=this.TOKENIZER_CLASS_MAPPING[l];return u||(console.warn(`Unknown tokenizer class "${l}", attempting to construct from base class.`),u=V),new u(s,c)}}},"./src/utils/audio.js":(e,t,n)=>{n.r(t),n.d(t,{RawAudio:()=>O,hamming:()=>f,hanning:()=>d,mel_filter_bank:()=>y,read_audio:()=>l,spectrogram:()=>w,window_function:()=>T});var r=n( /*! ./hub.js */ `./src/utils/hub.js`),i=n( /*! ./maths.js */ @@ -3551,7 +3551,7 @@ var af={"onnxruntime-common":e=>{e.exports=ne},"onnxruntime-web":e=>{e.exports=j /*! ./image.js */ `./src/utils/image.js`),i=n( /*! ../env.js */ -`./src/env.js`);class a{constructor(e,t){this.image=e,this.timestamp=t}}class o{constructor(e,t){e.length>0&&e[0]instanceof r.RawImage&&(e=e.map((n,r)=>new a(n,(r+1)/(e.length+1)*t))),this.frames=e,this.duration=t}get width(){return this.frames[0].image.width}get height(){return this.frames[0].image.height}get fps(){return this.frames.length/this.duration}}async function s(e,{num_frames:t=null,fps:n=null}={}){if(!i.apis.IS_BROWSER_ENV)throw Error("`load_video` is currently only supported in browser environments.");if(t==null&&n==null)throw Error(`Either num_frames or fps must be provided.`);let s=[],c=document.createElement(`video`);if(c.crossOrigin=`anonymous`,c.muted=!0,typeof e==`string`)c.src=e;else if(e instanceof Blob)c.src=URL.createObjectURL(e);else if(e instanceof HTMLVideoElement)c.src=e.src;else throw Error(`Invalid URL or video element provided.`);if(await new Promise(e=>c.onloadedmetadata=e),c.seekable.start(0)===c.seekable.end(0)){let e=await fetch(c.src),t=await e.blob();c.src=URL.createObjectURL(t),await new Promise(e=>c.onloadedmetadata=e)}let l=c.duration,u,d;t==null?(d=1/n,u=Math.floor(l/d)):(u=t,d=t===1?0:l/(t-1));let f=[];for(let e=0;e{c.onseeked=e}),m.drawImage(c,0,0,p.width,p.height);let t=m.getImageData(0,0,p.width,p.height),n=new r.RawImage(t.data,p.width,p.height,4),i=new a(n,e);s.push(i)}return c.remove(),new o(s,l)}}},sf={};function cf(e){var t=sf[e];if(t!==void 0)return t.exports;var n=sf[e]={exports:{}};return af[e](n,n.exports,cf),n.exports}(()=>{var e=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,t;cf.t=function(n,r){if(r&1&&(n=this(n)),r&8||typeof n==`object`&&n&&(r&4&&n.__esModule||r&16&&typeof n.then==`function`))return n;var i=Object.create(null);cf.r(i);var a={};t||=[null,e({}),e([]),e(e)];for(var o=r&2&&n;typeof o==`object`&&!~t.indexOf(o);o=e(o))Object.getOwnPropertyNames(o).forEach(e=>a[e]=()=>n[e]);return a.default=()=>n,cf.d(i,a),i}})(),cf.d=(exports,t)=>{for(var n in t)cf.o(t,n)&&!cf.o(exports,n)&&Object.defineProperty(exports,n,{enumerable:!0,get:t[n]})},cf.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),cf.r=exports=>{typeof Symbol<`u`&&Symbol.toStringTag&&Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),Object.defineProperty(exports,`__esModule`,{value:!0})};var $={};(()=>{cf.r($),cf.d($,{ASTFeatureExtractor:()=>d.ASTFeatureExtractor,ASTForAudioClassification:()=>n.ASTForAudioClassification,ASTModel:()=>n.ASTModel,ASTPreTrainedModel:()=>n.ASTPreTrainedModel,AlbertForMaskedLM:()=>n.AlbertForMaskedLM,AlbertForQuestionAnswering:()=>n.AlbertForQuestionAnswering,AlbertForSequenceClassification:()=>n.AlbertForSequenceClassification,AlbertModel:()=>n.AlbertModel,AlbertPreTrainedModel:()=>n.AlbertPreTrainedModel,AlbertTokenizer:()=>r.AlbertTokenizer,AudioClassificationPipeline:()=>t.AudioClassificationPipeline,AutoConfig:()=>i.AutoConfig,AutoFeatureExtractor:()=>f.AutoFeatureExtractor,AutoImageProcessor:()=>h.AutoImageProcessor,AutoModel:()=>n.AutoModel,AutoModelForAudioClassification:()=>n.AutoModelForAudioClassification,AutoModelForAudioFrameClassification:()=>n.AutoModelForAudioFrameClassification,AutoModelForAudioTextToText:()=>n.AutoModelForAudioTextToText,AutoModelForCTC:()=>n.AutoModelForCTC,AutoModelForCausalLM:()=>n.AutoModelForCausalLM,AutoModelForDepthEstimation:()=>n.AutoModelForDepthEstimation,AutoModelForDocumentQuestionAnswering:()=>n.AutoModelForDocumentQuestionAnswering,AutoModelForImageClassification:()=>n.AutoModelForImageClassification,AutoModelForImageFeatureExtraction:()=>n.AutoModelForImageFeatureExtraction,AutoModelForImageMatting:()=>n.AutoModelForImageMatting,AutoModelForImageSegmentation:()=>n.AutoModelForImageSegmentation,AutoModelForImageTextToText:()=>n.AutoModelForImageTextToText,AutoModelForImageToImage:()=>n.AutoModelForImageToImage,AutoModelForMaskGeneration:()=>n.AutoModelForMaskGeneration,AutoModelForMaskedLM:()=>n.AutoModelForMaskedLM,AutoModelForNormalEstimation:()=>n.AutoModelForNormalEstimation,AutoModelForObjectDetection:()=>n.AutoModelForObjectDetection,AutoModelForPoseEstimation:()=>n.AutoModelForPoseEstimation,AutoModelForQuestionAnswering:()=>n.AutoModelForQuestionAnswering,AutoModelForSemanticSegmentation:()=>n.AutoModelForSemanticSegmentation,AutoModelForSeq2SeqLM:()=>n.AutoModelForSeq2SeqLM,AutoModelForSequenceClassification:()=>n.AutoModelForSequenceClassification,AutoModelForSpeechSeq2Seq:()=>n.AutoModelForSpeechSeq2Seq,AutoModelForTextToSpectrogram:()=>n.AutoModelForTextToSpectrogram,AutoModelForTextToWaveform:()=>n.AutoModelForTextToWaveform,AutoModelForTokenClassification:()=>n.AutoModelForTokenClassification,AutoModelForUniversalSegmentation:()=>n.AutoModelForUniversalSegmentation,AutoModelForVision2Seq:()=>n.AutoModelForVision2Seq,AutoModelForXVector:()=>n.AutoModelForXVector,AutoModelForZeroShotObjectDetection:()=>n.AutoModelForZeroShotObjectDetection,AutoProcessor:()=>v.AutoProcessor,AutoTokenizer:()=>r.AutoTokenizer,AutomaticSpeechRecognitionPipeline:()=>t.AutomaticSpeechRecognitionPipeline,BackgroundRemovalPipeline:()=>t.BackgroundRemovalPipeline,BartForConditionalGeneration:()=>n.BartForConditionalGeneration,BartForSequenceClassification:()=>n.BartForSequenceClassification,BartModel:()=>n.BartModel,BartPretrainedModel:()=>n.BartPretrainedModel,BartTokenizer:()=>r.BartTokenizer,BaseModelOutput:()=>n.BaseModelOutput,BaseStreamer:()=>y.BaseStreamer,BeitFeatureExtractor:()=>m.BeitFeatureExtractor,BeitForImageClassification:()=>n.BeitForImageClassification,BeitModel:()=>n.BeitModel,BeitPreTrainedModel:()=>n.BeitPreTrainedModel,BertForMaskedLM:()=>n.BertForMaskedLM,BertForQuestionAnswering:()=>n.BertForQuestionAnswering,BertForSequenceClassification:()=>n.BertForSequenceClassification,BertForTokenClassification:()=>n.BertForTokenClassification,BertModel:()=>n.BertModel,BertPreTrainedModel:()=>n.BertPreTrainedModel,BertTokenizer:()=>r.BertTokenizer,BitImageProcessor:()=>m.BitImageProcessor,BlenderbotForConditionalGeneration:()=>n.BlenderbotForConditionalGeneration,BlenderbotModel:()=>n.BlenderbotModel,BlenderbotPreTrainedModel:()=>n.BlenderbotPreTrainedModel,BlenderbotSmallForConditionalGeneration:()=>n.BlenderbotSmallForConditionalGeneration,BlenderbotSmallModel:()=>n.BlenderbotSmallModel,BlenderbotSmallPreTrainedModel:()=>n.BlenderbotSmallPreTrainedModel,BlenderbotSmallTokenizer:()=>r.BlenderbotSmallTokenizer,BlenderbotTokenizer:()=>r.BlenderbotTokenizer,BloomForCausalLM:()=>n.BloomForCausalLM,BloomModel:()=>n.BloomModel,BloomPreTrainedModel:()=>n.BloomPreTrainedModel,BloomTokenizer:()=>r.BloomTokenizer,CLIPFeatureExtractor:()=>m.CLIPFeatureExtractor,CLIPImageProcessor:()=>m.CLIPImageProcessor,CLIPModel:()=>n.CLIPModel,CLIPPreTrainedModel:()=>n.CLIPPreTrainedModel,CLIPSegForImageSegmentation:()=>n.CLIPSegForImageSegmentation,CLIPSegModel:()=>n.CLIPSegModel,CLIPSegPreTrainedModel:()=>n.CLIPSegPreTrainedModel,CLIPTextModel:()=>n.CLIPTextModel,CLIPTextModelWithProjection:()=>n.CLIPTextModelWithProjection,CLIPTokenizer:()=>r.CLIPTokenizer,CLIPVisionModel:()=>n.CLIPVisionModel,CLIPVisionModelWithProjection:()=>n.CLIPVisionModelWithProjection,CamembertForMaskedLM:()=>n.CamembertForMaskedLM,CamembertForQuestionAnswering:()=>n.CamembertForQuestionAnswering,CamembertForSequenceClassification:()=>n.CamembertForSequenceClassification,CamembertForTokenClassification:()=>n.CamembertForTokenClassification,CamembertModel:()=>n.CamembertModel,CamembertPreTrainedModel:()=>n.CamembertPreTrainedModel,CamembertTokenizer:()=>r.CamembertTokenizer,CausalLMOutput:()=>n.CausalLMOutput,CausalLMOutputWithPast:()=>n.CausalLMOutputWithPast,ChineseCLIPFeatureExtractor:()=>m.ChineseCLIPFeatureExtractor,ChineseCLIPModel:()=>n.ChineseCLIPModel,ChineseCLIPPreTrainedModel:()=>n.ChineseCLIPPreTrainedModel,ClapAudioModelWithProjection:()=>n.ClapAudioModelWithProjection,ClapFeatureExtractor:()=>d.ClapFeatureExtractor,ClapModel:()=>n.ClapModel,ClapPreTrainedModel:()=>n.ClapPreTrainedModel,ClapTextModelWithProjection:()=>n.ClapTextModelWithProjection,ClassifierFreeGuidanceLogitsProcessor:()=>x.ClassifierFreeGuidanceLogitsProcessor,CodeGenForCausalLM:()=>n.CodeGenForCausalLM,CodeGenModel:()=>n.CodeGenModel,CodeGenPreTrainedModel:()=>n.CodeGenPreTrainedModel,CodeGenTokenizer:()=>r.CodeGenTokenizer,CodeLlamaTokenizer:()=>r.CodeLlamaTokenizer,CohereForCausalLM:()=>n.CohereForCausalLM,CohereModel:()=>n.CohereModel,CoherePreTrainedModel:()=>n.CoherePreTrainedModel,CohereTokenizer:()=>r.CohereTokenizer,ConvBertForMaskedLM:()=>n.ConvBertForMaskedLM,ConvBertForQuestionAnswering:()=>n.ConvBertForQuestionAnswering,ConvBertForSequenceClassification:()=>n.ConvBertForSequenceClassification,ConvBertForTokenClassification:()=>n.ConvBertForTokenClassification,ConvBertModel:()=>n.ConvBertModel,ConvBertPreTrainedModel:()=>n.ConvBertPreTrainedModel,ConvBertTokenizer:()=>r.ConvBertTokenizer,ConvNextFeatureExtractor:()=>m.ConvNextFeatureExtractor,ConvNextForImageClassification:()=>n.ConvNextForImageClassification,ConvNextImageProcessor:()=>m.ConvNextImageProcessor,ConvNextModel:()=>n.ConvNextModel,ConvNextPreTrainedModel:()=>n.ConvNextPreTrainedModel,ConvNextV2ForImageClassification:()=>n.ConvNextV2ForImageClassification,ConvNextV2Model:()=>n.ConvNextV2Model,ConvNextV2PreTrainedModel:()=>n.ConvNextV2PreTrainedModel,DFineForObjectDetection:()=>n.DFineForObjectDetection,DFineModel:()=>n.DFineModel,DFinePreTrainedModel:()=>n.DFinePreTrainedModel,DPTFeatureExtractor:()=>m.DPTFeatureExtractor,DPTForDepthEstimation:()=>n.DPTForDepthEstimation,DPTImageProcessor:()=>m.DPTImageProcessor,DPTModel:()=>n.DPTModel,DPTPreTrainedModel:()=>n.DPTPreTrainedModel,DacDecoderModel:()=>n.DacDecoderModel,DacDecoderOutput:()=>n.DacDecoderOutput,DacEncoderModel:()=>n.DacEncoderModel,DacEncoderOutput:()=>n.DacEncoderOutput,DacFeatureExtractor:()=>d.DacFeatureExtractor,DacModel:()=>n.DacModel,DacPreTrainedModel:()=>n.DacPreTrainedModel,DataTypeMap:()=>c.DataTypeMap,DebertaForMaskedLM:()=>n.DebertaForMaskedLM,DebertaForQuestionAnswering:()=>n.DebertaForQuestionAnswering,DebertaForSequenceClassification:()=>n.DebertaForSequenceClassification,DebertaForTokenClassification:()=>n.DebertaForTokenClassification,DebertaModel:()=>n.DebertaModel,DebertaPreTrainedModel:()=>n.DebertaPreTrainedModel,DebertaTokenizer:()=>r.DebertaTokenizer,DebertaV2ForMaskedLM:()=>n.DebertaV2ForMaskedLM,DebertaV2ForQuestionAnswering:()=>n.DebertaV2ForQuestionAnswering,DebertaV2ForSequenceClassification:()=>n.DebertaV2ForSequenceClassification,DebertaV2ForTokenClassification:()=>n.DebertaV2ForTokenClassification,DebertaV2Model:()=>n.DebertaV2Model,DebertaV2PreTrainedModel:()=>n.DebertaV2PreTrainedModel,DebertaV2Tokenizer:()=>r.DebertaV2Tokenizer,DecisionTransformerModel:()=>n.DecisionTransformerModel,DecisionTransformerPreTrainedModel:()=>n.DecisionTransformerPreTrainedModel,DeiTFeatureExtractor:()=>m.DeiTFeatureExtractor,DeiTForImageClassification:()=>n.DeiTForImageClassification,DeiTImageProcessor:()=>m.DeiTImageProcessor,DeiTModel:()=>n.DeiTModel,DeiTPreTrainedModel:()=>n.DeiTPreTrainedModel,DepthAnythingForDepthEstimation:()=>n.DepthAnythingForDepthEstimation,DepthAnythingPreTrainedModel:()=>n.DepthAnythingPreTrainedModel,DepthEstimationPipeline:()=>t.DepthEstimationPipeline,DepthProForDepthEstimation:()=>n.DepthProForDepthEstimation,DepthProPreTrainedModel:()=>n.DepthProPreTrainedModel,DetrFeatureExtractor:()=>m.DetrFeatureExtractor,DetrForObjectDetection:()=>n.DetrForObjectDetection,DetrForSegmentation:()=>n.DetrForSegmentation,DetrImageProcessor:()=>m.DetrImageProcessor,DetrModel:()=>n.DetrModel,DetrObjectDetectionOutput:()=>n.DetrObjectDetectionOutput,DetrPreTrainedModel:()=>n.DetrPreTrainedModel,DetrSegmentationOutput:()=>n.DetrSegmentationOutput,Dinov2ForImageClassification:()=>n.Dinov2ForImageClassification,Dinov2Model:()=>n.Dinov2Model,Dinov2PreTrainedModel:()=>n.Dinov2PreTrainedModel,Dinov2WithRegistersForImageClassification:()=>n.Dinov2WithRegistersForImageClassification,Dinov2WithRegistersModel:()=>n.Dinov2WithRegistersModel,Dinov2WithRegistersPreTrainedModel:()=>n.Dinov2WithRegistersPreTrainedModel,DistilBertForMaskedLM:()=>n.DistilBertForMaskedLM,DistilBertForQuestionAnswering:()=>n.DistilBertForQuestionAnswering,DistilBertForSequenceClassification:()=>n.DistilBertForSequenceClassification,DistilBertForTokenClassification:()=>n.DistilBertForTokenClassification,DistilBertModel:()=>n.DistilBertModel,DistilBertPreTrainedModel:()=>n.DistilBertPreTrainedModel,DistilBertTokenizer:()=>r.DistilBertTokenizer,DocumentQuestionAnsweringPipeline:()=>t.DocumentQuestionAnsweringPipeline,DonutFeatureExtractor:()=>m.DonutFeatureExtractor,DonutImageProcessor:()=>m.DonutImageProcessor,DonutSwinModel:()=>n.DonutSwinModel,DonutSwinPreTrainedModel:()=>n.DonutSwinPreTrainedModel,EfficientNetForImageClassification:()=>n.EfficientNetForImageClassification,EfficientNetImageProcessor:()=>m.EfficientNetImageProcessor,EfficientNetModel:()=>n.EfficientNetModel,EfficientNetPreTrainedModel:()=>n.EfficientNetPreTrainedModel,ElectraForMaskedLM:()=>n.ElectraForMaskedLM,ElectraForQuestionAnswering:()=>n.ElectraForQuestionAnswering,ElectraForSequenceClassification:()=>n.ElectraForSequenceClassification,ElectraForTokenClassification:()=>n.ElectraForTokenClassification,ElectraModel:()=>n.ElectraModel,ElectraPreTrainedModel:()=>n.ElectraPreTrainedModel,ElectraTokenizer:()=>r.ElectraTokenizer,EncodecFeatureExtractor:()=>d.EncodecFeatureExtractor,EosTokenCriteria:()=>b.EosTokenCriteria,EsmForMaskedLM:()=>n.EsmForMaskedLM,EsmForSequenceClassification:()=>n.EsmForSequenceClassification,EsmForTokenClassification:()=>n.EsmForTokenClassification,EsmModel:()=>n.EsmModel,EsmPreTrainedModel:()=>n.EsmPreTrainedModel,EsmTokenizer:()=>r.EsmTokenizer,ExaoneForCausalLM:()=>n.ExaoneForCausalLM,ExaoneModel:()=>n.ExaoneModel,ExaonePreTrainedModel:()=>n.ExaonePreTrainedModel,FFT:()=>l.FFT,FalconForCausalLM:()=>n.FalconForCausalLM,FalconModel:()=>n.FalconModel,FalconPreTrainedModel:()=>n.FalconPreTrainedModel,FalconTokenizer:()=>r.FalconTokenizer,FastViTForImageClassification:()=>n.FastViTForImageClassification,FastViTModel:()=>n.FastViTModel,FastViTPreTrainedModel:()=>n.FastViTPreTrainedModel,FeatureExtractionPipeline:()=>t.FeatureExtractionPipeline,FeatureExtractor:()=>u.FeatureExtractor,FillMaskPipeline:()=>t.FillMaskPipeline,Florence2ForConditionalGeneration:()=>n.Florence2ForConditionalGeneration,Florence2PreTrainedModel:()=>n.Florence2PreTrainedModel,Florence2Processor:()=>_.Florence2Processor,ForcedBOSTokenLogitsProcessor:()=>x.ForcedBOSTokenLogitsProcessor,ForcedEOSTokenLogitsProcessor:()=>x.ForcedEOSTokenLogitsProcessor,GLPNFeatureExtractor:()=>m.GLPNFeatureExtractor,GLPNForDepthEstimation:()=>n.GLPNForDepthEstimation,GLPNModel:()=>n.GLPNModel,GLPNPreTrainedModel:()=>n.GLPNPreTrainedModel,GPT2LMHeadModel:()=>n.GPT2LMHeadModel,GPT2Model:()=>n.GPT2Model,GPT2PreTrainedModel:()=>n.GPT2PreTrainedModel,GPT2Tokenizer:()=>r.GPT2Tokenizer,GPTBigCodeForCausalLM:()=>n.GPTBigCodeForCausalLM,GPTBigCodeModel:()=>n.GPTBigCodeModel,GPTBigCodePreTrainedModel:()=>n.GPTBigCodePreTrainedModel,GPTJForCausalLM:()=>n.GPTJForCausalLM,GPTJModel:()=>n.GPTJModel,GPTJPreTrainedModel:()=>n.GPTJPreTrainedModel,GPTNeoForCausalLM:()=>n.GPTNeoForCausalLM,GPTNeoModel:()=>n.GPTNeoModel,GPTNeoPreTrainedModel:()=>n.GPTNeoPreTrainedModel,GPTNeoXForCausalLM:()=>n.GPTNeoXForCausalLM,GPTNeoXModel:()=>n.GPTNeoXModel,GPTNeoXPreTrainedModel:()=>n.GPTNeoXPreTrainedModel,GPTNeoXTokenizer:()=>r.GPTNeoXTokenizer,Gemma2ForCausalLM:()=>n.Gemma2ForCausalLM,Gemma2Model:()=>n.Gemma2Model,Gemma2PreTrainedModel:()=>n.Gemma2PreTrainedModel,Gemma3ForCausalLM:()=>n.Gemma3ForCausalLM,Gemma3Model:()=>n.Gemma3Model,Gemma3PreTrainedModel:()=>n.Gemma3PreTrainedModel,Gemma3nAudioFeatureExtractor:()=>d.Gemma3nAudioFeatureExtractor,Gemma3nForConditionalGeneration:()=>n.Gemma3nForConditionalGeneration,Gemma3nPreTrainedModel:()=>n.Gemma3nPreTrainedModel,Gemma3nProcessor:()=>_.Gemma3nProcessor,GemmaForCausalLM:()=>n.GemmaForCausalLM,GemmaModel:()=>n.GemmaModel,GemmaPreTrainedModel:()=>n.GemmaPreTrainedModel,GemmaTokenizer:()=>r.GemmaTokenizer,GlmForCausalLM:()=>n.GlmForCausalLM,GlmModel:()=>n.GlmModel,GlmPreTrainedModel:()=>n.GlmPreTrainedModel,GraniteForCausalLM:()=>n.GraniteForCausalLM,GraniteModel:()=>n.GraniteModel,GranitePreTrainedModel:()=>n.GranitePreTrainedModel,Grok1Tokenizer:()=>r.Grok1Tokenizer,GroundingDinoForObjectDetection:()=>n.GroundingDinoForObjectDetection,GroundingDinoImageProcessor:()=>m.GroundingDinoImageProcessor,GroundingDinoPreTrainedModel:()=>n.GroundingDinoPreTrainedModel,GroundingDinoProcessor:()=>_.GroundingDinoProcessor,GroupViTModel:()=>n.GroupViTModel,GroupViTPreTrainedModel:()=>n.GroupViTPreTrainedModel,HeliumForCausalLM:()=>n.HeliumForCausalLM,HeliumModel:()=>n.HeliumModel,HeliumPreTrainedModel:()=>n.HeliumPreTrainedModel,HerbertTokenizer:()=>r.HerbertTokenizer,HieraForImageClassification:()=>n.HieraForImageClassification,HieraModel:()=>n.HieraModel,HieraPreTrainedModel:()=>n.HieraPreTrainedModel,HubertForCTC:()=>n.HubertForCTC,HubertForSequenceClassification:()=>n.HubertForSequenceClassification,HubertModel:()=>n.HubertModel,HubertPreTrainedModel:()=>n.HubertPreTrainedModel,IJepaForImageClassification:()=>n.IJepaForImageClassification,IJepaModel:()=>n.IJepaModel,IJepaPreTrainedModel:()=>n.IJepaPreTrainedModel,Idefics3ForConditionalGeneration:()=>n.Idefics3ForConditionalGeneration,Idefics3ImageProcessor:()=>m.Idefics3ImageProcessor,Idefics3PreTrainedModel:()=>n.Idefics3PreTrainedModel,Idefics3Processor:()=>_.Idefics3Processor,ImageClassificationPipeline:()=>t.ImageClassificationPipeline,ImageFeatureExtractionPipeline:()=>t.ImageFeatureExtractionPipeline,ImageFeatureExtractor:()=>d.ImageFeatureExtractor,ImageMattingOutput:()=>n.ImageMattingOutput,ImageProcessor:()=>p.ImageProcessor,ImageSegmentationPipeline:()=>t.ImageSegmentationPipeline,ImageToImagePipeline:()=>t.ImageToImagePipeline,ImageToTextPipeline:()=>t.ImageToTextPipeline,InterruptableStoppingCriteria:()=>b.InterruptableStoppingCriteria,JAISLMHeadModel:()=>n.JAISLMHeadModel,JAISModel:()=>n.JAISModel,JAISPreTrainedModel:()=>n.JAISPreTrainedModel,JinaCLIPImageProcessor:()=>m.JinaCLIPImageProcessor,JinaCLIPModel:()=>n.JinaCLIPModel,JinaCLIPPreTrainedModel:()=>n.JinaCLIPPreTrainedModel,JinaCLIPProcessor:()=>_.JinaCLIPProcessor,JinaCLIPTextModel:()=>n.JinaCLIPTextModel,JinaCLIPVisionModel:()=>n.JinaCLIPVisionModel,LiteWhisperForConditionalGeneration:()=>n.LiteWhisperForConditionalGeneration,LlamaForCausalLM:()=>n.LlamaForCausalLM,LlamaModel:()=>n.LlamaModel,LlamaPreTrainedModel:()=>n.LlamaPreTrainedModel,LlamaTokenizer:()=>r.LlamaTokenizer,LlavaForConditionalGeneration:()=>n.LlavaForConditionalGeneration,LlavaOnevisionForConditionalGeneration:()=>n.LlavaOnevisionForConditionalGeneration,LlavaOnevisionImageProcessor:()=>m.LlavaOnevisionImageProcessor,LlavaPreTrainedModel:()=>n.LlavaPreTrainedModel,LlavaProcessor:()=>_.LlavaProcessor,LlavaQwen2ForCausalLM:()=>n.LlavaQwen2ForCausalLM,LogitsProcessor:()=>x.LogitsProcessor,LogitsProcessorList:()=>x.LogitsProcessorList,LogitsWarper:()=>x.LogitsWarper,LongT5ForConditionalGeneration:()=>n.LongT5ForConditionalGeneration,LongT5Model:()=>n.LongT5Model,LongT5PreTrainedModel:()=>n.LongT5PreTrainedModel,M2M100ForConditionalGeneration:()=>n.M2M100ForConditionalGeneration,M2M100Model:()=>n.M2M100Model,M2M100PreTrainedModel:()=>n.M2M100PreTrainedModel,M2M100Tokenizer:()=>r.M2M100Tokenizer,MBart50Tokenizer:()=>r.MBart50Tokenizer,MBartForCausalLM:()=>n.MBartForCausalLM,MBartForConditionalGeneration:()=>n.MBartForConditionalGeneration,MBartForSequenceClassification:()=>n.MBartForSequenceClassification,MBartModel:()=>n.MBartModel,MBartPreTrainedModel:()=>n.MBartPreTrainedModel,MBartTokenizer:()=>r.MBartTokenizer,MPNetForMaskedLM:()=>n.MPNetForMaskedLM,MPNetForQuestionAnswering:()=>n.MPNetForQuestionAnswering,MPNetForSequenceClassification:()=>n.MPNetForSequenceClassification,MPNetForTokenClassification:()=>n.MPNetForTokenClassification,MPNetModel:()=>n.MPNetModel,MPNetPreTrainedModel:()=>n.MPNetPreTrainedModel,MPNetTokenizer:()=>r.MPNetTokenizer,MT5ForConditionalGeneration:()=>n.MT5ForConditionalGeneration,MT5Model:()=>n.MT5Model,MT5PreTrainedModel:()=>n.MT5PreTrainedModel,MarianMTModel:()=>n.MarianMTModel,MarianModel:()=>n.MarianModel,MarianPreTrainedModel:()=>n.MarianPreTrainedModel,MarianTokenizer:()=>r.MarianTokenizer,Mask2FormerImageProcessor:()=>m.Mask2FormerImageProcessor,MaskFormerFeatureExtractor:()=>m.MaskFormerFeatureExtractor,MaskFormerForInstanceSegmentation:()=>n.MaskFormerForInstanceSegmentation,MaskFormerImageProcessor:()=>m.MaskFormerImageProcessor,MaskFormerModel:()=>n.MaskFormerModel,MaskFormerPreTrainedModel:()=>n.MaskFormerPreTrainedModel,MaskedLMOutput:()=>n.MaskedLMOutput,MaxLengthCriteria:()=>b.MaxLengthCriteria,Metric3DForDepthEstimation:()=>n.Metric3DForDepthEstimation,Metric3DPreTrainedModel:()=>n.Metric3DPreTrainedModel,Metric3Dv2ForDepthEstimation:()=>n.Metric3Dv2ForDepthEstimation,Metric3Dv2PreTrainedModel:()=>n.Metric3Dv2PreTrainedModel,MgpstrForSceneTextRecognition:()=>n.MgpstrForSceneTextRecognition,MgpstrModelOutput:()=>n.MgpstrModelOutput,MgpstrPreTrainedModel:()=>n.MgpstrPreTrainedModel,MgpstrProcessor:()=>_.MgpstrProcessor,MgpstrTokenizer:()=>r.MgpstrTokenizer,MimiDecoderModel:()=>n.MimiDecoderModel,MimiDecoderOutput:()=>n.MimiDecoderOutput,MimiEncoderModel:()=>n.MimiEncoderModel,MimiEncoderOutput:()=>n.MimiEncoderOutput,MimiModel:()=>n.MimiModel,MimiPreTrainedModel:()=>n.MimiPreTrainedModel,MinLengthLogitsProcessor:()=>x.MinLengthLogitsProcessor,MinNewTokensLengthLogitsProcessor:()=>x.MinNewTokensLengthLogitsProcessor,MistralForCausalLM:()=>n.MistralForCausalLM,MistralModel:()=>n.MistralModel,MistralPreTrainedModel:()=>n.MistralPreTrainedModel,MobileBertForMaskedLM:()=>n.MobileBertForMaskedLM,MobileBertForQuestionAnswering:()=>n.MobileBertForQuestionAnswering,MobileBertForSequenceClassification:()=>n.MobileBertForSequenceClassification,MobileBertModel:()=>n.MobileBertModel,MobileBertPreTrainedModel:()=>n.MobileBertPreTrainedModel,MobileBertTokenizer:()=>r.MobileBertTokenizer,MobileLLMForCausalLM:()=>n.MobileLLMForCausalLM,MobileLLMModel:()=>n.MobileLLMModel,MobileLLMPreTrainedModel:()=>n.MobileLLMPreTrainedModel,MobileNetV1FeatureExtractor:()=>m.MobileNetV1FeatureExtractor,MobileNetV1ForImageClassification:()=>n.MobileNetV1ForImageClassification,MobileNetV1ForSemanticSegmentation:()=>n.MobileNetV1ForSemanticSegmentation,MobileNetV1ImageProcessor:()=>m.MobileNetV1ImageProcessor,MobileNetV1Model:()=>n.MobileNetV1Model,MobileNetV1PreTrainedModel:()=>n.MobileNetV1PreTrainedModel,MobileNetV2FeatureExtractor:()=>m.MobileNetV2FeatureExtractor,MobileNetV2ForImageClassification:()=>n.MobileNetV2ForImageClassification,MobileNetV2ForSemanticSegmentation:()=>n.MobileNetV2ForSemanticSegmentation,MobileNetV2ImageProcessor:()=>m.MobileNetV2ImageProcessor,MobileNetV2Model:()=>n.MobileNetV2Model,MobileNetV2PreTrainedModel:()=>n.MobileNetV2PreTrainedModel,MobileNetV3FeatureExtractor:()=>m.MobileNetV3FeatureExtractor,MobileNetV3ForImageClassification:()=>n.MobileNetV3ForImageClassification,MobileNetV3ForSemanticSegmentation:()=>n.MobileNetV3ForSemanticSegmentation,MobileNetV3ImageProcessor:()=>m.MobileNetV3ImageProcessor,MobileNetV3Model:()=>n.MobileNetV3Model,MobileNetV3PreTrainedModel:()=>n.MobileNetV3PreTrainedModel,MobileNetV4FeatureExtractor:()=>m.MobileNetV4FeatureExtractor,MobileNetV4ForImageClassification:()=>n.MobileNetV4ForImageClassification,MobileNetV4ForSemanticSegmentation:()=>n.MobileNetV4ForSemanticSegmentation,MobileNetV4ImageProcessor:()=>m.MobileNetV4ImageProcessor,MobileNetV4Model:()=>n.MobileNetV4Model,MobileNetV4PreTrainedModel:()=>n.MobileNetV4PreTrainedModel,MobileViTFeatureExtractor:()=>m.MobileViTFeatureExtractor,MobileViTForImageClassification:()=>n.MobileViTForImageClassification,MobileViTImageProcessor:()=>m.MobileViTImageProcessor,MobileViTModel:()=>n.MobileViTModel,MobileViTPreTrainedModel:()=>n.MobileViTPreTrainedModel,MobileViTV2ForImageClassification:()=>n.MobileViTV2ForImageClassification,MobileViTV2Model:()=>n.MobileViTV2Model,MobileViTV2PreTrainedModel:()=>n.MobileViTV2PreTrainedModel,ModelOutput:()=>n.ModelOutput,ModernBertForMaskedLM:()=>n.ModernBertForMaskedLM,ModernBertForSequenceClassification:()=>n.ModernBertForSequenceClassification,ModernBertForTokenClassification:()=>n.ModernBertForTokenClassification,ModernBertModel:()=>n.ModernBertModel,ModernBertPreTrainedModel:()=>n.ModernBertPreTrainedModel,Moondream1ForConditionalGeneration:()=>n.Moondream1ForConditionalGeneration,MoonshineFeatureExtractor:()=>d.MoonshineFeatureExtractor,MoonshineForConditionalGeneration:()=>n.MoonshineForConditionalGeneration,MoonshineModel:()=>n.MoonshineModel,MoonshinePreTrainedModel:()=>n.MoonshinePreTrainedModel,MoonshineProcessor:()=>_.MoonshineProcessor,MptForCausalLM:()=>n.MptForCausalLM,MptModel:()=>n.MptModel,MptPreTrainedModel:()=>n.MptPreTrainedModel,MultiModalityCausalLM:()=>n.MultiModalityCausalLM,MultiModalityPreTrainedModel:()=>n.MultiModalityPreTrainedModel,MusicgenForCausalLM:()=>n.MusicgenForCausalLM,MusicgenForConditionalGeneration:()=>n.MusicgenForConditionalGeneration,MusicgenModel:()=>n.MusicgenModel,MusicgenPreTrainedModel:()=>n.MusicgenPreTrainedModel,NeoBertForMaskedLM:()=>n.NeoBertForMaskedLM,NeoBertForQuestionAnswering:()=>n.NeoBertForQuestionAnswering,NeoBertForSequenceClassification:()=>n.NeoBertForSequenceClassification,NeoBertForTokenClassification:()=>n.NeoBertForTokenClassification,NeoBertModel:()=>n.NeoBertModel,NeoBertPreTrainedModel:()=>n.NeoBertPreTrainedModel,NllbTokenizer:()=>r.NllbTokenizer,NoBadWordsLogitsProcessor:()=>x.NoBadWordsLogitsProcessor,NoRepeatNGramLogitsProcessor:()=>x.NoRepeatNGramLogitsProcessor,NomicBertModel:()=>n.NomicBertModel,NomicBertPreTrainedModel:()=>n.NomicBertPreTrainedModel,NougatImageProcessor:()=>m.NougatImageProcessor,NougatTokenizer:()=>r.NougatTokenizer,OPTForCausalLM:()=>n.OPTForCausalLM,OPTModel:()=>n.OPTModel,OPTPreTrainedModel:()=>n.OPTPreTrainedModel,ObjectDetectionPipeline:()=>t.ObjectDetectionPipeline,Olmo2ForCausalLM:()=>n.Olmo2ForCausalLM,Olmo2Model:()=>n.Olmo2Model,Olmo2PreTrainedModel:()=>n.Olmo2PreTrainedModel,OlmoForCausalLM:()=>n.OlmoForCausalLM,OlmoModel:()=>n.OlmoModel,OlmoPreTrainedModel:()=>n.OlmoPreTrainedModel,OpenELMForCausalLM:()=>n.OpenELMForCausalLM,OpenELMModel:()=>n.OpenELMModel,OpenELMPreTrainedModel:()=>n.OpenELMPreTrainedModel,OwlViTFeatureExtractor:()=>m.OwlViTFeatureExtractor,OwlViTForObjectDetection:()=>n.OwlViTForObjectDetection,OwlViTImageProcessor:()=>m.OwlViTImageProcessor,OwlViTModel:()=>n.OwlViTModel,OwlViTPreTrainedModel:()=>n.OwlViTPreTrainedModel,OwlViTProcessor:()=>_.OwlViTProcessor,Owlv2ForObjectDetection:()=>n.Owlv2ForObjectDetection,Owlv2ImageProcessor:()=>m.Owlv2ImageProcessor,Owlv2Model:()=>n.Owlv2Model,Owlv2PreTrainedModel:()=>n.Owlv2PreTrainedModel,PaliGemmaForConditionalGeneration:()=>n.PaliGemmaForConditionalGeneration,PaliGemmaPreTrainedModel:()=>n.PaliGemmaPreTrainedModel,PaliGemmaProcessor:()=>_.PaliGemmaProcessor,PatchTSMixerForPrediction:()=>n.PatchTSMixerForPrediction,PatchTSMixerModel:()=>n.PatchTSMixerModel,PatchTSMixerPreTrainedModel:()=>n.PatchTSMixerPreTrainedModel,PatchTSTForPrediction:()=>n.PatchTSTForPrediction,PatchTSTModel:()=>n.PatchTSTModel,PatchTSTPreTrainedModel:()=>n.PatchTSTPreTrainedModel,Phi3ForCausalLM:()=>n.Phi3ForCausalLM,Phi3Model:()=>n.Phi3Model,Phi3PreTrainedModel:()=>n.Phi3PreTrainedModel,Phi3VForCausalLM:()=>n.Phi3VForCausalLM,Phi3VImageProcessor:()=>m.Phi3VImageProcessor,Phi3VPreTrainedModel:()=>n.Phi3VPreTrainedModel,Phi3VProcessor:()=>_.Phi3VProcessor,PhiForCausalLM:()=>n.PhiForCausalLM,PhiModel:()=>n.PhiModel,PhiPreTrainedModel:()=>n.PhiPreTrainedModel,Pipeline:()=>t.Pipeline,PreTrainedModel:()=>n.PreTrainedModel,PreTrainedTokenizer:()=>r.PreTrainedTokenizer,PretrainedConfig:()=>i.PretrainedConfig,PretrainedMixin:()=>n.PretrainedMixin,Processor:()=>g.Processor,PvtForImageClassification:()=>n.PvtForImageClassification,PvtImageProcessor:()=>m.PvtImageProcessor,PvtModel:()=>n.PvtModel,PvtPreTrainedModel:()=>n.PvtPreTrainedModel,PyAnnoteFeatureExtractor:()=>d.PyAnnoteFeatureExtractor,PyAnnoteForAudioFrameClassification:()=>n.PyAnnoteForAudioFrameClassification,PyAnnoteModel:()=>n.PyAnnoteModel,PyAnnotePreTrainedModel:()=>n.PyAnnotePreTrainedModel,PyAnnoteProcessor:()=>_.PyAnnoteProcessor,QuestionAnsweringModelOutput:()=>n.QuestionAnsweringModelOutput,QuestionAnsweringPipeline:()=>t.QuestionAnsweringPipeline,Qwen2ForCausalLM:()=>n.Qwen2ForCausalLM,Qwen2Model:()=>n.Qwen2Model,Qwen2PreTrainedModel:()=>n.Qwen2PreTrainedModel,Qwen2Tokenizer:()=>r.Qwen2Tokenizer,Qwen2VLForConditionalGeneration:()=>n.Qwen2VLForConditionalGeneration,Qwen2VLImageProcessor:()=>m.Qwen2VLImageProcessor,Qwen2VLPreTrainedModel:()=>n.Qwen2VLPreTrainedModel,Qwen2VLProcessor:()=>_.Qwen2VLProcessor,Qwen3ForCausalLM:()=>n.Qwen3ForCausalLM,Qwen3Model:()=>n.Qwen3Model,Qwen3PreTrainedModel:()=>n.Qwen3PreTrainedModel,RFDetrForObjectDetection:()=>n.RFDetrForObjectDetection,RFDetrModel:()=>n.RFDetrModel,RFDetrObjectDetectionOutput:()=>n.RFDetrObjectDetectionOutput,RFDetrPreTrainedModel:()=>n.RFDetrPreTrainedModel,RTDetrForObjectDetection:()=>n.RTDetrForObjectDetection,RTDetrImageProcessor:()=>m.RTDetrImageProcessor,RTDetrModel:()=>n.RTDetrModel,RTDetrObjectDetectionOutput:()=>n.RTDetrObjectDetectionOutput,RTDetrPreTrainedModel:()=>n.RTDetrPreTrainedModel,RTDetrV2ForObjectDetection:()=>n.RTDetrV2ForObjectDetection,RTDetrV2Model:()=>n.RTDetrV2Model,RTDetrV2ObjectDetectionOutput:()=>n.RTDetrV2ObjectDetectionOutput,RTDetrV2PreTrainedModel:()=>n.RTDetrV2PreTrainedModel,RawAudio:()=>a.RawAudio,RawImage:()=>o.RawImage,RawVideo:()=>s.RawVideo,RawVideoFrame:()=>s.RawVideoFrame,RepetitionPenaltyLogitsProcessor:()=>x.RepetitionPenaltyLogitsProcessor,ResNetForImageClassification:()=>n.ResNetForImageClassification,ResNetModel:()=>n.ResNetModel,ResNetPreTrainedModel:()=>n.ResNetPreTrainedModel,RoFormerForMaskedLM:()=>n.RoFormerForMaskedLM,RoFormerForQuestionAnswering:()=>n.RoFormerForQuestionAnswering,RoFormerForSequenceClassification:()=>n.RoFormerForSequenceClassification,RoFormerForTokenClassification:()=>n.RoFormerForTokenClassification,RoFormerModel:()=>n.RoFormerModel,RoFormerPreTrainedModel:()=>n.RoFormerPreTrainedModel,RoFormerTokenizer:()=>r.RoFormerTokenizer,RobertaForMaskedLM:()=>n.RobertaForMaskedLM,RobertaForQuestionAnswering:()=>n.RobertaForQuestionAnswering,RobertaForSequenceClassification:()=>n.RobertaForSequenceClassification,RobertaForTokenClassification:()=>n.RobertaForTokenClassification,RobertaModel:()=>n.RobertaModel,RobertaPreTrainedModel:()=>n.RobertaPreTrainedModel,RobertaTokenizer:()=>r.RobertaTokenizer,SamImageProcessor:()=>m.SamImageProcessor,SamImageSegmentationOutput:()=>n.SamImageSegmentationOutput,SamModel:()=>n.SamModel,SamPreTrainedModel:()=>n.SamPreTrainedModel,SamProcessor:()=>_.SamProcessor,SapiensForDepthEstimation:()=>n.SapiensForDepthEstimation,SapiensForNormalEstimation:()=>n.SapiensForNormalEstimation,SapiensForSemanticSegmentation:()=>n.SapiensForSemanticSegmentation,SapiensPreTrainedModel:()=>n.SapiensPreTrainedModel,SeamlessM4TFeatureExtractor:()=>d.SeamlessM4TFeatureExtractor,SegformerFeatureExtractor:()=>m.SegformerFeatureExtractor,SegformerForImageClassification:()=>n.SegformerForImageClassification,SegformerForSemanticSegmentation:()=>n.SegformerForSemanticSegmentation,SegformerImageProcessor:()=>m.SegformerImageProcessor,SegformerModel:()=>n.SegformerModel,SegformerPreTrainedModel:()=>n.SegformerPreTrainedModel,Seq2SeqLMOutput:()=>n.Seq2SeqLMOutput,SequenceClassifierOutput:()=>n.SequenceClassifierOutput,SiglipImageProcessor:()=>m.SiglipImageProcessor,SiglipModel:()=>n.SiglipModel,SiglipPreTrainedModel:()=>n.SiglipPreTrainedModel,SiglipTextModel:()=>n.SiglipTextModel,SiglipTokenizer:()=>r.SiglipTokenizer,SiglipVisionModel:()=>n.SiglipVisionModel,SmolVLMForConditionalGeneration:()=>n.SmolVLMForConditionalGeneration,SmolVLMImageProcessor:()=>m.SmolVLMImageProcessor,SmolVLMProcessor:()=>_.SmolVLMProcessor,SnacDecoderModel:()=>n.SnacDecoderModel,SnacEncoderModel:()=>n.SnacEncoderModel,SnacFeatureExtractor:()=>d.SnacFeatureExtractor,SnacModel:()=>n.SnacModel,SnacPreTrainedModel:()=>n.SnacPreTrainedModel,SpeechT5FeatureExtractor:()=>d.SpeechT5FeatureExtractor,SpeechT5ForSpeechToText:()=>n.SpeechT5ForSpeechToText,SpeechT5ForTextToSpeech:()=>n.SpeechT5ForTextToSpeech,SpeechT5HifiGan:()=>n.SpeechT5HifiGan,SpeechT5Model:()=>n.SpeechT5Model,SpeechT5PreTrainedModel:()=>n.SpeechT5PreTrainedModel,SpeechT5Processor:()=>_.SpeechT5Processor,SpeechT5Tokenizer:()=>r.SpeechT5Tokenizer,SqueezeBertForMaskedLM:()=>n.SqueezeBertForMaskedLM,SqueezeBertForQuestionAnswering:()=>n.SqueezeBertForQuestionAnswering,SqueezeBertForSequenceClassification:()=>n.SqueezeBertForSequenceClassification,SqueezeBertModel:()=>n.SqueezeBertModel,SqueezeBertPreTrainedModel:()=>n.SqueezeBertPreTrainedModel,SqueezeBertTokenizer:()=>r.SqueezeBertTokenizer,StableLmForCausalLM:()=>n.StableLmForCausalLM,StableLmModel:()=>n.StableLmModel,StableLmPreTrainedModel:()=>n.StableLmPreTrainedModel,Starcoder2ForCausalLM:()=>n.Starcoder2ForCausalLM,Starcoder2Model:()=>n.Starcoder2Model,Starcoder2PreTrainedModel:()=>n.Starcoder2PreTrainedModel,StoppingCriteria:()=>b.StoppingCriteria,StoppingCriteriaList:()=>b.StoppingCriteriaList,StyleTextToSpeech2Model:()=>n.StyleTextToSpeech2Model,StyleTextToSpeech2PreTrainedModel:()=>n.StyleTextToSpeech2PreTrainedModel,SummarizationPipeline:()=>t.SummarizationPipeline,SuppressTokensAtBeginLogitsProcessor:()=>x.SuppressTokensAtBeginLogitsProcessor,Swin2SRForImageSuperResolution:()=>n.Swin2SRForImageSuperResolution,Swin2SRImageProcessor:()=>m.Swin2SRImageProcessor,Swin2SRModel:()=>n.Swin2SRModel,Swin2SRPreTrainedModel:()=>n.Swin2SRPreTrainedModel,SwinForImageClassification:()=>n.SwinForImageClassification,SwinForSemanticSegmentation:()=>n.SwinForSemanticSegmentation,SwinModel:()=>n.SwinModel,SwinPreTrainedModel:()=>n.SwinPreTrainedModel,T5ForConditionalGeneration:()=>n.T5ForConditionalGeneration,T5Model:()=>n.T5Model,T5PreTrainedModel:()=>n.T5PreTrainedModel,T5Tokenizer:()=>r.T5Tokenizer,TableTransformerForObjectDetection:()=>n.TableTransformerForObjectDetection,TableTransformerModel:()=>n.TableTransformerModel,TableTransformerObjectDetectionOutput:()=>n.TableTransformerObjectDetectionOutput,TableTransformerPreTrainedModel:()=>n.TableTransformerPreTrainedModel,TemperatureLogitsWarper:()=>x.TemperatureLogitsWarper,Tensor:()=>c.Tensor,Text2TextGenerationPipeline:()=>t.Text2TextGenerationPipeline,TextClassificationPipeline:()=>t.TextClassificationPipeline,TextGenerationPipeline:()=>t.TextGenerationPipeline,TextStreamer:()=>y.TextStreamer,TextToAudioPipeline:()=>t.TextToAudioPipeline,TokenClassificationPipeline:()=>t.TokenClassificationPipeline,TokenClassifierOutput:()=>n.TokenClassifierOutput,TokenizerModel:()=>r.TokenizerModel,TopKLogitsWarper:()=>x.TopKLogitsWarper,TopPLogitsWarper:()=>x.TopPLogitsWarper,TrOCRForCausalLM:()=>n.TrOCRForCausalLM,TrOCRPreTrainedModel:()=>n.TrOCRPreTrainedModel,TranslationPipeline:()=>t.TranslationPipeline,UltravoxModel:()=>n.UltravoxModel,UltravoxPreTrainedModel:()=>n.UltravoxPreTrainedModel,UltravoxProcessor:()=>_.UltravoxProcessor,UniSpeechForCTC:()=>n.UniSpeechForCTC,UniSpeechForSequenceClassification:()=>n.UniSpeechForSequenceClassification,UniSpeechModel:()=>n.UniSpeechModel,UniSpeechPreTrainedModel:()=>n.UniSpeechPreTrainedModel,UniSpeechSatForAudioFrameClassification:()=>n.UniSpeechSatForAudioFrameClassification,UniSpeechSatForCTC:()=>n.UniSpeechSatForCTC,UniSpeechSatForSequenceClassification:()=>n.UniSpeechSatForSequenceClassification,UniSpeechSatModel:()=>n.UniSpeechSatModel,UniSpeechSatPreTrainedModel:()=>n.UniSpeechSatPreTrainedModel,VLChatProcessor:()=>_.VLChatProcessor,VLMImageProcessor:()=>m.VLMImageProcessor,ViTFeatureExtractor:()=>m.ViTFeatureExtractor,ViTForImageClassification:()=>n.ViTForImageClassification,ViTImageProcessor:()=>m.ViTImageProcessor,ViTMAEModel:()=>n.ViTMAEModel,ViTMAEPreTrainedModel:()=>n.ViTMAEPreTrainedModel,ViTMSNForImageClassification:()=>n.ViTMSNForImageClassification,ViTMSNModel:()=>n.ViTMSNModel,ViTMSNPreTrainedModel:()=>n.ViTMSNPreTrainedModel,ViTModel:()=>n.ViTModel,ViTPreTrainedModel:()=>n.ViTPreTrainedModel,VisionEncoderDecoderModel:()=>n.VisionEncoderDecoderModel,VitMatteForImageMatting:()=>n.VitMatteForImageMatting,VitMatteImageProcessor:()=>m.VitMatteImageProcessor,VitMattePreTrainedModel:()=>n.VitMattePreTrainedModel,VitPoseForPoseEstimation:()=>n.VitPoseForPoseEstimation,VitPoseImageProcessor:()=>m.VitPoseImageProcessor,VitPosePreTrainedModel:()=>n.VitPosePreTrainedModel,VitsModel:()=>n.VitsModel,VitsModelOutput:()=>n.VitsModelOutput,VitsPreTrainedModel:()=>n.VitsPreTrainedModel,VitsTokenizer:()=>r.VitsTokenizer,Wav2Vec2BertForCTC:()=>n.Wav2Vec2BertForCTC,Wav2Vec2BertForSequenceClassification:()=>n.Wav2Vec2BertForSequenceClassification,Wav2Vec2BertModel:()=>n.Wav2Vec2BertModel,Wav2Vec2BertPreTrainedModel:()=>n.Wav2Vec2BertPreTrainedModel,Wav2Vec2CTCTokenizer:()=>r.Wav2Vec2CTCTokenizer,Wav2Vec2FeatureExtractor:()=>d.Wav2Vec2FeatureExtractor,Wav2Vec2ForAudioFrameClassification:()=>n.Wav2Vec2ForAudioFrameClassification,Wav2Vec2ForCTC:()=>n.Wav2Vec2ForCTC,Wav2Vec2ForSequenceClassification:()=>n.Wav2Vec2ForSequenceClassification,Wav2Vec2Model:()=>n.Wav2Vec2Model,Wav2Vec2PreTrainedModel:()=>n.Wav2Vec2PreTrainedModel,Wav2Vec2Processor:()=>_.Wav2Vec2Processor,Wav2Vec2ProcessorWithLM:()=>_.Wav2Vec2ProcessorWithLM,WavLMForAudioFrameClassification:()=>n.WavLMForAudioFrameClassification,WavLMForCTC:()=>n.WavLMForCTC,WavLMForSequenceClassification:()=>n.WavLMForSequenceClassification,WavLMForXVector:()=>n.WavLMForXVector,WavLMModel:()=>n.WavLMModel,WavLMPreTrainedModel:()=>n.WavLMPreTrainedModel,WeSpeakerFeatureExtractor:()=>d.WeSpeakerFeatureExtractor,WeSpeakerResNetModel:()=>n.WeSpeakerResNetModel,WeSpeakerResNetPreTrainedModel:()=>n.WeSpeakerResNetPreTrainedModel,WhisperFeatureExtractor:()=>d.WhisperFeatureExtractor,WhisperForConditionalGeneration:()=>n.WhisperForConditionalGeneration,WhisperModel:()=>n.WhisperModel,WhisperPreTrainedModel:()=>n.WhisperPreTrainedModel,WhisperProcessor:()=>_.WhisperProcessor,WhisperTextStreamer:()=>y.WhisperTextStreamer,WhisperTimeStampLogitsProcessor:()=>x.WhisperTimeStampLogitsProcessor,WhisperTokenizer:()=>r.WhisperTokenizer,XLMForQuestionAnswering:()=>n.XLMForQuestionAnswering,XLMForSequenceClassification:()=>n.XLMForSequenceClassification,XLMForTokenClassification:()=>n.XLMForTokenClassification,XLMModel:()=>n.XLMModel,XLMPreTrainedModel:()=>n.XLMPreTrainedModel,XLMRobertaForMaskedLM:()=>n.XLMRobertaForMaskedLM,XLMRobertaForQuestionAnswering:()=>n.XLMRobertaForQuestionAnswering,XLMRobertaForSequenceClassification:()=>n.XLMRobertaForSequenceClassification,XLMRobertaForTokenClassification:()=>n.XLMRobertaForTokenClassification,XLMRobertaModel:()=>n.XLMRobertaModel,XLMRobertaPreTrainedModel:()=>n.XLMRobertaPreTrainedModel,XLMRobertaTokenizer:()=>r.XLMRobertaTokenizer,XLMTokenizer:()=>r.XLMTokenizer,XLMWithLMHeadModel:()=>n.XLMWithLMHeadModel,XVectorOutput:()=>n.XVectorOutput,YolosFeatureExtractor:()=>m.YolosFeatureExtractor,YolosForObjectDetection:()=>n.YolosForObjectDetection,YolosImageProcessor:()=>m.YolosImageProcessor,YolosModel:()=>n.YolosModel,YolosObjectDetectionOutput:()=>n.YolosObjectDetectionOutput,YolosPreTrainedModel:()=>n.YolosPreTrainedModel,ZeroShotAudioClassificationPipeline:()=>t.ZeroShotAudioClassificationPipeline,ZeroShotClassificationPipeline:()=>t.ZeroShotClassificationPipeline,ZeroShotImageClassificationPipeline:()=>t.ZeroShotImageClassificationPipeline,ZeroShotObjectDetectionPipeline:()=>t.ZeroShotObjectDetectionPipeline,bankers_round:()=>l.bankers_round,cat:()=>c.cat,cos_sim:()=>l.cos_sim,dot:()=>l.dot,dynamic_time_warping:()=>l.dynamic_time_warping,env:()=>e.env,full:()=>c.full,full_like:()=>c.full_like,getKeyValueShapes:()=>i.getKeyValueShapes,hamming:()=>a.hamming,hanning:()=>a.hanning,interpolate:()=>c.interpolate,interpolate_4d:()=>c.interpolate_4d,interpolate_data:()=>l.interpolate_data,is_chinese_char:()=>r.is_chinese_char,layer_norm:()=>c.layer_norm,load_image:()=>o.load_image,load_video:()=>s.load_video,log_softmax:()=>l.log_softmax,magnitude:()=>l.magnitude,matmul:()=>c.matmul,max:()=>l.max,mean:()=>c.mean,mean_pooling:()=>c.mean_pooling,medianFilter:()=>l.medianFilter,mel_filter_bank:()=>a.mel_filter_bank,min:()=>l.min,ones:()=>c.ones,ones_like:()=>c.ones_like,permute:()=>c.permute,permute_data:()=>l.permute_data,pipeline:()=>t.pipeline,quantize_embeddings:()=>c.quantize_embeddings,rand:()=>c.rand,read_audio:()=>a.read_audio,rfft:()=>c.rfft,round:()=>l.round,slice:()=>c.slice,softmax:()=>l.softmax,spectrogram:()=>a.spectrogram,stack:()=>c.stack,std_mean:()=>c.std_mean,topk:()=>c.topk,window_function:()=>a.window_function,zeros:()=>c.zeros,zeros_like:()=>c.zeros_like});var e=cf( +`./src/env.js`);class a{constructor(e,t){this.image=e,this.timestamp=t}}class o{constructor(e,t){e.length>0&&e[0]instanceof r.RawImage&&(e=e.map((n,r)=>new a(n,(r+1)/(e.length+1)*t))),this.frames=e,this.duration=t}get width(){return this.frames[0].image.width}get height(){return this.frames[0].image.height}get fps(){return this.frames.length/this.duration}}async function s(e,{num_frames:t=null,fps:n=null}={}){if(!i.apis.IS_BROWSER_ENV)throw Error("`load_video` is currently only supported in browser environments.");if(t==null&&n==null)throw Error(`Either num_frames or fps must be provided.`);let s=[],c=document.createElement(`video`);if(c.crossOrigin=`anonymous`,c.muted=!0,typeof e==`string`)c.src=e;else if(e instanceof Blob)c.src=URL.createObjectURL(e);else if(e instanceof HTMLVideoElement)c.src=e.src;else throw Error(`Invalid URL or video element provided.`);if(await new Promise(e=>c.onloadedmetadata=e),c.seekable.start(0)===c.seekable.end(0)){let e=await fetch(c.src),t=await e.blob();c.src=URL.createObjectURL(t),await new Promise(e=>c.onloadedmetadata=e)}let l=c.duration,u,d;t==null?(d=1/n,u=Math.floor(l/d)):(u=t,d=t===1?0:l/(t-1));let f=[];for(let e=0;e{c.onseeked=e}),m.drawImage(c,0,0,p.width,p.height);let t=m.getImageData(0,0,p.width,p.height),n=new r.RawImage(t.data,p.width,p.height,4),i=new a(n,e);s.push(i)}return c.remove(),new o(s,l)}}},sf={};function cf(e){var t=sf[e];if(t!==void 0)return t.exports;var n=sf[e]={exports:{}};return af[e](n,n.exports,cf),n.exports}(()=>{var e=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,t;cf.t=function(n,r){if(r&1&&(n=this(n)),r&8||typeof n==`object`&&n&&(r&4&&n.__esModule||r&16&&typeof n.then==`function`))return n;var i=Object.create(null);cf.r(i);var a={};t||=[null,e({}),e([]),e(e)];for(var o=r&2&&n;typeof o==`object`&&!~t.indexOf(o);o=e(o))Object.getOwnPropertyNames(o).forEach(e=>a[e]=()=>n[e]);return a.default=()=>n,cf.d(i,a),i}})(),cf.d=(exports,t)=>{for(var n in t)cf.o(t,n)&&!cf.o(exports,n)&&Object.defineProperty(exports,n,{enumerable:!0,get:t[n]})},cf.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),cf.r=exports=>{typeof Symbol<`u`&&Symbol.toStringTag&&Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),Object.defineProperty(exports,`__esModule`,{value:!0})};var $={};(()=>{cf.r($),cf.d($,{ASTFeatureExtractor:()=>d.ASTFeatureExtractor,ASTForAudioClassification:()=>n.ASTForAudioClassification,ASTModel:()=>n.ASTModel,ASTPreTrainedModel:()=>n.ASTPreTrainedModel,AlbertForMaskedLM:()=>n.AlbertForMaskedLM,AlbertForQuestionAnswering:()=>n.AlbertForQuestionAnswering,AlbertForSequenceClassification:()=>n.AlbertForSequenceClassification,AlbertModel:()=>n.AlbertModel,AlbertPreTrainedModel:()=>n.AlbertPreTrainedModel,AlbertTokenizer:()=>r.AlbertTokenizer,AudioClassificationPipeline:()=>t.AudioClassificationPipeline,AutoConfig:()=>i.AutoConfig,AutoFeatureExtractor:()=>f.AutoFeatureExtractor,AutoImageProcessor:()=>h.AutoImageProcessor,AutoModel:()=>n.AutoModel,AutoModelForAudioClassification:()=>n.AutoModelForAudioClassification,AutoModelForAudioFrameClassification:()=>n.AutoModelForAudioFrameClassification,AutoModelForAudioTextToText:()=>n.AutoModelForAudioTextToText,AutoModelForCTC:()=>n.AutoModelForCTC,AutoModelForCausalLM:()=>n.AutoModelForCausalLM,AutoModelForDepthEstimation:()=>n.AutoModelForDepthEstimation,AutoModelForDocumentQuestionAnswering:()=>n.AutoModelForDocumentQuestionAnswering,AutoModelForImageClassification:()=>n.AutoModelForImageClassification,AutoModelForImageFeatureExtraction:()=>n.AutoModelForImageFeatureExtraction,AutoModelForImageMatting:()=>n.AutoModelForImageMatting,AutoModelForImageSegmentation:()=>n.AutoModelForImageSegmentation,AutoModelForImageTextToText:()=>n.AutoModelForImageTextToText,AutoModelForImageToImage:()=>n.AutoModelForImageToImage,AutoModelForMaskGeneration:()=>n.AutoModelForMaskGeneration,AutoModelForMaskedLM:()=>n.AutoModelForMaskedLM,AutoModelForNormalEstimation:()=>n.AutoModelForNormalEstimation,AutoModelForObjectDetection:()=>n.AutoModelForObjectDetection,AutoModelForPoseEstimation:()=>n.AutoModelForPoseEstimation,AutoModelForQuestionAnswering:()=>n.AutoModelForQuestionAnswering,AutoModelForSemanticSegmentation:()=>n.AutoModelForSemanticSegmentation,AutoModelForSeq2SeqLM:()=>n.AutoModelForSeq2SeqLM,AutoModelForSequenceClassification:()=>n.AutoModelForSequenceClassification,AutoModelForSpeechSeq2Seq:()=>n.AutoModelForSpeechSeq2Seq,AutoModelForTextToSpectrogram:()=>n.AutoModelForTextToSpectrogram,AutoModelForTextToWaveform:()=>n.AutoModelForTextToWaveform,AutoModelForTokenClassification:()=>n.AutoModelForTokenClassification,AutoModelForUniversalSegmentation:()=>n.AutoModelForUniversalSegmentation,AutoModelForVision2Seq:()=>n.AutoModelForVision2Seq,AutoModelForXVector:()=>n.AutoModelForXVector,AutoModelForZeroShotObjectDetection:()=>n.AutoModelForZeroShotObjectDetection,AutoProcessor:()=>v.AutoProcessor,AutoTokenizer:()=>r.AutoTokenizer,AutomaticSpeechRecognitionPipeline:()=>t.AutomaticSpeechRecognitionPipeline,BackgroundRemovalPipeline:()=>t.BackgroundRemovalPipeline,BartForConditionalGeneration:()=>n.BartForConditionalGeneration,BartForSequenceClassification:()=>n.BartForSequenceClassification,BartModel:()=>n.BartModel,BartPretrainedModel:()=>n.BartPretrainedModel,BartTokenizer:()=>r.BartTokenizer,BaseModelOutput:()=>n.BaseModelOutput,BaseStreamer:()=>y.BaseStreamer,BeitFeatureExtractor:()=>m.BeitFeatureExtractor,BeitForImageClassification:()=>n.BeitForImageClassification,BeitModel:()=>n.BeitModel,BeitPreTrainedModel:()=>n.BeitPreTrainedModel,BertForMaskedLM:()=>n.BertForMaskedLM,BertForQuestionAnswering:()=>n.BertForQuestionAnswering,BertForSequenceClassification:()=>n.BertForSequenceClassification,BertForTokenClassification:()=>n.BertForTokenClassification,BertModel:()=>n.BertModel,BertPreTrainedModel:()=>n.BertPreTrainedModel,BertTokenizer:()=>r.BertTokenizer,BitImageProcessor:()=>m.BitImageProcessor,BlenderbotForConditionalGeneration:()=>n.BlenderbotForConditionalGeneration,BlenderbotModel:()=>n.BlenderbotModel,BlenderbotPreTrainedModel:()=>n.BlenderbotPreTrainedModel,BlenderbotSmallForConditionalGeneration:()=>n.BlenderbotSmallForConditionalGeneration,BlenderbotSmallModel:()=>n.BlenderbotSmallModel,BlenderbotSmallPreTrainedModel:()=>n.BlenderbotSmallPreTrainedModel,BlenderbotSmallTokenizer:()=>r.BlenderbotSmallTokenizer,BlenderbotTokenizer:()=>r.BlenderbotTokenizer,BloomForCausalLM:()=>n.BloomForCausalLM,BloomModel:()=>n.BloomModel,BloomPreTrainedModel:()=>n.BloomPreTrainedModel,BloomTokenizer:()=>r.BloomTokenizer,CLIPFeatureExtractor:()=>m.CLIPFeatureExtractor,CLIPImageProcessor:()=>m.CLIPImageProcessor,CLIPModel:()=>n.CLIPModel,CLIPPreTrainedModel:()=>n.CLIPPreTrainedModel,CLIPSegForImageSegmentation:()=>n.CLIPSegForImageSegmentation,CLIPSegModel:()=>n.CLIPSegModel,CLIPSegPreTrainedModel:()=>n.CLIPSegPreTrainedModel,CLIPTextModel:()=>n.CLIPTextModel,CLIPTextModelWithProjection:()=>n.CLIPTextModelWithProjection,CLIPTokenizer:()=>r.CLIPTokenizer,CLIPVisionModel:()=>n.CLIPVisionModel,CLIPVisionModelWithProjection:()=>n.CLIPVisionModelWithProjection,CamembertForMaskedLM:()=>n.CamembertForMaskedLM,CamembertForQuestionAnswering:()=>n.CamembertForQuestionAnswering,CamembertForSequenceClassification:()=>n.CamembertForSequenceClassification,CamembertForTokenClassification:()=>n.CamembertForTokenClassification,CamembertModel:()=>n.CamembertModel,CamembertPreTrainedModel:()=>n.CamembertPreTrainedModel,CamembertTokenizer:()=>r.CamembertTokenizer,CausalLMOutput:()=>n.CausalLMOutput,CausalLMOutputWithPast:()=>n.CausalLMOutputWithPast,ChineseCLIPFeatureExtractor:()=>m.ChineseCLIPFeatureExtractor,ChineseCLIPModel:()=>n.ChineseCLIPModel,ChineseCLIPPreTrainedModel:()=>n.ChineseCLIPPreTrainedModel,ClapAudioModelWithProjection:()=>n.ClapAudioModelWithProjection,ClapFeatureExtractor:()=>d.ClapFeatureExtractor,ClapModel:()=>n.ClapModel,ClapPreTrainedModel:()=>n.ClapPreTrainedModel,ClapTextModelWithProjection:()=>n.ClapTextModelWithProjection,ClassifierFreeGuidanceLogitsProcessor:()=>x.ClassifierFreeGuidanceLogitsProcessor,CodeGenForCausalLM:()=>n.CodeGenForCausalLM,CodeGenModel:()=>n.CodeGenModel,CodeGenPreTrainedModel:()=>n.CodeGenPreTrainedModel,CodeGenTokenizer:()=>r.CodeGenTokenizer,CodeLlamaTokenizer:()=>r.CodeLlamaTokenizer,CohereForCausalLM:()=>n.CohereForCausalLM,CohereModel:()=>n.CohereModel,CoherePreTrainedModel:()=>n.CoherePreTrainedModel,CohereTokenizer:()=>r.CohereTokenizer,ConvBertForMaskedLM:()=>n.ConvBertForMaskedLM,ConvBertForQuestionAnswering:()=>n.ConvBertForQuestionAnswering,ConvBertForSequenceClassification:()=>n.ConvBertForSequenceClassification,ConvBertForTokenClassification:()=>n.ConvBertForTokenClassification,ConvBertModel:()=>n.ConvBertModel,ConvBertPreTrainedModel:()=>n.ConvBertPreTrainedModel,ConvBertTokenizer:()=>r.ConvBertTokenizer,ConvNextFeatureExtractor:()=>m.ConvNextFeatureExtractor,ConvNextForImageClassification:()=>n.ConvNextForImageClassification,ConvNextImageProcessor:()=>m.ConvNextImageProcessor,ConvNextModel:()=>n.ConvNextModel,ConvNextPreTrainedModel:()=>n.ConvNextPreTrainedModel,ConvNextV2ForImageClassification:()=>n.ConvNextV2ForImageClassification,ConvNextV2Model:()=>n.ConvNextV2Model,ConvNextV2PreTrainedModel:()=>n.ConvNextV2PreTrainedModel,DFineForObjectDetection:()=>n.DFineForObjectDetection,DFineModel:()=>n.DFineModel,DFinePreTrainedModel:()=>n.DFinePreTrainedModel,DPTFeatureExtractor:()=>m.DPTFeatureExtractor,DPTForDepthEstimation:()=>n.DPTForDepthEstimation,DPTImageProcessor:()=>m.DPTImageProcessor,DPTModel:()=>n.DPTModel,DPTPreTrainedModel:()=>n.DPTPreTrainedModel,DacDecoderModel:()=>n.DacDecoderModel,DacDecoderOutput:()=>n.DacDecoderOutput,DacEncoderModel:()=>n.DacEncoderModel,DacEncoderOutput:()=>n.DacEncoderOutput,DacFeatureExtractor:()=>d.DacFeatureExtractor,DacModel:()=>n.DacModel,DacPreTrainedModel:()=>n.DacPreTrainedModel,DataTypeMap:()=>c.DataTypeMap,DebertaForMaskedLM:()=>n.DebertaForMaskedLM,DebertaForQuestionAnswering:()=>n.DebertaForQuestionAnswering,DebertaForSequenceClassification:()=>n.DebertaForSequenceClassification,DebertaForTokenClassification:()=>n.DebertaForTokenClassification,DebertaModel:()=>n.DebertaModel,DebertaPreTrainedModel:()=>n.DebertaPreTrainedModel,DebertaTokenizer:()=>r.DebertaTokenizer,DebertaV2ForMaskedLM:()=>n.DebertaV2ForMaskedLM,DebertaV2ForQuestionAnswering:()=>n.DebertaV2ForQuestionAnswering,DebertaV2ForSequenceClassification:()=>n.DebertaV2ForSequenceClassification,DebertaV2ForTokenClassification:()=>n.DebertaV2ForTokenClassification,DebertaV2Model:()=>n.DebertaV2Model,DebertaV2PreTrainedModel:()=>n.DebertaV2PreTrainedModel,DebertaV2Tokenizer:()=>r.DebertaV2Tokenizer,DecisionTransformerModel:()=>n.DecisionTransformerModel,DecisionTransformerPreTrainedModel:()=>n.DecisionTransformerPreTrainedModel,DeiTFeatureExtractor:()=>m.DeiTFeatureExtractor,DeiTForImageClassification:()=>n.DeiTForImageClassification,DeiTImageProcessor:()=>m.DeiTImageProcessor,DeiTModel:()=>n.DeiTModel,DeiTPreTrainedModel:()=>n.DeiTPreTrainedModel,DepthAnythingForDepthEstimation:()=>n.DepthAnythingForDepthEstimation,DepthAnythingPreTrainedModel:()=>n.DepthAnythingPreTrainedModel,DepthEstimationPipeline:()=>t.DepthEstimationPipeline,DepthProForDepthEstimation:()=>n.DepthProForDepthEstimation,DepthProPreTrainedModel:()=>n.DepthProPreTrainedModel,DetrFeatureExtractor:()=>m.DetrFeatureExtractor,DetrForObjectDetection:()=>n.DetrForObjectDetection,DetrForSegmentation:()=>n.DetrForSegmentation,DetrImageProcessor:()=>m.DetrImageProcessor,DetrModel:()=>n.DetrModel,DetrObjectDetectionOutput:()=>n.DetrObjectDetectionOutput,DetrPreTrainedModel:()=>n.DetrPreTrainedModel,DetrSegmentationOutput:()=>n.DetrSegmentationOutput,Dinov2ForImageClassification:()=>n.Dinov2ForImageClassification,Dinov2Model:()=>n.Dinov2Model,Dinov2PreTrainedModel:()=>n.Dinov2PreTrainedModel,Dinov2WithRegistersForImageClassification:()=>n.Dinov2WithRegistersForImageClassification,Dinov2WithRegistersModel:()=>n.Dinov2WithRegistersModel,Dinov2WithRegistersPreTrainedModel:()=>n.Dinov2WithRegistersPreTrainedModel,DistilBertForMaskedLM:()=>n.DistilBertForMaskedLM,DistilBertForQuestionAnswering:()=>n.DistilBertForQuestionAnswering,DistilBertForSequenceClassification:()=>n.DistilBertForSequenceClassification,DistilBertForTokenClassification:()=>n.DistilBertForTokenClassification,DistilBertModel:()=>n.DistilBertModel,DistilBertPreTrainedModel:()=>n.DistilBertPreTrainedModel,DistilBertTokenizer:()=>r.DistilBertTokenizer,DocumentQuestionAnsweringPipeline:()=>t.DocumentQuestionAnsweringPipeline,DonutFeatureExtractor:()=>m.DonutFeatureExtractor,DonutImageProcessor:()=>m.DonutImageProcessor,DonutSwinModel:()=>n.DonutSwinModel,DonutSwinPreTrainedModel:()=>n.DonutSwinPreTrainedModel,EfficientNetForImageClassification:()=>n.EfficientNetForImageClassification,EfficientNetImageProcessor:()=>m.EfficientNetImageProcessor,EfficientNetModel:()=>n.EfficientNetModel,EfficientNetPreTrainedModel:()=>n.EfficientNetPreTrainedModel,ElectraForMaskedLM:()=>n.ElectraForMaskedLM,ElectraForQuestionAnswering:()=>n.ElectraForQuestionAnswering,ElectraForSequenceClassification:()=>n.ElectraForSequenceClassification,ElectraForTokenClassification:()=>n.ElectraForTokenClassification,ElectraModel:()=>n.ElectraModel,ElectraPreTrainedModel:()=>n.ElectraPreTrainedModel,ElectraTokenizer:()=>r.ElectraTokenizer,EncodecFeatureExtractor:()=>d.EncodecFeatureExtractor,EosTokenCriteria:()=>b.EosTokenCriteria,Ernie4_5_ForCausalLM:()=>n.Ernie4_5_ForCausalLM,Ernie4_5_Model:()=>n.Ernie4_5_Model,Ernie4_5_PretrainedModel:()=>n.Ernie4_5_PretrainedModel,Ernie4_5_Tokenizer:()=>r.Ernie4_5_Tokenizer,EsmForMaskedLM:()=>n.EsmForMaskedLM,EsmForSequenceClassification:()=>n.EsmForSequenceClassification,EsmForTokenClassification:()=>n.EsmForTokenClassification,EsmModel:()=>n.EsmModel,EsmPreTrainedModel:()=>n.EsmPreTrainedModel,EsmTokenizer:()=>r.EsmTokenizer,ExaoneForCausalLM:()=>n.ExaoneForCausalLM,ExaoneModel:()=>n.ExaoneModel,ExaonePreTrainedModel:()=>n.ExaonePreTrainedModel,FFT:()=>l.FFT,FalconForCausalLM:()=>n.FalconForCausalLM,FalconModel:()=>n.FalconModel,FalconPreTrainedModel:()=>n.FalconPreTrainedModel,FalconTokenizer:()=>r.FalconTokenizer,FastViTForImageClassification:()=>n.FastViTForImageClassification,FastViTModel:()=>n.FastViTModel,FastViTPreTrainedModel:()=>n.FastViTPreTrainedModel,FeatureExtractionPipeline:()=>t.FeatureExtractionPipeline,FeatureExtractor:()=>u.FeatureExtractor,FillMaskPipeline:()=>t.FillMaskPipeline,Florence2ForConditionalGeneration:()=>n.Florence2ForConditionalGeneration,Florence2PreTrainedModel:()=>n.Florence2PreTrainedModel,Florence2Processor:()=>_.Florence2Processor,ForcedBOSTokenLogitsProcessor:()=>x.ForcedBOSTokenLogitsProcessor,ForcedEOSTokenLogitsProcessor:()=>x.ForcedEOSTokenLogitsProcessor,GLPNFeatureExtractor:()=>m.GLPNFeatureExtractor,GLPNForDepthEstimation:()=>n.GLPNForDepthEstimation,GLPNModel:()=>n.GLPNModel,GLPNPreTrainedModel:()=>n.GLPNPreTrainedModel,GPT2LMHeadModel:()=>n.GPT2LMHeadModel,GPT2Model:()=>n.GPT2Model,GPT2PreTrainedModel:()=>n.GPT2PreTrainedModel,GPT2Tokenizer:()=>r.GPT2Tokenizer,GPTBigCodeForCausalLM:()=>n.GPTBigCodeForCausalLM,GPTBigCodeModel:()=>n.GPTBigCodeModel,GPTBigCodePreTrainedModel:()=>n.GPTBigCodePreTrainedModel,GPTJForCausalLM:()=>n.GPTJForCausalLM,GPTJModel:()=>n.GPTJModel,GPTJPreTrainedModel:()=>n.GPTJPreTrainedModel,GPTNeoForCausalLM:()=>n.GPTNeoForCausalLM,GPTNeoModel:()=>n.GPTNeoModel,GPTNeoPreTrainedModel:()=>n.GPTNeoPreTrainedModel,GPTNeoXForCausalLM:()=>n.GPTNeoXForCausalLM,GPTNeoXModel:()=>n.GPTNeoXModel,GPTNeoXPreTrainedModel:()=>n.GPTNeoXPreTrainedModel,GPTNeoXTokenizer:()=>r.GPTNeoXTokenizer,Gemma2ForCausalLM:()=>n.Gemma2ForCausalLM,Gemma2Model:()=>n.Gemma2Model,Gemma2PreTrainedModel:()=>n.Gemma2PreTrainedModel,Gemma3ForCausalLM:()=>n.Gemma3ForCausalLM,Gemma3Model:()=>n.Gemma3Model,Gemma3PreTrainedModel:()=>n.Gemma3PreTrainedModel,Gemma3nAudioFeatureExtractor:()=>d.Gemma3nAudioFeatureExtractor,Gemma3nForConditionalGeneration:()=>n.Gemma3nForConditionalGeneration,Gemma3nPreTrainedModel:()=>n.Gemma3nPreTrainedModel,Gemma3nProcessor:()=>_.Gemma3nProcessor,GemmaForCausalLM:()=>n.GemmaForCausalLM,GemmaModel:()=>n.GemmaModel,GemmaPreTrainedModel:()=>n.GemmaPreTrainedModel,GemmaTokenizer:()=>r.GemmaTokenizer,GlmForCausalLM:()=>n.GlmForCausalLM,GlmModel:()=>n.GlmModel,GlmPreTrainedModel:()=>n.GlmPreTrainedModel,GraniteForCausalLM:()=>n.GraniteForCausalLM,GraniteModel:()=>n.GraniteModel,GranitePreTrainedModel:()=>n.GranitePreTrainedModel,Grok1Tokenizer:()=>r.Grok1Tokenizer,GroundingDinoForObjectDetection:()=>n.GroundingDinoForObjectDetection,GroundingDinoImageProcessor:()=>m.GroundingDinoImageProcessor,GroundingDinoPreTrainedModel:()=>n.GroundingDinoPreTrainedModel,GroundingDinoProcessor:()=>_.GroundingDinoProcessor,GroupViTModel:()=>n.GroupViTModel,GroupViTPreTrainedModel:()=>n.GroupViTPreTrainedModel,HeliumForCausalLM:()=>n.HeliumForCausalLM,HeliumModel:()=>n.HeliumModel,HeliumPreTrainedModel:()=>n.HeliumPreTrainedModel,HerbertTokenizer:()=>r.HerbertTokenizer,HieraForImageClassification:()=>n.HieraForImageClassification,HieraModel:()=>n.HieraModel,HieraPreTrainedModel:()=>n.HieraPreTrainedModel,HubertForCTC:()=>n.HubertForCTC,HubertForSequenceClassification:()=>n.HubertForSequenceClassification,HubertModel:()=>n.HubertModel,HubertPreTrainedModel:()=>n.HubertPreTrainedModel,IJepaForImageClassification:()=>n.IJepaForImageClassification,IJepaModel:()=>n.IJepaModel,IJepaPreTrainedModel:()=>n.IJepaPreTrainedModel,Idefics3ForConditionalGeneration:()=>n.Idefics3ForConditionalGeneration,Idefics3ImageProcessor:()=>m.Idefics3ImageProcessor,Idefics3PreTrainedModel:()=>n.Idefics3PreTrainedModel,Idefics3Processor:()=>_.Idefics3Processor,ImageClassificationPipeline:()=>t.ImageClassificationPipeline,ImageFeatureExtractionPipeline:()=>t.ImageFeatureExtractionPipeline,ImageFeatureExtractor:()=>d.ImageFeatureExtractor,ImageMattingOutput:()=>n.ImageMattingOutput,ImageProcessor:()=>p.ImageProcessor,ImageSegmentationPipeline:()=>t.ImageSegmentationPipeline,ImageToImagePipeline:()=>t.ImageToImagePipeline,ImageToTextPipeline:()=>t.ImageToTextPipeline,InterruptableStoppingCriteria:()=>b.InterruptableStoppingCriteria,JAISLMHeadModel:()=>n.JAISLMHeadModel,JAISModel:()=>n.JAISModel,JAISPreTrainedModel:()=>n.JAISPreTrainedModel,JinaCLIPImageProcessor:()=>m.JinaCLIPImageProcessor,JinaCLIPModel:()=>n.JinaCLIPModel,JinaCLIPPreTrainedModel:()=>n.JinaCLIPPreTrainedModel,JinaCLIPProcessor:()=>_.JinaCLIPProcessor,JinaCLIPTextModel:()=>n.JinaCLIPTextModel,JinaCLIPVisionModel:()=>n.JinaCLIPVisionModel,LiteWhisperForConditionalGeneration:()=>n.LiteWhisperForConditionalGeneration,LlamaForCausalLM:()=>n.LlamaForCausalLM,LlamaModel:()=>n.LlamaModel,LlamaPreTrainedModel:()=>n.LlamaPreTrainedModel,LlamaTokenizer:()=>r.LlamaTokenizer,LlavaForConditionalGeneration:()=>n.LlavaForConditionalGeneration,LlavaOnevisionForConditionalGeneration:()=>n.LlavaOnevisionForConditionalGeneration,LlavaOnevisionImageProcessor:()=>m.LlavaOnevisionImageProcessor,LlavaPreTrainedModel:()=>n.LlavaPreTrainedModel,LlavaProcessor:()=>_.LlavaProcessor,LlavaQwen2ForCausalLM:()=>n.LlavaQwen2ForCausalLM,LogitsProcessor:()=>x.LogitsProcessor,LogitsProcessorList:()=>x.LogitsProcessorList,LogitsWarper:()=>x.LogitsWarper,LongT5ForConditionalGeneration:()=>n.LongT5ForConditionalGeneration,LongT5Model:()=>n.LongT5Model,LongT5PreTrainedModel:()=>n.LongT5PreTrainedModel,M2M100ForConditionalGeneration:()=>n.M2M100ForConditionalGeneration,M2M100Model:()=>n.M2M100Model,M2M100PreTrainedModel:()=>n.M2M100PreTrainedModel,M2M100Tokenizer:()=>r.M2M100Tokenizer,MBart50Tokenizer:()=>r.MBart50Tokenizer,MBartForCausalLM:()=>n.MBartForCausalLM,MBartForConditionalGeneration:()=>n.MBartForConditionalGeneration,MBartForSequenceClassification:()=>n.MBartForSequenceClassification,MBartModel:()=>n.MBartModel,MBartPreTrainedModel:()=>n.MBartPreTrainedModel,MBartTokenizer:()=>r.MBartTokenizer,MPNetForMaskedLM:()=>n.MPNetForMaskedLM,MPNetForQuestionAnswering:()=>n.MPNetForQuestionAnswering,MPNetForSequenceClassification:()=>n.MPNetForSequenceClassification,MPNetForTokenClassification:()=>n.MPNetForTokenClassification,MPNetModel:()=>n.MPNetModel,MPNetPreTrainedModel:()=>n.MPNetPreTrainedModel,MPNetTokenizer:()=>r.MPNetTokenizer,MT5ForConditionalGeneration:()=>n.MT5ForConditionalGeneration,MT5Model:()=>n.MT5Model,MT5PreTrainedModel:()=>n.MT5PreTrainedModel,MarianMTModel:()=>n.MarianMTModel,MarianModel:()=>n.MarianModel,MarianPreTrainedModel:()=>n.MarianPreTrainedModel,MarianTokenizer:()=>r.MarianTokenizer,Mask2FormerImageProcessor:()=>m.Mask2FormerImageProcessor,MaskFormerFeatureExtractor:()=>m.MaskFormerFeatureExtractor,MaskFormerForInstanceSegmentation:()=>n.MaskFormerForInstanceSegmentation,MaskFormerImageProcessor:()=>m.MaskFormerImageProcessor,MaskFormerModel:()=>n.MaskFormerModel,MaskFormerPreTrainedModel:()=>n.MaskFormerPreTrainedModel,MaskedLMOutput:()=>n.MaskedLMOutput,MaxLengthCriteria:()=>b.MaxLengthCriteria,Metric3DForDepthEstimation:()=>n.Metric3DForDepthEstimation,Metric3DPreTrainedModel:()=>n.Metric3DPreTrainedModel,Metric3Dv2ForDepthEstimation:()=>n.Metric3Dv2ForDepthEstimation,Metric3Dv2PreTrainedModel:()=>n.Metric3Dv2PreTrainedModel,MgpstrForSceneTextRecognition:()=>n.MgpstrForSceneTextRecognition,MgpstrModelOutput:()=>n.MgpstrModelOutput,MgpstrPreTrainedModel:()=>n.MgpstrPreTrainedModel,MgpstrProcessor:()=>_.MgpstrProcessor,MgpstrTokenizer:()=>r.MgpstrTokenizer,MimiDecoderModel:()=>n.MimiDecoderModel,MimiDecoderOutput:()=>n.MimiDecoderOutput,MimiEncoderModel:()=>n.MimiEncoderModel,MimiEncoderOutput:()=>n.MimiEncoderOutput,MimiModel:()=>n.MimiModel,MimiPreTrainedModel:()=>n.MimiPreTrainedModel,MinLengthLogitsProcessor:()=>x.MinLengthLogitsProcessor,MinNewTokensLengthLogitsProcessor:()=>x.MinNewTokensLengthLogitsProcessor,MistralForCausalLM:()=>n.MistralForCausalLM,MistralModel:()=>n.MistralModel,MistralPreTrainedModel:()=>n.MistralPreTrainedModel,MobileBertForMaskedLM:()=>n.MobileBertForMaskedLM,MobileBertForQuestionAnswering:()=>n.MobileBertForQuestionAnswering,MobileBertForSequenceClassification:()=>n.MobileBertForSequenceClassification,MobileBertModel:()=>n.MobileBertModel,MobileBertPreTrainedModel:()=>n.MobileBertPreTrainedModel,MobileBertTokenizer:()=>r.MobileBertTokenizer,MobileLLMForCausalLM:()=>n.MobileLLMForCausalLM,MobileLLMModel:()=>n.MobileLLMModel,MobileLLMPreTrainedModel:()=>n.MobileLLMPreTrainedModel,MobileNetV1FeatureExtractor:()=>m.MobileNetV1FeatureExtractor,MobileNetV1ForImageClassification:()=>n.MobileNetV1ForImageClassification,MobileNetV1ForSemanticSegmentation:()=>n.MobileNetV1ForSemanticSegmentation,MobileNetV1ImageProcessor:()=>m.MobileNetV1ImageProcessor,MobileNetV1Model:()=>n.MobileNetV1Model,MobileNetV1PreTrainedModel:()=>n.MobileNetV1PreTrainedModel,MobileNetV2FeatureExtractor:()=>m.MobileNetV2FeatureExtractor,MobileNetV2ForImageClassification:()=>n.MobileNetV2ForImageClassification,MobileNetV2ForSemanticSegmentation:()=>n.MobileNetV2ForSemanticSegmentation,MobileNetV2ImageProcessor:()=>m.MobileNetV2ImageProcessor,MobileNetV2Model:()=>n.MobileNetV2Model,MobileNetV2PreTrainedModel:()=>n.MobileNetV2PreTrainedModel,MobileNetV3FeatureExtractor:()=>m.MobileNetV3FeatureExtractor,MobileNetV3ForImageClassification:()=>n.MobileNetV3ForImageClassification,MobileNetV3ForSemanticSegmentation:()=>n.MobileNetV3ForSemanticSegmentation,MobileNetV3ImageProcessor:()=>m.MobileNetV3ImageProcessor,MobileNetV3Model:()=>n.MobileNetV3Model,MobileNetV3PreTrainedModel:()=>n.MobileNetV3PreTrainedModel,MobileNetV4FeatureExtractor:()=>m.MobileNetV4FeatureExtractor,MobileNetV4ForImageClassification:()=>n.MobileNetV4ForImageClassification,MobileNetV4ForSemanticSegmentation:()=>n.MobileNetV4ForSemanticSegmentation,MobileNetV4ImageProcessor:()=>m.MobileNetV4ImageProcessor,MobileNetV4Model:()=>n.MobileNetV4Model,MobileNetV4PreTrainedModel:()=>n.MobileNetV4PreTrainedModel,MobileViTFeatureExtractor:()=>m.MobileViTFeatureExtractor,MobileViTForImageClassification:()=>n.MobileViTForImageClassification,MobileViTImageProcessor:()=>m.MobileViTImageProcessor,MobileViTModel:()=>n.MobileViTModel,MobileViTPreTrainedModel:()=>n.MobileViTPreTrainedModel,MobileViTV2ForImageClassification:()=>n.MobileViTV2ForImageClassification,MobileViTV2Model:()=>n.MobileViTV2Model,MobileViTV2PreTrainedModel:()=>n.MobileViTV2PreTrainedModel,ModelOutput:()=>n.ModelOutput,ModernBertForMaskedLM:()=>n.ModernBertForMaskedLM,ModernBertForSequenceClassification:()=>n.ModernBertForSequenceClassification,ModernBertForTokenClassification:()=>n.ModernBertForTokenClassification,ModernBertModel:()=>n.ModernBertModel,ModernBertPreTrainedModel:()=>n.ModernBertPreTrainedModel,Moondream1ForConditionalGeneration:()=>n.Moondream1ForConditionalGeneration,MoonshineFeatureExtractor:()=>d.MoonshineFeatureExtractor,MoonshineForConditionalGeneration:()=>n.MoonshineForConditionalGeneration,MoonshineModel:()=>n.MoonshineModel,MoonshinePreTrainedModel:()=>n.MoonshinePreTrainedModel,MoonshineProcessor:()=>_.MoonshineProcessor,MptForCausalLM:()=>n.MptForCausalLM,MptModel:()=>n.MptModel,MptPreTrainedModel:()=>n.MptPreTrainedModel,MultiModalityCausalLM:()=>n.MultiModalityCausalLM,MultiModalityPreTrainedModel:()=>n.MultiModalityPreTrainedModel,MusicgenForCausalLM:()=>n.MusicgenForCausalLM,MusicgenForConditionalGeneration:()=>n.MusicgenForConditionalGeneration,MusicgenModel:()=>n.MusicgenModel,MusicgenPreTrainedModel:()=>n.MusicgenPreTrainedModel,NeoBertForMaskedLM:()=>n.NeoBertForMaskedLM,NeoBertForQuestionAnswering:()=>n.NeoBertForQuestionAnswering,NeoBertForSequenceClassification:()=>n.NeoBertForSequenceClassification,NeoBertForTokenClassification:()=>n.NeoBertForTokenClassification,NeoBertModel:()=>n.NeoBertModel,NeoBertPreTrainedModel:()=>n.NeoBertPreTrainedModel,NllbTokenizer:()=>r.NllbTokenizer,NoBadWordsLogitsProcessor:()=>x.NoBadWordsLogitsProcessor,NoRepeatNGramLogitsProcessor:()=>x.NoRepeatNGramLogitsProcessor,NomicBertModel:()=>n.NomicBertModel,NomicBertPreTrainedModel:()=>n.NomicBertPreTrainedModel,NougatImageProcessor:()=>m.NougatImageProcessor,NougatTokenizer:()=>r.NougatTokenizer,OPTForCausalLM:()=>n.OPTForCausalLM,OPTModel:()=>n.OPTModel,OPTPreTrainedModel:()=>n.OPTPreTrainedModel,ObjectDetectionPipeline:()=>t.ObjectDetectionPipeline,Olmo2ForCausalLM:()=>n.Olmo2ForCausalLM,Olmo2Model:()=>n.Olmo2Model,Olmo2PreTrainedModel:()=>n.Olmo2PreTrainedModel,OlmoForCausalLM:()=>n.OlmoForCausalLM,OlmoModel:()=>n.OlmoModel,OlmoPreTrainedModel:()=>n.OlmoPreTrainedModel,OpenELMForCausalLM:()=>n.OpenELMForCausalLM,OpenELMModel:()=>n.OpenELMModel,OpenELMPreTrainedModel:()=>n.OpenELMPreTrainedModel,OwlViTFeatureExtractor:()=>m.OwlViTFeatureExtractor,OwlViTForObjectDetection:()=>n.OwlViTForObjectDetection,OwlViTImageProcessor:()=>m.OwlViTImageProcessor,OwlViTModel:()=>n.OwlViTModel,OwlViTPreTrainedModel:()=>n.OwlViTPreTrainedModel,OwlViTProcessor:()=>_.OwlViTProcessor,Owlv2ForObjectDetection:()=>n.Owlv2ForObjectDetection,Owlv2ImageProcessor:()=>m.Owlv2ImageProcessor,Owlv2Model:()=>n.Owlv2Model,Owlv2PreTrainedModel:()=>n.Owlv2PreTrainedModel,PaliGemmaForConditionalGeneration:()=>n.PaliGemmaForConditionalGeneration,PaliGemmaPreTrainedModel:()=>n.PaliGemmaPreTrainedModel,PaliGemmaProcessor:()=>_.PaliGemmaProcessor,PatchTSMixerForPrediction:()=>n.PatchTSMixerForPrediction,PatchTSMixerModel:()=>n.PatchTSMixerModel,PatchTSMixerPreTrainedModel:()=>n.PatchTSMixerPreTrainedModel,PatchTSTForPrediction:()=>n.PatchTSTForPrediction,PatchTSTModel:()=>n.PatchTSTModel,PatchTSTPreTrainedModel:()=>n.PatchTSTPreTrainedModel,Phi3ForCausalLM:()=>n.Phi3ForCausalLM,Phi3Model:()=>n.Phi3Model,Phi3PreTrainedModel:()=>n.Phi3PreTrainedModel,Phi3VForCausalLM:()=>n.Phi3VForCausalLM,Phi3VImageProcessor:()=>m.Phi3VImageProcessor,Phi3VPreTrainedModel:()=>n.Phi3VPreTrainedModel,Phi3VProcessor:()=>_.Phi3VProcessor,PhiForCausalLM:()=>n.PhiForCausalLM,PhiModel:()=>n.PhiModel,PhiPreTrainedModel:()=>n.PhiPreTrainedModel,Pipeline:()=>t.Pipeline,PreTrainedModel:()=>n.PreTrainedModel,PreTrainedTokenizer:()=>r.PreTrainedTokenizer,PretrainedConfig:()=>i.PretrainedConfig,PretrainedMixin:()=>n.PretrainedMixin,Processor:()=>g.Processor,PvtForImageClassification:()=>n.PvtForImageClassification,PvtImageProcessor:()=>m.PvtImageProcessor,PvtModel:()=>n.PvtModel,PvtPreTrainedModel:()=>n.PvtPreTrainedModel,PyAnnoteFeatureExtractor:()=>d.PyAnnoteFeatureExtractor,PyAnnoteForAudioFrameClassification:()=>n.PyAnnoteForAudioFrameClassification,PyAnnoteModel:()=>n.PyAnnoteModel,PyAnnotePreTrainedModel:()=>n.PyAnnotePreTrainedModel,PyAnnoteProcessor:()=>_.PyAnnoteProcessor,QuestionAnsweringModelOutput:()=>n.QuestionAnsweringModelOutput,QuestionAnsweringPipeline:()=>t.QuestionAnsweringPipeline,Qwen2ForCausalLM:()=>n.Qwen2ForCausalLM,Qwen2Model:()=>n.Qwen2Model,Qwen2PreTrainedModel:()=>n.Qwen2PreTrainedModel,Qwen2Tokenizer:()=>r.Qwen2Tokenizer,Qwen2VLForConditionalGeneration:()=>n.Qwen2VLForConditionalGeneration,Qwen2VLImageProcessor:()=>m.Qwen2VLImageProcessor,Qwen2VLPreTrainedModel:()=>n.Qwen2VLPreTrainedModel,Qwen2VLProcessor:()=>_.Qwen2VLProcessor,Qwen3ForCausalLM:()=>n.Qwen3ForCausalLM,Qwen3Model:()=>n.Qwen3Model,Qwen3PreTrainedModel:()=>n.Qwen3PreTrainedModel,RFDetrForObjectDetection:()=>n.RFDetrForObjectDetection,RFDetrModel:()=>n.RFDetrModel,RFDetrObjectDetectionOutput:()=>n.RFDetrObjectDetectionOutput,RFDetrPreTrainedModel:()=>n.RFDetrPreTrainedModel,RTDetrForObjectDetection:()=>n.RTDetrForObjectDetection,RTDetrImageProcessor:()=>m.RTDetrImageProcessor,RTDetrModel:()=>n.RTDetrModel,RTDetrObjectDetectionOutput:()=>n.RTDetrObjectDetectionOutput,RTDetrPreTrainedModel:()=>n.RTDetrPreTrainedModel,RTDetrV2ForObjectDetection:()=>n.RTDetrV2ForObjectDetection,RTDetrV2Model:()=>n.RTDetrV2Model,RTDetrV2ObjectDetectionOutput:()=>n.RTDetrV2ObjectDetectionOutput,RTDetrV2PreTrainedModel:()=>n.RTDetrV2PreTrainedModel,RawAudio:()=>a.RawAudio,RawImage:()=>o.RawImage,RawVideo:()=>s.RawVideo,RawVideoFrame:()=>s.RawVideoFrame,RepetitionPenaltyLogitsProcessor:()=>x.RepetitionPenaltyLogitsProcessor,ResNetForImageClassification:()=>n.ResNetForImageClassification,ResNetModel:()=>n.ResNetModel,ResNetPreTrainedModel:()=>n.ResNetPreTrainedModel,RoFormerForMaskedLM:()=>n.RoFormerForMaskedLM,RoFormerForQuestionAnswering:()=>n.RoFormerForQuestionAnswering,RoFormerForSequenceClassification:()=>n.RoFormerForSequenceClassification,RoFormerForTokenClassification:()=>n.RoFormerForTokenClassification,RoFormerModel:()=>n.RoFormerModel,RoFormerPreTrainedModel:()=>n.RoFormerPreTrainedModel,RoFormerTokenizer:()=>r.RoFormerTokenizer,RobertaForMaskedLM:()=>n.RobertaForMaskedLM,RobertaForQuestionAnswering:()=>n.RobertaForQuestionAnswering,RobertaForSequenceClassification:()=>n.RobertaForSequenceClassification,RobertaForTokenClassification:()=>n.RobertaForTokenClassification,RobertaModel:()=>n.RobertaModel,RobertaPreTrainedModel:()=>n.RobertaPreTrainedModel,RobertaTokenizer:()=>r.RobertaTokenizer,SamImageProcessor:()=>m.SamImageProcessor,SamImageSegmentationOutput:()=>n.SamImageSegmentationOutput,SamModel:()=>n.SamModel,SamPreTrainedModel:()=>n.SamPreTrainedModel,SamProcessor:()=>_.SamProcessor,SapiensForDepthEstimation:()=>n.SapiensForDepthEstimation,SapiensForNormalEstimation:()=>n.SapiensForNormalEstimation,SapiensForSemanticSegmentation:()=>n.SapiensForSemanticSegmentation,SapiensPreTrainedModel:()=>n.SapiensPreTrainedModel,SeamlessM4TFeatureExtractor:()=>d.SeamlessM4TFeatureExtractor,SegformerFeatureExtractor:()=>m.SegformerFeatureExtractor,SegformerForImageClassification:()=>n.SegformerForImageClassification,SegformerForSemanticSegmentation:()=>n.SegformerForSemanticSegmentation,SegformerImageProcessor:()=>m.SegformerImageProcessor,SegformerModel:()=>n.SegformerModel,SegformerPreTrainedModel:()=>n.SegformerPreTrainedModel,Seq2SeqLMOutput:()=>n.Seq2SeqLMOutput,SequenceClassifierOutput:()=>n.SequenceClassifierOutput,SiglipImageProcessor:()=>m.SiglipImageProcessor,SiglipModel:()=>n.SiglipModel,SiglipPreTrainedModel:()=>n.SiglipPreTrainedModel,SiglipTextModel:()=>n.SiglipTextModel,SiglipTokenizer:()=>r.SiglipTokenizer,SiglipVisionModel:()=>n.SiglipVisionModel,SmolLM3ForCausalLM:()=>n.SmolLM3ForCausalLM,SmolLM3Model:()=>n.SmolLM3Model,SmolLM3PreTrainedModel:()=>n.SmolLM3PreTrainedModel,SmolVLMForConditionalGeneration:()=>n.SmolVLMForConditionalGeneration,SmolVLMImageProcessor:()=>m.SmolVLMImageProcessor,SmolVLMProcessor:()=>_.SmolVLMProcessor,SnacDecoderModel:()=>n.SnacDecoderModel,SnacEncoderModel:()=>n.SnacEncoderModel,SnacFeatureExtractor:()=>d.SnacFeatureExtractor,SnacModel:()=>n.SnacModel,SnacPreTrainedModel:()=>n.SnacPreTrainedModel,SpeechT5FeatureExtractor:()=>d.SpeechT5FeatureExtractor,SpeechT5ForSpeechToText:()=>n.SpeechT5ForSpeechToText,SpeechT5ForTextToSpeech:()=>n.SpeechT5ForTextToSpeech,SpeechT5HifiGan:()=>n.SpeechT5HifiGan,SpeechT5Model:()=>n.SpeechT5Model,SpeechT5PreTrainedModel:()=>n.SpeechT5PreTrainedModel,SpeechT5Processor:()=>_.SpeechT5Processor,SpeechT5Tokenizer:()=>r.SpeechT5Tokenizer,SqueezeBertForMaskedLM:()=>n.SqueezeBertForMaskedLM,SqueezeBertForQuestionAnswering:()=>n.SqueezeBertForQuestionAnswering,SqueezeBertForSequenceClassification:()=>n.SqueezeBertForSequenceClassification,SqueezeBertModel:()=>n.SqueezeBertModel,SqueezeBertPreTrainedModel:()=>n.SqueezeBertPreTrainedModel,SqueezeBertTokenizer:()=>r.SqueezeBertTokenizer,StableLmForCausalLM:()=>n.StableLmForCausalLM,StableLmModel:()=>n.StableLmModel,StableLmPreTrainedModel:()=>n.StableLmPreTrainedModel,Starcoder2ForCausalLM:()=>n.Starcoder2ForCausalLM,Starcoder2Model:()=>n.Starcoder2Model,Starcoder2PreTrainedModel:()=>n.Starcoder2PreTrainedModel,StoppingCriteria:()=>b.StoppingCriteria,StoppingCriteriaList:()=>b.StoppingCriteriaList,StyleTextToSpeech2Model:()=>n.StyleTextToSpeech2Model,StyleTextToSpeech2PreTrainedModel:()=>n.StyleTextToSpeech2PreTrainedModel,SummarizationPipeline:()=>t.SummarizationPipeline,SuppressTokensAtBeginLogitsProcessor:()=>x.SuppressTokensAtBeginLogitsProcessor,Swin2SRForImageSuperResolution:()=>n.Swin2SRForImageSuperResolution,Swin2SRImageProcessor:()=>m.Swin2SRImageProcessor,Swin2SRModel:()=>n.Swin2SRModel,Swin2SRPreTrainedModel:()=>n.Swin2SRPreTrainedModel,SwinForImageClassification:()=>n.SwinForImageClassification,SwinForSemanticSegmentation:()=>n.SwinForSemanticSegmentation,SwinModel:()=>n.SwinModel,SwinPreTrainedModel:()=>n.SwinPreTrainedModel,T5ForConditionalGeneration:()=>n.T5ForConditionalGeneration,T5Model:()=>n.T5Model,T5PreTrainedModel:()=>n.T5PreTrainedModel,T5Tokenizer:()=>r.T5Tokenizer,TableTransformerForObjectDetection:()=>n.TableTransformerForObjectDetection,TableTransformerModel:()=>n.TableTransformerModel,TableTransformerObjectDetectionOutput:()=>n.TableTransformerObjectDetectionOutput,TableTransformerPreTrainedModel:()=>n.TableTransformerPreTrainedModel,TemperatureLogitsWarper:()=>x.TemperatureLogitsWarper,Tensor:()=>c.Tensor,Text2TextGenerationPipeline:()=>t.Text2TextGenerationPipeline,TextClassificationPipeline:()=>t.TextClassificationPipeline,TextGenerationPipeline:()=>t.TextGenerationPipeline,TextStreamer:()=>y.TextStreamer,TextToAudioPipeline:()=>t.TextToAudioPipeline,TokenClassificationPipeline:()=>t.TokenClassificationPipeline,TokenClassifierOutput:()=>n.TokenClassifierOutput,TokenizerModel:()=>r.TokenizerModel,TopKLogitsWarper:()=>x.TopKLogitsWarper,TopPLogitsWarper:()=>x.TopPLogitsWarper,TrOCRForCausalLM:()=>n.TrOCRForCausalLM,TrOCRPreTrainedModel:()=>n.TrOCRPreTrainedModel,TranslationPipeline:()=>t.TranslationPipeline,UltravoxModel:()=>n.UltravoxModel,UltravoxPreTrainedModel:()=>n.UltravoxPreTrainedModel,UltravoxProcessor:()=>_.UltravoxProcessor,UniSpeechForCTC:()=>n.UniSpeechForCTC,UniSpeechForSequenceClassification:()=>n.UniSpeechForSequenceClassification,UniSpeechModel:()=>n.UniSpeechModel,UniSpeechPreTrainedModel:()=>n.UniSpeechPreTrainedModel,UniSpeechSatForAudioFrameClassification:()=>n.UniSpeechSatForAudioFrameClassification,UniSpeechSatForCTC:()=>n.UniSpeechSatForCTC,UniSpeechSatForSequenceClassification:()=>n.UniSpeechSatForSequenceClassification,UniSpeechSatModel:()=>n.UniSpeechSatModel,UniSpeechSatPreTrainedModel:()=>n.UniSpeechSatPreTrainedModel,VLChatProcessor:()=>_.VLChatProcessor,VLMImageProcessor:()=>m.VLMImageProcessor,ViTFeatureExtractor:()=>m.ViTFeatureExtractor,ViTForImageClassification:()=>n.ViTForImageClassification,ViTImageProcessor:()=>m.ViTImageProcessor,ViTMAEModel:()=>n.ViTMAEModel,ViTMAEPreTrainedModel:()=>n.ViTMAEPreTrainedModel,ViTMSNForImageClassification:()=>n.ViTMSNForImageClassification,ViTMSNModel:()=>n.ViTMSNModel,ViTMSNPreTrainedModel:()=>n.ViTMSNPreTrainedModel,ViTModel:()=>n.ViTModel,ViTPreTrainedModel:()=>n.ViTPreTrainedModel,VisionEncoderDecoderModel:()=>n.VisionEncoderDecoderModel,VitMatteForImageMatting:()=>n.VitMatteForImageMatting,VitMatteImageProcessor:()=>m.VitMatteImageProcessor,VitMattePreTrainedModel:()=>n.VitMattePreTrainedModel,VitPoseForPoseEstimation:()=>n.VitPoseForPoseEstimation,VitPoseImageProcessor:()=>m.VitPoseImageProcessor,VitPosePreTrainedModel:()=>n.VitPosePreTrainedModel,VitsModel:()=>n.VitsModel,VitsModelOutput:()=>n.VitsModelOutput,VitsPreTrainedModel:()=>n.VitsPreTrainedModel,VitsTokenizer:()=>r.VitsTokenizer,Wav2Vec2BertForCTC:()=>n.Wav2Vec2BertForCTC,Wav2Vec2BertForSequenceClassification:()=>n.Wav2Vec2BertForSequenceClassification,Wav2Vec2BertModel:()=>n.Wav2Vec2BertModel,Wav2Vec2BertPreTrainedModel:()=>n.Wav2Vec2BertPreTrainedModel,Wav2Vec2CTCTokenizer:()=>r.Wav2Vec2CTCTokenizer,Wav2Vec2FeatureExtractor:()=>d.Wav2Vec2FeatureExtractor,Wav2Vec2ForAudioFrameClassification:()=>n.Wav2Vec2ForAudioFrameClassification,Wav2Vec2ForCTC:()=>n.Wav2Vec2ForCTC,Wav2Vec2ForSequenceClassification:()=>n.Wav2Vec2ForSequenceClassification,Wav2Vec2Model:()=>n.Wav2Vec2Model,Wav2Vec2PreTrainedModel:()=>n.Wav2Vec2PreTrainedModel,Wav2Vec2Processor:()=>_.Wav2Vec2Processor,Wav2Vec2ProcessorWithLM:()=>_.Wav2Vec2ProcessorWithLM,WavLMForAudioFrameClassification:()=>n.WavLMForAudioFrameClassification,WavLMForCTC:()=>n.WavLMForCTC,WavLMForSequenceClassification:()=>n.WavLMForSequenceClassification,WavLMForXVector:()=>n.WavLMForXVector,WavLMModel:()=>n.WavLMModel,WavLMPreTrainedModel:()=>n.WavLMPreTrainedModel,WeSpeakerFeatureExtractor:()=>d.WeSpeakerFeatureExtractor,WeSpeakerResNetModel:()=>n.WeSpeakerResNetModel,WeSpeakerResNetPreTrainedModel:()=>n.WeSpeakerResNetPreTrainedModel,WhisperFeatureExtractor:()=>d.WhisperFeatureExtractor,WhisperForConditionalGeneration:()=>n.WhisperForConditionalGeneration,WhisperModel:()=>n.WhisperModel,WhisperPreTrainedModel:()=>n.WhisperPreTrainedModel,WhisperProcessor:()=>_.WhisperProcessor,WhisperTextStreamer:()=>y.WhisperTextStreamer,WhisperTimeStampLogitsProcessor:()=>x.WhisperTimeStampLogitsProcessor,WhisperTokenizer:()=>r.WhisperTokenizer,XLMForQuestionAnswering:()=>n.XLMForQuestionAnswering,XLMForSequenceClassification:()=>n.XLMForSequenceClassification,XLMForTokenClassification:()=>n.XLMForTokenClassification,XLMModel:()=>n.XLMModel,XLMPreTrainedModel:()=>n.XLMPreTrainedModel,XLMRobertaForMaskedLM:()=>n.XLMRobertaForMaskedLM,XLMRobertaForQuestionAnswering:()=>n.XLMRobertaForQuestionAnswering,XLMRobertaForSequenceClassification:()=>n.XLMRobertaForSequenceClassification,XLMRobertaForTokenClassification:()=>n.XLMRobertaForTokenClassification,XLMRobertaModel:()=>n.XLMRobertaModel,XLMRobertaPreTrainedModel:()=>n.XLMRobertaPreTrainedModel,XLMRobertaTokenizer:()=>r.XLMRobertaTokenizer,XLMTokenizer:()=>r.XLMTokenizer,XLMWithLMHeadModel:()=>n.XLMWithLMHeadModel,XVectorOutput:()=>n.XVectorOutput,YolosFeatureExtractor:()=>m.YolosFeatureExtractor,YolosForObjectDetection:()=>n.YolosForObjectDetection,YolosImageProcessor:()=>m.YolosImageProcessor,YolosModel:()=>n.YolosModel,YolosObjectDetectionOutput:()=>n.YolosObjectDetectionOutput,YolosPreTrainedModel:()=>n.YolosPreTrainedModel,ZeroShotAudioClassificationPipeline:()=>t.ZeroShotAudioClassificationPipeline,ZeroShotClassificationPipeline:()=>t.ZeroShotClassificationPipeline,ZeroShotImageClassificationPipeline:()=>t.ZeroShotImageClassificationPipeline,ZeroShotObjectDetectionPipeline:()=>t.ZeroShotObjectDetectionPipeline,bankers_round:()=>l.bankers_round,cat:()=>c.cat,cos_sim:()=>l.cos_sim,dot:()=>l.dot,dynamic_time_warping:()=>l.dynamic_time_warping,env:()=>e.env,full:()=>c.full,full_like:()=>c.full_like,getKeyValueShapes:()=>i.getKeyValueShapes,hamming:()=>a.hamming,hanning:()=>a.hanning,interpolate:()=>c.interpolate,interpolate_4d:()=>c.interpolate_4d,interpolate_data:()=>l.interpolate_data,is_chinese_char:()=>r.is_chinese_char,layer_norm:()=>c.layer_norm,load_image:()=>o.load_image,load_video:()=>s.load_video,log_softmax:()=>l.log_softmax,magnitude:()=>l.magnitude,matmul:()=>c.matmul,max:()=>l.max,mean:()=>c.mean,mean_pooling:()=>c.mean_pooling,medianFilter:()=>l.medianFilter,mel_filter_bank:()=>a.mel_filter_bank,min:()=>l.min,ones:()=>c.ones,ones_like:()=>c.ones_like,permute:()=>c.permute,permute_data:()=>l.permute_data,pipeline:()=>t.pipeline,quantize_embeddings:()=>c.quantize_embeddings,rand:()=>c.rand,read_audio:()=>a.read_audio,rfft:()=>c.rfft,round:()=>l.round,slice:()=>c.slice,softmax:()=>l.softmax,spectrogram:()=>a.spectrogram,stack:()=>c.stack,std_mean:()=>c.std_mean,topk:()=>c.topk,window_function:()=>a.window_function,zeros:()=>c.zeros,zeros_like:()=>c.zeros_like});var e=cf( /*! ./env.js */ `./src/env.js`),t=cf( /*! ./pipelines.js */ @@ -3595,4 +3595,4 @@ var af={"onnxruntime-common":e=>{e.exports=ne},"onnxruntime-web":e=>{e.exports=j /*! ./generation/stopping_criteria.js */ `./src/generation/stopping_criteria.js`),x=cf( /*! ./generation/logits_process.js */ -`./src/generation/logits_process.js`)})();var lf=$.ASTFeatureExtractor,uf=$.ASTForAudioClassification,df=$.ASTModel,ff=$.ASTPreTrainedModel,pf=$.AlbertForMaskedLM,mf=$.AlbertForQuestionAnswering,hf=$.AlbertForSequenceClassification,gf=$.AlbertModel,_f=$.AlbertPreTrainedModel,vf=$.AlbertTokenizer,yf=$.AudioClassificationPipeline,bf=$.AutoConfig,xf=$.AutoFeatureExtractor,Sf=$.AutoImageProcessor,Cf=$.AutoModel,wf=$.AutoModelForAudioClassification,Tf=$.AutoModelForAudioFrameClassification,Ef=$.AutoModelForAudioTextToText,Df=$.AutoModelForCTC,Of=$.AutoModelForCausalLM,kf=$.AutoModelForDepthEstimation,Af=$.AutoModelForDocumentQuestionAnswering,jf=$.AutoModelForImageClassification,Mf=$.AutoModelForImageFeatureExtraction,Nf=$.AutoModelForImageMatting,Pf=$.AutoModelForImageSegmentation,Ff=$.AutoModelForImageTextToText,If=$.AutoModelForImageToImage,Lf=$.AutoModelForMaskGeneration,Rf=$.AutoModelForMaskedLM,zf=$.AutoModelForNormalEstimation,Bf=$.AutoModelForObjectDetection,Vf=$.AutoModelForPoseEstimation,Hf=$.AutoModelForQuestionAnswering,Uf=$.AutoModelForSemanticSegmentation,Wf=$.AutoModelForSeq2SeqLM,Gf=$.AutoModelForSequenceClassification,Kf=$.AutoModelForSpeechSeq2Seq,qf=$.AutoModelForTextToSpectrogram,Jf=$.AutoModelForTextToWaveform,Yf=$.AutoModelForTokenClassification,Xf=$.AutoModelForUniversalSegmentation,Zf=$.AutoModelForVision2Seq,Qf=$.AutoModelForXVector,$f=$.AutoModelForZeroShotObjectDetection,ep=$.AutoProcessor,tp=$.AutoTokenizer,np=$.AutomaticSpeechRecognitionPipeline,rp=$.BackgroundRemovalPipeline,ip=$.BartForConditionalGeneration,ap=$.BartForSequenceClassification,op=$.BartModel,sp=$.BartPretrainedModel,cp=$.BartTokenizer,lp=$.BaseModelOutput,up=$.BaseStreamer,dp=$.BeitFeatureExtractor,fp=$.BeitForImageClassification,pp=$.BeitModel,mp=$.BeitPreTrainedModel,hp=$.BertForMaskedLM,gp=$.BertForQuestionAnswering,_p=$.BertForSequenceClassification,vp=$.BertForTokenClassification,yp=$.BertModel,bp=$.BertPreTrainedModel,xp=$.BertTokenizer,Sp=$.BitImageProcessor,Cp=$.BlenderbotForConditionalGeneration,wp=$.BlenderbotModel,Tp=$.BlenderbotPreTrainedModel,Ep=$.BlenderbotSmallForConditionalGeneration,Dp=$.BlenderbotSmallModel,Op=$.BlenderbotSmallPreTrainedModel,kp=$.BlenderbotSmallTokenizer,Ap=$.BlenderbotTokenizer,jp=$.BloomForCausalLM,Mp=$.BloomModel,Np=$.BloomPreTrainedModel,Pp=$.BloomTokenizer,Fp=$.CLIPFeatureExtractor,Ip=$.CLIPImageProcessor,Lp=$.CLIPModel,Rp=$.CLIPPreTrainedModel,zp=$.CLIPSegForImageSegmentation,Bp=$.CLIPSegModel,Vp=$.CLIPSegPreTrainedModel,Hp=$.CLIPTextModel,Up=$.CLIPTextModelWithProjection,Wp=$.CLIPTokenizer,Gp=$.CLIPVisionModel,Kp=$.CLIPVisionModelWithProjection,qp=$.CamembertForMaskedLM,Jp=$.CamembertForQuestionAnswering,Yp=$.CamembertForSequenceClassification,Xp=$.CamembertForTokenClassification,Zp=$.CamembertModel,Qp=$.CamembertPreTrainedModel,$p=$.CamembertTokenizer,em=$.CausalLMOutput,tm=$.CausalLMOutputWithPast,nm=$.ChineseCLIPFeatureExtractor,rm=$.ChineseCLIPModel,im=$.ChineseCLIPPreTrainedModel,am=$.ClapAudioModelWithProjection,om=$.ClapFeatureExtractor,sm=$.ClapModel,cm=$.ClapPreTrainedModel,lm=$.ClapTextModelWithProjection,um=$.ClassifierFreeGuidanceLogitsProcessor,dm=$.CodeGenForCausalLM,fm=$.CodeGenModel,pm=$.CodeGenPreTrainedModel,mm=$.CodeGenTokenizer,hm=$.CodeLlamaTokenizer,gm=$.CohereForCausalLM,_m=$.CohereModel,vm=$.CoherePreTrainedModel,ym=$.CohereTokenizer,bm=$.ConvBertForMaskedLM,xm=$.ConvBertForQuestionAnswering,Sm=$.ConvBertForSequenceClassification,Cm=$.ConvBertForTokenClassification,wm=$.ConvBertModel,Tm=$.ConvBertPreTrainedModel,Em=$.ConvBertTokenizer,Dm=$.ConvNextFeatureExtractor,Om=$.ConvNextForImageClassification,km=$.ConvNextImageProcessor,Am=$.ConvNextModel,jm=$.ConvNextPreTrainedModel,Mm=$.ConvNextV2ForImageClassification,Nm=$.ConvNextV2Model,Pm=$.ConvNextV2PreTrainedModel,Fm=$.DFineForObjectDetection,Im=$.DFineModel,Lm=$.DFinePreTrainedModel,Rm=$.DPTFeatureExtractor,zm=$.DPTForDepthEstimation,Bm=$.DPTImageProcessor,Vm=$.DPTModel,Hm=$.DPTPreTrainedModel,Um=$.DacDecoderModel,Wm=$.DacDecoderOutput,Gm=$.DacEncoderModel,Km=$.DacEncoderOutput,qm=$.DacFeatureExtractor,Jm=$.DacModel,Ym=$.DacPreTrainedModel,Xm=$.DataTypeMap,Zm=$.DebertaForMaskedLM,Qm=$.DebertaForQuestionAnswering,$m=$.DebertaForSequenceClassification,eh=$.DebertaForTokenClassification,th=$.DebertaModel,nh=$.DebertaPreTrainedModel,rh=$.DebertaTokenizer,ih=$.DebertaV2ForMaskedLM,ah=$.DebertaV2ForQuestionAnswering,oh=$.DebertaV2ForSequenceClassification,sh=$.DebertaV2ForTokenClassification,ch=$.DebertaV2Model,lh=$.DebertaV2PreTrainedModel,uh=$.DebertaV2Tokenizer,dh=$.DecisionTransformerModel,fh=$.DecisionTransformerPreTrainedModel,ph=$.DeiTFeatureExtractor,mh=$.DeiTForImageClassification,hh=$.DeiTImageProcessor,gh=$.DeiTModel,_h=$.DeiTPreTrainedModel,vh=$.DepthAnythingForDepthEstimation,yh=$.DepthAnythingPreTrainedModel,bh=$.DepthEstimationPipeline,xh=$.DepthProForDepthEstimation,Sh=$.DepthProPreTrainedModel,Ch=$.DetrFeatureExtractor,wh=$.DetrForObjectDetection,Th=$.DetrForSegmentation,Eh=$.DetrImageProcessor,Dh=$.DetrModel,Oh=$.DetrObjectDetectionOutput,kh=$.DetrPreTrainedModel,Ah=$.DetrSegmentationOutput,jh=$.Dinov2ForImageClassification,Mh=$.Dinov2Model,Nh=$.Dinov2PreTrainedModel,Ph=$.Dinov2WithRegistersForImageClassification,Fh=$.Dinov2WithRegistersModel,Ih=$.Dinov2WithRegistersPreTrainedModel,Lh=$.DistilBertForMaskedLM,Rh=$.DistilBertForQuestionAnswering,zh=$.DistilBertForSequenceClassification,Bh=$.DistilBertForTokenClassification,Vh=$.DistilBertModel,Hh=$.DistilBertPreTrainedModel,Uh=$.DistilBertTokenizer,Wh=$.DocumentQuestionAnsweringPipeline,Gh=$.DonutFeatureExtractor,Kh=$.DonutImageProcessor,qh=$.DonutSwinModel,Jh=$.DonutSwinPreTrainedModel,Yh=$.EfficientNetForImageClassification,Xh=$.EfficientNetImageProcessor,Zh=$.EfficientNetModel,Qh=$.EfficientNetPreTrainedModel,$h=$.ElectraForMaskedLM,eg=$.ElectraForQuestionAnswering,tg=$.ElectraForSequenceClassification,ng=$.ElectraForTokenClassification,rg=$.ElectraModel,ig=$.ElectraPreTrainedModel,ag=$.ElectraTokenizer,og=$.EncodecFeatureExtractor,sg=$.EosTokenCriteria,cg=$.EsmForMaskedLM,lg=$.EsmForSequenceClassification,ug=$.EsmForTokenClassification,dg=$.EsmModel,fg=$.EsmPreTrainedModel,pg=$.EsmTokenizer,mg=$.ExaoneForCausalLM,hg=$.ExaoneModel,gg=$.ExaonePreTrainedModel,_g=$.FFT,vg=$.FalconForCausalLM,yg=$.FalconModel,bg=$.FalconPreTrainedModel,xg=$.FalconTokenizer,Sg=$.FastViTForImageClassification,Cg=$.FastViTModel,wg=$.FastViTPreTrainedModel,Tg=$.FeatureExtractionPipeline,Eg=$.FeatureExtractor,Dg=$.FillMaskPipeline,Og=$.Florence2ForConditionalGeneration,kg=$.Florence2PreTrainedModel,Ag=$.Florence2Processor,jg=$.ForcedBOSTokenLogitsProcessor,Mg=$.ForcedEOSTokenLogitsProcessor,Ng=$.GLPNFeatureExtractor,Pg=$.GLPNForDepthEstimation,Fg=$.GLPNModel,Ig=$.GLPNPreTrainedModel,Lg=$.GPT2LMHeadModel,Rg=$.GPT2Model,zg=$.GPT2PreTrainedModel,Bg=$.GPT2Tokenizer,Vg=$.GPTBigCodeForCausalLM,Hg=$.GPTBigCodeModel,Ug=$.GPTBigCodePreTrainedModel,Wg=$.GPTJForCausalLM,Gg=$.GPTJModel,Kg=$.GPTJPreTrainedModel,qg=$.GPTNeoForCausalLM,Jg=$.GPTNeoModel,Yg=$.GPTNeoPreTrainedModel,Xg=$.GPTNeoXForCausalLM,Zg=$.GPTNeoXModel,Qg=$.GPTNeoXPreTrainedModel,$g=$.GPTNeoXTokenizer,e_=$.Gemma2ForCausalLM,t_=$.Gemma2Model,n_=$.Gemma2PreTrainedModel,r_=$.Gemma3ForCausalLM,i_=$.Gemma3Model,a_=$.Gemma3PreTrainedModel,o_=$.Gemma3nAudioFeatureExtractor,s_=$.Gemma3nForConditionalGeneration,c_=$.Gemma3nPreTrainedModel,l_=$.Gemma3nProcessor,u_=$.GemmaForCausalLM,d_=$.GemmaModel,f_=$.GemmaPreTrainedModel,p_=$.GemmaTokenizer,m_=$.GlmForCausalLM,h_=$.GlmModel,g_=$.GlmPreTrainedModel,__=$.GraniteForCausalLM,v_=$.GraniteModel,y_=$.GranitePreTrainedModel,b_=$.Grok1Tokenizer,x_=$.GroundingDinoForObjectDetection,S_=$.GroundingDinoImageProcessor,C_=$.GroundingDinoPreTrainedModel,w_=$.GroundingDinoProcessor,T_=$.GroupViTModel,E_=$.GroupViTPreTrainedModel,D_=$.HeliumForCausalLM,O_=$.HeliumModel,k_=$.HeliumPreTrainedModel,A_=$.HerbertTokenizer,j_=$.HieraForImageClassification,M_=$.HieraModel,N_=$.HieraPreTrainedModel,P_=$.HubertForCTC,F_=$.HubertForSequenceClassification,I_=$.HubertModel,L_=$.HubertPreTrainedModel,R_=$.IJepaForImageClassification,z_=$.IJepaModel,B_=$.IJepaPreTrainedModel,V_=$.Idefics3ForConditionalGeneration,H_=$.Idefics3ImageProcessor,U_=$.Idefics3PreTrainedModel,W_=$.Idefics3Processor,G_=$.ImageClassificationPipeline,K_=$.ImageFeatureExtractionPipeline,q_=$.ImageFeatureExtractor,J_=$.ImageMattingOutput,Y_=$.ImageProcessor,X_=$.ImageSegmentationPipeline,Z_=$.ImageToImagePipeline,Q_=$.ImageToTextPipeline,$_=$.InterruptableStoppingCriteria,ev=$.JAISLMHeadModel,tv=$.JAISModel,nv=$.JAISPreTrainedModel,rv=$.JinaCLIPImageProcessor,iv=$.JinaCLIPModel,av=$.JinaCLIPPreTrainedModel,ov=$.JinaCLIPProcessor,sv=$.JinaCLIPTextModel,cv=$.JinaCLIPVisionModel,lv=$.LiteWhisperForConditionalGeneration,uv=$.LlamaForCausalLM,dv=$.LlamaModel,fv=$.LlamaPreTrainedModel,pv=$.LlamaTokenizer,mv=$.LlavaForConditionalGeneration,hv=$.LlavaOnevisionForConditionalGeneration,gv=$.LlavaOnevisionImageProcessor,_v=$.LlavaPreTrainedModel,vv=$.LlavaProcessor,yv=$.LlavaQwen2ForCausalLM,bv=$.LogitsProcessor,xv=$.LogitsProcessorList,Sv=$.LogitsWarper,Cv=$.LongT5ForConditionalGeneration,wv=$.LongT5Model,Tv=$.LongT5PreTrainedModel,Ev=$.M2M100ForConditionalGeneration,Dv=$.M2M100Model,Ov=$.M2M100PreTrainedModel,kv=$.M2M100Tokenizer,Av=$.MBart50Tokenizer,jv=$.MBartForCausalLM,Mv=$.MBartForConditionalGeneration,Nv=$.MBartForSequenceClassification,Pv=$.MBartModel,Fv=$.MBartPreTrainedModel,Iv=$.MBartTokenizer,Lv=$.MPNetForMaskedLM,Rv=$.MPNetForQuestionAnswering,zv=$.MPNetForSequenceClassification,Bv=$.MPNetForTokenClassification,Vv=$.MPNetModel,Hv=$.MPNetPreTrainedModel,Uv=$.MPNetTokenizer,Wv=$.MT5ForConditionalGeneration,Gv=$.MT5Model,Kv=$.MT5PreTrainedModel,qv=$.MarianMTModel,Jv=$.MarianModel,Yv=$.MarianPreTrainedModel,Xv=$.MarianTokenizer,Zv=$.Mask2FormerImageProcessor,Qv=$.MaskFormerFeatureExtractor,$v=$.MaskFormerForInstanceSegmentation,ey=$.MaskFormerImageProcessor,ty=$.MaskFormerModel,ny=$.MaskFormerPreTrainedModel,ry=$.MaskedLMOutput,iy=$.MaxLengthCriteria,ay=$.Metric3DForDepthEstimation,oy=$.Metric3DPreTrainedModel,sy=$.Metric3Dv2ForDepthEstimation,cy=$.Metric3Dv2PreTrainedModel,ly=$.MgpstrForSceneTextRecognition,uy=$.MgpstrModelOutput,dy=$.MgpstrPreTrainedModel,fy=$.MgpstrProcessor,py=$.MgpstrTokenizer,my=$.MimiDecoderModel,hy=$.MimiDecoderOutput,gy=$.MimiEncoderModel,_y=$.MimiEncoderOutput,vy=$.MimiModel,yy=$.MimiPreTrainedModel,by=$.MinLengthLogitsProcessor,xy=$.MinNewTokensLengthLogitsProcessor,Sy=$.MistralForCausalLM,Cy=$.MistralModel,wy=$.MistralPreTrainedModel,Ty=$.MobileBertForMaskedLM,Ey=$.MobileBertForQuestionAnswering,Dy=$.MobileBertForSequenceClassification,Oy=$.MobileBertModel,ky=$.MobileBertPreTrainedModel,Ay=$.MobileBertTokenizer,jy=$.MobileLLMForCausalLM,My=$.MobileLLMModel,Ny=$.MobileLLMPreTrainedModel,Py=$.MobileNetV1FeatureExtractor,Fy=$.MobileNetV1ForImageClassification,Iy=$.MobileNetV1ForSemanticSegmentation,Ly=$.MobileNetV1ImageProcessor,Ry=$.MobileNetV1Model,zy=$.MobileNetV1PreTrainedModel,By=$.MobileNetV2FeatureExtractor,Vy=$.MobileNetV2ForImageClassification,Hy=$.MobileNetV2ForSemanticSegmentation,Uy=$.MobileNetV2ImageProcessor,Wy=$.MobileNetV2Model,Gy=$.MobileNetV2PreTrainedModel,Ky=$.MobileNetV3FeatureExtractor,qy=$.MobileNetV3ForImageClassification,Jy=$.MobileNetV3ForSemanticSegmentation,Yy=$.MobileNetV3ImageProcessor,Xy=$.MobileNetV3Model,Zy=$.MobileNetV3PreTrainedModel,Qy=$.MobileNetV4FeatureExtractor,$y=$.MobileNetV4ForImageClassification,eb=$.MobileNetV4ForSemanticSegmentation,tb=$.MobileNetV4ImageProcessor,nb=$.MobileNetV4Model,rb=$.MobileNetV4PreTrainedModel,ib=$.MobileViTFeatureExtractor,ab=$.MobileViTForImageClassification,ob=$.MobileViTImageProcessor,sb=$.MobileViTModel,cb=$.MobileViTPreTrainedModel,lb=$.MobileViTV2ForImageClassification,ub=$.MobileViTV2Model,db=$.MobileViTV2PreTrainedModel,fb=$.ModelOutput,pb=$.ModernBertForMaskedLM,mb=$.ModernBertForSequenceClassification,hb=$.ModernBertForTokenClassification,gb=$.ModernBertModel,_b=$.ModernBertPreTrainedModel,vb=$.Moondream1ForConditionalGeneration,yb=$.MoonshineFeatureExtractor,bb=$.MoonshineForConditionalGeneration,xb=$.MoonshineModel,Sb=$.MoonshinePreTrainedModel,Cb=$.MoonshineProcessor,wb=$.MptForCausalLM,Tb=$.MptModel,Eb=$.MptPreTrainedModel,Db=$.MultiModalityCausalLM,Ob=$.MultiModalityPreTrainedModel,kb=$.MusicgenForCausalLM,Ab=$.MusicgenForConditionalGeneration,jb=$.MusicgenModel,Mb=$.MusicgenPreTrainedModel,Nb=$.NeoBertForMaskedLM,Pb=$.NeoBertForQuestionAnswering,Fb=$.NeoBertForSequenceClassification,Ib=$.NeoBertForTokenClassification,Lb=$.NeoBertModel,Rb=$.NeoBertPreTrainedModel,zb=$.NllbTokenizer,Bb=$.NoBadWordsLogitsProcessor,Vb=$.NoRepeatNGramLogitsProcessor,Hb=$.NomicBertModel,Ub=$.NomicBertPreTrainedModel,Wb=$.NougatImageProcessor,Gb=$.NougatTokenizer,Kb=$.OPTForCausalLM,qb=$.OPTModel,Jb=$.OPTPreTrainedModel,Yb=$.ObjectDetectionPipeline,Xb=$.Olmo2ForCausalLM,Zb=$.Olmo2Model,Qb=$.Olmo2PreTrainedModel,$b=$.OlmoForCausalLM,ex=$.OlmoModel,tx=$.OlmoPreTrainedModel,nx=$.OpenELMForCausalLM,rx=$.OpenELMModel,ix=$.OpenELMPreTrainedModel,ax=$.OwlViTFeatureExtractor,ox=$.OwlViTForObjectDetection,sx=$.OwlViTImageProcessor,cx=$.OwlViTModel,lx=$.OwlViTPreTrainedModel,ux=$.OwlViTProcessor,dx=$.Owlv2ForObjectDetection,fx=$.Owlv2ImageProcessor,px=$.Owlv2Model,mx=$.Owlv2PreTrainedModel,hx=$.PaliGemmaForConditionalGeneration,gx=$.PaliGemmaPreTrainedModel,_x=$.PaliGemmaProcessor,vx=$.PatchTSMixerForPrediction,yx=$.PatchTSMixerModel,bx=$.PatchTSMixerPreTrainedModel,xx=$.PatchTSTForPrediction,Sx=$.PatchTSTModel,Cx=$.PatchTSTPreTrainedModel,wx=$.Phi3ForCausalLM,Tx=$.Phi3Model,Ex=$.Phi3PreTrainedModel,Dx=$.Phi3VForCausalLM,Ox=$.Phi3VImageProcessor,kx=$.Phi3VPreTrainedModel,Ax=$.Phi3VProcessor,jx=$.PhiForCausalLM,Mx=$.PhiModel,Nx=$.PhiPreTrainedModel,Px=$.Pipeline,Fx=$.PreTrainedModel,Ix=$.PreTrainedTokenizer,Lx=$.PretrainedConfig,Rx=$.PretrainedMixin,zx=$.Processor,Bx=$.PvtForImageClassification,Vx=$.PvtImageProcessor,Hx=$.PvtModel,Ux=$.PvtPreTrainedModel,Wx=$.PyAnnoteFeatureExtractor,Gx=$.PyAnnoteForAudioFrameClassification,Kx=$.PyAnnoteModel,qx=$.PyAnnotePreTrainedModel,Jx=$.PyAnnoteProcessor,Yx=$.QuestionAnsweringModelOutput,Xx=$.QuestionAnsweringPipeline,Zx=$.Qwen2ForCausalLM,Qx=$.Qwen2Model,$x=$.Qwen2PreTrainedModel,eS=$.Qwen2Tokenizer,tS=$.Qwen2VLForConditionalGeneration,nS=$.Qwen2VLImageProcessor,rS=$.Qwen2VLPreTrainedModel,iS=$.Qwen2VLProcessor,aS=$.Qwen3ForCausalLM,oS=$.Qwen3Model,sS=$.Qwen3PreTrainedModel,cS=$.RFDetrForObjectDetection,lS=$.RFDetrModel,uS=$.RFDetrObjectDetectionOutput,dS=$.RFDetrPreTrainedModel,fS=$.RTDetrForObjectDetection,pS=$.RTDetrImageProcessor,mS=$.RTDetrModel,hS=$.RTDetrObjectDetectionOutput,gS=$.RTDetrPreTrainedModel,_S=$.RTDetrV2ForObjectDetection,vS=$.RTDetrV2Model,yS=$.RTDetrV2ObjectDetectionOutput,bS=$.RTDetrV2PreTrainedModel,xS=$.RawAudio,SS=$.RawImage,CS=$.RawVideo,wS=$.RawVideoFrame,TS=$.RepetitionPenaltyLogitsProcessor,ES=$.ResNetForImageClassification,DS=$.ResNetModel,OS=$.ResNetPreTrainedModel,kS=$.RoFormerForMaskedLM,AS=$.RoFormerForQuestionAnswering,jS=$.RoFormerForSequenceClassification,MS=$.RoFormerForTokenClassification,NS=$.RoFormerModel,PS=$.RoFormerPreTrainedModel,FS=$.RoFormerTokenizer,IS=$.RobertaForMaskedLM,LS=$.RobertaForQuestionAnswering,RS=$.RobertaForSequenceClassification,zS=$.RobertaForTokenClassification,BS=$.RobertaModel,VS=$.RobertaPreTrainedModel,HS=$.RobertaTokenizer,US=$.SamImageProcessor,WS=$.SamImageSegmentationOutput,GS=$.SamModel,KS=$.SamPreTrainedModel,qS=$.SamProcessor,JS=$.SapiensForDepthEstimation,YS=$.SapiensForNormalEstimation,XS=$.SapiensForSemanticSegmentation,ZS=$.SapiensPreTrainedModel,QS=$.SeamlessM4TFeatureExtractor,$S=$.SegformerFeatureExtractor,eC=$.SegformerForImageClassification,tC=$.SegformerForSemanticSegmentation,nC=$.SegformerImageProcessor,rC=$.SegformerModel,iC=$.SegformerPreTrainedModel,aC=$.Seq2SeqLMOutput,oC=$.SequenceClassifierOutput,sC=$.SiglipImageProcessor,cC=$.SiglipModel,lC=$.SiglipPreTrainedModel,uC=$.SiglipTextModel,dC=$.SiglipTokenizer,fC=$.SiglipVisionModel,pC=$.SmolVLMForConditionalGeneration,mC=$.SmolVLMImageProcessor,hC=$.SmolVLMProcessor,gC=$.SnacDecoderModel,_C=$.SnacEncoderModel,vC=$.SnacFeatureExtractor,yC=$.SnacModel,bC=$.SnacPreTrainedModel,xC=$.SpeechT5FeatureExtractor,SC=$.SpeechT5ForSpeechToText,CC=$.SpeechT5ForTextToSpeech,wC=$.SpeechT5HifiGan,TC=$.SpeechT5Model,EC=$.SpeechT5PreTrainedModel,DC=$.SpeechT5Processor,OC=$.SpeechT5Tokenizer,kC=$.SqueezeBertForMaskedLM,AC=$.SqueezeBertForQuestionAnswering,jC=$.SqueezeBertForSequenceClassification,MC=$.SqueezeBertModel,NC=$.SqueezeBertPreTrainedModel,PC=$.SqueezeBertTokenizer,FC=$.StableLmForCausalLM,IC=$.StableLmModel,LC=$.StableLmPreTrainedModel,RC=$.Starcoder2ForCausalLM,zC=$.Starcoder2Model,BC=$.Starcoder2PreTrainedModel,VC=$.StoppingCriteria,HC=$.StoppingCriteriaList,UC=$.StyleTextToSpeech2Model,WC=$.StyleTextToSpeech2PreTrainedModel,GC=$.SummarizationPipeline,KC=$.SuppressTokensAtBeginLogitsProcessor,qC=$.Swin2SRForImageSuperResolution,JC=$.Swin2SRImageProcessor,YC=$.Swin2SRModel,XC=$.Swin2SRPreTrainedModel,ZC=$.SwinForImageClassification,QC=$.SwinForSemanticSegmentation,$C=$.SwinModel,ew=$.SwinPreTrainedModel,tw=$.T5ForConditionalGeneration,nw=$.T5Model,rw=$.T5PreTrainedModel,iw=$.T5Tokenizer,aw=$.TableTransformerForObjectDetection,ow=$.TableTransformerModel,sw=$.TableTransformerObjectDetectionOutput,cw=$.TableTransformerPreTrainedModel,lw=$.TemperatureLogitsWarper,uw=$.Tensor,dw=$.Text2TextGenerationPipeline,fw=$.TextClassificationPipeline,pw=$.TextGenerationPipeline,mw=$.TextStreamer,hw=$.TextToAudioPipeline,gw=$.TokenClassificationPipeline,_w=$.TokenClassifierOutput,vw=$.TokenizerModel,yw=$.TopKLogitsWarper,bw=$.TopPLogitsWarper,xw=$.TrOCRForCausalLM,Sw=$.TrOCRPreTrainedModel,Cw=$.TranslationPipeline,ww=$.UltravoxModel,Tw=$.UltravoxPreTrainedModel,Ew=$.UltravoxProcessor,Dw=$.UniSpeechForCTC,Ow=$.UniSpeechForSequenceClassification,kw=$.UniSpeechModel,Aw=$.UniSpeechPreTrainedModel,jw=$.UniSpeechSatForAudioFrameClassification,Mw=$.UniSpeechSatForCTC,Nw=$.UniSpeechSatForSequenceClassification,Pw=$.UniSpeechSatModel,Fw=$.UniSpeechSatPreTrainedModel,Iw=$.VLChatProcessor,Lw=$.VLMImageProcessor,Rw=$.ViTFeatureExtractor,zw=$.ViTForImageClassification,Bw=$.ViTImageProcessor,Vw=$.ViTMAEModel,Hw=$.ViTMAEPreTrainedModel,Uw=$.ViTMSNForImageClassification,Ww=$.ViTMSNModel,Gw=$.ViTMSNPreTrainedModel,Kw=$.ViTModel,qw=$.ViTPreTrainedModel,Jw=$.VisionEncoderDecoderModel,Yw=$.VitMatteForImageMatting,Xw=$.VitMatteImageProcessor,Zw=$.VitMattePreTrainedModel,Qw=$.VitPoseForPoseEstimation,$w=$.VitPoseImageProcessor,eT=$.VitPosePreTrainedModel,tT=$.VitsModel,nT=$.VitsModelOutput,rT=$.VitsPreTrainedModel,iT=$.VitsTokenizer,aT=$.Wav2Vec2BertForCTC,oT=$.Wav2Vec2BertForSequenceClassification,sT=$.Wav2Vec2BertModel,cT=$.Wav2Vec2BertPreTrainedModel,lT=$.Wav2Vec2CTCTokenizer,uT=$.Wav2Vec2FeatureExtractor,dT=$.Wav2Vec2ForAudioFrameClassification,fT=$.Wav2Vec2ForCTC,pT=$.Wav2Vec2ForSequenceClassification,mT=$.Wav2Vec2Model,hT=$.Wav2Vec2PreTrainedModel,gT=$.Wav2Vec2Processor,_T=$.Wav2Vec2ProcessorWithLM,vT=$.WavLMForAudioFrameClassification,yT=$.WavLMForCTC,bT=$.WavLMForSequenceClassification,xT=$.WavLMForXVector,ST=$.WavLMModel,CT=$.WavLMPreTrainedModel,wT=$.WeSpeakerFeatureExtractor,TT=$.WeSpeakerResNetModel,ET=$.WeSpeakerResNetPreTrainedModel,DT=$.WhisperFeatureExtractor,OT=$.WhisperForConditionalGeneration,kT=$.WhisperModel,AT=$.WhisperPreTrainedModel,jT=$.WhisperProcessor,MT=$.WhisperTextStreamer,NT=$.WhisperTimeStampLogitsProcessor,PT=$.WhisperTokenizer,FT=$.XLMForQuestionAnswering,IT=$.XLMForSequenceClassification,LT=$.XLMForTokenClassification,RT=$.XLMModel,zT=$.XLMPreTrainedModel,BT=$.XLMRobertaForMaskedLM,VT=$.XLMRobertaForQuestionAnswering,HT=$.XLMRobertaForSequenceClassification,UT=$.XLMRobertaForTokenClassification,WT=$.XLMRobertaModel,GT=$.XLMRobertaPreTrainedModel,KT=$.XLMRobertaTokenizer,qT=$.XLMTokenizer,JT=$.XLMWithLMHeadModel,YT=$.XVectorOutput,XT=$.YolosFeatureExtractor,ZT=$.YolosForObjectDetection,QT=$.YolosImageProcessor,$T=$.YolosModel,eE=$.YolosObjectDetectionOutput,tE=$.YolosPreTrainedModel,nE=$.ZeroShotAudioClassificationPipeline,rE=$.ZeroShotClassificationPipeline,iE=$.ZeroShotImageClassificationPipeline,aE=$.ZeroShotObjectDetectionPipeline,oE=$.bankers_round,sE=$.cat,cE=$.cos_sim,lE=$.dot,uE=$.dynamic_time_warping,dE=$.env,fE=$.full,pE=$.full_like,mE=$.getKeyValueShapes,hE=$.hamming,gE=$.hanning,_E=$.interpolate,vE=$.interpolate_4d,yE=$.interpolate_data,bE=$.is_chinese_char,xE=$.layer_norm,SE=$.load_image,CE=$.load_video,wE=$.log_softmax,TE=$.magnitude,EE=$.matmul,DE=$.max,OE=$.mean,kE=$.mean_pooling,AE=$.medianFilter,jE=$.mel_filter_bank,ME=$.min,NE=$.ones,PE=$.ones_like,FE=$.permute,IE=$.permute_data,LE=$.pipeline,RE=$.quantize_embeddings,zE=$.rand,BE=$.read_audio,VE=$.rfft,HE=$.round,UE=$.slice,WE=$.softmax,GE=$.spectrogram,KE=$.stack,qE=$.std_mean,JE=$.topk,YE=$.window_function,XE=$.zeros,ZE=$.zeros_like;export{SS as b,uw as c,dE as d,ep as e,Cf as f}; \ No newline at end of file +`./src/generation/logits_process.js`)})();var lf=$.ASTFeatureExtractor,uf=$.ASTForAudioClassification,df=$.ASTModel,ff=$.ASTPreTrainedModel,pf=$.AlbertForMaskedLM,mf=$.AlbertForQuestionAnswering,hf=$.AlbertForSequenceClassification,gf=$.AlbertModel,_f=$.AlbertPreTrainedModel,vf=$.AlbertTokenizer,yf=$.AudioClassificationPipeline,bf=$.AutoConfig,xf=$.AutoFeatureExtractor,Sf=$.AutoImageProcessor,Cf=$.AutoModel,wf=$.AutoModelForAudioClassification,Tf=$.AutoModelForAudioFrameClassification,Ef=$.AutoModelForAudioTextToText,Df=$.AutoModelForCTC,Of=$.AutoModelForCausalLM,kf=$.AutoModelForDepthEstimation,Af=$.AutoModelForDocumentQuestionAnswering,jf=$.AutoModelForImageClassification,Mf=$.AutoModelForImageFeatureExtraction,Nf=$.AutoModelForImageMatting,Pf=$.AutoModelForImageSegmentation,Ff=$.AutoModelForImageTextToText,If=$.AutoModelForImageToImage,Lf=$.AutoModelForMaskGeneration,Rf=$.AutoModelForMaskedLM,zf=$.AutoModelForNormalEstimation,Bf=$.AutoModelForObjectDetection,Vf=$.AutoModelForPoseEstimation,Hf=$.AutoModelForQuestionAnswering,Uf=$.AutoModelForSemanticSegmentation,Wf=$.AutoModelForSeq2SeqLM,Gf=$.AutoModelForSequenceClassification,Kf=$.AutoModelForSpeechSeq2Seq,qf=$.AutoModelForTextToSpectrogram,Jf=$.AutoModelForTextToWaveform,Yf=$.AutoModelForTokenClassification,Xf=$.AutoModelForUniversalSegmentation,Zf=$.AutoModelForVision2Seq,Qf=$.AutoModelForXVector,$f=$.AutoModelForZeroShotObjectDetection,ep=$.AutoProcessor,tp=$.AutoTokenizer,np=$.AutomaticSpeechRecognitionPipeline,rp=$.BackgroundRemovalPipeline,ip=$.BartForConditionalGeneration,ap=$.BartForSequenceClassification,op=$.BartModel,sp=$.BartPretrainedModel,cp=$.BartTokenizer,lp=$.BaseModelOutput,up=$.BaseStreamer,dp=$.BeitFeatureExtractor,fp=$.BeitForImageClassification,pp=$.BeitModel,mp=$.BeitPreTrainedModel,hp=$.BertForMaskedLM,gp=$.BertForQuestionAnswering,_p=$.BertForSequenceClassification,vp=$.BertForTokenClassification,yp=$.BertModel,bp=$.BertPreTrainedModel,xp=$.BertTokenizer,Sp=$.BitImageProcessor,Cp=$.BlenderbotForConditionalGeneration,wp=$.BlenderbotModel,Tp=$.BlenderbotPreTrainedModel,Ep=$.BlenderbotSmallForConditionalGeneration,Dp=$.BlenderbotSmallModel,Op=$.BlenderbotSmallPreTrainedModel,kp=$.BlenderbotSmallTokenizer,Ap=$.BlenderbotTokenizer,jp=$.BloomForCausalLM,Mp=$.BloomModel,Np=$.BloomPreTrainedModel,Pp=$.BloomTokenizer,Fp=$.CLIPFeatureExtractor,Ip=$.CLIPImageProcessor,Lp=$.CLIPModel,Rp=$.CLIPPreTrainedModel,zp=$.CLIPSegForImageSegmentation,Bp=$.CLIPSegModel,Vp=$.CLIPSegPreTrainedModel,Hp=$.CLIPTextModel,Up=$.CLIPTextModelWithProjection,Wp=$.CLIPTokenizer,Gp=$.CLIPVisionModel,Kp=$.CLIPVisionModelWithProjection,qp=$.CamembertForMaskedLM,Jp=$.CamembertForQuestionAnswering,Yp=$.CamembertForSequenceClassification,Xp=$.CamembertForTokenClassification,Zp=$.CamembertModel,Qp=$.CamembertPreTrainedModel,$p=$.CamembertTokenizer,em=$.CausalLMOutput,tm=$.CausalLMOutputWithPast,nm=$.ChineseCLIPFeatureExtractor,rm=$.ChineseCLIPModel,im=$.ChineseCLIPPreTrainedModel,am=$.ClapAudioModelWithProjection,om=$.ClapFeatureExtractor,sm=$.ClapModel,cm=$.ClapPreTrainedModel,lm=$.ClapTextModelWithProjection,um=$.ClassifierFreeGuidanceLogitsProcessor,dm=$.CodeGenForCausalLM,fm=$.CodeGenModel,pm=$.CodeGenPreTrainedModel,mm=$.CodeGenTokenizer,hm=$.CodeLlamaTokenizer,gm=$.CohereForCausalLM,_m=$.CohereModel,vm=$.CoherePreTrainedModel,ym=$.CohereTokenizer,bm=$.ConvBertForMaskedLM,xm=$.ConvBertForQuestionAnswering,Sm=$.ConvBertForSequenceClassification,Cm=$.ConvBertForTokenClassification,wm=$.ConvBertModel,Tm=$.ConvBertPreTrainedModel,Em=$.ConvBertTokenizer,Dm=$.ConvNextFeatureExtractor,Om=$.ConvNextForImageClassification,km=$.ConvNextImageProcessor,Am=$.ConvNextModel,jm=$.ConvNextPreTrainedModel,Mm=$.ConvNextV2ForImageClassification,Nm=$.ConvNextV2Model,Pm=$.ConvNextV2PreTrainedModel,Fm=$.DFineForObjectDetection,Im=$.DFineModel,Lm=$.DFinePreTrainedModel,Rm=$.DPTFeatureExtractor,zm=$.DPTForDepthEstimation,Bm=$.DPTImageProcessor,Vm=$.DPTModel,Hm=$.DPTPreTrainedModel,Um=$.DacDecoderModel,Wm=$.DacDecoderOutput,Gm=$.DacEncoderModel,Km=$.DacEncoderOutput,qm=$.DacFeatureExtractor,Jm=$.DacModel,Ym=$.DacPreTrainedModel,Xm=$.DataTypeMap,Zm=$.DebertaForMaskedLM,Qm=$.DebertaForQuestionAnswering,$m=$.DebertaForSequenceClassification,eh=$.DebertaForTokenClassification,th=$.DebertaModel,nh=$.DebertaPreTrainedModel,rh=$.DebertaTokenizer,ih=$.DebertaV2ForMaskedLM,ah=$.DebertaV2ForQuestionAnswering,oh=$.DebertaV2ForSequenceClassification,sh=$.DebertaV2ForTokenClassification,ch=$.DebertaV2Model,lh=$.DebertaV2PreTrainedModel,uh=$.DebertaV2Tokenizer,dh=$.DecisionTransformerModel,fh=$.DecisionTransformerPreTrainedModel,ph=$.DeiTFeatureExtractor,mh=$.DeiTForImageClassification,hh=$.DeiTImageProcessor,gh=$.DeiTModel,_h=$.DeiTPreTrainedModel,vh=$.DepthAnythingForDepthEstimation,yh=$.DepthAnythingPreTrainedModel,bh=$.DepthEstimationPipeline,xh=$.DepthProForDepthEstimation,Sh=$.DepthProPreTrainedModel,Ch=$.DetrFeatureExtractor,wh=$.DetrForObjectDetection,Th=$.DetrForSegmentation,Eh=$.DetrImageProcessor,Dh=$.DetrModel,Oh=$.DetrObjectDetectionOutput,kh=$.DetrPreTrainedModel,Ah=$.DetrSegmentationOutput,jh=$.Dinov2ForImageClassification,Mh=$.Dinov2Model,Nh=$.Dinov2PreTrainedModel,Ph=$.Dinov2WithRegistersForImageClassification,Fh=$.Dinov2WithRegistersModel,Ih=$.Dinov2WithRegistersPreTrainedModel,Lh=$.DistilBertForMaskedLM,Rh=$.DistilBertForQuestionAnswering,zh=$.DistilBertForSequenceClassification,Bh=$.DistilBertForTokenClassification,Vh=$.DistilBertModel,Hh=$.DistilBertPreTrainedModel,Uh=$.DistilBertTokenizer,Wh=$.DocumentQuestionAnsweringPipeline,Gh=$.DonutFeatureExtractor,Kh=$.DonutImageProcessor,qh=$.DonutSwinModel,Jh=$.DonutSwinPreTrainedModel,Yh=$.EfficientNetForImageClassification,Xh=$.EfficientNetImageProcessor,Zh=$.EfficientNetModel,Qh=$.EfficientNetPreTrainedModel,$h=$.ElectraForMaskedLM,eg=$.ElectraForQuestionAnswering,tg=$.ElectraForSequenceClassification,ng=$.ElectraForTokenClassification,rg=$.ElectraModel,ig=$.ElectraPreTrainedModel,ag=$.ElectraTokenizer,og=$.EncodecFeatureExtractor,sg=$.EosTokenCriteria,cg=$.Ernie4_5_ForCausalLM,lg=$.Ernie4_5_Model,ug=$.Ernie4_5_PretrainedModel,dg=$.Ernie4_5_Tokenizer,fg=$.EsmForMaskedLM,pg=$.EsmForSequenceClassification,mg=$.EsmForTokenClassification,hg=$.EsmModel,gg=$.EsmPreTrainedModel,_g=$.EsmTokenizer,vg=$.ExaoneForCausalLM,yg=$.ExaoneModel,bg=$.ExaonePreTrainedModel,xg=$.FFT,Sg=$.FalconForCausalLM,Cg=$.FalconModel,wg=$.FalconPreTrainedModel,Tg=$.FalconTokenizer,Eg=$.FastViTForImageClassification,Dg=$.FastViTModel,Og=$.FastViTPreTrainedModel,kg=$.FeatureExtractionPipeline,Ag=$.FeatureExtractor,jg=$.FillMaskPipeline,Mg=$.Florence2ForConditionalGeneration,Ng=$.Florence2PreTrainedModel,Pg=$.Florence2Processor,Fg=$.ForcedBOSTokenLogitsProcessor,Ig=$.ForcedEOSTokenLogitsProcessor,Lg=$.GLPNFeatureExtractor,Rg=$.GLPNForDepthEstimation,zg=$.GLPNModel,Bg=$.GLPNPreTrainedModel,Vg=$.GPT2LMHeadModel,Hg=$.GPT2Model,Ug=$.GPT2PreTrainedModel,Wg=$.GPT2Tokenizer,Gg=$.GPTBigCodeForCausalLM,Kg=$.GPTBigCodeModel,qg=$.GPTBigCodePreTrainedModel,Jg=$.GPTJForCausalLM,Yg=$.GPTJModel,Xg=$.GPTJPreTrainedModel,Zg=$.GPTNeoForCausalLM,Qg=$.GPTNeoModel,$g=$.GPTNeoPreTrainedModel,e_=$.GPTNeoXForCausalLM,t_=$.GPTNeoXModel,n_=$.GPTNeoXPreTrainedModel,r_=$.GPTNeoXTokenizer,i_=$.Gemma2ForCausalLM,a_=$.Gemma2Model,o_=$.Gemma2PreTrainedModel,s_=$.Gemma3ForCausalLM,c_=$.Gemma3Model,l_=$.Gemma3PreTrainedModel,u_=$.Gemma3nAudioFeatureExtractor,d_=$.Gemma3nForConditionalGeneration,f_=$.Gemma3nPreTrainedModel,p_=$.Gemma3nProcessor,m_=$.GemmaForCausalLM,h_=$.GemmaModel,g_=$.GemmaPreTrainedModel,__=$.GemmaTokenizer,v_=$.GlmForCausalLM,y_=$.GlmModel,b_=$.GlmPreTrainedModel,x_=$.GraniteForCausalLM,S_=$.GraniteModel,C_=$.GranitePreTrainedModel,w_=$.Grok1Tokenizer,T_=$.GroundingDinoForObjectDetection,E_=$.GroundingDinoImageProcessor,D_=$.GroundingDinoPreTrainedModel,O_=$.GroundingDinoProcessor,k_=$.GroupViTModel,A_=$.GroupViTPreTrainedModel,j_=$.HeliumForCausalLM,M_=$.HeliumModel,N_=$.HeliumPreTrainedModel,P_=$.HerbertTokenizer,F_=$.HieraForImageClassification,I_=$.HieraModel,L_=$.HieraPreTrainedModel,R_=$.HubertForCTC,z_=$.HubertForSequenceClassification,B_=$.HubertModel,V_=$.HubertPreTrainedModel,H_=$.IJepaForImageClassification,U_=$.IJepaModel,W_=$.IJepaPreTrainedModel,G_=$.Idefics3ForConditionalGeneration,K_=$.Idefics3ImageProcessor,q_=$.Idefics3PreTrainedModel,J_=$.Idefics3Processor,Y_=$.ImageClassificationPipeline,X_=$.ImageFeatureExtractionPipeline,Z_=$.ImageFeatureExtractor,Q_=$.ImageMattingOutput,$_=$.ImageProcessor,ev=$.ImageSegmentationPipeline,tv=$.ImageToImagePipeline,nv=$.ImageToTextPipeline,rv=$.InterruptableStoppingCriteria,iv=$.JAISLMHeadModel,av=$.JAISModel,ov=$.JAISPreTrainedModel,sv=$.JinaCLIPImageProcessor,cv=$.JinaCLIPModel,lv=$.JinaCLIPPreTrainedModel,uv=$.JinaCLIPProcessor,dv=$.JinaCLIPTextModel,fv=$.JinaCLIPVisionModel,pv=$.LiteWhisperForConditionalGeneration,mv=$.LlamaForCausalLM,hv=$.LlamaModel,gv=$.LlamaPreTrainedModel,_v=$.LlamaTokenizer,vv=$.LlavaForConditionalGeneration,yv=$.LlavaOnevisionForConditionalGeneration,bv=$.LlavaOnevisionImageProcessor,xv=$.LlavaPreTrainedModel,Sv=$.LlavaProcessor,Cv=$.LlavaQwen2ForCausalLM,wv=$.LogitsProcessor,Tv=$.LogitsProcessorList,Ev=$.LogitsWarper,Dv=$.LongT5ForConditionalGeneration,Ov=$.LongT5Model,kv=$.LongT5PreTrainedModel,Av=$.M2M100ForConditionalGeneration,jv=$.M2M100Model,Mv=$.M2M100PreTrainedModel,Nv=$.M2M100Tokenizer,Pv=$.MBart50Tokenizer,Fv=$.MBartForCausalLM,Iv=$.MBartForConditionalGeneration,Lv=$.MBartForSequenceClassification,Rv=$.MBartModel,zv=$.MBartPreTrainedModel,Bv=$.MBartTokenizer,Vv=$.MPNetForMaskedLM,Hv=$.MPNetForQuestionAnswering,Uv=$.MPNetForSequenceClassification,Wv=$.MPNetForTokenClassification,Gv=$.MPNetModel,Kv=$.MPNetPreTrainedModel,qv=$.MPNetTokenizer,Jv=$.MT5ForConditionalGeneration,Yv=$.MT5Model,Xv=$.MT5PreTrainedModel,Zv=$.MarianMTModel,Qv=$.MarianModel,$v=$.MarianPreTrainedModel,ey=$.MarianTokenizer,ty=$.Mask2FormerImageProcessor,ny=$.MaskFormerFeatureExtractor,ry=$.MaskFormerForInstanceSegmentation,iy=$.MaskFormerImageProcessor,ay=$.MaskFormerModel,oy=$.MaskFormerPreTrainedModel,sy=$.MaskedLMOutput,cy=$.MaxLengthCriteria,ly=$.Metric3DForDepthEstimation,uy=$.Metric3DPreTrainedModel,dy=$.Metric3Dv2ForDepthEstimation,fy=$.Metric3Dv2PreTrainedModel,py=$.MgpstrForSceneTextRecognition,my=$.MgpstrModelOutput,hy=$.MgpstrPreTrainedModel,gy=$.MgpstrProcessor,_y=$.MgpstrTokenizer,vy=$.MimiDecoderModel,yy=$.MimiDecoderOutput,by=$.MimiEncoderModel,xy=$.MimiEncoderOutput,Sy=$.MimiModel,Cy=$.MimiPreTrainedModel,wy=$.MinLengthLogitsProcessor,Ty=$.MinNewTokensLengthLogitsProcessor,Ey=$.MistralForCausalLM,Dy=$.MistralModel,Oy=$.MistralPreTrainedModel,ky=$.MobileBertForMaskedLM,Ay=$.MobileBertForQuestionAnswering,jy=$.MobileBertForSequenceClassification,My=$.MobileBertModel,Ny=$.MobileBertPreTrainedModel,Py=$.MobileBertTokenizer,Fy=$.MobileLLMForCausalLM,Iy=$.MobileLLMModel,Ly=$.MobileLLMPreTrainedModel,Ry=$.MobileNetV1FeatureExtractor,zy=$.MobileNetV1ForImageClassification,By=$.MobileNetV1ForSemanticSegmentation,Vy=$.MobileNetV1ImageProcessor,Hy=$.MobileNetV1Model,Uy=$.MobileNetV1PreTrainedModel,Wy=$.MobileNetV2FeatureExtractor,Gy=$.MobileNetV2ForImageClassification,Ky=$.MobileNetV2ForSemanticSegmentation,qy=$.MobileNetV2ImageProcessor,Jy=$.MobileNetV2Model,Yy=$.MobileNetV2PreTrainedModel,Xy=$.MobileNetV3FeatureExtractor,Zy=$.MobileNetV3ForImageClassification,Qy=$.MobileNetV3ForSemanticSegmentation,$y=$.MobileNetV3ImageProcessor,eb=$.MobileNetV3Model,tb=$.MobileNetV3PreTrainedModel,nb=$.MobileNetV4FeatureExtractor,rb=$.MobileNetV4ForImageClassification,ib=$.MobileNetV4ForSemanticSegmentation,ab=$.MobileNetV4ImageProcessor,ob=$.MobileNetV4Model,sb=$.MobileNetV4PreTrainedModel,cb=$.MobileViTFeatureExtractor,lb=$.MobileViTForImageClassification,ub=$.MobileViTImageProcessor,db=$.MobileViTModel,fb=$.MobileViTPreTrainedModel,pb=$.MobileViTV2ForImageClassification,mb=$.MobileViTV2Model,hb=$.MobileViTV2PreTrainedModel,gb=$.ModelOutput,_b=$.ModernBertForMaskedLM,vb=$.ModernBertForSequenceClassification,yb=$.ModernBertForTokenClassification,bb=$.ModernBertModel,xb=$.ModernBertPreTrainedModel,Sb=$.Moondream1ForConditionalGeneration,Cb=$.MoonshineFeatureExtractor,wb=$.MoonshineForConditionalGeneration,Tb=$.MoonshineModel,Eb=$.MoonshinePreTrainedModel,Db=$.MoonshineProcessor,Ob=$.MptForCausalLM,kb=$.MptModel,Ab=$.MptPreTrainedModel,jb=$.MultiModalityCausalLM,Mb=$.MultiModalityPreTrainedModel,Nb=$.MusicgenForCausalLM,Pb=$.MusicgenForConditionalGeneration,Fb=$.MusicgenModel,Ib=$.MusicgenPreTrainedModel,Lb=$.NeoBertForMaskedLM,Rb=$.NeoBertForQuestionAnswering,zb=$.NeoBertForSequenceClassification,Bb=$.NeoBertForTokenClassification,Vb=$.NeoBertModel,Hb=$.NeoBertPreTrainedModel,Ub=$.NllbTokenizer,Wb=$.NoBadWordsLogitsProcessor,Gb=$.NoRepeatNGramLogitsProcessor,Kb=$.NomicBertModel,qb=$.NomicBertPreTrainedModel,Jb=$.NougatImageProcessor,Yb=$.NougatTokenizer,Xb=$.OPTForCausalLM,Zb=$.OPTModel,Qb=$.OPTPreTrainedModel,$b=$.ObjectDetectionPipeline,ex=$.Olmo2ForCausalLM,tx=$.Olmo2Model,nx=$.Olmo2PreTrainedModel,rx=$.OlmoForCausalLM,ix=$.OlmoModel,ax=$.OlmoPreTrainedModel,ox=$.OpenELMForCausalLM,sx=$.OpenELMModel,cx=$.OpenELMPreTrainedModel,lx=$.OwlViTFeatureExtractor,ux=$.OwlViTForObjectDetection,dx=$.OwlViTImageProcessor,fx=$.OwlViTModel,px=$.OwlViTPreTrainedModel,mx=$.OwlViTProcessor,hx=$.Owlv2ForObjectDetection,gx=$.Owlv2ImageProcessor,_x=$.Owlv2Model,vx=$.Owlv2PreTrainedModel,yx=$.PaliGemmaForConditionalGeneration,bx=$.PaliGemmaPreTrainedModel,xx=$.PaliGemmaProcessor,Sx=$.PatchTSMixerForPrediction,Cx=$.PatchTSMixerModel,wx=$.PatchTSMixerPreTrainedModel,Tx=$.PatchTSTForPrediction,Ex=$.PatchTSTModel,Dx=$.PatchTSTPreTrainedModel,Ox=$.Phi3ForCausalLM,kx=$.Phi3Model,Ax=$.Phi3PreTrainedModel,jx=$.Phi3VForCausalLM,Mx=$.Phi3VImageProcessor,Nx=$.Phi3VPreTrainedModel,Px=$.Phi3VProcessor,Fx=$.PhiForCausalLM,Ix=$.PhiModel,Lx=$.PhiPreTrainedModel,Rx=$.Pipeline,zx=$.PreTrainedModel,Bx=$.PreTrainedTokenizer,Vx=$.PretrainedConfig,Hx=$.PretrainedMixin,Ux=$.Processor,Wx=$.PvtForImageClassification,Gx=$.PvtImageProcessor,Kx=$.PvtModel,qx=$.PvtPreTrainedModel,Jx=$.PyAnnoteFeatureExtractor,Yx=$.PyAnnoteForAudioFrameClassification,Xx=$.PyAnnoteModel,Zx=$.PyAnnotePreTrainedModel,Qx=$.PyAnnoteProcessor,$x=$.QuestionAnsweringModelOutput,eS=$.QuestionAnsweringPipeline,tS=$.Qwen2ForCausalLM,nS=$.Qwen2Model,rS=$.Qwen2PreTrainedModel,iS=$.Qwen2Tokenizer,aS=$.Qwen2VLForConditionalGeneration,oS=$.Qwen2VLImageProcessor,sS=$.Qwen2VLPreTrainedModel,cS=$.Qwen2VLProcessor,lS=$.Qwen3ForCausalLM,uS=$.Qwen3Model,dS=$.Qwen3PreTrainedModel,fS=$.RFDetrForObjectDetection,pS=$.RFDetrModel,mS=$.RFDetrObjectDetectionOutput,hS=$.RFDetrPreTrainedModel,gS=$.RTDetrForObjectDetection,_S=$.RTDetrImageProcessor,vS=$.RTDetrModel,yS=$.RTDetrObjectDetectionOutput,bS=$.RTDetrPreTrainedModel,xS=$.RTDetrV2ForObjectDetection,SS=$.RTDetrV2Model,CS=$.RTDetrV2ObjectDetectionOutput,wS=$.RTDetrV2PreTrainedModel,TS=$.RawAudio,ES=$.RawImage,DS=$.RawVideo,OS=$.RawVideoFrame,kS=$.RepetitionPenaltyLogitsProcessor,AS=$.ResNetForImageClassification,jS=$.ResNetModel,MS=$.ResNetPreTrainedModel,NS=$.RoFormerForMaskedLM,PS=$.RoFormerForQuestionAnswering,FS=$.RoFormerForSequenceClassification,IS=$.RoFormerForTokenClassification,LS=$.RoFormerModel,RS=$.RoFormerPreTrainedModel,zS=$.RoFormerTokenizer,BS=$.RobertaForMaskedLM,VS=$.RobertaForQuestionAnswering,HS=$.RobertaForSequenceClassification,US=$.RobertaForTokenClassification,WS=$.RobertaModel,GS=$.RobertaPreTrainedModel,KS=$.RobertaTokenizer,qS=$.SamImageProcessor,JS=$.SamImageSegmentationOutput,YS=$.SamModel,XS=$.SamPreTrainedModel,ZS=$.SamProcessor,QS=$.SapiensForDepthEstimation,$S=$.SapiensForNormalEstimation,eC=$.SapiensForSemanticSegmentation,tC=$.SapiensPreTrainedModel,nC=$.SeamlessM4TFeatureExtractor,rC=$.SegformerFeatureExtractor,iC=$.SegformerForImageClassification,aC=$.SegformerForSemanticSegmentation,oC=$.SegformerImageProcessor,sC=$.SegformerModel,cC=$.SegformerPreTrainedModel,lC=$.Seq2SeqLMOutput,uC=$.SequenceClassifierOutput,dC=$.SiglipImageProcessor,fC=$.SiglipModel,pC=$.SiglipPreTrainedModel,mC=$.SiglipTextModel,hC=$.SiglipTokenizer,gC=$.SiglipVisionModel,_C=$.SmolLM3ForCausalLM,vC=$.SmolLM3Model,yC=$.SmolLM3PreTrainedModel,bC=$.SmolVLMForConditionalGeneration,xC=$.SmolVLMImageProcessor,SC=$.SmolVLMProcessor,CC=$.SnacDecoderModel,wC=$.SnacEncoderModel,TC=$.SnacFeatureExtractor,EC=$.SnacModel,DC=$.SnacPreTrainedModel,OC=$.SpeechT5FeatureExtractor,kC=$.SpeechT5ForSpeechToText,AC=$.SpeechT5ForTextToSpeech,jC=$.SpeechT5HifiGan,MC=$.SpeechT5Model,NC=$.SpeechT5PreTrainedModel,PC=$.SpeechT5Processor,FC=$.SpeechT5Tokenizer,IC=$.SqueezeBertForMaskedLM,LC=$.SqueezeBertForQuestionAnswering,RC=$.SqueezeBertForSequenceClassification,zC=$.SqueezeBertModel,BC=$.SqueezeBertPreTrainedModel,VC=$.SqueezeBertTokenizer,HC=$.StableLmForCausalLM,UC=$.StableLmModel,WC=$.StableLmPreTrainedModel,GC=$.Starcoder2ForCausalLM,KC=$.Starcoder2Model,qC=$.Starcoder2PreTrainedModel,JC=$.StoppingCriteria,YC=$.StoppingCriteriaList,XC=$.StyleTextToSpeech2Model,ZC=$.StyleTextToSpeech2PreTrainedModel,QC=$.SummarizationPipeline,$C=$.SuppressTokensAtBeginLogitsProcessor,ew=$.Swin2SRForImageSuperResolution,tw=$.Swin2SRImageProcessor,nw=$.Swin2SRModel,rw=$.Swin2SRPreTrainedModel,iw=$.SwinForImageClassification,aw=$.SwinForSemanticSegmentation,ow=$.SwinModel,sw=$.SwinPreTrainedModel,cw=$.T5ForConditionalGeneration,lw=$.T5Model,uw=$.T5PreTrainedModel,dw=$.T5Tokenizer,fw=$.TableTransformerForObjectDetection,pw=$.TableTransformerModel,mw=$.TableTransformerObjectDetectionOutput,hw=$.TableTransformerPreTrainedModel,gw=$.TemperatureLogitsWarper,_w=$.Tensor,vw=$.Text2TextGenerationPipeline,yw=$.TextClassificationPipeline,bw=$.TextGenerationPipeline,xw=$.TextStreamer,Sw=$.TextToAudioPipeline,Cw=$.TokenClassificationPipeline,ww=$.TokenClassifierOutput,Tw=$.TokenizerModel,Ew=$.TopKLogitsWarper,Dw=$.TopPLogitsWarper,Ow=$.TrOCRForCausalLM,kw=$.TrOCRPreTrainedModel,Aw=$.TranslationPipeline,jw=$.UltravoxModel,Mw=$.UltravoxPreTrainedModel,Nw=$.UltravoxProcessor,Pw=$.UniSpeechForCTC,Fw=$.UniSpeechForSequenceClassification,Iw=$.UniSpeechModel,Lw=$.UniSpeechPreTrainedModel,Rw=$.UniSpeechSatForAudioFrameClassification,zw=$.UniSpeechSatForCTC,Bw=$.UniSpeechSatForSequenceClassification,Vw=$.UniSpeechSatModel,Hw=$.UniSpeechSatPreTrainedModel,Uw=$.VLChatProcessor,Ww=$.VLMImageProcessor,Gw=$.ViTFeatureExtractor,Kw=$.ViTForImageClassification,qw=$.ViTImageProcessor,Jw=$.ViTMAEModel,Yw=$.ViTMAEPreTrainedModel,Xw=$.ViTMSNForImageClassification,Zw=$.ViTMSNModel,Qw=$.ViTMSNPreTrainedModel,$w=$.ViTModel,eT=$.ViTPreTrainedModel,tT=$.VisionEncoderDecoderModel,nT=$.VitMatteForImageMatting,rT=$.VitMatteImageProcessor,iT=$.VitMattePreTrainedModel,aT=$.VitPoseForPoseEstimation,oT=$.VitPoseImageProcessor,sT=$.VitPosePreTrainedModel,cT=$.VitsModel,lT=$.VitsModelOutput,uT=$.VitsPreTrainedModel,dT=$.VitsTokenizer,fT=$.Wav2Vec2BertForCTC,pT=$.Wav2Vec2BertForSequenceClassification,mT=$.Wav2Vec2BertModel,hT=$.Wav2Vec2BertPreTrainedModel,gT=$.Wav2Vec2CTCTokenizer,_T=$.Wav2Vec2FeatureExtractor,vT=$.Wav2Vec2ForAudioFrameClassification,yT=$.Wav2Vec2ForCTC,bT=$.Wav2Vec2ForSequenceClassification,xT=$.Wav2Vec2Model,ST=$.Wav2Vec2PreTrainedModel,CT=$.Wav2Vec2Processor,wT=$.Wav2Vec2ProcessorWithLM,TT=$.WavLMForAudioFrameClassification,ET=$.WavLMForCTC,DT=$.WavLMForSequenceClassification,OT=$.WavLMForXVector,kT=$.WavLMModel,AT=$.WavLMPreTrainedModel,jT=$.WeSpeakerFeatureExtractor,MT=$.WeSpeakerResNetModel,NT=$.WeSpeakerResNetPreTrainedModel,PT=$.WhisperFeatureExtractor,FT=$.WhisperForConditionalGeneration,IT=$.WhisperModel,LT=$.WhisperPreTrainedModel,RT=$.WhisperProcessor,zT=$.WhisperTextStreamer,BT=$.WhisperTimeStampLogitsProcessor,VT=$.WhisperTokenizer,HT=$.XLMForQuestionAnswering,UT=$.XLMForSequenceClassification,WT=$.XLMForTokenClassification,GT=$.XLMModel,KT=$.XLMPreTrainedModel,qT=$.XLMRobertaForMaskedLM,JT=$.XLMRobertaForQuestionAnswering,YT=$.XLMRobertaForSequenceClassification,XT=$.XLMRobertaForTokenClassification,ZT=$.XLMRobertaModel,QT=$.XLMRobertaPreTrainedModel,$T=$.XLMRobertaTokenizer,eE=$.XLMTokenizer,tE=$.XLMWithLMHeadModel,nE=$.XVectorOutput,rE=$.YolosFeatureExtractor,iE=$.YolosForObjectDetection,aE=$.YolosImageProcessor,oE=$.YolosModel,sE=$.YolosObjectDetectionOutput,cE=$.YolosPreTrainedModel,lE=$.ZeroShotAudioClassificationPipeline,uE=$.ZeroShotClassificationPipeline,dE=$.ZeroShotImageClassificationPipeline,fE=$.ZeroShotObjectDetectionPipeline,pE=$.bankers_round,mE=$.cat,hE=$.cos_sim,gE=$.dot,_E=$.dynamic_time_warping,vE=$.env,yE=$.full,bE=$.full_like,xE=$.getKeyValueShapes,SE=$.hamming,CE=$.hanning,wE=$.interpolate,TE=$.interpolate_4d,EE=$.interpolate_data,DE=$.is_chinese_char,OE=$.layer_norm,kE=$.load_image,AE=$.load_video,jE=$.log_softmax,ME=$.magnitude,NE=$.matmul,PE=$.max,FE=$.mean,IE=$.mean_pooling,LE=$.medianFilter,RE=$.mel_filter_bank,zE=$.min,BE=$.ones,VE=$.ones_like,HE=$.permute,UE=$.permute_data,WE=$.pipeline,GE=$.quantize_embeddings,KE=$.rand,qE=$.read_audio,JE=$.rfft,YE=$.round,XE=$.slice,ZE=$.softmax,QE=$.spectrogram,$E=$.stack,eD=$.std_mean,tD=$.topk,nD=$.window_function,rD=$.zeros,iD=$.zeros_like;export{ep as b,Cf as c,_w as d,vE as e,ES as f}; \ No newline at end of file diff --git a/assets/valibot-CbgwcZn_-CLR2GVm1.js b/assets/valibot-CbgwcZn_-CzuPOF44.js similarity index 69% rename from assets/valibot-CbgwcZn_-CLR2GVm1.js rename to assets/valibot-CbgwcZn_-CzuPOF44.js index ba7049242e9d729e39ab02c13413c798f0308b49..aec3a09ac3ff870b610c07f5130a22f55a1f972c 100644 --- a/assets/valibot-CbgwcZn_-CLR2GVm1.js +++ b/assets/valibot-CbgwcZn_-CzuPOF44.js @@ -1 +1 @@ -import{O as e,aR as t}from"./index-BFym949y.js";const n=async()=>{let{toJsonSchema:n}=await e(t(()=>import(`./dist-CshDQrOa.js`),[]),`@valibot/to-json-schema`);return e=>n(e)};export{n as getToJsonSchemaFn}; \ No newline at end of file +import{O as e,aR as t}from"./index-J3uhnpYL.js";const n=async()=>{let{toJsonSchema:n}=await e(t(()=>import(`./dist-CshDQrOa.js`),[]),`@valibot/to-json-schema`);return e=>n(e)};export{n as getToJsonSchemaFn}; \ No newline at end of file diff --git a/assets/vibrant-BnHhPWZj.js b/assets/vibrant-BnHhPWZj.js deleted file mode 100644 index 6b1dc36bb111c645789ace222a25d026ca844feb..0000000000000000000000000000000000000000 --- a/assets/vibrant-BnHhPWZj.js +++ /dev/null @@ -1 +0,0 @@ -import{b as e}from"./InputFile-BA4DYXXI.js";import{bA as t,bB as n,bD as r,bM as i,bP as a,bQ as o,bS as s,bU as c,bX as l,b_ as u,by as d,c0 as f,c1 as p}from"./index-BFym949y.js";import{b as m}from"./browser-UfbE_1lV.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=a({__name:`vibrant`,setup(a){let x=l([]),S=l(),C=l([]),w=l([]);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 d(x,e=>{T(e[0])},{deep:!0}),(a,l)=>(t(),s(`div`,h,[n(`div`,g,[(t(!0),s(i,null,r(C.value,(e,n)=>(t(),s(`div`,{key:n,style:f({backgroundColor:e}),"size-20":``,"rounded-full":``},null,4))),128))]),n(`div`,_,p(w.value),1),n(`div`,v,[c(u(e),{modelValue:x.value,"onUpdate:modelValue":l[0]||=e=>x.value=e,"h-60":``,"w-full":``},null,8,[`modelValue`])]),n(`div`,y,[S.value?(t(),s(`img`,{key:0,src:S.value.src,"h-full":``,"w-full":``,"object-contain":``},null,8,b)):o(``,!0)])]))}}),S=x;export{S as default}; \ No newline at end of file diff --git a/assets/vibrant-D7XJhUFd.js b/assets/vibrant-D7XJhUFd.js new file mode 100644 index 0000000000000000000000000000000000000000..9049f15f46be6ef360f20bb5657fb5777a6094ab --- /dev/null +++ b/assets/vibrant-D7XJhUFd.js @@ -0,0 +1 @@ +import{b as e}from"./InputFile-DYGPp1hR.js";import{b$ as t,bG as n,bJ as r,bK as i,bM as a,bO as o,bQ as s,bT as c,bU as l,bX as u,b_ as d,bx as f,c0 as p}from"./index-J3uhnpYL.js";import{b as m}from"./browser-UfbE_1lV.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=r({__name:`vibrant`,setup(r){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 s(x,e=>{T(e[0])},{deep:!0}),(r,s)=>(c(),a(`div`,h,[l(`div`,g,[(c(!0),a(n,null,f(C.value,(e,n)=>(c(),a(`div`,{key:n,style:t({backgroundColor:e}),"size-20":``,"rounded-full":``},null,4))),128))]),l(`div`,_,p(w.value),1),l(`div`,v,[o(d(e),{modelValue:x.value,"onUpdate:modelValue":s[0]||=e=>x.value=e,"h-60":``,"w-full":``},null,8,[`modelValue`])]),l(`div`,y,[S.value?(c(),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-CYOv3NuR.js b/assets/volcengine-CYOv3NuR.js new file mode 100644 index 0000000000000000000000000000000000000000..189ed15e07701e306f6a41d40c9dd577d4294845 --- /dev/null +++ b/assets/volcengine-CYOv3NuR.js @@ -0,0 +1 @@ +import{G as e,J as t,L as n,aS as r,au as i,aw as a,bA as o,bE as s,bH as c,bJ as l,bL as u,bO as d,bQ as f,bT as p,bU as m,bX as h,b_ as g,r as _,s as v}from"./index-J3uhnpYL.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b={flex:`~ col gap-4`},x=`volcengine`,S=`v1`;var C=l({__name:`volcengine`,setup(l){let y=h(1),C=e(),w=t(),{providers:T}=r(w),{t:E}=n(),D=c({get:()=>(T.value[x]?.app)?.appId||``,set:e=>{T.value[x]||(T.value[x]={}),T.value[x].app={appId:e}}}),O=c(()=>!!T.value[x]?.apiKey),k=c(()=>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 s(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,t)=>(p(),o(g(_),{"provider-id":x,"default-model":S},{"basic-settings":u(()=>[m(`div`,b,[d(g(a),{modelValue:D.value,"onUpdate:modelValue":t[0]||=e=>D.value=e,label:g(E)(`settings.pages.providers.provider.volcengine.fields.field.appId.label`),description:g(E)(`settings.pages.providers.provider.volcengine.fields.field.appId.description`),required:``},null,8,[`modelValue`,`label`,`description`])])]),"voice-settings":u(()=>[d(g(i),{modelValue:y.value,"onUpdate:modelValue":t[1]||=e=>y.value=e,label:g(E)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:g(E)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:2,step:.01},null,8,[`modelValue`,`label`,`description`])]),playground:u(()=>[d(g(v),{"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/volcengine-DGc8MHu2.js b/assets/volcengine-DGc8MHu2.js deleted file mode 100644 index 156d4b997db53f27246e94e4401bcf7822c30e01..0000000000000000000000000000000000000000 --- a/assets/volcengine-DGc8MHu2.js +++ /dev/null @@ -1 +0,0 @@ -import{G as e,J as t,L as n,aS as r,au as i,aw as a,bA as o,bB as s,bG as c,bK as l,bN as u,bP as d,bR as f,bU as p,bX as m,b_ as h,by as g,r as _,s as v}from"./index-BFym949y.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b={flex:`~ col gap-4`},x=`volcengine`,S=`v1`;var C=d({__name:`volcengine`,setup(d){let y=m(1),C=e(),w=t(),{providers:T}=r(w),{t:E}=n(),D=u({get:()=>(T.value[x]?.app)?.appId||``,set:e=>{T.value[x]||(T.value[x]={}),T.value[x].app={appId:e}}}),O=u(()=>!!T.value[x]?.apiKey),k=u(()=>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 l(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)}),g(y,async()=>{let e=w.getProviderConfig(x);e.audio||={},e.audio.speedRatio=y.value}),g([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,t)=>(o(),c(h(_),{"provider-id":x,"default-model":S},{"basic-settings":f(()=>[s(`div`,b,[p(h(a),{modelValue:D.value,"onUpdate:modelValue":t[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":f(()=>[p(h(i),{modelValue:y.value,"onUpdate:modelValue":t[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:f(()=>[p(h(v),{"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/worker-Bv82ofgX.js b/assets/worker-FPXhib_8.js similarity index 55% rename from assets/worker-Bv82ofgX.js rename to assets/worker-FPXhib_8.js index 05275f8b3284cba1040431f2c825942f3b597777..497e0a401d94df4542d33a8e65e29a8daf82412f 100644 --- a/assets/worker-Bv82ofgX.js +++ b/assets/worker-FPXhib_8.js @@ -1,21 +1,21 @@ -(function(){var e=Object.defineProperty,t=(t,n)=>{for(var r in n)e(t,r,{get:n[r],enumerable:!0})};let 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`,c=`warning`,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});let 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`]]),x=!1,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)}};let 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}};let te=ee;var ne={};t(ne,{InferenceSession:()=>te,TRACE:()=>D,TRACE_FUNC_BEGIN:()=>k,TRACE_FUNC_END:()=>A,Tensor:()=>E,env:()=>u,registerBackend:()=>i});var j={};t(j,{InferenceSession:()=>Ke,TRACE:()=>z,TRACE_FUNC_BEGIN:()=>He,TRACE_FUNC_END:()=>B,Tensor:()=>ze,default:()=>rf,env:()=>L,registerBackend:()=>P}); +(function(){var e=Object.defineProperty,t=(t,n)=>{for(var r in n)e(t,r,{get:n[r],enumerable:!0})};let 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`,c=`warning`,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});let 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`]]),x=!1,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)}};let 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}};let te=ee;var ne={};t(ne,{InferenceSession:()=>te,TRACE:()=>D,TRACE_FUNC_BEGIN:()=>k,TRACE_FUNC_END:()=>A,Tensor:()=>E,env:()=>u,registerBackend:()=>i});var j={};t(j,{InferenceSession:()=>We,TRACE:()=>V,TRACE_FUNC_BEGIN:()=>Be,TRACE_FUNC_END:()=>H,Tensor:()=>Le,default:()=>rf,env:()=>R,registerBackend:()=>fe}); /*! * ONNX Runtime Web v1.22.0-dev.20250409-89f8206ba4 * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. */ -var re=Object.defineProperty,ie=Object.getOwnPropertyDescriptor,ae=Object.getOwnPropertyNames,oe=Object.prototype.hasOwnProperty,se=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error(`Dynamic require of "`+e+`" is not supported`)}),M=(e,t)=>()=>(e&&(t=e(e=0)),t),N=(e,t)=>{for(var n in t)re(e,n,{get:t[n],enumerable:!0})},ce=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of ae(t))!oe.call(e,i)&&i!==n&&re(e,i,{get:()=>t[i],enumerable:!(r=ie(t,i))||r.enumerable});return e},le=e=>ce(re({},`__esModule`,{value:!0}),e),ue,de,P,F,fe,I=M(()=>{"use strict";ue=new Map,de=[],P=(e,t,n)=>{if(t&&typeof t.init==`function`&&typeof t.createInferenceSessionHandler==`function`){let r=ue.get(e);if(r===void 0)ue.set(e,{backend:t,priority:n});else{if(r.priority>n)return;if(r.priority===n&&r.backend!==t)throw Error(`cannot register backend "${e}" using priority ${n}`)}if(n>=0){let t=de.indexOf(e);t!==-1&&de.splice(t,1);for(let t=0;t{let t=ue.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}}},fe=async e=>{let t=e.executionProviders||[],n=t.map(e=>typeof e==`string`?e:e.name),r=n.length===0?de:n,i,a=[],o=new Set;for(let e of r){let t=await F(e);typeof t==`string`?a.push({name:e,err:t}):(i||=t,i===t&&o.add(e))}if(!i)throw Error(`no available backend found. ERR: ${a.map(e=>`[${e.name}] ${e.err}`).join(`, `)}`);for(let{name:e,err:t}of a)n.includes(e)&&console.warn(`removing requested execution provider "${e}" from session options because it is not available: ${t}`);let s=t.filter(e=>o.has(typeof e==`string`?e:e.name));return[i,new Proxy(e,{get:(e,t)=>t===`executionProviders`?s:Reflect.get(e,t)})]}}),pe=M(()=>{"use strict";I()}),me,he=M(()=>{"use strict";me=`1.22.0-dev.20250409-89f8206ba4`}),ge,_e,ve=M(()=>{"use strict";he(),ge=`warning`,_e={wasm:{},webgl:{},webgpu:{},versions:{common:me},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}`);ge=e}},get logLevel(){return ge}},Object.defineProperty(_e,`logLevel`,{enumerable:!0})}),L,ye=M(()=>{"use strict";ve(),L=_e}),be,xe,Se=M(()=>{"use strict";be=(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?t.format:`RGB`,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{"use strict";Re(),Ce=(e,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?t.tensorFormat:`RGB`,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,Ce(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(Ce(e.data,s))}});throw Error(`Input data provided is not supported - aborted tensor creation`)}if(o!==void 0)return Ce(o,s);throw Error(`Input data provided is not supported - aborted tensor creation`)},Te=(e,t)=>{let{width:n,height:r,download:i,dispose:a}=t,o=[1,r,n,4];return new Le({location:`texture`,type:`float32`,texture:e,dims:o,download:i,dispose:a})},Ee=(e,t)=>{let{dataType:n,dims:r,download:i,dispose:a}=t;return new Le({location:`gpu-buffer`,type:n??`float32`,gpuBuffer:e,dims:r,download:i,dispose:a})},De=(e,t)=>{let{dataType:n,dims:r,download:i,dispose:a}=t;return new Le({location:`ml-tensor`,type:n??`float32`,mlTensor:e,dims:r,download:i,dispose:a})},Oe=(e,t,n)=>new Le({location:`cpu-pinned`,type:e,data:t,dims:n??[t.length]})}),Ae,je,Me,Ne,R=M(()=>{"use strict";Ae=new Map([[`float32`,Float32Array],[`uint8`,Uint8Array],[`int8`,Int8Array],[`uint16`,Uint16Array],[`int16`,Int16Array],[`int32`,Int32Array],[`bool`,Uint8Array],[`float64`,Float64Array],[`uint32`,Uint32Array],[`int4`,Uint8Array],[`uint4`,Uint8Array]]),je=new Map([[Float32Array,`float32`],[Uint8Array,`uint8`],[Int8Array,`int8`],[Uint16Array,`uint16`],[Int16Array,`int16`],[Int32Array,`int32`],[Float64Array,`float64`],[Uint32Array,`uint32`]]),Me=!1,Ne=()=>{if(!Me){Me=!0;let e=typeof BigInt64Array<`u`&&BigInt64Array.from,t=typeof BigUint64Array<`u`&&BigUint64Array.from,n=globalThis.Float16Array,r=typeof n<`u`&&n.from;e&&(Ae.set(`int64`,BigInt64Array),je.set(BigInt64Array,`int64`)),t&&(Ae.set(`uint64`,BigUint64Array),je.set(BigUint64Array,`uint64`)),r?(Ae.set(`float16`,n),je.set(n,`float16`)):Ae.set(`float16`,Uint16Array)}}}),Pe,Fe,Ie=M(()=>{"use strict";Re(),Pe=e=>{let t=1;for(let n=0;n{switch(e.location){case`cpu`:return new Le(e.type,e.data,t);case`cpu-pinned`:return new Le({location:`cpu-pinned`,data:e.data,type:e.type,dims:t});case`texture`:return new Le({location:`texture`,texture:e.texture,type:e.type,dims:t});case`gpu-buffer`:return new Le({location:`gpu-buffer`,gpuBuffer:e.gpuBuffer,type:e.type,dims:t});case`ml-tensor`:return new Le({location:`ml-tensor`,mlTensor:e.mlTensor,type:e.type,dims:t});default:throw Error(`tensorReshape: tensor location ${e.location} is not supported`)}}}),Le,Re=M(()=>{"use strict";Se(),ke(),R(),Ie(),Le=class{constructor(e,t,n){Ne();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=Ae.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=Ae.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=je.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=Pe(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 we(e,t)}static fromTexture(e,t){return Te(e,t)}static fromGpuBuffer(e,t){return Ee(e,t)}static fromMLTensor(e,t){return De(e,t)}static fromPinnedBuffer(e,t,n){return Oe(e,t,n)}toDataURL(e){return be(this,e)}toImageData(e){return xe(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 Fe(this,e)}}}),ze,Be=M(()=>{"use strict";Re(),ze=Le}),z,Ve,He,B,Ue=M(()=>{"use strict";ve(),z=(e,t)=>{(typeof _e.trace>`u`?!_e.wasm.trace:!_e.trace)||console.timeStamp(`${e}::ORT::${t}`)},Ve=(e,t)=>{let n=Error().stack?.split(/\r\n|\r|\n/g)||[],r=!1;for(let i=0;i{(typeof _e.trace>`u`?!_e.wasm.trace:!_e.trace)||Ve(`BEGIN`,e)},B=e=>{(typeof _e.trace>`u`?!_e.wasm.trace:!_e.trace)||Ve(`END`,e)}}),We,Ge=M(()=>{"use strict";I(),Be(),Ue(),We=class e{constructor(e){this.handler=e}async run(e,t,n){He();let r={},i={};if(typeof e!=`object`||!e||e instanceof ze||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 ze)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(typeof n<`u`)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 ze)&&(e=!0,a=!1,r[n]=i)}if(e){if(typeof n==`object`&&n)i=n;else if(typeof n<`u`)throw TypeError(`'options' must be an object.`)}else i=t}}else if(typeof t<`u`)throw TypeError(`Unexpected argument[1]: must be 'fetches' or 'options'.`);for(let t of this.inputNames)if(typeof e[t]>`u`)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 ze?s[e]=t:s[e]=new ze(t.type,t.data,t.dims)}return B(),s}async release(){return this.handler.dispose()}static async create(t,n,r,i){He();let a,o={};if(typeof t==`string`){if(a=t,typeof n==`object`&&n)o=n;else if(typeof n<`u`)throw TypeError(`'options' must be an object.`)}else if(t instanceof Uint8Array){if(a=t,typeof n==`object`&&n)o=n;else if(typeof n<`u`)throw TypeError(`'options' must be an object.`)}else if(t instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&t instanceof SharedArrayBuffer){let e=t,s=0,c=t.byteLength;if(typeof n==`object`&&n)o=n;else if(typeof n==`number`){if(s=n,!Number.isSafeInteger(s))throw RangeError(`'byteOffset' must be an integer.`);if(s<0||s>=e.byteLength)throw RangeError(`'byteOffset' is out of range [0, ${e.byteLength}).`);if(c=t.byteLength-s,typeof r==`number`){if(c=r,!Number.isSafeInteger(c))throw RangeError(`'byteLength' must be an integer.`);if(c<=0||s+c>e.byteLength)throw RangeError(`'byteLength' is out of range (0, ${e.byteLength-s}].`);if(typeof i==`object`&&i)o=i;else if(typeof i<`u`)throw TypeError(`'options' must be an object.`)}else if(typeof r<`u`)throw TypeError(`'byteLength' must be a number.`)}else if(typeof n<`u`)throw TypeError(`'options' must be an object.`);a=new Uint8Array(e,s,c)}else throw TypeError(`Unexpected argument[0]: must be 'path' or 'buffer'.`);let[s,c]=await fe(o),l=await s.createInferenceSessionHandler(a,c);return B(),new e(l)}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}}}),Ke,qe=M(()=>{"use strict";Ge(),Ke=We}),Je=M(()=>{"use strict";}),Ye=M(()=>{"use strict";}),Xe=M(()=>{"use strict";}),Ze=M(()=>{"use strict";}),Qe={};N(Qe,{InferenceSession:()=>Ke,TRACE:()=>z,TRACE_FUNC_BEGIN:()=>He,TRACE_FUNC_END:()=>B,Tensor:()=>ze,env:()=>L,registerBackend:()=>P});var $e=M(()=>{"use strict";pe(),ye(),qe(),Be(),Je(),Ye(),Ue(),Xe(),Ze()}),et=M(()=>{"use strict";}),tt={};N(tt,{default:()=>it});var nt,rt,it,at=M(()=>{"use strict";Dd(),It(),Et(),nt=`ort-wasm-proxy-worker`,rt=globalThis.self?.name===nt,rt&&(self.onmessage=e=>{let{type:t,in:n}=e.data;try{switch(t){case`init-wasm`:Pt(n.wasm).then(()=>{hd(n).then(()=>{postMessage({type:t})},e=>{postMessage({type:t,err:e})})},e=>{postMessage({type:t,err:e})});break;case`init-ep`:{let{epName:e,env:r}=n;gd(r,e).then(()=>{postMessage({type:t})},e=>{postMessage({type:t,err:e})});break}case`copy-from`:{let{buffer:e}=n,r=bd(e);postMessage({type:t,out:r});break}case`create`:{let{model:e,options:r}=n;xd(e,r).then(e=>{postMessage({type:t,out:e})},e=>{postMessage({type:t,err:e})});break}case`release`:Sd(n),postMessage({type:t});break;case`run`:{let{sessionId:e,inputIndices:r,inputs:i,outputIndices:a,options:o}=n;wd(e,r,i,a,Array(a.length).fill(null),o).then(e=>{e.some(e=>e[3]!==`cpu`)?postMessage({type:t,err:`Proxy does not support non-cpu tensor location.`}):postMessage({type:t,out:e},Ed([...i,...e]))},e=>{postMessage({type:t,err:e})});break}case`end-profiling`:Td(n),postMessage({type:t});break;default:}}catch(e){postMessage({type:t,err:e})}}),it=rt?null:e=>new Worker(e??ht,{type:`module`,name:nt})}),ot={};N(ot,{default:()=>lt});var st,ct,lt,ut,dt=M(()=>{"use strict";ct=(st=self.location.href,async function(e={}){var t,n,r=e,i=new Promise((e,r)=>{t=e,n=r}),a=typeof window==`object`,o=typeof WorkerGlobalScope<`u`,s=o&&self.name?.startsWith(`em-pthread`);r.mountExternalData=(e,t)=>{e.startsWith(`./`)&&(e=e.substring(2)),(r.Eb||=new Map).set(e,t)},r.unmountExternalData=()=>{delete r.Eb};var c=globalThis.SharedArrayBuffer??new WebAssembly.Memory({initial:0,maximum:0,pc:!0}).buffer.constructor;let l=e=>async(...t)=>{try{if(r.Fb)throw Error(`Session already started`);let n=r.Fb={dc:t[0],errors:[]},i=await e(...t);if(r.Fb!==n)throw Error(`Session mismatch`);r.Jb?.flush();let a=n.errors;if(0e),0{if(e===`webgpu`){[r.Jb,r.Ub,r.Yb,r.Kb,r.Xb,r.jb,r.Zb,r.ac,r.Vb,r.Wb,r.$b]=t;let e=r.Jb;r.jsepRegisterBuffer=(t,n,r,i)=>e.registerBuffer(t,n,r,i),r.jsepGetBuffer=t=>e.getBuffer(t),r.jsepCreateDownloader=(t,n,r)=>e.createDownloader(t,n,r),r.jsepOnCreateSession=t=>{e.onCreateSession(t)},r.jsepOnReleaseSession=t=>{e.onReleaseSession(t)},r.jsepOnRunStart=t=>e.onRunStart(t),r.bc=(t,n)=>{e.upload(t,n)}}else if(e===`webnn`){let e=t[0];[r.nc,r.Nb,r.webnnEnsureTensor,r.Ob,r.webnnDownloadTensor]=t.slice(1),r.webnnReleaseTensorId=r.Nb,r.webnnUploadTensor=r.Ob,r.webnnOnRunStart=t=>e.onRunStart(t),r.webnnOnRunEnd=e.onRunEnd.bind(e),r.webnnRegisterMLContext=(t,n)=>{e.registerMLContext(t,n)},r.webnnOnReleaseSession=t=>{e.onReleaseSession(t)},r.webnnCreateMLTensorDownloader=(t,n)=>e.createMLTensorDownloader(t,n),r.webnnRegisterMLTensor=(t,n,r,i)=>e.registerMLTensor(t,n,r,i),r.webnnCreateMLContext=t=>e.createMLContext(t),r.webnnRegisterMLConstant=(t,n,i,a,o,s)=>e.registerMLConstant(t,n,i,a,o,r.Eb,s),r.webnnRegisterGraphInput=e.registerGraphInput.bind(e),r.webnnIsGraphInput=e.isGraphInput.bind(e),r.webnnCreateTemporaryTensor=e.createTemporaryTensor.bind(e),r.webnnIsInt64Supported=e.isInt64Supported.bind(e)}};let u=()=>{let e=(e,t,n)=>(...r)=>{let i=tn,a=t?.();r=e(...r);let o=t?.();return a!==o&&(e=o,n(a),t=n=null),tn==i?r:new Promise((e,t)=>{sn={resolve:e,reject:t}})};(()=>{for(let t of[`_OrtAppendExecutionProvider`,`_OrtCreateSession`,`_OrtRun`,`_OrtRunWithBinding`,`_OrtBindInput`])r[t]=e(r[t],()=>r[t],e=>r[t]=e)})(),l!==void 0&&(r._OrtRun=l(r._OrtRun),r._OrtRunWithBinding=l(r._OrtRunWithBinding)),u=void 0};r.asyncInit=()=>{u?.()};var d,f,p=Object.assign({},r),m=(e,t)=>{throw t},h=``;(a||o)&&(o?h=self.location.href:typeof document<`u`&&document.currentScript&&(h=document.currentScript.src),st&&(h=st),h=h.startsWith(`blob:`)?``:h.slice(0,h.replace(/[?#].*/,``).lastIndexOf(`/`)+1),o&&(f=e=>{var t=new XMLHttpRequest;return t.open(`GET`,e,!1),t.responseType=`arraybuffer`,t.send(null),new Uint8Array(t.response)}),d=async e=>{if(re(e))return new Promise((t,n)=>{var r=new XMLHttpRequest;r.open(`GET`,e,!0),r.responseType=`arraybuffer`,r.onload=()=>{r.status==200||r.status==0&&r.response?t(r.response):n(r.status)},r.onerror=n,r.send(null)});var t=await fetch(e,{credentials:`same-origin`});if(t.ok)return t.arrayBuffer();throw Error(t.status+` : `+t.url)});var g=console.log.bind(console),_=console.error.bind(console),v=g,y=_;Object.assign(r,p),p=null;var b,x,S,C,w,T,E,D,O,k,A,ee,te,ne=r.wasmBinary,j=!1,re=e=>e.startsWith(`file://`);function ie(){return b.buffer!=C.buffer&&F(),C}function ae(){return b.buffer!=C.buffer&&F(),w}function oe(){return b.buffer!=C.buffer&&F(),T}function se(){return b.buffer!=C.buffer&&F(),E}function M(){return b.buffer!=C.buffer&&F(),D}function N(){return b.buffer!=C.buffer&&F(),O}function ce(){return b.buffer!=C.buffer&&F(),k}function le(){return b.buffer!=C.buffer&&F(),te}if(s){let e=function(t){try{var n=t.data,i=n.Bb;if(i===`load`){let t=[];self.onmessage=e=>t.push(e),self.startWorker=()=>{postMessage({Bb:`loaded`});for(let n of t)e(n);self.onmessage=e};for(let e of n.Rb)r[e]&&!r[e].proxy||(r[e]=(...t)=>{postMessage({Bb:`callHandler`,Qb:e,args:t})},e==`print`&&(v=r[e]),e==`printErr`&&(y=r[e]));b=n.kc,F(),de(n.lc)}else if(i===`run`){Ie(n.Ab),yr(n.Ab,0,0,1,0,0),R(),Vt(n.Ab),P||(hr(),P=!0);try{Le(n.fc,n.Hb)}catch(e){if(e!=`unwind`)throw e}}else n.target!==`setimmediate`&&(i===`checkMailbox`?P&&Ht():i&&(y(`worker: received unknown command ${i}`),y(n)))}catch(e){throw br(),e}};var ue=e,de,P=!1;y=function(...e){e=e.join(` `),console.error(e)},self.alert=function(...e){postMessage({Bb:`alert`,text:e.join(` `),ic:gr()})},self.onunhandledrejection=e=>{throw e.reason||e},self.onmessage=e}function F(){var e=b.buffer;r.HEAP8=C=new Int8Array(e),r.HEAP16=T=new Int16Array(e),r.HEAPU8=w=new Uint8Array(e),r.HEAPU16=E=new Uint16Array(e),r.HEAP32=D=new Int32Array(e),r.HEAPU32=O=new Uint32Array(e),r.HEAPF32=k=new Float32Array(e),r.HEAPF64=te=new Float64Array(e),r.HEAP64=A=new BigInt64Array(e),r.HEAPU64=ee=new BigUint64Array(e)}function fe(){s?startWorker(r):X.Ca()}s||(b=new WebAssembly.Memory({initial:256,maximum:65536,shared:!0}),F());var I,pe=0,me=null;function he(){if(--pe==0&&me){var e=me;me=null,e()}}function ge(e){throw y(e=`Aborted(`+e+`)`),j=!0,e=new WebAssembly.RuntimeError(e+`. Build with -sASSERTIONS for more info.`),n(e),e}function _e(){return{a:{L:ye,Aa:L,b:ze,$:z,A:Ue,pa:We,X:qe,Z:Je,qa:Ye,na:Xe,ga:Ze,ma:Qe,J:$e,Y:et,V:tt,oa:nt,W:rt,va:ot,E:mt,Q:gt,O:wt,D:Et,u:Dt,r:Ot,P:kt,z:Lt,R:Rt,ja:zt,T:Ut,aa:Gt,M:Kt,F:qt,ia:Vt,sa:Jt,t:Zt,Ba:Qt,w:un,o:fn,l:mn,c:yt,n:U,j:yn,v:W,p:bn,f:xn,s:Sn,m:Cn,e:wn,k:Tn,i:En,g:Dn,d:On,da:kn,ea:Nn,fa:Pn,ba:Fn,ca:In,N:zn,xa:Bn,ua:Un,h:Kn,C:qn,G:Jn,ta:Vn,x:Yn,ra:Xn,U:Zn,q:Rn,y:Qn,K:$n,S:er,za:rr,ya:ir,ka:J,la:or,_:Oe,B:sr,I:cr,ha:lr,H:ur,a:b,wa:Ee}}}var ve={829644:(e,t,n,i,a)=>{if(r===void 0||!r.Eb)return 1;if((e=B(Number(e>>>0))).startsWith(`./`)&&(e=e.substring(2)),!(e=r.Eb.get(e)))return 2;if(t=Number(t>>>0),n=Number(n>>>0),i=Number(i>>>0),t+n>e.byteLength)return 3;try{let o=e.subarray(t,t+n);switch(a){case 0:ae().set(o,i>>>0);break;case 1:r.mc?r.mc(i,o):r.bc(i,o);break;default:return 4}return 0}catch{return 4}},830468:(e,t,n)=>{r.Ob(e,ae().subarray(t>>>0,t+n>>>0))},830532:()=>r.nc(),830574:e=>{r.Nb(e)},830611:()=>{r.Vb()},830642:()=>{r.Wb()},830671:()=>{r.$b()},830696:e=>r.Ub(e),830729:e=>r.Yb(e),830761:(e,t,n)=>{r.Kb(Number(e),Number(t),Number(n),!0)},830824:(e,t,n)=>{r.Kb(Number(e),Number(t),Number(n))},830881:()=>typeof wasmOffsetConverter<`u`,830938:e=>{r.jb(`Abs`,e,void 0)},830989:e=>{r.jb(`Neg`,e,void 0)},831040:e=>{r.jb(`Floor`,e,void 0)},831093:e=>{r.jb(`Ceil`,e,void 0)},831145:e=>{r.jb(`Reciprocal`,e,void 0)},831203:e=>{r.jb(`Sqrt`,e,void 0)},831255:e=>{r.jb(`Exp`,e,void 0)},831306:e=>{r.jb(`Erf`,e,void 0)},831357:e=>{r.jb(`Sigmoid`,e,void 0)},831412:(e,t,n)=>{r.jb(`HardSigmoid`,e,{alpha:t,beta:n})},831491:e=>{r.jb(`Log`,e,void 0)},831542:e=>{r.jb(`Sin`,e,void 0)},831593:e=>{r.jb(`Cos`,e,void 0)},831644:e=>{r.jb(`Tan`,e,void 0)},831695:e=>{r.jb(`Asin`,e,void 0)},831747:e=>{r.jb(`Acos`,e,void 0)},831799:e=>{r.jb(`Atan`,e,void 0)},831851:e=>{r.jb(`Sinh`,e,void 0)},831903:e=>{r.jb(`Cosh`,e,void 0)},831955:e=>{r.jb(`Asinh`,e,void 0)},832008:e=>{r.jb(`Acosh`,e,void 0)},832061:e=>{r.jb(`Atanh`,e,void 0)},832114:e=>{r.jb(`Tanh`,e,void 0)},832166:e=>{r.jb(`Not`,e,void 0)},832217:(e,t,n)=>{r.jb(`Clip`,e,{min:t,max:n})},832286:e=>{r.jb(`Clip`,e,void 0)},832338:(e,t)=>{r.jb(`Elu`,e,{alpha:t})},832396:e=>{r.jb(`Gelu`,e,void 0)},832448:e=>{r.jb(`Relu`,e,void 0)},832500:(e,t)=>{r.jb(`LeakyRelu`,e,{alpha:t})},832564:(e,t)=>{r.jb(`ThresholdedRelu`,e,{alpha:t})},832634:(e,t)=>{r.jb(`Cast`,e,{to:t})},832692:e=>{r.jb(`Add`,e,void 0)},832743:e=>{r.jb(`Sub`,e,void 0)},832794:e=>{r.jb(`Mul`,e,void 0)},832845:e=>{r.jb(`Div`,e,void 0)},832896:e=>{r.jb(`Pow`,e,void 0)},832947:e=>{r.jb(`Equal`,e,void 0)},833e3:e=>{r.jb(`Greater`,e,void 0)},833055:e=>{r.jb(`GreaterOrEqual`,e,void 0)},833117:e=>{r.jb(`Less`,e,void 0)},833169:e=>{r.jb(`LessOrEqual`,e,void 0)},833228:(e,t,n,i,a)=>{r.jb(`ReduceMean`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},833403:(e,t,n,i,a)=>{r.jb(`ReduceMax`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},833577:(e,t,n,i,a)=>{r.jb(`ReduceMin`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},833751:(e,t,n,i,a)=>{r.jb(`ReduceProd`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},833926:(e,t,n,i,a)=>{r.jb(`ReduceSum`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},834100:(e,t,n,i,a)=>{r.jb(`ReduceL1`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},834273:(e,t,n,i,a)=>{r.jb(`ReduceL2`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},834446:(e,t,n,i,a)=>{r.jb(`ReduceLogSum`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},834623:(e,t,n,i,a)=>{r.jb(`ReduceSumSquare`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},834803:(e,t,n,i,a)=>{r.jb(`ReduceLogSumExp`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},834983:e=>{r.jb(`Where`,e,void 0)},835036:(e,t,n)=>{r.jb(`Transpose`,e,{perm:t?Array.from(M().subarray(Number(t)>>>0,Number(n)>>>0)):[]})},835160:(e,t,n,i)=>{r.jb(`DepthToSpace`,e,{blocksize:t,mode:B(n),format:i?`NHWC`:`NCHW`})},835293:(e,t,n,i)=>{r.jb(`DepthToSpace`,e,{blocksize:t,mode:B(n),format:i?`NHWC`:`NCHW`})},835426:(e,t,n,i,a,o,s,c,l,u,d,f,p,m,h)=>{r.jb(`ConvTranspose`,e,{format:l?`NHWC`:`NCHW`,autoPad:t,dilations:[n],group:i,kernelShape:[a],pads:[o,s],strides:[c],wIsConst:()=>!!ie()[u>>>0],outputPadding:d?Array.from(M().subarray(Number(d)>>>0,Number(f)>>>0)):[],outputShape:p?Array.from(M().subarray(Number(p)>>>0,Number(m)>>>0)):[],activation:B(h)})},835859:(e,t,n,i,a,o,s,c,l,u,d,f,p,m)=>{r.jb(`ConvTranspose`,e,{format:c?`NHWC`:`NCHW`,autoPad:t,dilations:Array.from(M().subarray(Number(n)>>>0,2+(Number(n)>>>0)>>>0)),group:i,kernelShape:Array.from(M().subarray(Number(a)>>>0,2+(Number(a)>>>0)>>>0)),pads:Array.from(M().subarray(Number(o)>>>0,4+(Number(o)>>>0)>>>0)),strides:Array.from(M().subarray(Number(s)>>>0,2+(Number(s)>>>0)>>>0)),wIsConst:()=>!!ie()[l>>>0],outputPadding:u?Array.from(M().subarray(Number(u)>>>0,Number(d)>>>0)):[],outputShape:f?Array.from(M().subarray(Number(f)>>>0,Number(p)>>>0)):[],activation:B(m)})},836520:(e,t,n,i,a,o,s,c,l,u,d,f,p,m,h)=>{r.jb(`ConvTranspose`,e,{format:l?`NHWC`:`NCHW`,autoPad:t,dilations:[n],group:i,kernelShape:[a],pads:[o,s],strides:[c],wIsConst:()=>!!ie()[u>>>0],outputPadding:d?Array.from(M().subarray(Number(d)>>>0,Number(f)>>>0)):[],outputShape:p?Array.from(M().subarray(Number(p)>>>0,Number(m)>>>0)):[],activation:B(h)})},836953:(e,t,n,i,a,o,s,c,l,u,d,f,p,m)=>{r.jb(`ConvTranspose`,e,{format:c?`NHWC`:`NCHW`,autoPad:t,dilations:Array.from(M().subarray(Number(n)>>>0,2+(Number(n)>>>0)>>>0)),group:i,kernelShape:Array.from(M().subarray(Number(a)>>>0,2+(Number(a)>>>0)>>>0)),pads:Array.from(M().subarray(Number(o)>>>0,4+(Number(o)>>>0)>>>0)),strides:Array.from(M().subarray(Number(s)>>>0,2+(Number(s)>>>0)>>>0)),wIsConst:()=>!!ie()[l>>>0],outputPadding:u?Array.from(M().subarray(Number(u)>>>0,Number(d)>>>0)):[],outputShape:f?Array.from(M().subarray(Number(f)>>>0,Number(p)>>>0)):[],activation:B(m)})},837614:(e,t)=>{r.jb(`GlobalAveragePool`,e,{format:t?`NHWC`:`NCHW`})},837705:(e,t,n,i,a,o,s,c,l,u,d,f,p,m)=>{r.jb(`AveragePool`,e,{format:m?`NHWC`:`NCHW`,auto_pad:t,ceil_mode:n,count_include_pad:i,storage_order:a,dilations:o?Array.from(M().subarray(Number(o)>>>0,Number(s)>>>0)):[],kernel_shape:c?Array.from(M().subarray(Number(c)>>>0,Number(l)>>>0)):[],pads:u?Array.from(M().subarray(Number(u)>>>0,Number(d)>>>0)):[],strides:f?Array.from(M().subarray(Number(f)>>>0,Number(p)>>>0)):[]})},838184:(e,t)=>{r.jb(`GlobalAveragePool`,e,{format:t?`NHWC`:`NCHW`})},838275:(e,t,n,i,a,o,s,c,l,u,d,f,p,m)=>{r.jb(`AveragePool`,e,{format:m?`NHWC`:`NCHW`,auto_pad:t,ceil_mode:n,count_include_pad:i,storage_order:a,dilations:o?Array.from(M().subarray(Number(o)>>>0,Number(s)>>>0)):[],kernel_shape:c?Array.from(M().subarray(Number(c)>>>0,Number(l)>>>0)):[],pads:u?Array.from(M().subarray(Number(u)>>>0,Number(d)>>>0)):[],strides:f?Array.from(M().subarray(Number(f)>>>0,Number(p)>>>0)):[]})},838754:(e,t)=>{r.jb(`GlobalMaxPool`,e,{format:t?`NHWC`:`NCHW`})},838841:(e,t,n,i,a,o,s,c,l,u,d,f,p,m)=>{r.jb(`MaxPool`,e,{format:m?`NHWC`:`NCHW`,auto_pad:t,ceil_mode:n,count_include_pad:i,storage_order:a,dilations:o?Array.from(M().subarray(Number(o)>>>0,Number(s)>>>0)):[],kernel_shape:c?Array.from(M().subarray(Number(c)>>>0,Number(l)>>>0)):[],pads:u?Array.from(M().subarray(Number(u)>>>0,Number(d)>>>0)):[],strides:f?Array.from(M().subarray(Number(f)>>>0,Number(p)>>>0)):[]})},839316:(e,t)=>{r.jb(`GlobalMaxPool`,e,{format:t?`NHWC`:`NCHW`})},839403:(e,t,n,i,a,o,s,c,l,u,d,f,p,m)=>{r.jb(`MaxPool`,e,{format:m?`NHWC`:`NCHW`,auto_pad:t,ceil_mode:n,count_include_pad:i,storage_order:a,dilations:o?Array.from(M().subarray(Number(o)>>>0,Number(s)>>>0)):[],kernel_shape:c?Array.from(M().subarray(Number(c)>>>0,Number(l)>>>0)):[],pads:u?Array.from(M().subarray(Number(u)>>>0,Number(d)>>>0)):[],strides:f?Array.from(M().subarray(Number(f)>>>0,Number(p)>>>0)):[]})},839878:(e,t,n,i,a)=>{r.jb(`Gemm`,e,{alpha:t,beta:n,transA:i,transB:a})},839982:e=>{r.jb(`MatMul`,e,void 0)},840036:(e,t,n,i)=>{r.jb(`ArgMax`,e,{keepDims:!!t,selectLastIndex:!!n,axis:i})},840144:(e,t,n,i)=>{r.jb(`ArgMin`,e,{keepDims:!!t,selectLastIndex:!!n,axis:i})},840252:(e,t)=>{r.jb(`Softmax`,e,{axis:t})},840315:(e,t)=>{r.jb(`Concat`,e,{axis:t})},840375:(e,t,n,i,a)=>{r.jb(`Split`,e,{axis:t,numOutputs:n,splitSizes:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},840531:e=>{r.jb(`Expand`,e,void 0)},840585:(e,t)=>{r.jb(`Gather`,e,{axis:Number(t)})},840656:(e,t)=>{r.jb(`GatherElements`,e,{axis:Number(t)})},840735:(e,t)=>{r.jb(`GatherND`,e,{batch_dims:Number(t)})},840814:(e,t,n,i,a,o,s,c,l,u,d)=>{r.jb(`Resize`,e,{antialias:t,axes:n?Array.from(M().subarray(Number(n)>>>0,Number(i)>>>0)):[],coordinateTransformMode:B(a),cubicCoeffA:o,excludeOutside:s,extrapolationValue:c,keepAspectRatioPolicy:B(l),mode:B(u),nearestMode:B(d)})},841176:(e,t,n,i,a,o,s)=>{r.jb(`Slice`,e,{starts:t?Array.from(M().subarray(Number(t)>>>0,Number(n)>>>0)):[],ends:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[],axes:o?Array.from(M().subarray(Number(o)>>>0,Number(s)>>>0)):[]})},841440:e=>{r.jb(`Tile`,e,void 0)},841492:(e,t,n)=>{r.jb(`InstanceNormalization`,e,{epsilon:t,format:n?`NHWC`:`NCHW`})},841606:(e,t,n)=>{r.jb(`InstanceNormalization`,e,{epsilon:t,format:n?`NHWC`:`NCHW`})},841720:e=>{r.jb(`Range`,e,void 0)},841773:(e,t)=>{r.jb(`Einsum`,e,{equation:B(t)})},841854:(e,t,n,i,a)=>{r.jb(`Pad`,e,{mode:t,value:n,pads:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},841997:(e,t,n,i,a,o)=>{r.jb(`BatchNormalization`,e,{epsilon:t,momentum:n,spatial:!!a,trainingMode:!!i,format:o?`NHWC`:`NCHW`})},842166:(e,t,n,i,a,o)=>{r.jb(`BatchNormalization`,e,{epsilon:t,momentum:n,spatial:!!a,trainingMode:!!i,format:o?`NHWC`:`NCHW`})},842335:(e,t,n)=>{r.jb(`CumSum`,e,{exclusive:Number(t),reverse:Number(n)})},842432:(e,t,n)=>{r.jb(`DequantizeLinear`,e,{axis:t,blockSize:n})},842522:(e,t,n,i,a)=>{r.jb(`GridSample`,e,{align_corners:t,mode:B(n),padding_mode:B(i),format:a?`NHWC`:`NCHW`})},842692:(e,t,n,i,a)=>{r.jb(`GridSample`,e,{align_corners:t,mode:B(n),padding_mode:B(i),format:a?`NHWC`:`NCHW`})},842862:(e,t)=>{r.jb(`ScatterND`,e,{reduction:B(t)})},842947:(e,t,n,i,a,o,s,c,l)=>{r.jb(`Attention`,e,{numHeads:t,isUnidirectional:n,maskFilterValue:i,scale:a,doRotary:o,qkvHiddenSizes:s?Array.from(M().subarray(Number(c)>>>0,Number(c)+s>>>0)):[],pastPresentShareBuffer:!!l})},843219:e=>{r.jb(`BiasAdd`,e,void 0)},843274:e=>{r.jb(`BiasSplitGelu`,e,void 0)},843335:e=>{r.jb(`FastGelu`,e,void 0)},843391:(e,t,n,i,a,o,s,c,l,u,d,f,p,m,h,g)=>{r.jb(`Conv`,e,{format:f?`NHWC`:`NCHW`,auto_pad:t,dilations:n?Array.from(M().subarray(Number(n)>>>0,Number(i)>>>0)):[],group:a,kernel_shape:o?Array.from(M().subarray(Number(o)>>>0,Number(s)>>>0)):[],pads:c?Array.from(M().subarray(Number(c)>>>0,Number(l)>>>0)):[],strides:u?Array.from(M().subarray(Number(u)>>>0,Number(d)>>>0)):[],w_is_const:()=>!!ie()[Number(p)>>>0],activation:B(m),activation_params:h?Array.from(ce().subarray(Number(h)>>>0,Number(g)>>>0)):[]})},843975:e=>{r.jb(`Gelu`,e,void 0)},844027:(e,t,n,i,a,o,s,c,l)=>{r.jb(`GroupQueryAttention`,e,{numHeads:t,kvNumHeads:n,scale:i,softcap:a,doRotary:o,rotaryInterleaved:s,smoothSoftmax:c,localWindowSize:l})},844244:(e,t,n,i)=>{r.jb(`LayerNormalization`,e,{axis:t,epsilon:n,simplified:!!i})},844355:(e,t,n,i)=>{r.jb(`LayerNormalization`,e,{axis:t,epsilon:n,simplified:!!i})},844466:(e,t,n,i,a,o)=>{r.jb(`MatMulNBits`,e,{k:t,n,accuracyLevel:i,bits:a,blockSize:o})},844593:(e,t,n,i,a,o)=>{r.jb(`MultiHeadAttention`,e,{numHeads:t,isUnidirectional:n,maskFilterValue:i,scale:a,doRotary:o})},844752:(e,t)=>{r.jb(`QuickGelu`,e,{alpha:t})},844816:(e,t,n,i,a)=>{r.jb(`RotaryEmbedding`,e,{interleaved:!!t,numHeads:n,rotaryEmbeddingDim:i,scale:a})},844955:(e,t,n)=>{r.jb(`SkipLayerNormalization`,e,{epsilon:t,simplified:!!n})},845057:(e,t,n)=>{r.jb(`SkipLayerNormalization`,e,{epsilon:t,simplified:!!n})},845159:(e,t,n,i)=>{r.jb(`GatherBlockQuantized`,e,{gatherAxis:t,quantizeAxis:n,blockSize:i})},845280:e=>{r.Zb(e)},845314:(e,t)=>r.ac(Number(e),Number(t),r.Fb.dc,r.Fb.errors)};function L(e,t,n){return ln(async()=>{await r.Xb(Number(e),Number(t),Number(n))})}function ye(){return typeof wasmOffsetConverter<`u`}class be{name=`ExitStatus`;constructor(e){this.message=`Program terminated with exit(${e})`,this.status=e}}var xe=e=>{e.terminate(),e.onmessage=()=>{}},Se=[],Ce=e=>{ke.length==0&&(Fe(),Pe(ke[0]));var t=ke.pop();if(!t)return 6;Ae.push(t),Me[e.Ab]=t,t.Ab=e.Ab;var n={Bb:`run`,fc:e.ec,Hb:e.Hb,Ab:e.Ab};return t.postMessage(n,e.Mb),0},we=0,Te=(e,t,...n)=>{for(var r=2*n.length,i=kr(),a=Or(8*r),o=a>>>3,s=0;s>>0]=c)}return e=xr(e,0,r,a,t),Dr(i),e};function Ee(e){if(s)return Te(0,1,e);if(S=e,!(0{if(S=e,s)throw De(e),`unwind`;Ee(e)},ke=[],Ae=[],je=[],Me={},Ne=e=>{var t=e.Ab;delete Me[t],ke.push(e),Ae.splice(Ae.indexOf(e),1),e.Ab=0,Sr(t)};function R(){je.forEach(e=>e())}var Pe=e=>new Promise(t=>{e.onmessage=n=>{var i=(n=n.data).Bb;if(n.Gb&&n.Gb!=gr()){var a=Me[n.Gb];a?a.postMessage(n,n.Mb):y(`Internal error! Worker sent a message "${i}" to target pthread ${n.Gb}, but that thread no longer exists!`)}else i===`checkMailbox`?Ht():i===`spawnThread`?Ce(n):i===`cleanupThread`?Ne(Me[n.hc]):i===`loaded`?(e.loaded=!0,t(e)):i===`alert`?alert(`Thread ${n.ic}: ${n.text}`):n.target===`setimmediate`?e.postMessage(n):i===`callHandler`?r[n.Qb](...n.args):i&&y(`worker sent an unknown command ${i}`)},e.onerror=e=>{throw y(`worker sent an error! ${e.filename}:${e.lineno}: ${e.message}`),e};var n,i=[];for(n of[])r.propertyIsEnumerable(n)&&i.push(n);e.postMessage({Bb:`load`,Rb:i,kc:b,lc:x})});function Fe(){var e=new Worker((()=>{let e=URL;return self.location.href>`file:`&&self.location.href<`file;`?new e(`ort.bundle.min.mjs`,self.location.href):new URL(self.location.href)})(),{type:`module`,workerData:`em-pthread`,name:`em-pthread`});ke.push(e)}var Ie=e=>{F();var t=N()[e+52>>>2>>>0];e=N()[e+56>>>2>>>0],Er(t,t-e),Dr(t)},Le=(e,t)=>{we=0,e=Ar(e,t),0>>=0);throw t>>>=0,n>>>=0,N()[r.Ib+16>>>2>>>0]=0,N()[r.Ib+4>>>2>>>0]=t,N()[r.Ib+8>>>2>>>0]=n,e}function Be(e,t,n,r){return s?Te(2,1,e,t,n,r):z(e,t,n,r)}function z(e,t,n,r){if(e>>>=0,n>>>=0,r>>>=0,c===void 0)return 6;var i=[];return s&&i.length===0?Be(e,t>>>=0,n,r):(e={ec:n,Ab:e,Hb:r,Mb:i},s?(e.Bb=`spawnThread`,postMessage(e,i),0):Ce(e))}var Ve=typeof TextDecoder<`u`?new TextDecoder:void 0,He=(e,t=0,n=NaN)=>{var r=(t>>>=0)+n;for(n=t;e[n]&&!(n>=r);)++n;if(16(i=(240&i)==224?(15&i)<<12|a<<6|o:(7&i)<<18|a<<12|o<<6|63&e[t++])?r+=String.fromCharCode(i):(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i))}}else r+=String.fromCharCode(i)}return r},B=(e,t)=>(e>>>=0)?He(ae(),e,t):``;function Ue(e,t,n){return s?Te(3,1,e,t,n):0}function We(e,t){if(s)return Te(4,1,e,t)}var Ge=e=>{for(var t=0,n=0;n=r?t++:2047>=r?t+=2:55296<=r&&57343>=r?(t+=4,++n):t+=3}return t},Ke=(e,t,n)=>{var r=ae();if(t>>>=0,0=o&&(o=65536+((1023&o)<<10)|1023&e.charCodeAt(++a)),127>=o){if(t>=n)break;r[t++>>>0]=o}else{if(2047>=o){if(t+1>=n)break;r[t++>>>0]=192|o>>6}else{if(65535>=o){if(t+2>=n)break;r[t++>>>0]=224|o>>12}else{if(t+3>=n)break;r[t++>>>0]=240|o>>18,r[t++>>>0]=128|o>>12&63}r[t++>>>0]=128|o>>6&63}r[t++>>>0]=128|63&o}}r[t>>>0]=0,e=t-i}else e=0;return e};function qe(e,t){if(s)return Te(5,1,e,t)}function Je(e,t,n){if(s)return Te(6,1,e,t,n)}function Ye(e,t,n){return s?Te(7,1,e,t,n):0}function Xe(e,t){if(s)return Te(8,1,e,t)}function Ze(e,t,n){if(s)return Te(9,1,e,t,n)}function Qe(e,t,n,r){if(s)return Te(10,1,e,t,n,r)}function $e(e,t,n,r){if(s)return Te(11,1,e,t,n,r)}function et(e,t,n,r){if(s)return Te(12,1,e,t,n,r)}function tt(e){if(s)return Te(13,1,e)}function nt(e,t){if(s)return Te(14,1,e,t)}function rt(e,t,n){if(s)return Te(15,1,e,t,n)}var it,at,ot=()=>ge(``),ct=e=>{for(var t=``;ae()[e>>>0];)t+=it[ae()[e++>>>0]];return t},lt={},ut={},dt={};function ft(e,t,n={}){return function(e,t,n={}){var r=t.name;if(!e)throw new at(`type "${r}" must have a positive integer typeid pointer`);if(ut.hasOwnProperty(e)){if(n.Sb)return;throw new at(`Cannot register type '${r}' twice`)}ut[e]=t,delete dt[e],lt.hasOwnProperty(e)&&(t=lt[e],delete lt[e],t.forEach(e=>e()))}(e,t,n)}var pt=(e,t,n)=>{switch(t){case 1:return n?e=>ie()[e>>>0]:e=>ae()[e>>>0];case 2:return n?e=>oe()[e>>>1>>>0]:e=>se()[e>>>1>>>0];case 4:return n?e=>M()[e>>>2>>>0]:e=>N()[e>>>2>>>0];case 8:return n?e=>A[e>>>3]:e=>ee[e>>>3];default:throw TypeError(`invalid integer width (${t}): ${e}`)}};function mt(e,t,n){n>>>=0,ft(e>>>=0,{name:t=ct(t>>>0),fromWireType:e=>e,toWireType:function(e,t){if(typeof t!=`bigint`&&typeof t!=`number`)throw t=t===null?`null`:(e=typeof t)==`object`||e===`array`||e===`function`?t.toString():``+t,TypeError(`Cannot convert "${t}" to ${this.name}`);return typeof t==`number`&&(t=BigInt(t)),t},Cb:ht,readValueFromPointer:pt(t,n,t.indexOf(`u`)==-1),Db:null})}var ht=8;function gt(e,t,n,r){ft(e>>>=0,{name:t=ct(t>>>0),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?n:r},Cb:ht,readValueFromPointer:function(e){return this.fromWireType(ae()[e>>>0])},Db:null})}var _t=[],vt=[];function yt(e){9<(e>>>=0)&&--vt[e+1]==0&&(vt[e]=void 0,_t.push(e))}var bt=e=>{if(!e)throw new at(`Cannot use deleted val. handle = `+e);return vt[e]},xt=e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:let t=_t.pop()||vt.length;return vt[t]=e,vt[t+1]=1,t}};function St(e){return this.fromWireType(N()[e>>>2>>>0])}var Ct={name:`emscripten::val`,fromWireType:e=>{var t=bt(e);return yt(e),t},toWireType:(e,t)=>xt(t),Cb:ht,readValueFromPointer:St,Db:null};function wt(e){return ft(e>>>0,Ct)}var Tt=(e,t)=>{switch(t){case 4:return function(e){return this.fromWireType(ce()[e>>>2>>>0])};case 8:return function(e){return this.fromWireType(le()[e>>>3>>>0])};default:throw TypeError(`invalid float width (${t}): ${e}`)}};function Et(e,t,n){n>>>=0,ft(e>>>=0,{name:t=ct(t>>>0),fromWireType:e=>e,toWireType:(e,t)=>t,Cb:ht,readValueFromPointer:Tt(t,n),Db:null})}function Dt(e,t,n,r,i){if(e>>>=0,n>>>=0,t=ct(t>>>0),i===-1&&(i=4294967295),i=e=>e,r===0){var a=32-8*n;i=e=>e<>>a}var o=t.includes(`unsigned`)?function(e,t){return t>>>0}:function(e,t){return t};ft(e,{name:t,fromWireType:i,toWireType:o,Cb:ht,readValueFromPointer:pt(t,n,r!==0),Db:null})}function Ot(e,t,n){function r(e){var t=N()[e>>>2>>>0];return e=N()[e+4>>>2>>>0],new i(ie().buffer,e,t)}var i=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][t];ft(e>>>=0,{name:n=ct(n>>>0),fromWireType:r,Cb:ht,readValueFromPointer:r},{Sb:!0})}function kt(e,t){ft(e>>>=0,{name:t=ct(t>>>0),fromWireType:function(e){for(var t,n=N()[e>>>2>>>0],r=e+4,i=r,a=0;a<=n;++a){var o=r+a;a!=n&&ae()[o>>>0]!=0||(i=B(i,o-i),t===void 0?t=i:(t+=`\0`,t+=i),i=o+1)}return _r(e),t},toWireType:function(e,t){t instanceof ArrayBuffer&&(t=new Uint8Array(t));var n=typeof t==`string`;if(!(n||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array))throw new at(`Cannot pass non-string to std::string`);var r=n?Ge(t):t.length,i=vr(4+r+1),a=i+4;if(N()[i>>>2>>>0]=r,n)Ke(t,a,r+1);else if(n)for(n=0;n>>0]=o}else for(n=0;n>>0]=t[n];return e!==null&&e.push(_r,i),i},Cb:ht,readValueFromPointer:St,Db(e){_r(e)}})}var At=typeof TextDecoder<`u`?new TextDecoder(`utf-16le`):void 0,jt=(e,t)=>{for(var n=e>>1,r=n+t/2;!(n>=r)&&se()[n>>>0];)++n;if(32<(n<<=1)-e&&At)return At.decode(ae().slice(e,n));for(n=``,r=0;!(r>=t/2);++r){var i=oe()[e+2*r>>>1>>>0];if(i==0)break;n+=String.fromCharCode(i)}return n},Mt=(e,t,n)=>{if(n??=2147483647,2>n)return 0;var r=t;n=(n-=2)<2*e.length?n/2:e.length;for(var i=0;i>>1>>>0]=a,t+=2}return oe()[t>>>1>>>0]=0,t-r},Nt=e=>2*e.length,Pt=(e,t)=>{for(var n=0,r=``;!(n>=t/4);){var i=M()[e+4*n>>>2>>>0];if(i==0)break;++n,65536<=i?(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i)):r+=String.fromCharCode(i)}return r},Ft=(e,t,n)=>{if(t>>>=0,n??=2147483647,4>n)return 0;var r=t;n=r+n-4;for(var i=0;i=a&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++i)),M()[t>>>2>>>0]=a,(t+=4)+4>n)break}return M()[t>>>2>>>0]=0,t-r},It=e=>{for(var t=0,n=0;n=r&&++n,t+=4}return t};function Lt(e,t,n){if(e>>>=0,t>>>=0,n=ct(n>>>=0),t===2)var r=jt,i=Mt,a=Nt,o=e=>se()[e>>>1>>>0];else t===4&&(r=Pt,i=Ft,a=It,o=e=>N()[e>>>2>>>0]);ft(e,{name:n,fromWireType:e=>{for(var n,i=N()[e>>>2>>>0],a=e+4,s=0;s<=i;++s){var c=e+4+s*t;s!=i&&o(c)!=0||(a=r(a,c-a),n===void 0?n=a:(n+=`\0`,n+=a),a=c+t)}return _r(e),n},toWireType:(e,r)=>{if(typeof r!=`string`)throw new at(`Cannot pass non-string to C++ string type ${n}`);var o=a(r),s=vr(4+o+t);return N()[s>>>2>>>0]=o/t,i(r,s+4,o+t),e!==null&&e.push(_r,s),s},Cb:ht,readValueFromPointer:St,Db(e){_r(e)}})}function Rt(e,t){ft(e>>>=0,{Tb:!0,name:t=ct(t>>>0),Cb:0,fromWireType:()=>{},toWireType:()=>{}})}function zt(e){yr(e>>>0,!o,1,!a,131072,!1),R()}var Bt=e=>{if(!j)try{if(e(),!(0>>=0,typeof Atomics.jc==`function`&&(Atomics.jc(M(),e>>>2,e).value.then(Ht),e+=128,Atomics.store(M(),e>>>2,1))}var Ht=()=>{var e=gr();e&&(Vt(e),Bt(Tr))};function Ut(e,t){(e>>>=0)==t>>>0?setTimeout(Ht):s?postMessage({Gb:e,Bb:`checkMailbox`}):(e=Me[e])&&e.postMessage({Bb:`checkMailbox`})}var Wt=[];function Gt(e,t,n,r,i){for(t>>>=0,r/=2,Wt.length=r,n=i>>>0>>>3,i=0;i>>0];return(t?ve[t]:pr[e])(...Wt)}var Kt=()=>{we=0};function qt(e){e>>>=0,s?postMessage({Bb:`cleanupThread`,hc:e}):Ne(Me[e])}function Jt(e){}var Yt=(e,t)=>{var n=ut[e];if(n===void 0)throw e=mr(e),n=ct(e),_r(e),new at(`${t} has unknown type ${n}`);return n},Xt=(e,t,n)=>{var r=[];return e=e.toWireType(r,n),r.length&&(N()[t>>>2>>>0]=xt(r)),e};function Zt(e,t,n){return t>>>=0,n>>>=0,e=bt(e>>>0),t=Yt(t,`emval::as`),Xt(t,n,e)}function Qt(e,t){return t>>>=0,e=bt(e>>>0),(t=Yt(t,`emval::as`)).toWireType(null,e)}var $t=e=>{try{e()}catch(e){ge(e)}},en=0,tn=null,nn=0,rn=[],V={},an={},on=0,sn=null,cn=[];function ln(e){return function(e){if(!j){if(en===0){var t=!1,n=!1;e((e=0)=>{if(!j&&(nn=e,t=!0,n)){en=2,$t(()=>Nr(tn)),typeof MainLoop<`u`&&MainLoop.Pb&&MainLoop.resume(),e=!1;try{var r=function(){var e=M()[tn+8>>>2>>>0];return e=X[an[e]],--we,e()}()}catch(t){r=t,e=!0}var i=!1;if(!tn){var a=sn;a&&(sn=null,(e?a.reject:a.resolve)(r),i=!0)}if(e&&!i)throw r}}),n=!0,t||(en=1,tn=function(){var e=vr(65548),t=e+12;N()[e>>>2>>>0]=t,N()[e+4>>>2>>>0]=t+65536,t=rn[0];var n=V[t];return n===void 0&&(n=on++,V[t]=n,an[n]=t),t=n,M()[e+8>>>2>>>0]=t,e}(),typeof MainLoop<`u`&&MainLoop.Pb&&MainLoop.pause(),$t(()=>jr(tn)))}else en===2?(en=0,$t(Pr),_r(tn),tn=null,cn.forEach(Bt)):ge(`invalid state: ${en}`);return nn}}(t=>{e().then(t)})}function un(e){return e>>>=0,ln(async()=>{var t=await bt(e);return xt(t)})}var dn=[];function fn(e,t,n,r){return n>>>=0,r>>>=0,(e=dn[e>>>0])(null,t=bt(t>>>0),n,r)}var H={},pn=e=>{var t=H[e];return t===void 0?ct(e):t};function mn(e,t,n,r,i){return n>>>=0,r>>>=0,i>>>=0,(e=dn[e>>>0])(t=bt(t>>>0),t[n=pn(n)],r,i)}var hn=()=>typeof globalThis==`object`?globalThis:Function(`return this`)();function U(e){return(e>>>=0)==0?xt(hn()):(e=pn(e),xt(hn()[e]))}var gn=e=>{var t=dn.length;return dn.push(e),t},_n=(e,t)=>{for(var n=Array(e),r=0;r>>2>>>0],`parameter `+r);return n},vn=(e,t)=>Object.defineProperty(t,`name`,{value:e});function yn(e,t,n){var r=(t=_n(e,t>>>0)).shift();e--;var i=`return function (obj, func, destructorsRef, args) { +var re=Object.defineProperty,ie=Object.getOwnPropertyDescriptor,ae=Object.getOwnPropertyNames,oe=Object.prototype.hasOwnProperty,se=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error(`Dynamic require of "`+e+`" is not supported`)}),M=(e,t)=>()=>(e&&(t=e(e=0)),t),N=(e,t)=>{for(var n in t)re(e,n,{get:t[n],enumerable:!0})},ce=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of ae(t))!oe.call(e,i)&&i!==n&&re(e,i,{get:()=>t[i],enumerable:!(r=ie(t,i))||r.enumerable});return e},le=e=>ce(re({},`__esModule`,{value:!0}),e),ue,de,fe,P,pe,F=M(()=>{"use strict";ue=new Map,de=[],fe=(e,t,n)=>{if(t&&typeof t.init==`function`&&typeof t.createInferenceSessionHandler==`function`){let r=ue.get(e);if(r===void 0)ue.set(e,{backend:t,priority:n});else{if(r.priority>n)return;if(r.priority===n&&r.backend!==t)throw Error(`cannot register backend "${e}" using priority ${n}`)}if(n>=0){let t=de.indexOf(e);t!==-1&&de.splice(t,1);for(let t=0;t{let t=ue.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}}},pe=async e=>{let t=e.executionProviders||[],n=t.map(e=>typeof e==`string`?e:e.name),r=n.length===0?de:n,i,a=[],o=new Set;for(let e of r){let t=await P(e);typeof t==`string`?a.push({name:e,err:t}):(i||=t,i===t&&o.add(e))}if(!i)throw Error(`no available backend found. ERR: ${a.map(e=>`[${e.name}] ${e.err}`).join(`, `)}`);for(let{name:e,err:t}of a)n.includes(e)&&console.warn(`removing requested execution provider "${e}" from session options because it is not available: ${t}`);let s=t.filter(e=>o.has(typeof e==`string`?e:e.name));return[i,new Proxy(e,{get:(e,t)=>t===`executionProviders`?s:Reflect.get(e,t)})]}}),me=M(()=>{"use strict";F()}),he,ge=M(()=>{"use strict";he=`1.22.0-dev.20250409-89f8206ba4`}),I,_e,L=M(()=>{"use strict";ge(),I=`warning`,_e={wasm:{},webgl:{},webgpu:{},versions:{common:he},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}`);I=e}},get logLevel(){return I}},Object.defineProperty(_e,`logLevel`,{enumerable:!0})}),R,ve=M(()=>{"use strict";L(),R=_e}),ye,z,be=M(()=>{"use strict";ye=(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?t.format:`RGB`,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{"use strict";Ie(),xe=(e,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?t.tensorFormat:`RGB`,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,xe(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(xe(e.data,s))}});throw Error(`Input data provided is not supported - aborted tensor creation`)}if(o!==void 0)return xe(o,s);throw Error(`Input data provided is not supported - aborted tensor creation`)},B=(e,t)=>{let{width:n,height:r,download:i,dispose:a}=t,o=[1,r,n,4];return new Fe({location:`texture`,type:`float32`,texture:e,dims:o,download:i,dispose:a})},Ce=(e,t)=>{let{dataType:n,dims:r,download:i,dispose:a}=t;return new Fe({location:`gpu-buffer`,type:n??`float32`,gpuBuffer:e,dims:r,download:i,dispose:a})},we=(e,t)=>{let{dataType:n,dims:r,download:i,dispose:a}=t;return new Fe({location:`ml-tensor`,type:n??`float32`,mlTensor:e,dims:r,download:i,dispose:a})},Te=(e,t,n)=>new Fe({location:`cpu-pinned`,type:e,data:t,dims:n??[t.length]})}),De,Oe,ke,Ae,je=M(()=>{"use strict";De=new Map([[`float32`,Float32Array],[`uint8`,Uint8Array],[`int8`,Int8Array],[`uint16`,Uint16Array],[`int16`,Int16Array],[`int32`,Int32Array],[`bool`,Uint8Array],[`float64`,Float64Array],[`uint32`,Uint32Array],[`int4`,Uint8Array],[`uint4`,Uint8Array]]),Oe=new Map([[Float32Array,`float32`],[Uint8Array,`uint8`],[Int8Array,`int8`],[Uint16Array,`uint16`],[Int16Array,`int16`],[Int32Array,`int32`],[Float64Array,`float64`],[Uint32Array,`uint32`]]),ke=!1,Ae=()=>{if(!ke){ke=!0;let e=typeof BigInt64Array<`u`&&BigInt64Array.from,t=typeof BigUint64Array<`u`&&BigUint64Array.from,n=globalThis.Float16Array,r=typeof n<`u`&&n.from;e&&(De.set(`int64`,BigInt64Array),Oe.set(BigInt64Array,`int64`)),t&&(De.set(`uint64`,BigUint64Array),Oe.set(BigUint64Array,`uint64`)),r?(De.set(`float16`,n),Oe.set(n,`float16`)):De.set(`float16`,Uint16Array)}}}),Me,Ne,Pe=M(()=>{"use strict";Ie(),Me=e=>{let t=1;for(let n=0;n{switch(e.location){case`cpu`:return new Fe(e.type,e.data,t);case`cpu-pinned`:return new Fe({location:`cpu-pinned`,data:e.data,type:e.type,dims:t});case`texture`:return new Fe({location:`texture`,texture:e.texture,type:e.type,dims:t});case`gpu-buffer`:return new Fe({location:`gpu-buffer`,gpuBuffer:e.gpuBuffer,type:e.type,dims:t});case`ml-tensor`:return new Fe({location:`ml-tensor`,mlTensor:e.mlTensor,type:e.type,dims:t});default:throw Error(`tensorReshape: tensor location ${e.location} is not supported`)}}}),Fe,Ie=M(()=>{"use strict";be(),Ee(),je(),Pe(),Fe=class{constructor(e,t,n){Ae();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=De.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=De.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=Oe.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=Me(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 Se(e,t)}static fromTexture(e,t){return B(e,t)}static fromGpuBuffer(e,t){return Ce(e,t)}static fromMLTensor(e,t){return we(e,t)}static fromPinnedBuffer(e,t,n){return Te(e,t,n)}toDataURL(e){return ye(this,e)}toImageData(e){return z(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 Ne(this,e)}}}),Le,Re=M(()=>{"use strict";Ie(),Le=Fe}),V,ze,Be,H,Ve=M(()=>{"use strict";L(),V=(e,t)=>{(typeof _e.trace>`u`?!_e.wasm.trace:!_e.trace)||console.timeStamp(`${e}::ORT::${t}`)},ze=(e,t)=>{let n=Error().stack?.split(/\r\n|\r|\n/g)||[],r=!1;for(let i=0;i{(typeof _e.trace>`u`?!_e.wasm.trace:!_e.trace)||ze(`BEGIN`,e)},H=e=>{(typeof _e.trace>`u`?!_e.wasm.trace:!_e.trace)||ze(`END`,e)}}),He,Ue=M(()=>{"use strict";F(),Re(),Ve(),He=class e{constructor(e){this.handler=e}async run(e,t,n){Be();let r={},i={};if(typeof e!=`object`||!e||e instanceof Le||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 Le)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(typeof n<`u`)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 Le)&&(e=!0,a=!1,r[n]=i)}if(e){if(typeof n==`object`&&n)i=n;else if(typeof n<`u`)throw TypeError(`'options' must be an object.`)}else i=t}}else if(typeof t<`u`)throw TypeError(`Unexpected argument[1]: must be 'fetches' or 'options'.`);for(let t of this.inputNames)if(typeof e[t]>`u`)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 Le?s[e]=t:s[e]=new Le(t.type,t.data,t.dims)}return H(),s}async release(){return this.handler.dispose()}static async create(t,n,r,i){Be();let a,o={};if(typeof t==`string`){if(a=t,typeof n==`object`&&n)o=n;else if(typeof n<`u`)throw TypeError(`'options' must be an object.`)}else if(t instanceof Uint8Array){if(a=t,typeof n==`object`&&n)o=n;else if(typeof n<`u`)throw TypeError(`'options' must be an object.`)}else if(t instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&t instanceof SharedArrayBuffer){let e=t,s=0,c=t.byteLength;if(typeof n==`object`&&n)o=n;else if(typeof n==`number`){if(s=n,!Number.isSafeInteger(s))throw RangeError(`'byteOffset' must be an integer.`);if(s<0||s>=e.byteLength)throw RangeError(`'byteOffset' is out of range [0, ${e.byteLength}).`);if(c=t.byteLength-s,typeof r==`number`){if(c=r,!Number.isSafeInteger(c))throw RangeError(`'byteLength' must be an integer.`);if(c<=0||s+c>e.byteLength)throw RangeError(`'byteLength' is out of range (0, ${e.byteLength-s}].`);if(typeof i==`object`&&i)o=i;else if(typeof i<`u`)throw TypeError(`'options' must be an object.`)}else if(typeof r<`u`)throw TypeError(`'byteLength' must be a number.`)}else if(typeof n<`u`)throw TypeError(`'options' must be an object.`);a=new Uint8Array(e,s,c)}else throw TypeError(`Unexpected argument[0]: must be 'path' or 'buffer'.`);let[s,c]=await pe(o),l=await s.createInferenceSessionHandler(a,c);return H(),new e(l)}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}}}),We,Ge=M(()=>{"use strict";Ue(),We=He}),Ke=M(()=>{"use strict";}),qe=M(()=>{"use strict";}),Je=M(()=>{"use strict";}),Ye=M(()=>{"use strict";}),Xe={};N(Xe,{InferenceSession:()=>We,TRACE:()=>V,TRACE_FUNC_BEGIN:()=>Be,TRACE_FUNC_END:()=>H,Tensor:()=>Le,env:()=>R,registerBackend:()=>fe});var Ze=M(()=>{"use strict";me(),ve(),Ge(),Re(),Ke(),qe(),Ve(),Je(),Ye()}),Qe=M(()=>{"use strict";}),$e={};N($e,{default:()=>nt});var et,tt,nt,rt=M(()=>{"use strict";Dd(),Pt(),wt(),et=`ort-wasm-proxy-worker`,tt=globalThis.self?.name===et,tt&&(self.onmessage=e=>{let{type:t,in:n}=e.data;try{switch(t){case`init-wasm`:Mt(n.wasm).then(()=>{hd(n).then(()=>{postMessage({type:t})},e=>{postMessage({type:t,err:e})})},e=>{postMessage({type:t,err:e})});break;case`init-ep`:{let{epName:e,env:r}=n;gd(r,e).then(()=>{postMessage({type:t})},e=>{postMessage({type:t,err:e})});break}case`copy-from`:{let{buffer:e}=n,r=bd(e);postMessage({type:t,out:r});break}case`create`:{let{model:e,options:r}=n;xd(e,r).then(e=>{postMessage({type:t,out:e})},e=>{postMessage({type:t,err:e})});break}case`release`:Sd(n),postMessage({type:t});break;case`run`:{let{sessionId:e,inputIndices:r,inputs:i,outputIndices:a,options:o}=n;wd(e,r,i,a,Array(a.length).fill(null),o).then(e=>{e.some(e=>e[3]!==`cpu`)?postMessage({type:t,err:`Proxy does not support non-cpu tensor location.`}):postMessage({type:t,out:e},Ed([...i,...e]))},e=>{postMessage({type:t,err:e})});break}case`end-profiling`:Td(n),postMessage({type:t});break;default:}}catch(e){postMessage({type:t,err:e})}}),nt=tt?null:e=>new Worker(e??pt,{type:`module`,name:et})}),it={};N(it,{default:()=>st});var at,ot,st,ct,lt=M(()=>{"use strict";ot=(at=self.location.href,async function(e={}){var t,n,r=e,i=new Promise((e,r)=>{t=e,n=r}),a=typeof window==`object`,o=typeof WorkerGlobalScope<`u`,s=o&&self.name?.startsWith(`em-pthread`);r.mountExternalData=(e,t)=>{e.startsWith(`./`)&&(e=e.substring(2)),(r.Eb||=new Map).set(e,t)},r.unmountExternalData=()=>{delete r.Eb};var c=globalThis.SharedArrayBuffer??new WebAssembly.Memory({initial:0,maximum:0,pc:!0}).buffer.constructor;let l=e=>async(...t)=>{try{if(r.Fb)throw Error(`Session already started`);let n=r.Fb={dc:t[0],errors:[]},i=await e(...t);if(r.Fb!==n)throw Error(`Session mismatch`);r.Jb?.flush();let a=n.errors;if(0e),0{if(e===`webgpu`){[r.Jb,r.Ub,r.Yb,r.Kb,r.Xb,r.jb,r.Zb,r.ac,r.Vb,r.Wb,r.$b]=t;let e=r.Jb;r.jsepRegisterBuffer=(t,n,r,i)=>e.registerBuffer(t,n,r,i),r.jsepGetBuffer=t=>e.getBuffer(t),r.jsepCreateDownloader=(t,n,r)=>e.createDownloader(t,n,r),r.jsepOnCreateSession=t=>{e.onCreateSession(t)},r.jsepOnReleaseSession=t=>{e.onReleaseSession(t)},r.jsepOnRunStart=t=>e.onRunStart(t),r.bc=(t,n)=>{e.upload(t,n)}}else if(e===`webnn`){let e=t[0];[r.nc,r.Nb,r.webnnEnsureTensor,r.Ob,r.webnnDownloadTensor]=t.slice(1),r.webnnReleaseTensorId=r.Nb,r.webnnUploadTensor=r.Ob,r.webnnOnRunStart=t=>e.onRunStart(t),r.webnnOnRunEnd=e.onRunEnd.bind(e),r.webnnRegisterMLContext=(t,n)=>{e.registerMLContext(t,n)},r.webnnOnReleaseSession=t=>{e.onReleaseSession(t)},r.webnnCreateMLTensorDownloader=(t,n)=>e.createMLTensorDownloader(t,n),r.webnnRegisterMLTensor=(t,n,r,i)=>e.registerMLTensor(t,n,r,i),r.webnnCreateMLContext=t=>e.createMLContext(t),r.webnnRegisterMLConstant=(t,n,i,a,o,s)=>e.registerMLConstant(t,n,i,a,o,r.Eb,s),r.webnnRegisterGraphInput=e.registerGraphInput.bind(e),r.webnnIsGraphInput=e.isGraphInput.bind(e),r.webnnCreateTemporaryTensor=e.createTemporaryTensor.bind(e),r.webnnIsInt64Supported=e.isInt64Supported.bind(e)}};let u=()=>{let e=(e,t,n)=>(...r)=>{let i=$t,a=t?.();r=e(...r);let o=t?.();return a!==o&&(e=o,n(a),t=n=null),$t==i?r:new Promise((e,t)=>{an={resolve:e,reject:t}})};(()=>{for(let t of[`_OrtAppendExecutionProvider`,`_OrtCreateSession`,`_OrtRun`,`_OrtRunWithBinding`,`_OrtBindInput`])r[t]=e(r[t],()=>r[t],e=>r[t]=e)})(),l!==void 0&&(r._OrtRun=l(r._OrtRun),r._OrtRunWithBinding=l(r._OrtRunWithBinding)),u=void 0};r.asyncInit=()=>{u?.()};var d,f,p=Object.assign({},r),m=(e,t)=>{throw t},h=``;(a||o)&&(o?h=self.location.href:typeof document<`u`&&document.currentScript&&(h=document.currentScript.src),at&&(h=at),h=h.startsWith(`blob:`)?``:h.slice(0,h.replace(/[?#].*/,``).lastIndexOf(`/`)+1),o&&(f=e=>{var t=new XMLHttpRequest;return t.open(`GET`,e,!1),t.responseType=`arraybuffer`,t.send(null),new Uint8Array(t.response)}),d=async e=>{if(re(e))return new Promise((t,n)=>{var r=new XMLHttpRequest;r.open(`GET`,e,!0),r.responseType=`arraybuffer`,r.onload=()=>{r.status==200||r.status==0&&r.response?t(r.response):n(r.status)},r.onerror=n,r.send(null)});var t=await fetch(e,{credentials:`same-origin`});if(t.ok)return t.arrayBuffer();throw Error(t.status+` : `+t.url)});var g=console.log.bind(console),_=console.error.bind(console),v=g,y=_;Object.assign(r,p),p=null;var b,x,S,C,w,T,E,D,O,k,A,ee,te,ne=r.wasmBinary,j=!1,re=e=>e.startsWith(`file://`);function ie(){return b.buffer!=C.buffer&&P(),C}function ae(){return b.buffer!=C.buffer&&P(),w}function oe(){return b.buffer!=C.buffer&&P(),T}function se(){return b.buffer!=C.buffer&&P(),E}function M(){return b.buffer!=C.buffer&&P(),D}function N(){return b.buffer!=C.buffer&&P(),O}function ce(){return b.buffer!=C.buffer&&P(),k}function le(){return b.buffer!=C.buffer&&P(),te}if(s){let e=function(t){try{var n=t.data,i=n.Bb;if(i===`load`){let t=[];self.onmessage=e=>t.push(e),self.startWorker=()=>{postMessage({Bb:`loaded`});for(let n of t)e(n);self.onmessage=e};for(let e of n.Rb)r[e]&&!r[e].proxy||(r[e]=(...t)=>{postMessage({Bb:`callHandler`,Qb:e,args:t})},e==`print`&&(v=r[e]),e==`printErr`&&(y=r[e]));b=n.kc,P(),de(n.lc)}else if(i===`run`){Pe(n.Ab),vr(n.Ab,0,0,1,0,0),je(),zt(n.Ab),fe||(mr(),fe=!0);try{Fe(n.fc,n.Hb)}catch(e){if(e!=`unwind`)throw e}}else n.target!==`setimmediate`&&(i===`checkMailbox`?fe&&Bt():i&&(y(`worker: received unknown command ${i}`),y(n)))}catch(e){throw yr(),e}};var ue=e,de,fe=!1;y=function(...e){e=e.join(` `),console.error(e)},self.alert=function(...e){postMessage({Bb:`alert`,text:e.join(` `),ic:hr()})},self.onunhandledrejection=e=>{throw e.reason||e},self.onmessage=e}function P(){var e=b.buffer;r.HEAP8=C=new Int8Array(e),r.HEAP16=T=new Int16Array(e),r.HEAPU8=w=new Uint8Array(e),r.HEAPU16=E=new Uint16Array(e),r.HEAP32=D=new Int32Array(e),r.HEAPU32=O=new Uint32Array(e),r.HEAPF32=k=new Float32Array(e),r.HEAPF64=te=new Float64Array(e),r.HEAP64=A=new BigInt64Array(e),r.HEAPU64=ee=new BigUint64Array(e)}function pe(){s?startWorker(r):Z.Ca()}s||(b=new WebAssembly.Memory({initial:256,maximum:65536,shared:!0}),P());var F,me=0,he=null;function ge(){if(--me==0&&he){var e=he;he=null,e()}}function I(e){throw y(e=`Aborted(`+e+`)`),j=!0,e=new WebAssembly.RuntimeError(e+`. Build with -sASSERTIONS for more info.`),n(e),e}function _e(){return{a:{L:ve,Aa:R,b:Le,$:V,A:Ve,pa:He,X:Ge,Z:Ke,qa:qe,na:Je,ga:Ye,ma:Xe,J:Ze,Y:Qe,V:$e,oa:et,W:tt,va:it,E:ft,Q:mt,O:St,D:wt,u:Tt,r:Et,P:Dt,z:Ft,R:It,ja:Lt,T:Vt,aa:Ut,M:Wt,F:Gt,ia:zt,sa:Kt,t:Yt,Ba:Xt,w:cn,o:un,l:pn,c:_t,n:W,j:vn,v:G,p:yn,f:bn,s:xn,m:Sn,e:Cn,k:wn,i:Tn,g:En,d:Dn,da:On,ea:Mn,fa:Nn,ba:Pn,ca:Fn,N:Rn,xa:zn,ua:Hn,h:Gn,C:Kn,G:qn,ta:Bn,x:Jn,ra:Yn,U:Xn,q:Ln,y:Zn,K:Qn,S:$n,za:nr,ya:rr,ka:Y,la:ar,_:Te,B:or,I:sr,ha:cr,H:lr,a:b,wa:Ce}}}var L={829644:(e,t,n,i,a)=>{if(r===void 0||!r.Eb)return 1;if((e=H(Number(e>>>0))).startsWith(`./`)&&(e=e.substring(2)),!(e=r.Eb.get(e)))return 2;if(t=Number(t>>>0),n=Number(n>>>0),i=Number(i>>>0),t+n>e.byteLength)return 3;try{let o=e.subarray(t,t+n);switch(a){case 0:ae().set(o,i>>>0);break;case 1:r.mc?r.mc(i,o):r.bc(i,o);break;default:return 4}return 0}catch{return 4}},830468:(e,t,n)=>{r.Ob(e,ae().subarray(t>>>0,t+n>>>0))},830532:()=>r.nc(),830574:e=>{r.Nb(e)},830611:()=>{r.Vb()},830642:()=>{r.Wb()},830671:()=>{r.$b()},830696:e=>r.Ub(e),830729:e=>r.Yb(e),830761:(e,t,n)=>{r.Kb(Number(e),Number(t),Number(n),!0)},830824:(e,t,n)=>{r.Kb(Number(e),Number(t),Number(n))},830881:()=>typeof wasmOffsetConverter<`u`,830938:e=>{r.jb(`Abs`,e,void 0)},830989:e=>{r.jb(`Neg`,e,void 0)},831040:e=>{r.jb(`Floor`,e,void 0)},831093:e=>{r.jb(`Ceil`,e,void 0)},831145:e=>{r.jb(`Reciprocal`,e,void 0)},831203:e=>{r.jb(`Sqrt`,e,void 0)},831255:e=>{r.jb(`Exp`,e,void 0)},831306:e=>{r.jb(`Erf`,e,void 0)},831357:e=>{r.jb(`Sigmoid`,e,void 0)},831412:(e,t,n)=>{r.jb(`HardSigmoid`,e,{alpha:t,beta:n})},831491:e=>{r.jb(`Log`,e,void 0)},831542:e=>{r.jb(`Sin`,e,void 0)},831593:e=>{r.jb(`Cos`,e,void 0)},831644:e=>{r.jb(`Tan`,e,void 0)},831695:e=>{r.jb(`Asin`,e,void 0)},831747:e=>{r.jb(`Acos`,e,void 0)},831799:e=>{r.jb(`Atan`,e,void 0)},831851:e=>{r.jb(`Sinh`,e,void 0)},831903:e=>{r.jb(`Cosh`,e,void 0)},831955:e=>{r.jb(`Asinh`,e,void 0)},832008:e=>{r.jb(`Acosh`,e,void 0)},832061:e=>{r.jb(`Atanh`,e,void 0)},832114:e=>{r.jb(`Tanh`,e,void 0)},832166:e=>{r.jb(`Not`,e,void 0)},832217:(e,t,n)=>{r.jb(`Clip`,e,{min:t,max:n})},832286:e=>{r.jb(`Clip`,e,void 0)},832338:(e,t)=>{r.jb(`Elu`,e,{alpha:t})},832396:e=>{r.jb(`Gelu`,e,void 0)},832448:e=>{r.jb(`Relu`,e,void 0)},832500:(e,t)=>{r.jb(`LeakyRelu`,e,{alpha:t})},832564:(e,t)=>{r.jb(`ThresholdedRelu`,e,{alpha:t})},832634:(e,t)=>{r.jb(`Cast`,e,{to:t})},832692:e=>{r.jb(`Add`,e,void 0)},832743:e=>{r.jb(`Sub`,e,void 0)},832794:e=>{r.jb(`Mul`,e,void 0)},832845:e=>{r.jb(`Div`,e,void 0)},832896:e=>{r.jb(`Pow`,e,void 0)},832947:e=>{r.jb(`Equal`,e,void 0)},833e3:e=>{r.jb(`Greater`,e,void 0)},833055:e=>{r.jb(`GreaterOrEqual`,e,void 0)},833117:e=>{r.jb(`Less`,e,void 0)},833169:e=>{r.jb(`LessOrEqual`,e,void 0)},833228:(e,t,n,i,a)=>{r.jb(`ReduceMean`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},833403:(e,t,n,i,a)=>{r.jb(`ReduceMax`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},833577:(e,t,n,i,a)=>{r.jb(`ReduceMin`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},833751:(e,t,n,i,a)=>{r.jb(`ReduceProd`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},833926:(e,t,n,i,a)=>{r.jb(`ReduceSum`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},834100:(e,t,n,i,a)=>{r.jb(`ReduceL1`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},834273:(e,t,n,i,a)=>{r.jb(`ReduceL2`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},834446:(e,t,n,i,a)=>{r.jb(`ReduceLogSum`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},834623:(e,t,n,i,a)=>{r.jb(`ReduceSumSquare`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},834803:(e,t,n,i,a)=>{r.jb(`ReduceLogSumExp`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},834983:e=>{r.jb(`Where`,e,void 0)},835036:(e,t,n)=>{r.jb(`Transpose`,e,{perm:t?Array.from(M().subarray(Number(t)>>>0,Number(n)>>>0)):[]})},835160:(e,t,n,i)=>{r.jb(`DepthToSpace`,e,{blocksize:t,mode:H(n),format:i?`NHWC`:`NCHW`})},835293:(e,t,n,i)=>{r.jb(`DepthToSpace`,e,{blocksize:t,mode:H(n),format:i?`NHWC`:`NCHW`})},835426:(e,t,n,i,a,o,s,c,l,u,d,f,p,m,h)=>{r.jb(`ConvTranspose`,e,{format:l?`NHWC`:`NCHW`,autoPad:t,dilations:[n],group:i,kernelShape:[a],pads:[o,s],strides:[c],wIsConst:()=>!!ie()[u>>>0],outputPadding:d?Array.from(M().subarray(Number(d)>>>0,Number(f)>>>0)):[],outputShape:p?Array.from(M().subarray(Number(p)>>>0,Number(m)>>>0)):[],activation:H(h)})},835859:(e,t,n,i,a,o,s,c,l,u,d,f,p,m)=>{r.jb(`ConvTranspose`,e,{format:c?`NHWC`:`NCHW`,autoPad:t,dilations:Array.from(M().subarray(Number(n)>>>0,2+(Number(n)>>>0)>>>0)),group:i,kernelShape:Array.from(M().subarray(Number(a)>>>0,2+(Number(a)>>>0)>>>0)),pads:Array.from(M().subarray(Number(o)>>>0,4+(Number(o)>>>0)>>>0)),strides:Array.from(M().subarray(Number(s)>>>0,2+(Number(s)>>>0)>>>0)),wIsConst:()=>!!ie()[l>>>0],outputPadding:u?Array.from(M().subarray(Number(u)>>>0,Number(d)>>>0)):[],outputShape:f?Array.from(M().subarray(Number(f)>>>0,Number(p)>>>0)):[],activation:H(m)})},836520:(e,t,n,i,a,o,s,c,l,u,d,f,p,m,h)=>{r.jb(`ConvTranspose`,e,{format:l?`NHWC`:`NCHW`,autoPad:t,dilations:[n],group:i,kernelShape:[a],pads:[o,s],strides:[c],wIsConst:()=>!!ie()[u>>>0],outputPadding:d?Array.from(M().subarray(Number(d)>>>0,Number(f)>>>0)):[],outputShape:p?Array.from(M().subarray(Number(p)>>>0,Number(m)>>>0)):[],activation:H(h)})},836953:(e,t,n,i,a,o,s,c,l,u,d,f,p,m)=>{r.jb(`ConvTranspose`,e,{format:c?`NHWC`:`NCHW`,autoPad:t,dilations:Array.from(M().subarray(Number(n)>>>0,2+(Number(n)>>>0)>>>0)),group:i,kernelShape:Array.from(M().subarray(Number(a)>>>0,2+(Number(a)>>>0)>>>0)),pads:Array.from(M().subarray(Number(o)>>>0,4+(Number(o)>>>0)>>>0)),strides:Array.from(M().subarray(Number(s)>>>0,2+(Number(s)>>>0)>>>0)),wIsConst:()=>!!ie()[l>>>0],outputPadding:u?Array.from(M().subarray(Number(u)>>>0,Number(d)>>>0)):[],outputShape:f?Array.from(M().subarray(Number(f)>>>0,Number(p)>>>0)):[],activation:H(m)})},837614:(e,t)=>{r.jb(`GlobalAveragePool`,e,{format:t?`NHWC`:`NCHW`})},837705:(e,t,n,i,a,o,s,c,l,u,d,f,p,m)=>{r.jb(`AveragePool`,e,{format:m?`NHWC`:`NCHW`,auto_pad:t,ceil_mode:n,count_include_pad:i,storage_order:a,dilations:o?Array.from(M().subarray(Number(o)>>>0,Number(s)>>>0)):[],kernel_shape:c?Array.from(M().subarray(Number(c)>>>0,Number(l)>>>0)):[],pads:u?Array.from(M().subarray(Number(u)>>>0,Number(d)>>>0)):[],strides:f?Array.from(M().subarray(Number(f)>>>0,Number(p)>>>0)):[]})},838184:(e,t)=>{r.jb(`GlobalAveragePool`,e,{format:t?`NHWC`:`NCHW`})},838275:(e,t,n,i,a,o,s,c,l,u,d,f,p,m)=>{r.jb(`AveragePool`,e,{format:m?`NHWC`:`NCHW`,auto_pad:t,ceil_mode:n,count_include_pad:i,storage_order:a,dilations:o?Array.from(M().subarray(Number(o)>>>0,Number(s)>>>0)):[],kernel_shape:c?Array.from(M().subarray(Number(c)>>>0,Number(l)>>>0)):[],pads:u?Array.from(M().subarray(Number(u)>>>0,Number(d)>>>0)):[],strides:f?Array.from(M().subarray(Number(f)>>>0,Number(p)>>>0)):[]})},838754:(e,t)=>{r.jb(`GlobalMaxPool`,e,{format:t?`NHWC`:`NCHW`})},838841:(e,t,n,i,a,o,s,c,l,u,d,f,p,m)=>{r.jb(`MaxPool`,e,{format:m?`NHWC`:`NCHW`,auto_pad:t,ceil_mode:n,count_include_pad:i,storage_order:a,dilations:o?Array.from(M().subarray(Number(o)>>>0,Number(s)>>>0)):[],kernel_shape:c?Array.from(M().subarray(Number(c)>>>0,Number(l)>>>0)):[],pads:u?Array.from(M().subarray(Number(u)>>>0,Number(d)>>>0)):[],strides:f?Array.from(M().subarray(Number(f)>>>0,Number(p)>>>0)):[]})},839316:(e,t)=>{r.jb(`GlobalMaxPool`,e,{format:t?`NHWC`:`NCHW`})},839403:(e,t,n,i,a,o,s,c,l,u,d,f,p,m)=>{r.jb(`MaxPool`,e,{format:m?`NHWC`:`NCHW`,auto_pad:t,ceil_mode:n,count_include_pad:i,storage_order:a,dilations:o?Array.from(M().subarray(Number(o)>>>0,Number(s)>>>0)):[],kernel_shape:c?Array.from(M().subarray(Number(c)>>>0,Number(l)>>>0)):[],pads:u?Array.from(M().subarray(Number(u)>>>0,Number(d)>>>0)):[],strides:f?Array.from(M().subarray(Number(f)>>>0,Number(p)>>>0)):[]})},839878:(e,t,n,i,a)=>{r.jb(`Gemm`,e,{alpha:t,beta:n,transA:i,transB:a})},839982:e=>{r.jb(`MatMul`,e,void 0)},840036:(e,t,n,i)=>{r.jb(`ArgMax`,e,{keepDims:!!t,selectLastIndex:!!n,axis:i})},840144:(e,t,n,i)=>{r.jb(`ArgMin`,e,{keepDims:!!t,selectLastIndex:!!n,axis:i})},840252:(e,t)=>{r.jb(`Softmax`,e,{axis:t})},840315:(e,t)=>{r.jb(`Concat`,e,{axis:t})},840375:(e,t,n,i,a)=>{r.jb(`Split`,e,{axis:t,numOutputs:n,splitSizes:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},840531:e=>{r.jb(`Expand`,e,void 0)},840585:(e,t)=>{r.jb(`Gather`,e,{axis:Number(t)})},840656:(e,t)=>{r.jb(`GatherElements`,e,{axis:Number(t)})},840735:(e,t)=>{r.jb(`GatherND`,e,{batch_dims:Number(t)})},840814:(e,t,n,i,a,o,s,c,l,u,d)=>{r.jb(`Resize`,e,{antialias:t,axes:n?Array.from(M().subarray(Number(n)>>>0,Number(i)>>>0)):[],coordinateTransformMode:H(a),cubicCoeffA:o,excludeOutside:s,extrapolationValue:c,keepAspectRatioPolicy:H(l),mode:H(u),nearestMode:H(d)})},841176:(e,t,n,i,a,o,s)=>{r.jb(`Slice`,e,{starts:t?Array.from(M().subarray(Number(t)>>>0,Number(n)>>>0)):[],ends:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[],axes:o?Array.from(M().subarray(Number(o)>>>0,Number(s)>>>0)):[]})},841440:e=>{r.jb(`Tile`,e,void 0)},841492:(e,t,n)=>{r.jb(`InstanceNormalization`,e,{epsilon:t,format:n?`NHWC`:`NCHW`})},841606:(e,t,n)=>{r.jb(`InstanceNormalization`,e,{epsilon:t,format:n?`NHWC`:`NCHW`})},841720:e=>{r.jb(`Range`,e,void 0)},841773:(e,t)=>{r.jb(`Einsum`,e,{equation:H(t)})},841854:(e,t,n,i,a)=>{r.jb(`Pad`,e,{mode:t,value:n,pads:i?Array.from(M().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},841997:(e,t,n,i,a,o)=>{r.jb(`BatchNormalization`,e,{epsilon:t,momentum:n,spatial:!!a,trainingMode:!!i,format:o?`NHWC`:`NCHW`})},842166:(e,t,n,i,a,o)=>{r.jb(`BatchNormalization`,e,{epsilon:t,momentum:n,spatial:!!a,trainingMode:!!i,format:o?`NHWC`:`NCHW`})},842335:(e,t,n)=>{r.jb(`CumSum`,e,{exclusive:Number(t),reverse:Number(n)})},842432:(e,t,n)=>{r.jb(`DequantizeLinear`,e,{axis:t,blockSize:n})},842522:(e,t,n,i,a)=>{r.jb(`GridSample`,e,{align_corners:t,mode:H(n),padding_mode:H(i),format:a?`NHWC`:`NCHW`})},842692:(e,t,n,i,a)=>{r.jb(`GridSample`,e,{align_corners:t,mode:H(n),padding_mode:H(i),format:a?`NHWC`:`NCHW`})},842862:(e,t)=>{r.jb(`ScatterND`,e,{reduction:H(t)})},842947:(e,t,n,i,a,o,s,c,l)=>{r.jb(`Attention`,e,{numHeads:t,isUnidirectional:n,maskFilterValue:i,scale:a,doRotary:o,qkvHiddenSizes:s?Array.from(M().subarray(Number(c)>>>0,Number(c)+s>>>0)):[],pastPresentShareBuffer:!!l})},843219:e=>{r.jb(`BiasAdd`,e,void 0)},843274:e=>{r.jb(`BiasSplitGelu`,e,void 0)},843335:e=>{r.jb(`FastGelu`,e,void 0)},843391:(e,t,n,i,a,o,s,c,l,u,d,f,p,m,h,g)=>{r.jb(`Conv`,e,{format:f?`NHWC`:`NCHW`,auto_pad:t,dilations:n?Array.from(M().subarray(Number(n)>>>0,Number(i)>>>0)):[],group:a,kernel_shape:o?Array.from(M().subarray(Number(o)>>>0,Number(s)>>>0)):[],pads:c?Array.from(M().subarray(Number(c)>>>0,Number(l)>>>0)):[],strides:u?Array.from(M().subarray(Number(u)>>>0,Number(d)>>>0)):[],w_is_const:()=>!!ie()[Number(p)>>>0],activation:H(m),activation_params:h?Array.from(ce().subarray(Number(h)>>>0,Number(g)>>>0)):[]})},843975:e=>{r.jb(`Gelu`,e,void 0)},844027:(e,t,n,i,a,o,s,c,l)=>{r.jb(`GroupQueryAttention`,e,{numHeads:t,kvNumHeads:n,scale:i,softcap:a,doRotary:o,rotaryInterleaved:s,smoothSoftmax:c,localWindowSize:l})},844244:(e,t,n,i)=>{r.jb(`LayerNormalization`,e,{axis:t,epsilon:n,simplified:!!i})},844355:(e,t,n,i)=>{r.jb(`LayerNormalization`,e,{axis:t,epsilon:n,simplified:!!i})},844466:(e,t,n,i,a,o)=>{r.jb(`MatMulNBits`,e,{k:t,n,accuracyLevel:i,bits:a,blockSize:o})},844593:(e,t,n,i,a,o)=>{r.jb(`MultiHeadAttention`,e,{numHeads:t,isUnidirectional:n,maskFilterValue:i,scale:a,doRotary:o})},844752:(e,t)=>{r.jb(`QuickGelu`,e,{alpha:t})},844816:(e,t,n,i,a)=>{r.jb(`RotaryEmbedding`,e,{interleaved:!!t,numHeads:n,rotaryEmbeddingDim:i,scale:a})},844955:(e,t,n)=>{r.jb(`SkipLayerNormalization`,e,{epsilon:t,simplified:!!n})},845057:(e,t,n)=>{r.jb(`SkipLayerNormalization`,e,{epsilon:t,simplified:!!n})},845159:(e,t,n,i)=>{r.jb(`GatherBlockQuantized`,e,{gatherAxis:t,quantizeAxis:n,blockSize:i})},845280:e=>{r.Zb(e)},845314:(e,t)=>r.ac(Number(e),Number(t),r.Fb.dc,r.Fb.errors)};function R(e,t,n){return sn(async()=>{await r.Xb(Number(e),Number(t),Number(n))})}function ve(){return typeof wasmOffsetConverter<`u`}class ye{name=`ExitStatus`;constructor(e){this.message=`Program terminated with exit(${e})`,this.status=e}}var z=e=>{e.terminate(),e.onmessage=()=>{}},be=[],xe=e=>{Ee.length==0&&(Ne(),Me(Ee[0]));var t=Ee.pop();if(!t)return 6;De.push(t),ke[e.Ab]=t,t.Ab=e.Ab;var n={Bb:`run`,fc:e.ec,Hb:e.Hb,Ab:e.Ab};return t.postMessage(n,e.Mb),0},Se=0,B=(e,t,...n)=>{for(var r=2*n.length,i=Or(),a=Dr(8*r),o=a>>>3,s=0;s>>0]=c)}return e=br(e,0,r,a,t),Er(i),e};function Ce(e){if(s)return B(0,1,e);if(S=e,!(0{if(S=e,s)throw we(e),`unwind`;Ce(e)},Ee=[],De=[],Oe=[],ke={},Ae=e=>{var t=e.Ab;delete ke[t],Ee.push(e),De.splice(De.indexOf(e),1),e.Ab=0,xr(t)};function je(){Oe.forEach(e=>e())}var Me=e=>new Promise(t=>{e.onmessage=n=>{var i=(n=n.data).Bb;if(n.Gb&&n.Gb!=hr()){var a=ke[n.Gb];a?a.postMessage(n,n.Mb):y(`Internal error! Worker sent a message "${i}" to target pthread ${n.Gb}, but that thread no longer exists!`)}else i===`checkMailbox`?Bt():i===`spawnThread`?xe(n):i===`cleanupThread`?Ae(ke[n.hc]):i===`loaded`?(e.loaded=!0,t(e)):i===`alert`?alert(`Thread ${n.ic}: ${n.text}`):n.target===`setimmediate`?e.postMessage(n):i===`callHandler`?r[n.Qb](...n.args):i&&y(`worker sent an unknown command ${i}`)},e.onerror=e=>{throw y(`worker sent an error! ${e.filename}:${e.lineno}: ${e.message}`),e};var n,i=[];for(n of[])r.propertyIsEnumerable(n)&&i.push(n);e.postMessage({Bb:`load`,Rb:i,kc:b,lc:x})});function Ne(){var e=new Worker((()=>{let e=URL;return self.location.href>`file:`&&self.location.href<`file;`?new e(`ort.bundle.min.mjs`,self.location.href):new URL(self.location.href)})(),{type:`module`,workerData:`em-pthread`,name:`em-pthread`});Ee.push(e)}var Pe=e=>{P();var t=N()[e+52>>>2>>>0];e=N()[e+56>>>2>>>0],Tr(t,t-e),Er(t)},Fe=(e,t)=>{Se=0,e=kr(e,t),0>>=0);throw t>>>=0,n>>>=0,N()[r.Ib+16>>>2>>>0]=0,N()[r.Ib+4>>>2>>>0]=t,N()[r.Ib+8>>>2>>>0]=n,e}function Re(e,t,n,r){return s?B(2,1,e,t,n,r):V(e,t,n,r)}function V(e,t,n,r){if(e>>>=0,n>>>=0,r>>>=0,c===void 0)return 6;var i=[];return s&&i.length===0?Re(e,t>>>=0,n,r):(e={ec:n,Ab:e,Hb:r,Mb:i},s?(e.Bb=`spawnThread`,postMessage(e,i),0):xe(e))}var ze=typeof TextDecoder<`u`?new TextDecoder:void 0,Be=(e,t=0,n=NaN)=>{var r=(t>>>=0)+n;for(n=t;e[n]&&!(n>=r);)++n;if(16(i=(240&i)==224?(15&i)<<12|a<<6|o:(7&i)<<18|a<<12|o<<6|63&e[t++])?r+=String.fromCharCode(i):(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i))}}else r+=String.fromCharCode(i)}return r},H=(e,t)=>(e>>>=0)?Be(ae(),e,t):``;function Ve(e,t,n){return s?B(3,1,e,t,n):0}function He(e,t){if(s)return B(4,1,e,t)}var Ue=e=>{for(var t=0,n=0;n=r?t++:2047>=r?t+=2:55296<=r&&57343>=r?(t+=4,++n):t+=3}return t},We=(e,t,n)=>{var r=ae();if(t>>>=0,0=o&&(o=65536+((1023&o)<<10)|1023&e.charCodeAt(++a)),127>=o){if(t>=n)break;r[t++>>>0]=o}else{if(2047>=o){if(t+1>=n)break;r[t++>>>0]=192|o>>6}else{if(65535>=o){if(t+2>=n)break;r[t++>>>0]=224|o>>12}else{if(t+3>=n)break;r[t++>>>0]=240|o>>18,r[t++>>>0]=128|o>>12&63}r[t++>>>0]=128|o>>6&63}r[t++>>>0]=128|63&o}}r[t>>>0]=0,e=t-i}else e=0;return e};function Ge(e,t){if(s)return B(5,1,e,t)}function Ke(e,t,n){if(s)return B(6,1,e,t,n)}function qe(e,t,n){return s?B(7,1,e,t,n):0}function Je(e,t){if(s)return B(8,1,e,t)}function Ye(e,t,n){if(s)return B(9,1,e,t,n)}function Xe(e,t,n,r){if(s)return B(10,1,e,t,n,r)}function Ze(e,t,n,r){if(s)return B(11,1,e,t,n,r)}function Qe(e,t,n,r){if(s)return B(12,1,e,t,n,r)}function $e(e){if(s)return B(13,1,e)}function et(e,t){if(s)return B(14,1,e,t)}function tt(e,t,n){if(s)return B(15,1,e,t,n)}var nt,rt,it=()=>I(``),ot=e=>{for(var t=``;ae()[e>>>0];)t+=nt[ae()[e++>>>0]];return t},st={},ct={},lt={};function ut(e,t,n={}){return function(e,t,n={}){var r=t.name;if(!e)throw new rt(`type "${r}" must have a positive integer typeid pointer`);if(ct.hasOwnProperty(e)){if(n.Sb)return;throw new rt(`Cannot register type '${r}' twice`)}ct[e]=t,delete lt[e],st.hasOwnProperty(e)&&(t=st[e],delete st[e],t.forEach(e=>e()))}(e,t,n)}var dt=(e,t,n)=>{switch(t){case 1:return n?e=>ie()[e>>>0]:e=>ae()[e>>>0];case 2:return n?e=>oe()[e>>>1>>>0]:e=>se()[e>>>1>>>0];case 4:return n?e=>M()[e>>>2>>>0]:e=>N()[e>>>2>>>0];case 8:return n?e=>A[e>>>3]:e=>ee[e>>>3];default:throw TypeError(`invalid integer width (${t}): ${e}`)}};function ft(e,t,n){n>>>=0,ut(e>>>=0,{name:t=ot(t>>>0),fromWireType:e=>e,toWireType:function(e,t){if(typeof t!=`bigint`&&typeof t!=`number`)throw t=t===null?`null`:(e=typeof t)==`object`||e===`array`||e===`function`?t.toString():``+t,TypeError(`Cannot convert "${t}" to ${this.name}`);return typeof t==`number`&&(t=BigInt(t)),t},Cb:pt,readValueFromPointer:dt(t,n,t.indexOf(`u`)==-1),Db:null})}var pt=8;function mt(e,t,n,r){ut(e>>>=0,{name:t=ot(t>>>0),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?n:r},Cb:pt,readValueFromPointer:function(e){return this.fromWireType(ae()[e>>>0])},Db:null})}var ht=[],gt=[];function _t(e){9<(e>>>=0)&&--gt[e+1]==0&&(gt[e]=void 0,ht.push(e))}var vt=e=>{if(!e)throw new rt(`Cannot use deleted val. handle = `+e);return gt[e]},yt=e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:let t=ht.pop()||gt.length;return gt[t]=e,gt[t+1]=1,t}};function bt(e){return this.fromWireType(N()[e>>>2>>>0])}var xt={name:`emscripten::val`,fromWireType:e=>{var t=vt(e);return _t(e),t},toWireType:(e,t)=>yt(t),Cb:pt,readValueFromPointer:bt,Db:null};function St(e){return ut(e>>>0,xt)}var Ct=(e,t)=>{switch(t){case 4:return function(e){return this.fromWireType(ce()[e>>>2>>>0])};case 8:return function(e){return this.fromWireType(le()[e>>>3>>>0])};default:throw TypeError(`invalid float width (${t}): ${e}`)}};function wt(e,t,n){n>>>=0,ut(e>>>=0,{name:t=ot(t>>>0),fromWireType:e=>e,toWireType:(e,t)=>t,Cb:pt,readValueFromPointer:Ct(t,n),Db:null})}function Tt(e,t,n,r,i){if(e>>>=0,n>>>=0,t=ot(t>>>0),i===-1&&(i=4294967295),i=e=>e,r===0){var a=32-8*n;i=e=>e<>>a}var o=t.includes(`unsigned`)?function(e,t){return t>>>0}:function(e,t){return t};ut(e,{name:t,fromWireType:i,toWireType:o,Cb:pt,readValueFromPointer:dt(t,n,r!==0),Db:null})}function Et(e,t,n){function r(e){var t=N()[e>>>2>>>0];return e=N()[e+4>>>2>>>0],new i(ie().buffer,e,t)}var i=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][t];ut(e>>>=0,{name:n=ot(n>>>0),fromWireType:r,Cb:pt,readValueFromPointer:r},{Sb:!0})}function Dt(e,t){ut(e>>>=0,{name:t=ot(t>>>0),fromWireType:function(e){for(var t,n=N()[e>>>2>>>0],r=e+4,i=r,a=0;a<=n;++a){var o=r+a;a!=n&&ae()[o>>>0]!=0||(i=H(i,o-i),t===void 0?t=i:(t+=`\0`,t+=i),i=o+1)}return gr(e),t},toWireType:function(e,t){t instanceof ArrayBuffer&&(t=new Uint8Array(t));var n=typeof t==`string`;if(!(n||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array))throw new rt(`Cannot pass non-string to std::string`);var r=n?Ue(t):t.length,i=_r(4+r+1),a=i+4;if(N()[i>>>2>>>0]=r,n)We(t,a,r+1);else if(n)for(n=0;n>>0]=o}else for(n=0;n>>0]=t[n];return e!==null&&e.push(gr,i),i},Cb:pt,readValueFromPointer:bt,Db(e){gr(e)}})}var Ot=typeof TextDecoder<`u`?new TextDecoder(`utf-16le`):void 0,kt=(e,t)=>{for(var n=e>>1,r=n+t/2;!(n>=r)&&se()[n>>>0];)++n;if(32<(n<<=1)-e&&Ot)return Ot.decode(ae().slice(e,n));for(n=``,r=0;!(r>=t/2);++r){var i=oe()[e+2*r>>>1>>>0];if(i==0)break;n+=String.fromCharCode(i)}return n},At=(e,t,n)=>{if(n??=2147483647,2>n)return 0;var r=t;n=(n-=2)<2*e.length?n/2:e.length;for(var i=0;i>>1>>>0]=a,t+=2}return oe()[t>>>1>>>0]=0,t-r},jt=e=>2*e.length,Mt=(e,t)=>{for(var n=0,r=``;!(n>=t/4);){var i=M()[e+4*n>>>2>>>0];if(i==0)break;++n,65536<=i?(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i)):r+=String.fromCharCode(i)}return r},Nt=(e,t,n)=>{if(t>>>=0,n??=2147483647,4>n)return 0;var r=t;n=r+n-4;for(var i=0;i=a&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++i)),M()[t>>>2>>>0]=a,(t+=4)+4>n)break}return M()[t>>>2>>>0]=0,t-r},Pt=e=>{for(var t=0,n=0;n=r&&++n,t+=4}return t};function Ft(e,t,n){if(e>>>=0,t>>>=0,n=ot(n>>>=0),t===2)var r=kt,i=At,a=jt,o=e=>se()[e>>>1>>>0];else t===4&&(r=Mt,i=Nt,a=Pt,o=e=>N()[e>>>2>>>0]);ut(e,{name:n,fromWireType:e=>{for(var n,i=N()[e>>>2>>>0],a=e+4,s=0;s<=i;++s){var c=e+4+s*t;s!=i&&o(c)!=0||(a=r(a,c-a),n===void 0?n=a:(n+=`\0`,n+=a),a=c+t)}return gr(e),n},toWireType:(e,r)=>{if(typeof r!=`string`)throw new rt(`Cannot pass non-string to C++ string type ${n}`);var o=a(r),s=_r(4+o+t);return N()[s>>>2>>>0]=o/t,i(r,s+4,o+t),e!==null&&e.push(gr,s),s},Cb:pt,readValueFromPointer:bt,Db(e){gr(e)}})}function It(e,t){ut(e>>>=0,{Tb:!0,name:t=ot(t>>>0),Cb:0,fromWireType:()=>{},toWireType:()=>{}})}function Lt(e){vr(e>>>0,!o,1,!a,131072,!1),je()}var Rt=e=>{if(!j)try{if(e(),!(0>>=0,typeof Atomics.jc==`function`&&(Atomics.jc(M(),e>>>2,e).value.then(Bt),e+=128,Atomics.store(M(),e>>>2,1))}var Bt=()=>{var e=hr();e&&(zt(e),Rt(wr))};function Vt(e,t){(e>>>=0)==t>>>0?setTimeout(Bt):s?postMessage({Gb:e,Bb:`checkMailbox`}):(e=ke[e])&&e.postMessage({Bb:`checkMailbox`})}var Ht=[];function Ut(e,t,n,r,i){for(t>>>=0,r/=2,Ht.length=r,n=i>>>0>>>3,i=0;i>>0];return(t?L[t]:fr[e])(...Ht)}var Wt=()=>{Se=0};function Gt(e){e>>>=0,s?postMessage({Bb:`cleanupThread`,hc:e}):Ae(ke[e])}function Kt(e){}var qt=(e,t)=>{var n=ct[e];if(n===void 0)throw e=pr(e),n=ot(e),gr(e),new rt(`${t} has unknown type ${n}`);return n},Jt=(e,t,n)=>{var r=[];return e=e.toWireType(r,n),r.length&&(N()[t>>>2>>>0]=yt(r)),e};function Yt(e,t,n){return t>>>=0,n>>>=0,e=vt(e>>>0),t=qt(t,`emval::as`),Jt(t,n,e)}function Xt(e,t){return t>>>=0,e=vt(e>>>0),(t=qt(t,`emval::as`)).toWireType(null,e)}var Zt=e=>{try{e()}catch(e){I(e)}},Qt=0,$t=null,en=0,tn=[],U={},nn={},rn=0,an=null,on=[];function sn(e){return function(e){if(!j){if(Qt===0){var t=!1,n=!1;e((e=0)=>{if(!j&&(en=e,t=!0,n)){Qt=2,Zt(()=>Mr($t)),typeof MainLoop<`u`&&MainLoop.Pb&&MainLoop.resume(),e=!1;try{var r=function(){var e=M()[$t+8>>>2>>>0];return e=Z[nn[e]],--Se,e()}()}catch(t){r=t,e=!0}var i=!1;if(!$t){var a=an;a&&(an=null,(e?a.reject:a.resolve)(r),i=!0)}if(e&&!i)throw r}}),n=!0,t||(Qt=1,$t=function(){var e=_r(65548),t=e+12;N()[e>>>2>>>0]=t,N()[e+4>>>2>>>0]=t+65536,t=tn[0];var n=U[t];return n===void 0&&(n=rn++,U[t]=n,nn[n]=t),t=n,M()[e+8>>>2>>>0]=t,e}(),typeof MainLoop<`u`&&MainLoop.Pb&&MainLoop.pause(),Zt(()=>Ar($t)))}else Qt===2?(Qt=0,Zt(Nr),gr($t),$t=null,on.forEach(Rt)):I(`invalid state: ${Qt}`);return en}}(t=>{e().then(t)})}function cn(e){return e>>>=0,sn(async()=>{var t=await vt(e);return yt(t)})}var ln=[];function un(e,t,n,r){return n>>>=0,r>>>=0,(e=ln[e>>>0])(null,t=vt(t>>>0),n,r)}var dn={},fn=e=>{var t=dn[e];return t===void 0?ot(e):t};function pn(e,t,n,r,i){return n>>>=0,r>>>=0,i>>>=0,(e=ln[e>>>0])(t=vt(t>>>0),t[n=fn(n)],r,i)}var mn=()=>typeof globalThis==`object`?globalThis:Function(`return this`)();function W(e){return(e>>>=0)==0?yt(mn()):(e=fn(e),yt(mn()[e]))}var hn=e=>{var t=ln.length;return ln.push(e),t},gn=(e,t)=>{for(var n=Array(e),r=0;r>>2>>>0],`parameter `+r);return n},_n=(e,t)=>Object.defineProperty(t,`name`,{value:e});function vn(e,t,n){var r=(t=gn(e,t>>>0)).shift();e--;var i=`return function (obj, func, destructorsRef, args) { `,a=0,o=[];n===0&&o.push(`obj`);for(var s=[`retType`],c=[r],l=0;le.name).join(`, `)}) => ${r.name}>`,gn(vn(n,e))}function W(e){return e=pn(e>>>0),xt(r[e])}function bn(e,t){return t>>>=0,e=bt(e>>>0),t=bt(t),xt(e[t])}function xn(e){9<(e>>>=0)&&(vt[e+1]+=1)}function Sn(){return xt([])}function Cn(e){e=bt(e>>>0);for(var t=Array(e.length),n=0;n>>0))}function Tn(){return xt({})}function En(e){for(var t=bt(e>>>=0);t.length;){var n=t.pop();t.pop()(n)}yt(e)}function Dn(e,t,n){t>>>=0,n>>>=0,e=bt(e>>>0),t=bt(t),n=bt(n),e[t]=n}function On(e,t){return t>>>=0,e=(e=Yt(e>>>0,`_emval_take_value`)).readValueFromPointer(t),xt(e)}function kn(e,t){e=-9007199254740992>e||9007199254740992>>=0,e=new Date(1e3*e),M()[t>>>2>>>0]=e.getUTCSeconds(),M()[t+4>>>2>>>0]=e.getUTCMinutes(),M()[t+8>>>2>>>0]=e.getUTCHours(),M()[t+12>>>2>>>0]=e.getUTCDate(),M()[t+16>>>2>>>0]=e.getUTCMonth(),M()[t+20>>>2>>>0]=e.getUTCFullYear()-1900,M()[t+24>>>2>>>0]=e.getUTCDay(),e=(e.getTime()-Date.UTC(e.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,M()[t+28>>>2>>>0]=e}var An=e=>e%4==0&&(e%100!=0||e%400==0),jn=[0,31,60,91,121,152,182,213,244,274,305,335],Mn=[0,31,59,90,120,151,181,212,243,273,304,334];function Nn(e,t){e=-9007199254740992>e||9007199254740992>>=0,e=new Date(1e3*e),M()[t>>>2>>>0]=e.getSeconds(),M()[t+4>>>2>>>0]=e.getMinutes(),M()[t+8>>>2>>>0]=e.getHours(),M()[t+12>>>2>>>0]=e.getDate(),M()[t+16>>>2>>>0]=e.getMonth(),M()[t+20>>>2>>>0]=e.getFullYear()-1900,M()[t+24>>>2>>>0]=e.getDay();var n=(An(e.getFullYear())?jn:Mn)[e.getMonth()]+e.getDate()-1|0;M()[t+28>>>2>>>0]=n,M()[t+36>>>2>>>0]=-60*e.getTimezoneOffset(),n=new Date(e.getFullYear(),6,1).getTimezoneOffset();var r=new Date(e.getFullYear(),0,1).getTimezoneOffset();e=0|(n!=r&&e.getTimezoneOffset()==Math.min(r,n)),M()[t+32>>>2>>>0]=e}function Pn(e){e>>>=0;var t=new Date(M()[e+20>>>2>>>0]+1900,M()[e+16>>>2>>>0],M()[e+12>>>2>>>0],M()[e+8>>>2>>>0],M()[e+4>>>2>>>0],M()[e>>>2>>>0],0),n=M()[e+32>>>2>>>0],r=t.getTimezoneOffset(),i=new Date(t.getFullYear(),6,1).getTimezoneOffset(),a=new Date(t.getFullYear(),0,1).getTimezoneOffset(),o=Math.min(a,i);return 0>n?M()[e+32>>>2>>>0]=+(i!=a&&o==r):0>>2>>>0]=t.getDay(),n=(An(t.getFullYear())?jn:Mn)[t.getMonth()]+t.getDate()-1|0,M()[e+28>>>2>>>0]=n,M()[e>>>2>>>0]=t.getSeconds(),M()[e+4>>>2>>>0]=t.getMinutes(),M()[e+8>>>2>>>0]=t.getHours(),M()[e+12>>>2>>>0]=t.getDate(),M()[e+16>>>2>>>0]=t.getMonth(),M()[e+20>>>2>>>0]=t.getYear(),e=t.getTime(),BigInt(isNaN(e)?-1:e/1e3)}function Fn(e,t,n,r,i,a,o){return s?Te(16,1,e,t,n,r,i,a,o):-52}function In(e,t,n,r,i,a){if(s)return Te(17,1,e,t,n,r,i,a)}var Ln={},Rn=()=>performance.timeOrigin+performance.now();function zn(e,t){if(s)return Te(18,1,e,t);if(Ln[e]&&(clearTimeout(Ln[e].id),delete Ln[e]),!t)return 0;var n=setTimeout(()=>{delete Ln[e],Bt(()=>wr(e,performance.timeOrigin+performance.now()))},t);return Ln[e]={id:n,qc:t},0}function Bn(e,t,n,r){e>>>=0,t>>>=0,n>>>=0,r>>>=0;var i=new Date().getFullYear(),a=new Date(i,0,1).getTimezoneOffset();i=new Date(i,6,1).getTimezoneOffset();var o=Math.max(a,i);N()[e>>>2>>>0]=60*o,M()[t>>>2>>>0]=+(a!=i),e=(t=e=>{var t=Math.abs(e);return`UTC${0<=e?`-`:`+`}${String(Math.floor(t/60)).padStart(2,`0`)}${String(t%60).padStart(2,`0`)}`})(a),t=t(i),iDate.now(),Hn=1;function Un(e,t,n){if(!(0<=e&&3>=e))return 28;if(e===0)e=Date.now();else{if(!Hn)return 52;e=performance.timeOrigin+performance.now()}return A[n>>>0>>>3]=BigInt(Math.round(1e6*e)),0}var Wn=[],Gn=(e,t)=>{Wn.length=0;for(var n;n=ae()[e++>>>0];){var r=n!=105;t+=(r&=n!=112)&&t%8?4:0,Wn.push(n==112?N()[t>>>2>>>0]:n==106?A[t>>>3]:n==105?M()[t>>>2>>>0]:le()[t>>>3>>>0]),t+=r?8:4}return Wn};function Kn(e,t,n){return e>>>=0,t=Gn(t>>>0,n>>>0),ve[e](...t)}function qn(e,t,n){return e>>>=0,t=Gn(t>>>0,n>>>0),ve[e](...t)}var Jn=()=>{};function Yn(e,t){return y(B(e>>>0,t>>>0))}var Xn=()=>{throw we+=1,`unwind`};function Zn(){return 4294901760}var Qn=()=>navigator.hardwareConcurrency;function $n(){return ge(`Cannot use emscripten_pc_get_function without -sUSE_OFFSET_CONVERTER`),0}function er(e){e>>>=0;var t=ae().length;if(e<=t||4294901760=n;n*=2){var r=t*(1+.2/n);r=Math.min(r,e+100663296);e:{r=(Math.min(4294901760,65536*Math.ceil(Math.max(e,r)/65536))-b.buffer.byteLength+65535)/65536|0;try{b.grow(r),F();var i=1;break e}catch{}i=void 0}if(i)return!0}return!1}var G=()=>(ge(`Cannot use convertFrameToPC (needed by __builtin_return_address) without -sUSE_OFFSET_CONVERTER`),0),tr={},nr=e=>{e.forEach(e=>{var t=G();t&&(tr[t]=e)})};function rr(){var e=Error().stack.toString().split(` -`);return e[0]==`Error`&&e.shift(),nr(e),tr.Lb=G(),tr.cc=e,tr.Lb}function ir(e,t,n){if(e>>>=0,t>>>=0,tr.Lb==e)var r=tr.cc;else (r=Error().stack.toString().split(` -`))[0]==`Error`&&r.shift(),nr(r);for(var i=3;r[i]&&G()!=e;)++i;for(e=0;e>>2>>>0]=G();return e}var K,ar={},q=()=>{if(!K){var e,t={USER:`web_user`,LOGNAME:`web_user`,PATH:`/`,PWD:`/`,HOME:`/home/web_user`,LANG:(typeof navigator==`object`&&navigator.languages&&navigator.languages[0]||`C`).replace(`-`,`_`)+`.UTF-8`,_:`./this.program`};for(e in ar)ar[e]===void 0?delete t[e]:t[e]=ar[e];var n=[];for(e in t)n.push(`${e}=${t[e]}`);K=n}return K};function J(e,t){if(s)return Te(19,1,e,t);e>>>=0,t>>>=0;var n=0;return q().forEach((r,i)=>{var a=t+n;for(i=N()[e+4*i>>>2>>>0]=a,a=0;a>>0]=r.charCodeAt(a);ie()[i>>>0]=0,n+=r.length+1}),0}function or(e,t){if(s)return Te(20,1,e,t);e>>>=0,t>>>=0;var n=q();N()[e>>>2>>>0]=n.length;var r=0;return n.forEach(e=>r+=e.length+1),N()[t>>>2>>>0]=r,0}function sr(e){return s?Te(21,1,e):52}function cr(e,t,n,r){return s?Te(22,1,e,t,n,r):52}function lr(e,t,n,r){return s?Te(23,1,e,t,n,r):70}var Y=[null,[],[]];function ur(e,t,n,r){if(s)return Te(24,1,e,t,n,r);t>>>=0,n>>>=0,r>>>=0;for(var i=0,a=0;a>>2>>>0],c=N()[t+4>>>2>>>0];t+=8;for(var l=0;l>>0],d=Y[e];u===0||u===10?((e===1?v:y)(He(d)),d.length=0):d.push(u)}i+=c}return N()[r>>>2>>>0]=i,0}s||function(){for(var e=r.numThreads-1;e--;)Fe();Se.unshift(()=>{pe++,function(e){s?e():Promise.all(ke.map(Pe)).then(e)}(()=>he())})}();for(var dr=Array(256),fr=0;256>fr;++fr)dr[fr]=String.fromCharCode(fr);it=dr,at=r.BindingError=class extends Error{constructor(e){super(e),this.name=`BindingError`}},r.InternalError=class extends Error{constructor(e){super(e),this.name=`InternalError`}},vt.push(0,1,void 0,1,null,1,!0,1,!1,1),r.count_emval_handles=()=>vt.length/2-5-_t.length;var X,pr=[Ee,De,Be,Ue,We,qe,Je,Ye,Xe,Ze,Qe,$e,et,tt,nt,rt,Fn,In,zn,J,or,sr,cr,lr,ur];(async function(){function e(e,t){return X=e.exports,X=function(){var e=X,t={};for(let[n,r]of Object.entries(e))t[n]=typeof r==`function`?(...e)=>{rn.push(n);try{return r(...e)}finally{j||(rn.pop(),tn&&en===1&&rn.length===0&&(en=0,we+=1,$t(Mr),typeof Fibers<`u`&&Fibers.rc()))}}:r;return t}(),X=function(){var e=X,t=e=>t=>e(t)>>>0,n=e=>()=>e()>>>0;return(e=Object.assign({},e)).Da=t(e.Da),e.fb=n(e.fb),e.hb=t(e.hb),e.tb=t(e.tb),e.ub=n(e.ub),e.__cxa_get_exception_ptr=t(e.__cxa_get_exception_ptr),e}(),je.push(X.ib),x=t,he(),X}pe++;var t=_e();if(r.instantiateWasm)return new Promise(n=>{r.instantiateWasm(t,(t,r)=>{e(t,r),n(t.exports)})});if(s)return new Promise(t=>{de=n=>{var r=new WebAssembly.Instance(n,_e());t(e(r,n))}});I??=r.locateFile?r.locateFile?r.locateFile(`ort-wasm-simd-threaded.jsep.wasm`,h):h+`ort-wasm-simd-threaded.jsep.wasm`:new URL(`/assets/ort-wasm-simd-threaded.jsep-B0T3yYHD.wasm`,``+self.location.href).href;try{var i=await async function(e){var t=I;if(!ne&&typeof WebAssembly.instantiateStreaming==`function`&&!re(t))try{var n=fetch(t,{credentials:`same-origin`});return await WebAssembly.instantiateStreaming(n,e)}catch(e){y(`wasm streaming compile failed: ${e}`),y(`falling back to ArrayBuffer instantiation`)}return async function(e,t){try{var n=await async function(e){if(!ne)try{var t=await d(e);return new Uint8Array(t)}catch{}if(e==I&&ne)e=new Uint8Array(ne);else{if(!f)throw`both async and sync fetching of the wasm failed`;e=f(e)}return e}(e);return await WebAssembly.instantiate(n,t)}catch(e){y(`failed to asynchronously prepare wasm: ${e}`),ge(e)}}(t,e)}(t);return e(i.instance,i.module)}catch(e){return n(e),Promise.reject(e)}})();var mr=e=>(mr=X.Da)(e),hr=()=>(hr=X.Ea)();r._OrtInit=(e,t)=>(r._OrtInit=X.Fa)(e,t),r._OrtGetLastError=(e,t)=>(r._OrtGetLastError=X.Ga)(e,t),r._OrtCreateSessionOptions=(e,t,n,i,a,o,s,c,l,u)=>(r._OrtCreateSessionOptions=X.Ha)(e,t,n,i,a,o,s,c,l,u),r._OrtAppendExecutionProvider=(e,t,n,i,a)=>(r._OrtAppendExecutionProvider=X.Ia)(e,t,n,i,a),r._OrtAddFreeDimensionOverride=(e,t,n)=>(r._OrtAddFreeDimensionOverride=X.Ja)(e,t,n),r._OrtAddSessionConfigEntry=(e,t,n)=>(r._OrtAddSessionConfigEntry=X.Ka)(e,t,n),r._OrtReleaseSessionOptions=e=>(r._OrtReleaseSessionOptions=X.La)(e),r._OrtCreateSession=(e,t,n)=>(r._OrtCreateSession=X.Ma)(e,t,n),r._OrtReleaseSession=e=>(r._OrtReleaseSession=X.Na)(e),r._OrtGetInputOutputCount=(e,t,n)=>(r._OrtGetInputOutputCount=X.Oa)(e,t,n),r._OrtGetInputOutputMetadata=(e,t,n,i)=>(r._OrtGetInputOutputMetadata=X.Pa)(e,t,n,i),r._OrtFree=e=>(r._OrtFree=X.Qa)(e),r._OrtCreateTensor=(e,t,n,i,a,o)=>(r._OrtCreateTensor=X.Ra)(e,t,n,i,a,o),r._OrtGetTensorData=(e,t,n,i,a)=>(r._OrtGetTensorData=X.Sa)(e,t,n,i,a),r._OrtReleaseTensor=e=>(r._OrtReleaseTensor=X.Ta)(e),r._OrtCreateRunOptions=(e,t,n,i)=>(r._OrtCreateRunOptions=X.Ua)(e,t,n,i),r._OrtAddRunConfigEntry=(e,t,n)=>(r._OrtAddRunConfigEntry=X.Va)(e,t,n),r._OrtReleaseRunOptions=e=>(r._OrtReleaseRunOptions=X.Wa)(e),r._OrtCreateBinding=e=>(r._OrtCreateBinding=X.Xa)(e),r._OrtBindInput=(e,t,n)=>(r._OrtBindInput=X.Ya)(e,t,n),r._OrtBindOutput=(e,t,n,i)=>(r._OrtBindOutput=X.Za)(e,t,n,i),r._OrtClearBoundOutputs=e=>(r._OrtClearBoundOutputs=X._a)(e),r._OrtReleaseBinding=e=>(r._OrtReleaseBinding=X.$a)(e),r._OrtRunWithBinding=(e,t,n,i,a)=>(r._OrtRunWithBinding=X.ab)(e,t,n,i,a),r._OrtRun=(e,t,n,i,a,o,s,c)=>(r._OrtRun=X.bb)(e,t,n,i,a,o,s,c),r._OrtEndProfiling=e=>(r._OrtEndProfiling=X.cb)(e),r._JsepOutput=(e,t,n)=>(r._JsepOutput=X.db)(e,t,n),r._JsepGetNodeName=e=>(r._JsepGetNodeName=X.eb)(e);var gr=()=>(gr=X.fb)(),_r=r._free=e=>(_r=r._free=X.gb)(e),vr=r._malloc=e=>(vr=r._malloc=X.hb)(e),yr=(e,t,n,r,i,a)=>(yr=X.kb)(e,t,n,r,i,a),br=()=>(br=X.lb)(),xr=(e,t,n,r,i)=>(xr=X.mb)(e,t,n,r,i),Sr=e=>(Sr=X.nb)(e),Cr=e=>(Cr=X.ob)(e),wr=(e,t)=>(wr=X.pb)(e,t),Tr=()=>(Tr=X.qb)(),Er=(e,t)=>(Er=X.rb)(e,t),Dr=e=>(Dr=X.sb)(e),Or=e=>(Or=X.tb)(e),kr=()=>(kr=X.ub)(),Ar=r.dynCall_ii=(e,t)=>(Ar=r.dynCall_ii=X.vb)(e,t),jr=e=>(jr=X.wb)(e),Mr=()=>(Mr=X.xb)(),Nr=e=>(Nr=X.yb)(e),Pr=()=>(Pr=X.zb)();return r.stackSave=()=>kr(),r.stackRestore=e=>Dr(e),r.stackAlloc=e=>Or(e),r.setValue=function(e,t,n=`i8`){switch(n.endsWith(`*`)&&(n=`*`),n){case`i1`:case`i8`:ie()[e>>>0]=t;break;case`i16`:oe()[e>>>1>>>0]=t;break;case`i32`:M()[e>>>2>>>0]=t;break;case`i64`:A[e>>>3]=BigInt(t);break;case`float`:ce()[e>>>2>>>0]=t;break;case`double`:le()[e>>>3>>>0]=t;break;case`*`:N()[e>>>2>>>0]=t;break;default:ge(`invalid type for setValue: ${n}`)}},r.getValue=function(e,t=`i8`){switch(t.endsWith(`*`)&&(t=`*`),t){case`i1`:case`i8`:return ie()[e>>>0];case`i16`:return oe()[e>>>1>>>0];case`i32`:return M()[e>>>2>>>0];case`i64`:return A[e>>>3];case`float`:return ce()[e>>>2>>>0];case`double`:return le()[e>>>3>>>0];case`*`:return N()[e>>>2>>>0];default:ge(`invalid type for getValue: ${t}`)}},r.UTF8ToString=B,r.stringToUTF8=Ke,r.lengthBytesUTF8=Ge,function e(){if(0{"use strict";et(),ft=typeof location>`u`?void 0:location.origin,pt=self.location.href>`file:`&&self.location.href<`file;`,mt=()=>{if(pt){let e=URL;return new URL(new e(`ort.bundle.min.mjs`,self.location.href).href,ft).href}return self.location.href},ht=mt(),gt=()=>{if(ht&&!ht.startsWith(`blob:`))return ht.substring(0,ht.lastIndexOf(`/`)+1)},_t=(e,t)=>{try{let n=t??ht;return(n?new URL(e,n):new URL(e)).origin===ft}catch{return!1}},vt=(e,t)=>{let n=t??ht;try{return(n?new URL(e,n):new URL(e)).href}catch{return}},yt=(e,t)=>`${t??`./`}${e}`,bt=async e=>{let t=await(await fetch(e,{credentials:`same-origin`})).blob();return URL.createObjectURL(t)},xt=async e=>(await import(e)).default,St=(at(),le(tt)).default,Ct=async()=>{if(!ht)throw Error(`Failed to load proxy worker: cannot determine the script source URL.`);if(_t(ht))return[void 0,St()];let e=await bt(ht);return[e,St(e)]},wt=(dt(),le(ot)).default,Tt=async(e,t,n)=>{if(!e&&!t&&wt&&ht&&_t(ht))return[void 0,wt];{let r=`ort-wasm-simd-threaded.jsep.mjs`,i=e??vt(r,t),a=n&&i&&!_t(i,t),o=a?await bt(i):i??yt(r,t);return[a?o:void 0,await xt(o)]}}}),Dt,Ot,kt,At,jt,Mt,Nt,Pt,Ft,It=M(()=>{"use strict";Et(),Ot=!1,kt=!1,At=!1,jt=()=>{if(typeof SharedArrayBuffer>`u`)return!1;try{return typeof MessageChannel<`u`&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(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]))}catch{return!1}},Mt=()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,30,1,28,0,65,0,253,15,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,186,1,26,11]))}catch{return!1}},Nt=()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,19,1,17,0,65,1,253,15,65,2,253,15,65,3,253,15,253,147,2,11]))}catch{return!1}},Pt=async e=>{if(Ot)return Promise.resolve();if(kt)throw Error(`multiple calls to 'initializeWebAssembly()' detected.`);if(At)throw Error(`previous call to 'initializeWebAssembly()' failed.`);kt=!0;let t=e.initTimeout,n=e.numThreads;if(e.simd!==!1){if(e.simd===`relaxed`){if(!Nt())throw Error(`Relaxed WebAssembly SIMD is not supported in the current environment.`)}else if(!Mt())throw Error(`WebAssembly SIMD is not supported in the current environment.`)}let r=jt();n>1&&!r&&(typeof self<`u`&&!self.crossOriginIsolated&&console.warn(`env.wasm.numThreads is set to `+n+`, but this will not work unless you enable crossOriginIsolated mode. See https://web.dev/cross-origin-isolation-guide/ for more info.`),console.warn(`WebAssembly multi-threading is not supported in the current environment. Falling back to single-threading.`),e.numThreads=n=1);let i=e.wasmPaths,a=typeof i==`string`?i:void 0,o=i?.mjs,s=o?.href??o,c=i?.wasm,l=c?.href??c,u=e.wasmBinary,[d,f]=await Tt(s,a,n>1),p=!1,m=[];if(t>0&&m.push(new Promise(e=>{setTimeout(()=>{p=!0,e()},t)})),m.push(new Promise((e,t)=>{let r={numThreads:n};if(u)r.wasmBinary=u;else if(l||a)r.locateFile=e=>l??a+e;else if(s&&s.indexOf(`blob:`)!==0)r.locateFile=e=>new URL(e,s).href;else if(d){let e=gt();e&&(r.locateFile=t=>e+t)}f(r).then(t=>{kt=!1,Ot=!0,Dt=t,e(),d&&URL.revokeObjectURL(d)},e=>{kt=!1,At=!0,t(e)})})),await Promise.race(m),p)throw Error(`WebAssembly backend initializing failed due to timeout: ${t}ms`)},Ft=()=>{if(Ot&&Dt)return Dt;throw Error(`WebAssembly is not initialized yet.`)}}),Lt,Rt,zt,Bt=M(()=>{"use strict";It(),Lt=(e,t)=>{let n=Ft(),r=n.lengthBytesUTF8(e)+1,i=n._malloc(r);return n.stringToUTF8(e,i,r),t.push(i),i},Rt=(e,t,n,r)=>{if(typeof e==`object`&&e){if(n.has(e))throw Error(`Circular reference in options`);n.add(e)}Object.entries(e).forEach(([e,i])=>{let a=t?t+e:e;if(typeof i==`object`)Rt(i,a+`.`,n,r);else if(typeof i==`string`||typeof i==`number`)r(a,i.toString());else if(typeof i==`boolean`)r(a,i?`1`:`0`);else throw Error(`Can't handle extra config type: ${typeof i}`)})},zt=e=>{let t=Ft(),n=t.stackSave();try{let n=t.PTR_SIZE,r=t.stackAlloc(2*n);t._OrtGetLastError(r,r+n);let i=Number(t.getValue(r,n===4?`i32`:`i64`)),a=t.getValue(r+n,`*`),o=a?t.UTF8ToString(a):``;throw Error(`${e} ERROR_CODE: ${i}, ERROR_MESSAGE: ${o}`)}finally{t.stackRestore(n)}}}),Vt,Ht=M(()=>{"use strict";It(),Bt(),Vt=e=>{let t=Ft(),n=0,r=[],i=e||{};try{if(e?.logSeverityLevel===void 0)i.logSeverityLevel=2;else if(typeof e.logSeverityLevel!=`number`||!Number.isInteger(e.logSeverityLevel)||e.logSeverityLevel<0||e.logSeverityLevel>4)throw Error(`log serverity level is not valid: ${e.logSeverityLevel}`);if(e?.logVerbosityLevel===void 0)i.logVerbosityLevel=0;else if(typeof e.logVerbosityLevel!=`number`||!Number.isInteger(e.logVerbosityLevel))throw Error(`log verbosity level is not valid: ${e.logVerbosityLevel}`);e?.terminate===void 0&&(i.terminate=!1);let a=0;return e?.tag!==void 0&&(a=Lt(e.tag,r)),n=t._OrtCreateRunOptions(i.logSeverityLevel,i.logVerbosityLevel,!!i.terminate,a),n===0&&zt(`Can't create run options.`),e?.extra!==void 0&&Rt(e.extra,``,new WeakSet,(e,i)=>{let a=Lt(e,r),o=Lt(i,r);t._OrtAddRunConfigEntry(n,a,o)!==0&&zt(`Can't set a run config entry: ${e} - ${i}.`)}),[n,r]}catch(e){throw n!==0&&t._OrtReleaseRunOptions(n),r.forEach(e=>t._free(e)),e}}}),Ut,Wt,Gt,Kt,qt,Jt,Yt=M(()=>{"use strict";It(),Bt(),Ut=e=>{switch(e){case`disabled`:return 0;case`basic`:return 1;case`extended`:return 2;case`all`:return 99;default:throw Error(`unsupported graph optimization level: ${e}`)}},Wt=e=>{switch(e){case`sequential`:return 0;case`parallel`:return 1;default:throw Error(`unsupported execution mode: ${e}`)}},Gt=e=>{e.extra||={},e.extra.session||(e.extra.session={});let t=e.extra.session;t.use_ort_model_bytes_directly||=`1`,e.executionProviders&&e.executionProviders.some(e=>(typeof e==`string`?e:e.name)===`webgpu`)&&(e.enableMemPattern=!1)},Kt=(e,t,n,r)=>{let i=Lt(t,r),a=Lt(n,r);Ft()._OrtAddSessionConfigEntry(e,i,a)!==0&&zt(`Can't set a session config entry: ${t} - ${n}.`)},qt=async(e,t,n)=>{for(let r of t){let t=typeof r==`string`?r:r.name,i=[];switch(t){case`webnn`:if(t=`WEBNN`,typeof r!=`string`){let t=r?.deviceType;t&&Kt(e,`deviceType`,t,n)}break;case`webgpu`:if(t=`JS`,typeof r!=`string`){let t=r;if(t?.preferredLayout){if(t.preferredLayout!==`NCHW`&&t.preferredLayout!==`NHWC`)throw Error(`preferredLayout must be either 'NCHW' or 'NHWC': ${t.preferredLayout}`);Kt(e,`preferredLayout`,t.preferredLayout,n)}}break;case`wasm`:case`cpu`:continue;default:throw Error(`not supported execution provider: ${t}`)}let a=Lt(t,n),o=i.length,s=0,c=0;if(o>0){s=Ft()._malloc(o*Ft().PTR_SIZE),n.push(s),c=Ft()._malloc(o*Ft().PTR_SIZE),n.push(c);for(let e=0;e{let t=Ft(),n=0,r=[],i=e||{};Gt(i);try{let e=Ut(i.graphOptimizationLevel??`all`),a=Wt(i.executionMode??`sequential`),o=typeof i.logId==`string`?Lt(i.logId,r):0,s=i.logSeverityLevel??2;if(!Number.isInteger(s)||s<0||s>4)throw Error(`log serverity level is not valid: ${s}`);let c=i.logVerbosityLevel??0;if(!Number.isInteger(c)||c<0||c>4)throw Error(`log verbosity level is not valid: ${c}`);let l=typeof i.optimizedModelFilePath==`string`?Lt(i.optimizedModelFilePath,r):0;if(n=t._OrtCreateSessionOptions(e,!!i.enableCpuMemArena,!!i.enableMemPattern,a,!!i.enableProfiling,0,o,s,c,l),n===0&&zt(`Can't create session options.`),i.executionProviders&&await qt(n,i.executionProviders,r),i.enableGraphCapture!==void 0){if(typeof i.enableGraphCapture!=`boolean`)throw Error(`enableGraphCapture must be a boolean value: ${i.enableGraphCapture}`);Kt(n,`enableGraphCapture`,i.enableGraphCapture.toString(),r)}if(i.freeDimensionOverrides)for(let[e,a]of Object.entries(i.freeDimensionOverrides)){if(typeof e!=`string`)throw Error(`free dimension override name must be a string: ${e}`);if(typeof a!=`number`||!Number.isInteger(a)||a<0)throw Error(`free dimension override value must be a non-negative integer: ${a}`);let i=Lt(e,r);t._OrtAddFreeDimensionOverride(n,i,a)!==0&&zt(`Can't set a free dimension override: ${e} - ${a}.`)}return i.extra!==void 0&&Rt(i.extra,``,new WeakSet,(e,t)=>{Kt(n,e,t,r)}),[n,r]}catch(e){throw n!==0&&t._OrtReleaseSessionOptions(n)!==0&&zt(`Can't release session options.`),r.forEach(e=>t._free(e)),e}}}),Xt,Zt,Qt,$t,en,tn,nn,rn,V=M(()=>{"use strict";Xt=e=>{switch(e){case`int8`:return 3;case`uint8`:return 2;case`bool`:return 9;case`int16`:return 5;case`uint16`:return 4;case`int32`:return 6;case`uint32`:return 12;case`float16`:return 10;case`float32`:return 1;case`float64`:return 11;case`string`:return 8;case`int64`:return 7;case`uint64`:return 13;case`int4`:return 22;case`uint4`:return 21;default:throw Error(`unsupported data type: ${e}`)}},Zt=e=>{switch(e){case 3:return`int8`;case 2:return`uint8`;case 9:return`bool`;case 5:return`int16`;case 4:return`uint16`;case 6:return`int32`;case 12:return`uint32`;case 10:return`float16`;case 1:return`float32`;case 11:return`float64`;case 8:return`string`;case 7:return`int64`;case 13:return`uint64`;case 22:return`int4`;case 21:return`uint4`;default:throw Error(`unsupported data type: ${e}`)}},Qt=(e,t)=>{let n=[-1,4,1,1,2,2,4,8,-1,1,2,8,4,8,-1,-1,-1,-1,-1,-1,-1,.5,.5][e],r=typeof t==`number`?t:t.reduce((e,t)=>e*t,1);return n>0?Math.ceil(r*n):void 0},$t=e=>{switch(e){case`float16`:return typeof Float16Array<`u`&&Float16Array.from?Float16Array:Uint16Array;case`float32`:return Float32Array;case`uint8`:return Uint8Array;case`int8`:return Int8Array;case`uint16`:return Uint16Array;case`int16`:return Int16Array;case`int32`:return Int32Array;case`bool`:return Uint8Array;case`float64`:return Float64Array;case`uint32`:return Uint32Array;case`int64`:return BigInt64Array;case`uint64`:return BigUint64Array;default:throw Error(`unsupported type: ${e}`)}},en=e=>{switch(e){case`verbose`:return 0;case`info`:return 1;case`warning`:return 2;case`error`:return 3;case`fatal`:return 4;default:throw Error(`unsupported logging level: ${e}`)}},tn=e=>e===`float32`||e===`float16`||e===`int32`||e===`int64`||e===`uint32`||e===`uint8`||e===`bool`||e===`uint4`||e===`int4`,nn=e=>e===`float32`||e===`float16`||e===`int32`||e===`int64`||e===`uint32`||e===`uint64`||e===`int8`||e===`uint8`||e===`bool`||e===`uint4`||e===`int4`,rn=e=>{switch(e){case`none`:return 0;case`cpu`:return 1;case`cpu-pinned`:return 2;case`texture`:return 3;case`gpu-buffer`:return 4;case`ml-tensor`:return 5;default:throw Error(`unsupported data location: ${e}`)}}}),an,on=M(()=>{"use strict";et(),an=async e=>{if(typeof e==`string`){let t=await fetch(e);if(!t.ok)throw Error(`failed to load external data file: ${e}`);let n=t.headers.get(`Content-Length`),r=n?parseInt(n,10):0;if(r<1073741824)return new Uint8Array(await t.arrayBuffer());{if(!t.body)throw Error(`failed to load external data file: ${e}, no response body.`);let n=t.body.getReader(),i;try{i=new ArrayBuffer(r)}catch(e){if(e instanceof RangeError){let e=Math.ceil(r/65536);i=new WebAssembly.Memory({initial:e,maximum:e}).buffer}else throw e}let a=0;for(;;){let{done:e,value:t}=await n.read();if(e)break;let r=t.byteLength;new Uint8Array(i,a,r).set(t),a+=r}return new Uint8Array(i,0,r)}}else return e instanceof Blob?new Uint8Array(await e.arrayBuffer()):e instanceof Uint8Array?e:new Uint8Array(e)}}),sn,cn,ln,un,dn,fn,H,pn=M(()=>{"use strict";V(),sn=[`V`,`I`,`W`,`E`,`F`],cn=(e,t)=>{console.log(`[${sn[e]},${new Date().toISOString()}]${t}`)},dn=(e,t)=>{ln=e,un=t},fn=(e,t)=>{let n=en(e),r=en(ln);n>=r&&cn(n,typeof t==`function`?t():t)},H=(...e)=>{un&&fn(...e)}}),mn,hn,U,gn,_n,vn,yn,W=M(()=>{"use strict";mn=class{static calcMatMulShape(e,t){return e[1]===t[0]?[e[0],t[1]]:void 0}},hn=class{static calcShape(e,t,n=!1){let r=e.length,i=t.length;if(r===0)return t;if(i===0)return e;let a=Math.max(e.length,t.length),o=Array(a);if(n){if(r<2||i<2)return;let n=mn.calcMatMulShape([e[r-2],e[r-1]],[t[i-2],t[i-1]]);if(n===void 0)return;[o[a-2],o[a-1]]=n}for(let s=n?3:1;s<=a;s++){let n=r-s<0?1:e[r-s],c=i-s<0?1:t[i-s];if(n!==c&&n>1&&c>1)return;let l=Math.max(n,c);if(n&&c)o[a-s]=Math.max(n,c);else{if(l>1)return;o[a-s]=0}}return o}static isValidBroadcast(e,t){let n=e.length,r=t.length;if(n>r)return!1;for(let i=1;i<=n;i++)if(e[n-i]!==1&&e[n-i]!==t[r-i])return!1;return!0}},U=class e{static size(t){return e.getSizeFromDimensionRange(t,0,t.length)}static convertShape(e,t=4){let n=e.length;if(n===0)return[];let r=Array(n),i=n-1;for(;i>=0;){if(e[i]%t===0){r[i]=e[i]/t;break}if(t%e[i]!==0)throw Error(`cannot convert shape`);r[i]=1,t/=e[i],i--}for(i--;i>=0;i--)r[i]=e[i];return r}static sizeFromDimension(t,n){if(n<0||n>t.length)throw Error(`invalid dimension of ${n} for sizeFromDimension as Tensor has ${t.length} dimensions.`);return e.getSizeFromDimensionRange(t,n,t.length)}static sizeToDimension(t,n){if(n<0||n>t.length)throw Error(`invalid dimension of ${n} for sizeToDimension as Tensor has ${t.length} dimensions.`);return e.getSizeFromDimensionRange(t,0,n)}static getSizeFromDimensionRange(e,t,n){let r=1;for(let i=t;i=0;--r)n[r]=n[r+1]*e[r+1];return n}static normalizeAxis(e,t){if(e<-t&&e>=t)throw Error(`unsupported axis for this operation.`);return e<0?e+t:e}static normalizeAxes(e,t){return e.map(n=>this.normalizeAxis(n,t??e.length))}static sortBasedOnPerm(e,t){return t?t.map(t=>e[t]):e.slice().reverse()}static padShape(e,t){let n=e.length;return e.map((e,r)=>e+t[r]+t[r+n])}static areEqual(e,t){return e.length===t.length?e.every((e,n)=>e===t[n]):!1}},gn=class e{static adjustPoolAttributes(e,t,n,r,i,a){if(!e&&n.length!==t.length-2)throw Error(`length of specified kernel shapes should be 2 less than length of input dimensions`);if(e)for(let e=0;e=n.length?n.push(t[e+2]):n[e]=t[e+2];for(let e=0;e=n[e]||a[e+n.length]>=n[e])throw Error(`pads should be smaller than kernel`)}}static adjustPadsBasedOnAutoPad(t,n,r,i,a,o,s){if(s){if(a.length!==2*(t.length-2))throw Error(`length of pads should be twice the length of data dimensions`);if(n.length!==t.length-2)throw Error(`length of strides should be the length of data dimensions`);if(i.length!==t.length-2)throw Error(`length of kernel shapes should be the length of data dimensions`);for(let c=0;c{"use strict";V(),bn=(e,t)=>new($t(t))(e)}),Sn,Cn,wn,Tn,En,Dn,On,kn,An,jn,Mn=M(()=>{"use strict";pn(),Sn=(e,t=!0)=>{if(e.byteLength%8!=0)throw Error(`Invalid Uint8Array length - must be a multiple of 8 (BigInt).`);let n=e.byteLength/8,r=new BigInt64Array(e.buffer,e.byteOffset,n),i=new Int32Array(n);for(let e=0;e2147483647n||t<-2147483648n)throw Error(`Overflow occurred when converting BigInt to Int32 at index ${e}: ${t}`);i[e]=Number(t)}return t?new Uint8Array(i.buffer):i},Cn=(e,t=!0)=>{if(e.byteLength%4!=0)throw Error(`Invalid Uint8Array length - must be a multiple of 4 (Int32).`);let n=e.byteLength/4,r=new Int32Array(e.buffer,e.byteOffset,n),i=BigInt64Array.from(r,BigInt);return t?new Uint8Array(i.buffer):i},wn=1,Tn=()=>wn++,En=new Map([[`float32`,32],[`float16`,16],[`int32`,32],[`uint32`,32],[`int64`,64],[`uint64`,64],[`int8`,8],[`uint8`,8],[`int4`,4],[`uint4`,4]]),Dn=(e,t)=>{let n=En.get(e);if(!n)throw Error(`Unsupported data type.`);return t.length>0?Math.ceil(t.reduce((e,t)=>e*t)*n/8):0},On=class{constructor(e){this.shouldConvertInt64toInt32=!1,this.isInt64ToInt32Converted=!1;let{sessionId:t,context:n,tensor:r,dataType:i,shape:a,shouldConvertInt64toInt32:o=!1}=e;this.sessionId=t,this.mlContext=n,this.mlTensor=r,this.dataType=i,this.tensorShape=a,this.shouldConvertInt64toInt32=o}get tensor(){return this.mlTensor}get type(){return this.dataType}get shape(){return this.tensorShape}get byteLength(){return Dn(this.dataType,this.tensorShape)}destroy(){H(`verbose`,()=>`[WebNN] TensorWrapper.destroy`),this.mlTensor.destroy()}write(e){this.mlContext.writeTensor(this.mlTensor,e)}async read(e,t){if(e){let e=await this.mlContext.readTensor(this.mlTensor),n=Cn(new Uint8Array(e));if(t){(t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)).set(n);return}else return n.buffer}else return t?this.mlContext.readTensor(this.mlTensor,t):this.mlContext.readTensor(this.mlTensor)}canReuseTensor(e,t,n){return this.mlContext===e&&this.dataType===t&&this.tensorShape.length===n.length&&this.tensorShape.every((e,t)=>e===n[t])}setIsInt64ToInt32Converted(e){this.isInt64ToInt32Converted=e}},kn=class{constructor(e,t){this.tensorManager=e,this.wrapper=t}get tensorWrapper(){return this.wrapper}releaseTensor(){this.tensorWrapper&&(this.tensorManager.releaseTensor(this.tensorWrapper),this.wrapper=void 0)}async ensureTensor(e,t,n,r){let i=t,a=this.tensorManager.getMLContext(e),o=i===`int64`&&!a.opSupportLimits().input.dataTypes.includes(`int64`);if(o&&(i=`int32`,H(`verbose`,()=>`[WebNN] TensorIdTracker.ensureTensor: convert dataType from int64 to int32`)),this.wrapper){if(this.wrapper.canReuseTensor(a,i,n))return this.wrapper.tensor;if(r){if(this.wrapper.byteLength!==Dn(i,n))throw Error(`Unable to copy data to tensor with different size.`);this.activeUpload=new Uint8Array(await this.wrapper.read())}this.tensorManager.releaseTensor(this.wrapper)}let s=typeof MLTensorUsage>`u`?void 0:MLTensorUsage.READ|MLTensorUsage.WRITE;return this.wrapper=await this.tensorManager.getCachedTensor(e,i,n,s,!0,!0,o),r&&this.activeUpload&&(this.wrapper.write(this.activeUpload),this.activeUpload=void 0),this.wrapper.tensor}upload(e){let t=e;if(this.wrapper)if(this.wrapper.shouldConvertInt64toInt32&&(t=Sn(e,!0),this.wrapper.setIsInt64ToInt32Converted(!0)),t.byteLength===this.wrapper.byteLength){this.wrapper.write(t);return}else H(`verbose`,()=>`Data size does not match tensor size. Releasing tensor.`),this.releaseTensor();this.activeUpload?this.activeUpload.set(t):this.activeUpload=new Uint8Array(t)}async download(e){if(this.activeUpload){let t=this.wrapper?.isInt64ToInt32Converted?Cn(this.activeUpload):this.activeUpload;if(e){e instanceof ArrayBuffer?new Uint8Array(e).set(t):new Uint8Array(e.buffer,e.byteOffset,e.byteLength).set(t);return}else return t.buffer}if(!this.wrapper)throw Error(`Tensor has not been created.`);return e?this.wrapper.read(this.wrapper?.shouldConvertInt64toInt32,e):this.wrapper.read(this.wrapper?.shouldConvertInt64toInt32)}},An=class{constructor(e){this.backend=e,this.tensorTrackersById=new Map,this.freeTensors=[],this.externalTensors=new Set}getMLContext(e){let t=this.backend.getMLContext(e);if(!t)throw Error(`MLContext not found for session.`);return t}reserveTensorId(){let e=Tn();return this.tensorTrackersById.set(e,new kn(this)),e}releaseTensorId(e){let t=this.tensorTrackersById.get(e);t&&(this.tensorTrackersById.delete(e),t.tensorWrapper&&this.releaseTensor(t.tensorWrapper))}async ensureTensor(e,t,n,r,i){H(`verbose`,()=>`[WebNN] TensorManager.ensureTensor {tensorId: ${t}, dataType: ${n}, shape: ${r}, copyOld: ${i}}`);let a=this.tensorTrackersById.get(t);if(!a)throw Error(`Tensor not found.`);return a.ensureTensor(e,n,r,i)}upload(e,t){let n=this.tensorTrackersById.get(e);if(!n)throw Error(`Tensor not found.`);n.upload(t)}async download(e,t){H(`verbose`,()=>`[WebNN] TensorManager.download {tensorId: ${e}, dstBuffer: ${t?.byteLength}}`);let n=this.tensorTrackersById.get(e);if(!n)throw Error(`Tensor not found.`);return n.download(t)}releaseTensorsForSession(e){for(let t of this.freeTensors)t.sessionId===e&&t.destroy();this.freeTensors=this.freeTensors.filter(t=>t.sessionId!==e)}registerTensor(e,t,n,r){let i=this.getMLContext(e),a=Tn(),o=new On({sessionId:e,context:i,tensor:t,dataType:n,shape:r});return this.tensorTrackersById.set(a,new kn(this,o)),this.externalTensors.add(o),a}async getCachedTensor(e,t,n,r,i,a,o=!1){let s=this.getMLContext(e);for(let[r,i]of this.freeTensors.entries())if(i.canReuseTensor(s,t,n)){H(`verbose`,()=>`[WebNN] Reusing tensor {dataType: ${t}, shape: ${n}}`);let i=this.freeTensors.splice(r,1)[0];return i.sessionId=e,i}H(`verbose`,()=>`[WebNN] MLContext.createTensor {dataType: ${t}, shape: ${n}}`);let c=await s.createTensor({dataType:t,shape:n,dimensions:n,usage:r,writable:i,readable:a});return new On({sessionId:e,context:s,tensor:c,dataType:t,shape:n,shouldConvertInt64toInt32:o})}releaseTensor(e){this.externalTensors.has(e)&&this.externalTensors.delete(e),this.freeTensors.push(e)}},jn=(...e)=>new An(...e)}),Nn,Pn,Fn,In=M(()=>{"use strict";V(),It(),xn(),Mn(),pn(),Nn=new Map([[1,`float32`],[10,`float16`],[6,`int32`],[12,`uint32`],[7,`int64`],[13,`uint64`],[22,`int4`],[21,`uint4`],[3,`int8`],[2,`uint8`],[9,`uint8`]]),Pn=(e,t)=>{if(e===t)return!0;if(e===void 0||t===void 0)return!1;let n=Object.keys(e).sort(),r=Object.keys(t).sort();return n.length===r.length&&n.every((n,i)=>n===r[i]&&e[n]===t[n])},Fn=class{constructor(e){this.tensorManager=jn(this),this.mlContextBySessionId=new Map,this.sessionIdsByMLContext=new Map,this.mlContextCache=[],this.sessionGraphInputs=new Map,this.temporaryGraphInputs=[],this.temporarySessionTensorIds=new Map,dn(e.logLevel,!!e.debug)}get currentSessionId(){if(this.activeSessionId===void 0)throw Error(`No active session`);return this.activeSessionId}onRunStart(e){H(`verbose`,()=>`[WebNN] onRunStart {sessionId: ${e}}`),this.activeSessionId=e}onRunEnd(e){H(`verbose`,()=>`[WebNN] onRunEnd {sessionId: ${e}}`);let t=this.temporarySessionTensorIds.get(e);if(t){for(let e of t)H(`verbose`,()=>`[WebNN] releasing temporary tensor {tensorId: ${e}}`),this.tensorManager.releaseTensorId(e);this.temporarySessionTensorIds.delete(e),this.activeSessionId=void 0}}async createMLContext(e){if(e instanceof GPUDevice){let t=this.mlContextCache.findIndex(t=>t.gpuDevice===e);if(t!==-1)return this.mlContextCache[t].mlContext;{let t=await navigator.ml.createContext(e);return this.mlContextCache.push({gpuDevice:e,mlContext:t}),t}}else if(e===void 0){let e=this.mlContextCache.findIndex(e=>e.options===void 0&&e.gpuDevice===void 0);if(e!==-1)return this.mlContextCache[e].mlContext;{let e=await navigator.ml.createContext();return this.mlContextCache.push({mlContext:e}),e}}let t=this.mlContextCache.findIndex(t=>Pn(t.options,e));if(t!==-1)return this.mlContextCache[t].mlContext;{let t=await navigator.ml.createContext(e);return this.mlContextCache.push({options:e,mlContext:t}),t}}registerMLContext(e,t){this.mlContextBySessionId.set(e,t);let n=this.sessionIdsByMLContext.get(t);n||(n=new Set,this.sessionIdsByMLContext.set(t,n)),n.add(e),this.temporaryGraphInputs.length>0&&(this.sessionGraphInputs.set(e,this.temporaryGraphInputs),this.temporaryGraphInputs=[])}onReleaseSession(e){this.sessionGraphInputs.delete(e);let t=this.mlContextBySessionId.get(e);if(!t)return;this.tensorManager.releaseTensorsForSession(e),this.mlContextBySessionId.delete(e);let n=this.sessionIdsByMLContext.get(t);if(n.delete(e),n.size===0){this.sessionIdsByMLContext.delete(t);let e=this.mlContextCache.findIndex(e=>e.mlContext===t);e!==-1&&this.mlContextCache.splice(e,1)}}getMLContext(e){return this.mlContextBySessionId.get(e)}reserveTensorId(){return this.tensorManager.reserveTensorId()}releaseTensorId(e){H(`verbose`,()=>`[WebNN] releaseTensorId {tensorId: ${e}}`),this.tensorManager.releaseTensorId(e)}async ensureTensor(e,t,n,r,i){let a=Nn.get(n);if(!a)throw Error(`Unsupported ONNX data type: ${n}`);return this.tensorManager.ensureTensor(e??this.currentSessionId,t,a,r,i)}async createTemporaryTensor(e,t,n){H(`verbose`,()=>`[WebNN] createTemporaryTensor {onnxDataType: ${t}, shape: ${n}}`);let r=Nn.get(t);if(!r)throw Error(`Unsupported ONNX data type: ${t}`);let i=this.tensorManager.reserveTensorId();await this.tensorManager.ensureTensor(e,i,r,n,!1);let a=this.temporarySessionTensorIds.get(e);return a?a.push(i):this.temporarySessionTensorIds.set(e,[i]),i}uploadTensor(e,t){if(!Ft().shouldTransferToMLTensor)throw Error(`Trying to upload to a MLTensor while shouldTransferToMLTensor is false`);H(`verbose`,()=>`[WebNN] uploadTensor {tensorId: ${e}, data: ${t.byteLength}}`),this.tensorManager.upload(e,t)}async downloadTensor(e,t){return this.tensorManager.download(e,t)}createMLTensorDownloader(e,t){return async()=>{let n=await this.tensorManager.download(e);return bn(n,t)}}registerMLTensor(e,t,n,r){let i=Nn.get(n);if(!i)throw Error(`Unsupported ONNX data type: ${n}`);let a=this.tensorManager.registerTensor(e,t,i,r);return H(`verbose`,()=>`[WebNN] registerMLTensor {tensor: ${t}, dataType: ${i}, dimensions: ${r}} -> {tensorId: ${a}}`),a}registerMLConstant(e,t,n,r,i,a,o=!1){if(!a)throw Error(`External mounted files are not available.`);let s=e;e.startsWith(`./`)&&(s=e.substring(2));let c=a.get(s);if(!c)throw Error(`File with name ${s} not found in preloaded files.`);if(t+n>c.byteLength)throw Error(`Out of bounds: data offset and length exceed the external file data size.`);let l=c.slice(t,t+n).buffer,u;switch(i.dataType){case`float32`:u=new Float32Array(l);break;case`float16`:u=typeof Float16Array<`u`&&Float16Array.from?new Float16Array(l):new Uint16Array(l);break;case`int32`:u=new Int32Array(l);break;case`uint32`:u=new Uint32Array(l);break;case`int64`:o?(u=Sn(new Uint8Array(l),!1),i.dataType=`int32`):u=new BigInt64Array(l);break;case`uint64`:u=new BigUint64Array(l);break;case`int8`:u=new Int8Array(l);break;case`int4`:case`uint4`:case`uint8`:u=new Uint8Array(l);break;default:throw Error(`Unsupported data type: ${i.dataType} in creating WebNN Constant from external data.`)}return H(`verbose`,()=>`[WebNN] registerMLConstant {dataType: ${i.dataType}, shape: ${i.shape}}} ${o?`(Note: it was int64 data type and registered to int32 as workaround)`:``}`),r.constant(i,u)}registerGraphInput(e){this.temporaryGraphInputs.push(e)}isGraphInput(e,t){let n=this.sessionGraphInputs.get(e);return n?n.includes(t):!1}isInt64Supported(e){return!!this.mlContextBySessionId.get(e)?.opSupportLimits().input.dataTypes.includes(`int64`)}flush(){}}}),Ln=M(()=>{"use strict";}),Rn,zn,Bn,Vn,Hn,Un,Wn,Gn,Kn,qn=M(()=>{"use strict";pn(),Ln(),Rn=new Map([[64,250],[128,200],[256,200],[512,200],[2048,230],[4096,200],[8192,50],[16384,50],[32768,50],[65536,50],[131072,50],[262144,50],[524288,50],[1048576,50],[2097152,30],[4194304,20],[8388608,10],[12582912,10],[16777216,10],[26214400,15],[33554432,22],[44236800,2],[58982400,6],[67108864,6],[134217728,6],[167772160,6]]),zn=[],Bn=e=>Math.ceil(Number(e)/16)*16,Vn=e=>{for(let t=0;tHn++,Wn=async(e,t,n,r)=>{let i=Bn(n),a=e.device.createBuffer({size:i,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ});try{let o=e.getCommandEncoder();e.endComputePass(),o.copyBufferToBuffer(t,0,a,0,i),e.flush(),await a.mapAsync(GPUMapMode.READ);let s=a.getMappedRange();if(r){let e=r();return e.set(new Uint8Array(s,0,n)),e}else return new Uint8Array(s.slice(0,n))}finally{a.destroy()}},Gn=class{constructor(e){this.backend=e,this.storageCache=new Map,this.freeBuffers=new Map,this.freeUniformBuffers=new Map,this.buffersPending=[],this.capturedPendingBuffers=new Map;for(let[e]of Rn)zn.push(e),this.freeBuffers.set(e,[]),this.freeUniformBuffers.set(e,[]);this.sessionCount=0}upload(e,t){let n=t.buffer,r=t.byteOffset,i=t.byteLength,a=Bn(i),o=this.storageCache.get(e);if(!o)throw Error(`gpu data for uploading does not exist`);if(Number(o.originalSize)!==i)throw Error(`inconsistent data size. gpu data size=${o.originalSize}, data size=${i}`);let s=this.backend.device.createBuffer({mappedAtCreation:!0,size:a,usage:GPUBufferUsage.MAP_WRITE|GPUBufferUsage.COPY_SRC}),c=s.getMappedRange();new Uint8Array(c).set(new Uint8Array(n,r,i)),s.unmap();let l=this.backend.device.createCommandEncoder();l.copyBufferToBuffer(s,0,o.gpuData.buffer,0,a),this.backend.device.queue.submit([l.finish()]),s.destroy(),H(`verbose`,()=>`[WebGPU] GpuDataManager.upload(id=${e})`)}memcpy(e,t){let n=this.storageCache.get(e);if(!n)throw Error(`source gpu data for memcpy does not exist`);let r=this.storageCache.get(t);if(!r)throw Error(`destination gpu data for memcpy does not exist`);if(n.originalSize!==r.originalSize)throw Error(`inconsistent source and destination gpu data size`);let i=Bn(n.originalSize),a=this.backend.getCommandEncoder();this.backend.endComputePass(),a.copyBufferToBuffer(n.gpuData.buffer,0,r.gpuData.buffer,0,i)}registerExternalBuffer(e,t,n){let r;if(n){if(r=n[0],e===n[1])return H(`verbose`,()=>`[WebGPU] GpuDataManager.registerExternalBuffer(size=${t}) => id=${r}, buffer is the same, skip.`),r;if(this.backend.capturedCommandList.has(this.backend.currentSessionId))throw Error(`Registering a different external buffer under graph capture mode is not supported yet. - Please use the previous external buffer!`)}else r=Un();return this.storageCache.set(r,{gpuData:{id:r,type:0,buffer:e},originalSize:t}),H(`verbose`,()=>`[WebGPU] GpuDataManager.registerExternalBuffer(size=${t}) => id=${r}, registered.`),r}unregisterExternalBuffer(e){e!==void 0&&(this.storageCache.delete(e),H(`verbose`,()=>`[WebGPU] GpuDataManager.unregisterExternalBuffer() => id=${e}`))}create(e,t=GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST){let n=Vn(e),r,i=(t&GPUBufferUsage.STORAGE)===GPUBufferUsage.STORAGE,a=(t&GPUBufferUsage.UNIFORM)===GPUBufferUsage.UNIFORM;if(i||a){let e=(i?this.freeBuffers:this.freeUniformBuffers).get(n);r=e&&e.length>0?e.pop():this.backend.device.createBuffer({size:n,usage:t})}else r=this.backend.device.createBuffer({size:n,usage:t});let o={id:Un(),type:0,buffer:r};return this.storageCache.set(o.id,{gpuData:o,originalSize:Number(e)}),H(`verbose`,()=>`[WebGPU] GpuDataManager.create(size=${e}) => id=${o.id}`),o}get(e){return this.storageCache.get(e)?.gpuData}release(e){let t=typeof e==`bigint`?Number(e):e,n=this.storageCache.get(t);if(!n){if(this.storageCache.size===0)return 0;throw Error(`releasing data does not exist`)}return H(`verbose`,()=>`[WebGPU] GpuDataManager.release(id=${t}), gpuDataId=${n.gpuData.id}`),this.storageCache.delete(t),this.buffersPending.push(n.gpuData.buffer),n.originalSize}async download(e,t){let n=this.storageCache.get(Number(e));if(!n)throw Error(`data does not exist`);await Wn(this.backend,n.gpuData.buffer,n.originalSize,t)}refreshPendingBuffers(){if(this.buffersPending.length!==0)if(this.backend.sessionStatus===`default`){for(let e of this.buffersPending){let t=Rn.get(e.size);if((e.usage&GPUBufferUsage.STORAGE)===GPUBufferUsage.STORAGE){let n=this.freeBuffers.get(e.size)||[];t===void 0||n.length>=t?e.destroy():n.push(e)}else if((e.usage&GPUBufferUsage.UNIFORM)===GPUBufferUsage.UNIFORM){let n=this.freeUniformBuffers.get(e.size)||[];t===void 0||n.length>=t?e.destroy():n.push(e)}else e.destroy()}this.buffersPending=[]}else{let e=this.capturedPendingBuffers.get(this.backend.currentSessionId);e||(e=[],this.capturedPendingBuffers.set(this.backend.currentSessionId,e));for(let t of this.buffersPending)e.push(t);this.buffersPending=[]}}dispose(){this.freeBuffers.forEach(e=>{e.forEach(e=>{e.destroy()})}),this.freeUniformBuffers.forEach(e=>{e.forEach(e=>{e.destroy()})}),this.storageCache.forEach(e=>{e.gpuData.buffer.destroy()}),this.capturedPendingBuffers.forEach(e=>{e.forEach(e=>{e.destroy()})}),this.storageCache=new Map,this.freeBuffers=new Map,this.freeUniformBuffers=new Map,this.capturedPendingBuffers=new Map}onCreateSession(){this.sessionCount+=1}onReleaseSession(e){let t=this.capturedPendingBuffers.get(e);t&&(t.forEach(e=>{e.destroy()}),this.capturedPendingBuffers.delete(e)),--this.sessionCount,this.sessionCount===0&&(H(`warning`,()=>`[WebGPU] Clearing webgpu buffer cache`),this.storageCache.forEach(e=>{e.gpuData.buffer.destroy()}),this.storageCache=new Map)}},Kn=(...e)=>new Gn(...e)}),Jn,Yn,Xn=M(()=>{"use strict";Jn=class{constructor(e){Object.assign(this,e)}get cacheKey(){return this.key||=Object.getOwnPropertyNames(this).sort().map(e=>`${this[e]}`).join(`;`),this.key}},Yn=e=>new Jn(e)}),Zn,Qn,$n,er,G,tr,nr,rr,ir,K,ar,q,J,or,sr,cr,lr,Y=M(()=>{"use strict";V(),W(),Zn=64,Qn=(e,t)=>{if(t===3)throw Error(`vec3 has same alignment as vec4, use vec4 instead`);switch(Number(e)){case 10:return t>1?`vec${t}`:`f16`;case 1:return t>1?`vec${t}`:`f32`;case 6:return t>1?`vec${t}`:`i32`;case 12:return t>1?`vec${t}`:`u32`;case 7:if(t>1)throw Error(`currently not supported vecX of uint64 yet`);return[`vec2`,`i32`];case 13:if(t>1)throw Error(`currently not supported vecX of uint64 yet`);return[`vec2`,`u32`];case 9:if(t!==4)throw Error(`bool must be vec4`);return[`u32`,`vec4`];case 22:return`i32`;case 21:return`u32`;default:throw Error(`Unknown data type: ${e}`)}},$n=(e,t=1)=>{let n=Qn(e,t);return typeof n==`string`?n:n[0]},er=(e,t=1)=>{let n=Qn(e,t);return typeof n==`string`?n:n[1]},G=(...e)=>{let t=[];return e.forEach(e=>{e.length!==0&&t.push({type:12,data:e},{type:12,data:U.computeStrides(e)})}),t},tr=e=>e%4==0?4:e%2==0?2:1,nr=(e=`f32`,t,n=`0`)=>!t||t===1?`${e}(${n})`:`vec${t}<${e}>(${n})`,rr=(e,t,n)=>e===`f32`?n:t===1?`f32(${n})`:`vec${t}(${n})`,ir=(e,t)=>t===4?`(${e}.x + ${e}.y + ${e}.z + ${e}.w)`:t===2?`(${e}.x + ${e}.y)`:t===3?`(${e}.x + ${e}.y + ${e}.z)`:e,K=(e,t,n,r)=>e.startsWith(`uniforms.`)&&n>4?typeof t==`string`?r===`f16`?`${e}[(${t}) / 8][(${t}) % 8 / 4][(${t}) % 8 % 4]`:`${e}[(${t}) / 4][(${t}) % 4]`:r===`f16`?`${e}[${Math.floor(t/8)}][${Math.floor(t%8/4)}][${t%8%4}]`:`${e}[${Math.floor(t/4)}][${t%4}]`:n>1?`${e}[${t}]`:e,ar=(e,t,n,r,i)=>{let a=typeof n==`number`,o=a?n:n.length,s=[...Array(o).keys()],c=o<2?`u32`:o<=4?`vec${o}`:`array`,l=Qn(t,i),u=typeof l==`string`?l:l[1],d=typeof l==`string`?l:l[0],f={indices:c,value:u,storage:d,tensor:t},p=e=>typeof e==`string`?e:`${e}u`,m={offsetToIndices:!1,indicesToOffset:!1,broadcastedIndicesToOffset:!1,set:!1,setByIndices:!1,get:!1,getByIndices:!1},h=a?`uniforms.`:``,g=`${h}${e}_shape`,_=`${h}${e}_strides`,v=``;for(let e=0;ee.name).join(`, `)}) => ${r.name}>`,hn(_n(n,e))}function G(e){return e=fn(e>>>0),yt(r[e])}function yn(e,t){return t>>>=0,e=vt(e>>>0),t=vt(t),yt(e[t])}function bn(e){9<(e>>>=0)&&(gt[e+1]+=1)}function xn(){return yt([])}function Sn(e){e=vt(e>>>0);for(var t=Array(e.length),n=0;n>>0))}function wn(){return yt({})}function Tn(e){for(var t=vt(e>>>=0);t.length;){var n=t.pop();t.pop()(n)}_t(e)}function En(e,t,n){t>>>=0,n>>>=0,e=vt(e>>>0),t=vt(t),n=vt(n),e[t]=n}function Dn(e,t){return t>>>=0,e=(e=qt(e>>>0,`_emval_take_value`)).readValueFromPointer(t),yt(e)}function On(e,t){e=-9007199254740992>e||9007199254740992>>=0,e=new Date(1e3*e),M()[t>>>2>>>0]=e.getUTCSeconds(),M()[t+4>>>2>>>0]=e.getUTCMinutes(),M()[t+8>>>2>>>0]=e.getUTCHours(),M()[t+12>>>2>>>0]=e.getUTCDate(),M()[t+16>>>2>>>0]=e.getUTCMonth(),M()[t+20>>>2>>>0]=e.getUTCFullYear()-1900,M()[t+24>>>2>>>0]=e.getUTCDay(),e=(e.getTime()-Date.UTC(e.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,M()[t+28>>>2>>>0]=e}var kn=e=>e%4==0&&(e%100!=0||e%400==0),An=[0,31,60,91,121,152,182,213,244,274,305,335],jn=[0,31,59,90,120,151,181,212,243,273,304,334];function Mn(e,t){e=-9007199254740992>e||9007199254740992>>=0,e=new Date(1e3*e),M()[t>>>2>>>0]=e.getSeconds(),M()[t+4>>>2>>>0]=e.getMinutes(),M()[t+8>>>2>>>0]=e.getHours(),M()[t+12>>>2>>>0]=e.getDate(),M()[t+16>>>2>>>0]=e.getMonth(),M()[t+20>>>2>>>0]=e.getFullYear()-1900,M()[t+24>>>2>>>0]=e.getDay();var n=(kn(e.getFullYear())?An:jn)[e.getMonth()]+e.getDate()-1|0;M()[t+28>>>2>>>0]=n,M()[t+36>>>2>>>0]=-60*e.getTimezoneOffset(),n=new Date(e.getFullYear(),6,1).getTimezoneOffset();var r=new Date(e.getFullYear(),0,1).getTimezoneOffset();e=0|(n!=r&&e.getTimezoneOffset()==Math.min(r,n)),M()[t+32>>>2>>>0]=e}function Nn(e){e>>>=0;var t=new Date(M()[e+20>>>2>>>0]+1900,M()[e+16>>>2>>>0],M()[e+12>>>2>>>0],M()[e+8>>>2>>>0],M()[e+4>>>2>>>0],M()[e>>>2>>>0],0),n=M()[e+32>>>2>>>0],r=t.getTimezoneOffset(),i=new Date(t.getFullYear(),6,1).getTimezoneOffset(),a=new Date(t.getFullYear(),0,1).getTimezoneOffset(),o=Math.min(a,i);return 0>n?M()[e+32>>>2>>>0]=+(i!=a&&o==r):0>>2>>>0]=t.getDay(),n=(kn(t.getFullYear())?An:jn)[t.getMonth()]+t.getDate()-1|0,M()[e+28>>>2>>>0]=n,M()[e>>>2>>>0]=t.getSeconds(),M()[e+4>>>2>>>0]=t.getMinutes(),M()[e+8>>>2>>>0]=t.getHours(),M()[e+12>>>2>>>0]=t.getDate(),M()[e+16>>>2>>>0]=t.getMonth(),M()[e+20>>>2>>>0]=t.getYear(),e=t.getTime(),BigInt(isNaN(e)?-1:e/1e3)}function Pn(e,t,n,r,i,a,o){return s?B(16,1,e,t,n,r,i,a,o):-52}function Fn(e,t,n,r,i,a){if(s)return B(17,1,e,t,n,r,i,a)}var In={},Ln=()=>performance.timeOrigin+performance.now();function Rn(e,t){if(s)return B(18,1,e,t);if(In[e]&&(clearTimeout(In[e].id),delete In[e]),!t)return 0;var n=setTimeout(()=>{delete In[e],Rt(()=>Cr(e,performance.timeOrigin+performance.now()))},t);return In[e]={id:n,qc:t},0}function zn(e,t,n,r){e>>>=0,t>>>=0,n>>>=0,r>>>=0;var i=new Date().getFullYear(),a=new Date(i,0,1).getTimezoneOffset();i=new Date(i,6,1).getTimezoneOffset();var o=Math.max(a,i);N()[e>>>2>>>0]=60*o,M()[t>>>2>>>0]=+(a!=i),e=(t=e=>{var t=Math.abs(e);return`UTC${0<=e?`-`:`+`}${String(Math.floor(t/60)).padStart(2,`0`)}${String(t%60).padStart(2,`0`)}`})(a),t=t(i),iDate.now(),Vn=1;function Hn(e,t,n){if(!(0<=e&&3>=e))return 28;if(e===0)e=Date.now();else{if(!Vn)return 52;e=performance.timeOrigin+performance.now()}return A[n>>>0>>>3]=BigInt(Math.round(1e6*e)),0}var Un=[],Wn=(e,t)=>{Un.length=0;for(var n;n=ae()[e++>>>0];){var r=n!=105;t+=(r&=n!=112)&&t%8?4:0,Un.push(n==112?N()[t>>>2>>>0]:n==106?A[t>>>3]:n==105?M()[t>>>2>>>0]:le()[t>>>3>>>0]),t+=r?8:4}return Un};function Gn(e,t,n){return e>>>=0,t=Wn(t>>>0,n>>>0),L[e](...t)}function Kn(e,t,n){return e>>>=0,t=Wn(t>>>0,n>>>0),L[e](...t)}var qn=()=>{};function Jn(e,t){return y(H(e>>>0,t>>>0))}var Yn=()=>{throw Se+=1,`unwind`};function Xn(){return 4294901760}var Zn=()=>navigator.hardwareConcurrency;function Qn(){return I(`Cannot use emscripten_pc_get_function without -sUSE_OFFSET_CONVERTER`),0}function $n(e){e>>>=0;var t=ae().length;if(e<=t||4294901760=n;n*=2){var r=t*(1+.2/n);r=Math.min(r,e+100663296);e:{r=(Math.min(4294901760,65536*Math.ceil(Math.max(e,r)/65536))-b.buffer.byteLength+65535)/65536|0;try{b.grow(r),P();var i=1;break e}catch{}i=void 0}if(i)return!0}return!1}var K=()=>(I(`Cannot use convertFrameToPC (needed by __builtin_return_address) without -sUSE_OFFSET_CONVERTER`),0),er={},tr=e=>{e.forEach(e=>{var t=K();t&&(er[t]=e)})};function nr(){var e=Error().stack.toString().split(` +`);return e[0]==`Error`&&e.shift(),tr(e),er.Lb=K(),er.cc=e,er.Lb}function rr(e,t,n){if(e>>>=0,t>>>=0,er.Lb==e)var r=er.cc;else (r=Error().stack.toString().split(` +`))[0]==`Error`&&r.shift(),tr(r);for(var i=3;r[i]&&K()!=e;)++i;for(e=0;e>>2>>>0]=K();return e}var q,ir={},J=()=>{if(!q){var e,t={USER:`web_user`,LOGNAME:`web_user`,PATH:`/`,PWD:`/`,HOME:`/home/web_user`,LANG:(typeof navigator==`object`&&navigator.languages&&navigator.languages[0]||`C`).replace(`-`,`_`)+`.UTF-8`,_:`./this.program`};for(e in ir)ir[e]===void 0?delete t[e]:t[e]=ir[e];var n=[];for(e in t)n.push(`${e}=${t[e]}`);q=n}return q};function Y(e,t){if(s)return B(19,1,e,t);e>>>=0,t>>>=0;var n=0;return J().forEach((r,i)=>{var a=t+n;for(i=N()[e+4*i>>>2>>>0]=a,a=0;a>>0]=r.charCodeAt(a);ie()[i>>>0]=0,n+=r.length+1}),0}function ar(e,t){if(s)return B(20,1,e,t);e>>>=0,t>>>=0;var n=J();N()[e>>>2>>>0]=n.length;var r=0;return n.forEach(e=>r+=e.length+1),N()[t>>>2>>>0]=r,0}function or(e){return s?B(21,1,e):52}function sr(e,t,n,r){return s?B(22,1,e,t,n,r):52}function cr(e,t,n,r){return s?B(23,1,e,t,n,r):70}var X=[null,[],[]];function lr(e,t,n,r){if(s)return B(24,1,e,t,n,r);t>>>=0,n>>>=0,r>>>=0;for(var i=0,a=0;a>>2>>>0],c=N()[t+4>>>2>>>0];t+=8;for(var l=0;l>>0],d=X[e];u===0||u===10?((e===1?v:y)(Be(d)),d.length=0):d.push(u)}i+=c}return N()[r>>>2>>>0]=i,0}s||function(){for(var e=r.numThreads-1;e--;)Ne();be.unshift(()=>{me++,function(e){s?e():Promise.all(Ee.map(Me)).then(e)}(()=>ge())})}();for(var ur=Array(256),dr=0;256>dr;++dr)ur[dr]=String.fromCharCode(dr);nt=ur,rt=r.BindingError=class extends Error{constructor(e){super(e),this.name=`BindingError`}},r.InternalError=class extends Error{constructor(e){super(e),this.name=`InternalError`}},gt.push(0,1,void 0,1,null,1,!0,1,!1,1),r.count_emval_handles=()=>gt.length/2-5-ht.length;var Z,fr=[Ce,we,Re,Ve,He,Ge,Ke,qe,Je,Ye,Xe,Ze,Qe,$e,et,tt,Pn,Fn,Rn,Y,ar,or,sr,cr,lr];(async function(){function e(e,t){return Z=e.exports,Z=function(){var e=Z,t={};for(let[n,r]of Object.entries(e))t[n]=typeof r==`function`?(...e)=>{tn.push(n);try{return r(...e)}finally{j||(tn.pop(),$t&&Qt===1&&tn.length===0&&(Qt=0,Se+=1,Zt(jr),typeof Fibers<`u`&&Fibers.rc()))}}:r;return t}(),Z=function(){var e=Z,t=e=>t=>e(t)>>>0,n=e=>()=>e()>>>0;return(e=Object.assign({},e)).Da=t(e.Da),e.fb=n(e.fb),e.hb=t(e.hb),e.tb=t(e.tb),e.ub=n(e.ub),e.__cxa_get_exception_ptr=t(e.__cxa_get_exception_ptr),e}(),Oe.push(Z.ib),x=t,ge(),Z}me++;var t=_e();if(r.instantiateWasm)return new Promise(n=>{r.instantiateWasm(t,(t,r)=>{e(t,r),n(t.exports)})});if(s)return new Promise(t=>{de=n=>{var r=new WebAssembly.Instance(n,_e());t(e(r,n))}});F??=r.locateFile?r.locateFile?r.locateFile(`ort-wasm-simd-threaded.jsep.wasm`,h):h+`ort-wasm-simd-threaded.jsep.wasm`:new URL(`/assets/ort-wasm-simd-threaded.jsep-B0T3yYHD.wasm`,``+self.location.href).href;try{var i=await async function(e){var t=F;if(!ne&&typeof WebAssembly.instantiateStreaming==`function`&&!re(t))try{var n=fetch(t,{credentials:`same-origin`});return await WebAssembly.instantiateStreaming(n,e)}catch(e){y(`wasm streaming compile failed: ${e}`),y(`falling back to ArrayBuffer instantiation`)}return async function(e,t){try{var n=await async function(e){if(!ne)try{var t=await d(e);return new Uint8Array(t)}catch{}if(e==F&&ne)e=new Uint8Array(ne);else{if(!f)throw`both async and sync fetching of the wasm failed`;e=f(e)}return e}(e);return await WebAssembly.instantiate(n,t)}catch(e){y(`failed to asynchronously prepare wasm: ${e}`),I(e)}}(t,e)}(t);return e(i.instance,i.module)}catch(e){return n(e),Promise.reject(e)}})();var pr=e=>(pr=Z.Da)(e),mr=()=>(mr=Z.Ea)();r._OrtInit=(e,t)=>(r._OrtInit=Z.Fa)(e,t),r._OrtGetLastError=(e,t)=>(r._OrtGetLastError=Z.Ga)(e,t),r._OrtCreateSessionOptions=(e,t,n,i,a,o,s,c,l,u)=>(r._OrtCreateSessionOptions=Z.Ha)(e,t,n,i,a,o,s,c,l,u),r._OrtAppendExecutionProvider=(e,t,n,i,a)=>(r._OrtAppendExecutionProvider=Z.Ia)(e,t,n,i,a),r._OrtAddFreeDimensionOverride=(e,t,n)=>(r._OrtAddFreeDimensionOverride=Z.Ja)(e,t,n),r._OrtAddSessionConfigEntry=(e,t,n)=>(r._OrtAddSessionConfigEntry=Z.Ka)(e,t,n),r._OrtReleaseSessionOptions=e=>(r._OrtReleaseSessionOptions=Z.La)(e),r._OrtCreateSession=(e,t,n)=>(r._OrtCreateSession=Z.Ma)(e,t,n),r._OrtReleaseSession=e=>(r._OrtReleaseSession=Z.Na)(e),r._OrtGetInputOutputCount=(e,t,n)=>(r._OrtGetInputOutputCount=Z.Oa)(e,t,n),r._OrtGetInputOutputMetadata=(e,t,n,i)=>(r._OrtGetInputOutputMetadata=Z.Pa)(e,t,n,i),r._OrtFree=e=>(r._OrtFree=Z.Qa)(e),r._OrtCreateTensor=(e,t,n,i,a,o)=>(r._OrtCreateTensor=Z.Ra)(e,t,n,i,a,o),r._OrtGetTensorData=(e,t,n,i,a)=>(r._OrtGetTensorData=Z.Sa)(e,t,n,i,a),r._OrtReleaseTensor=e=>(r._OrtReleaseTensor=Z.Ta)(e),r._OrtCreateRunOptions=(e,t,n,i)=>(r._OrtCreateRunOptions=Z.Ua)(e,t,n,i),r._OrtAddRunConfigEntry=(e,t,n)=>(r._OrtAddRunConfigEntry=Z.Va)(e,t,n),r._OrtReleaseRunOptions=e=>(r._OrtReleaseRunOptions=Z.Wa)(e),r._OrtCreateBinding=e=>(r._OrtCreateBinding=Z.Xa)(e),r._OrtBindInput=(e,t,n)=>(r._OrtBindInput=Z.Ya)(e,t,n),r._OrtBindOutput=(e,t,n,i)=>(r._OrtBindOutput=Z.Za)(e,t,n,i),r._OrtClearBoundOutputs=e=>(r._OrtClearBoundOutputs=Z._a)(e),r._OrtReleaseBinding=e=>(r._OrtReleaseBinding=Z.$a)(e),r._OrtRunWithBinding=(e,t,n,i,a)=>(r._OrtRunWithBinding=Z.ab)(e,t,n,i,a),r._OrtRun=(e,t,n,i,a,o,s,c)=>(r._OrtRun=Z.bb)(e,t,n,i,a,o,s,c),r._OrtEndProfiling=e=>(r._OrtEndProfiling=Z.cb)(e),r._JsepOutput=(e,t,n)=>(r._JsepOutput=Z.db)(e,t,n),r._JsepGetNodeName=e=>(r._JsepGetNodeName=Z.eb)(e);var hr=()=>(hr=Z.fb)(),gr=r._free=e=>(gr=r._free=Z.gb)(e),_r=r._malloc=e=>(_r=r._malloc=Z.hb)(e),vr=(e,t,n,r,i,a)=>(vr=Z.kb)(e,t,n,r,i,a),yr=()=>(yr=Z.lb)(),br=(e,t,n,r,i)=>(br=Z.mb)(e,t,n,r,i),xr=e=>(xr=Z.nb)(e),Sr=e=>(Sr=Z.ob)(e),Cr=(e,t)=>(Cr=Z.pb)(e,t),wr=()=>(wr=Z.qb)(),Tr=(e,t)=>(Tr=Z.rb)(e,t),Er=e=>(Er=Z.sb)(e),Dr=e=>(Dr=Z.tb)(e),Or=()=>(Or=Z.ub)(),kr=r.dynCall_ii=(e,t)=>(kr=r.dynCall_ii=Z.vb)(e,t),Ar=e=>(Ar=Z.wb)(e),jr=()=>(jr=Z.xb)(),Mr=e=>(Mr=Z.yb)(e),Nr=()=>(Nr=Z.zb)();return r.stackSave=()=>Or(),r.stackRestore=e=>Er(e),r.stackAlloc=e=>Dr(e),r.setValue=function(e,t,n=`i8`){switch(n.endsWith(`*`)&&(n=`*`),n){case`i1`:case`i8`:ie()[e>>>0]=t;break;case`i16`:oe()[e>>>1>>>0]=t;break;case`i32`:M()[e>>>2>>>0]=t;break;case`i64`:A[e>>>3]=BigInt(t);break;case`float`:ce()[e>>>2>>>0]=t;break;case`double`:le()[e>>>3>>>0]=t;break;case`*`:N()[e>>>2>>>0]=t;break;default:I(`invalid type for setValue: ${n}`)}},r.getValue=function(e,t=`i8`){switch(t.endsWith(`*`)&&(t=`*`),t){case`i1`:case`i8`:return ie()[e>>>0];case`i16`:return oe()[e>>>1>>>0];case`i32`:return M()[e>>>2>>>0];case`i64`:return A[e>>>3];case`float`:return ce()[e>>>2>>>0];case`double`:return le()[e>>>3>>>0];case`*`:return N()[e>>>2>>>0];default:I(`invalid type for getValue: ${t}`)}},r.UTF8ToString=H,r.stringToUTF8=We,r.lengthBytesUTF8=Ue,function e(){if(0{"use strict";Qe(),ut=typeof location>`u`?void 0:location.origin,dt=self.location.href>`file:`&&self.location.href<`file;`,ft=()=>{if(dt){let e=URL;return new URL(new e(`ort.bundle.min.mjs`,self.location.href).href,ut).href}return self.location.href},pt=ft(),mt=()=>{if(pt&&!pt.startsWith(`blob:`))return pt.substring(0,pt.lastIndexOf(`/`)+1)},ht=(e,t)=>{try{let n=t??pt;return(n?new URL(e,n):new URL(e)).origin===ut}catch{return!1}},gt=(e,t)=>{let n=t??pt;try{return(n?new URL(e,n):new URL(e)).href}catch{return}},_t=(e,t)=>`${t??`./`}${e}`,vt=async e=>{let t=await(await fetch(e,{credentials:`same-origin`})).blob();return URL.createObjectURL(t)},yt=async e=>(await import(e)).default,bt=(rt(),le($e)).default,xt=async()=>{if(!pt)throw Error(`Failed to load proxy worker: cannot determine the script source URL.`);if(ht(pt))return[void 0,bt()];let e=await vt(pt);return[e,bt(e)]},St=(lt(),le(it)).default,Ct=async(e,t,n)=>{if(!e&&!t&&St&&pt&&ht(pt))return[void 0,St];{let r=`ort-wasm-simd-threaded.jsep.mjs`,i=e??gt(r,t),a=n&&i&&!ht(i,t),o=a?await vt(i):i??_t(r,t);return[a?o:void 0,await yt(o)]}}}),Tt,Et,Dt,Ot,kt,At,jt,Mt,Nt,Pt=M(()=>{"use strict";wt(),Et=!1,Dt=!1,Ot=!1,kt=()=>{if(typeof SharedArrayBuffer>`u`)return!1;try{return typeof MessageChannel<`u`&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(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]))}catch{return!1}},At=()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,30,1,28,0,65,0,253,15,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,186,1,26,11]))}catch{return!1}},jt=()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,19,1,17,0,65,1,253,15,65,2,253,15,65,3,253,15,253,147,2,11]))}catch{return!1}},Mt=async e=>{if(Et)return Promise.resolve();if(Dt)throw Error(`multiple calls to 'initializeWebAssembly()' detected.`);if(Ot)throw Error(`previous call to 'initializeWebAssembly()' failed.`);Dt=!0;let t=e.initTimeout,n=e.numThreads;if(e.simd!==!1){if(e.simd===`relaxed`){if(!jt())throw Error(`Relaxed WebAssembly SIMD is not supported in the current environment.`)}else if(!At())throw Error(`WebAssembly SIMD is not supported in the current environment.`)}let r=kt();n>1&&!r&&(typeof self<`u`&&!self.crossOriginIsolated&&console.warn(`env.wasm.numThreads is set to `+n+`, but this will not work unless you enable crossOriginIsolated mode. See https://web.dev/cross-origin-isolation-guide/ for more info.`),console.warn(`WebAssembly multi-threading is not supported in the current environment. Falling back to single-threading.`),e.numThreads=n=1);let i=e.wasmPaths,a=typeof i==`string`?i:void 0,o=i?.mjs,s=o?.href??o,c=i?.wasm,l=c?.href??c,u=e.wasmBinary,[d,f]=await Ct(s,a,n>1),p=!1,m=[];if(t>0&&m.push(new Promise(e=>{setTimeout(()=>{p=!0,e()},t)})),m.push(new Promise((e,t)=>{let r={numThreads:n};if(u)r.wasmBinary=u;else if(l||a)r.locateFile=e=>l??a+e;else if(s&&s.indexOf(`blob:`)!==0)r.locateFile=e=>new URL(e,s).href;else if(d){let e=mt();e&&(r.locateFile=t=>e+t)}f(r).then(t=>{Dt=!1,Et=!0,Tt=t,e(),d&&URL.revokeObjectURL(d)},e=>{Dt=!1,Ot=!0,t(e)})})),await Promise.race(m),p)throw Error(`WebAssembly backend initializing failed due to timeout: ${t}ms`)},Nt=()=>{if(Et&&Tt)return Tt;throw Error(`WebAssembly is not initialized yet.`)}}),Ft,It,Lt,Rt=M(()=>{"use strict";Pt(),Ft=(e,t)=>{let n=Nt(),r=n.lengthBytesUTF8(e)+1,i=n._malloc(r);return n.stringToUTF8(e,i,r),t.push(i),i},It=(e,t,n,r)=>{if(typeof e==`object`&&e){if(n.has(e))throw Error(`Circular reference in options`);n.add(e)}Object.entries(e).forEach(([e,i])=>{let a=t?t+e:e;if(typeof i==`object`)It(i,a+`.`,n,r);else if(typeof i==`string`||typeof i==`number`)r(a,i.toString());else if(typeof i==`boolean`)r(a,i?`1`:`0`);else throw Error(`Can't handle extra config type: ${typeof i}`)})},Lt=e=>{let t=Nt(),n=t.stackSave();try{let n=t.PTR_SIZE,r=t.stackAlloc(2*n);t._OrtGetLastError(r,r+n);let i=Number(t.getValue(r,n===4?`i32`:`i64`)),a=t.getValue(r+n,`*`),o=a?t.UTF8ToString(a):``;throw Error(`${e} ERROR_CODE: ${i}, ERROR_MESSAGE: ${o}`)}finally{t.stackRestore(n)}}}),zt,Bt=M(()=>{"use strict";Pt(),Rt(),zt=e=>{let t=Nt(),n=0,r=[],i=e||{};try{if(e?.logSeverityLevel===void 0)i.logSeverityLevel=2;else if(typeof e.logSeverityLevel!=`number`||!Number.isInteger(e.logSeverityLevel)||e.logSeverityLevel<0||e.logSeverityLevel>4)throw Error(`log serverity level is not valid: ${e.logSeverityLevel}`);if(e?.logVerbosityLevel===void 0)i.logVerbosityLevel=0;else if(typeof e.logVerbosityLevel!=`number`||!Number.isInteger(e.logVerbosityLevel))throw Error(`log verbosity level is not valid: ${e.logVerbosityLevel}`);e?.terminate===void 0&&(i.terminate=!1);let a=0;return e?.tag!==void 0&&(a=Ft(e.tag,r)),n=t._OrtCreateRunOptions(i.logSeverityLevel,i.logVerbosityLevel,!!i.terminate,a),n===0&&Lt(`Can't create run options.`),e?.extra!==void 0&&It(e.extra,``,new WeakSet,(e,i)=>{let a=Ft(e,r),o=Ft(i,r);t._OrtAddRunConfigEntry(n,a,o)!==0&&Lt(`Can't set a run config entry: ${e} - ${i}.`)}),[n,r]}catch(e){throw n!==0&&t._OrtReleaseRunOptions(n),r.forEach(e=>t._free(e)),e}}}),Vt,Ht,Ut,Wt,Gt,Kt,qt=M(()=>{"use strict";Pt(),Rt(),Vt=e=>{switch(e){case`disabled`:return 0;case`basic`:return 1;case`extended`:return 2;case`all`:return 99;default:throw Error(`unsupported graph optimization level: ${e}`)}},Ht=e=>{switch(e){case`sequential`:return 0;case`parallel`:return 1;default:throw Error(`unsupported execution mode: ${e}`)}},Ut=e=>{e.extra||={},e.extra.session||(e.extra.session={});let t=e.extra.session;t.use_ort_model_bytes_directly||=`1`,e.executionProviders&&e.executionProviders.some(e=>(typeof e==`string`?e:e.name)===`webgpu`)&&(e.enableMemPattern=!1)},Wt=(e,t,n,r)=>{let i=Ft(t,r),a=Ft(n,r);Nt()._OrtAddSessionConfigEntry(e,i,a)!==0&&Lt(`Can't set a session config entry: ${t} - ${n}.`)},Gt=async(e,t,n)=>{for(let r of t){let t=typeof r==`string`?r:r.name,i=[];switch(t){case`webnn`:if(t=`WEBNN`,typeof r!=`string`){let t=r?.deviceType;t&&Wt(e,`deviceType`,t,n)}break;case`webgpu`:if(t=`JS`,typeof r!=`string`){let t=r;if(t?.preferredLayout){if(t.preferredLayout!==`NCHW`&&t.preferredLayout!==`NHWC`)throw Error(`preferredLayout must be either 'NCHW' or 'NHWC': ${t.preferredLayout}`);Wt(e,`preferredLayout`,t.preferredLayout,n)}}break;case`wasm`:case`cpu`:continue;default:throw Error(`not supported execution provider: ${t}`)}let a=Ft(t,n),o=i.length,s=0,c=0;if(o>0){s=Nt()._malloc(o*Nt().PTR_SIZE),n.push(s),c=Nt()._malloc(o*Nt().PTR_SIZE),n.push(c);for(let e=0;e{let t=Nt(),n=0,r=[],i=e||{};Ut(i);try{let e=Vt(i.graphOptimizationLevel??`all`),a=Ht(i.executionMode??`sequential`),o=typeof i.logId==`string`?Ft(i.logId,r):0,s=i.logSeverityLevel??2;if(!Number.isInteger(s)||s<0||s>4)throw Error(`log serverity level is not valid: ${s}`);let c=i.logVerbosityLevel??0;if(!Number.isInteger(c)||c<0||c>4)throw Error(`log verbosity level is not valid: ${c}`);let l=typeof i.optimizedModelFilePath==`string`?Ft(i.optimizedModelFilePath,r):0;if(n=t._OrtCreateSessionOptions(e,!!i.enableCpuMemArena,!!i.enableMemPattern,a,!!i.enableProfiling,0,o,s,c,l),n===0&&Lt(`Can't create session options.`),i.executionProviders&&await Gt(n,i.executionProviders,r),i.enableGraphCapture!==void 0){if(typeof i.enableGraphCapture!=`boolean`)throw Error(`enableGraphCapture must be a boolean value: ${i.enableGraphCapture}`);Wt(n,`enableGraphCapture`,i.enableGraphCapture.toString(),r)}if(i.freeDimensionOverrides)for(let[e,a]of Object.entries(i.freeDimensionOverrides)){if(typeof e!=`string`)throw Error(`free dimension override name must be a string: ${e}`);if(typeof a!=`number`||!Number.isInteger(a)||a<0)throw Error(`free dimension override value must be a non-negative integer: ${a}`);let i=Ft(e,r);t._OrtAddFreeDimensionOverride(n,i,a)!==0&&Lt(`Can't set a free dimension override: ${e} - ${a}.`)}return i.extra!==void 0&&It(i.extra,``,new WeakSet,(e,t)=>{Wt(n,e,t,r)}),[n,r]}catch(e){throw n!==0&&t._OrtReleaseSessionOptions(n)!==0&&Lt(`Can't release session options.`),r.forEach(e=>t._free(e)),e}}}),Jt,Yt,Xt,Zt,Qt,$t,en,tn,U=M(()=>{"use strict";Jt=e=>{switch(e){case`int8`:return 3;case`uint8`:return 2;case`bool`:return 9;case`int16`:return 5;case`uint16`:return 4;case`int32`:return 6;case`uint32`:return 12;case`float16`:return 10;case`float32`:return 1;case`float64`:return 11;case`string`:return 8;case`int64`:return 7;case`uint64`:return 13;case`int4`:return 22;case`uint4`:return 21;default:throw Error(`unsupported data type: ${e}`)}},Yt=e=>{switch(e){case 3:return`int8`;case 2:return`uint8`;case 9:return`bool`;case 5:return`int16`;case 4:return`uint16`;case 6:return`int32`;case 12:return`uint32`;case 10:return`float16`;case 1:return`float32`;case 11:return`float64`;case 8:return`string`;case 7:return`int64`;case 13:return`uint64`;case 22:return`int4`;case 21:return`uint4`;default:throw Error(`unsupported data type: ${e}`)}},Xt=(e,t)=>{let n=[-1,4,1,1,2,2,4,8,-1,1,2,8,4,8,-1,-1,-1,-1,-1,-1,-1,.5,.5][e],r=typeof t==`number`?t:t.reduce((e,t)=>e*t,1);return n>0?Math.ceil(r*n):void 0},Zt=e=>{switch(e){case`float16`:return typeof Float16Array<`u`&&Float16Array.from?Float16Array:Uint16Array;case`float32`:return Float32Array;case`uint8`:return Uint8Array;case`int8`:return Int8Array;case`uint16`:return Uint16Array;case`int16`:return Int16Array;case`int32`:return Int32Array;case`bool`:return Uint8Array;case`float64`:return Float64Array;case`uint32`:return Uint32Array;case`int64`:return BigInt64Array;case`uint64`:return BigUint64Array;default:throw Error(`unsupported type: ${e}`)}},Qt=e=>{switch(e){case`verbose`:return 0;case`info`:return 1;case`warning`:return 2;case`error`:return 3;case`fatal`:return 4;default:throw Error(`unsupported logging level: ${e}`)}},$t=e=>e===`float32`||e===`float16`||e===`int32`||e===`int64`||e===`uint32`||e===`uint8`||e===`bool`||e===`uint4`||e===`int4`,en=e=>e===`float32`||e===`float16`||e===`int32`||e===`int64`||e===`uint32`||e===`uint64`||e===`int8`||e===`uint8`||e===`bool`||e===`uint4`||e===`int4`,tn=e=>{switch(e){case`none`:return 0;case`cpu`:return 1;case`cpu-pinned`:return 2;case`texture`:return 3;case`gpu-buffer`:return 4;case`ml-tensor`:return 5;default:throw Error(`unsupported data location: ${e}`)}}}),nn,rn=M(()=>{"use strict";Qe(),nn=async e=>{if(typeof e==`string`){let t=await fetch(e);if(!t.ok)throw Error(`failed to load external data file: ${e}`);let n=t.headers.get(`Content-Length`),r=n?parseInt(n,10):0;if(r<1073741824)return new Uint8Array(await t.arrayBuffer());{if(!t.body)throw Error(`failed to load external data file: ${e}, no response body.`);let n=t.body.getReader(),i;try{i=new ArrayBuffer(r)}catch(e){if(e instanceof RangeError){let e=Math.ceil(r/65536);i=new WebAssembly.Memory({initial:e,maximum:e}).buffer}else throw e}let a=0;for(;;){let{done:e,value:t}=await n.read();if(e)break;let r=t.byteLength;new Uint8Array(i,a,r).set(t),a+=r}return new Uint8Array(i,0,r)}}else return e instanceof Blob?new Uint8Array(await e.arrayBuffer()):e instanceof Uint8Array?e:new Uint8Array(e)}}),an,on,sn,cn,ln,un,dn,fn=M(()=>{"use strict";U(),an=[`V`,`I`,`W`,`E`,`F`],on=(e,t)=>{console.log(`[${an[e]},${new Date().toISOString()}]${t}`)},ln=(e,t)=>{sn=e,cn=t},un=(e,t)=>{let n=Qt(e),r=Qt(sn);n>=r&&on(n,typeof t==`function`?t():t)},dn=(...e)=>{cn&&un(...e)}}),pn,mn,W,hn,gn,_n,vn,G=M(()=>{"use strict";pn=class{static calcMatMulShape(e,t){return e[1]===t[0]?[e[0],t[1]]:void 0}},mn=class{static calcShape(e,t,n=!1){let r=e.length,i=t.length;if(r===0)return t;if(i===0)return e;let a=Math.max(e.length,t.length),o=Array(a);if(n){if(r<2||i<2)return;let n=pn.calcMatMulShape([e[r-2],e[r-1]],[t[i-2],t[i-1]]);if(n===void 0)return;[o[a-2],o[a-1]]=n}for(let s=n?3:1;s<=a;s++){let n=r-s<0?1:e[r-s],c=i-s<0?1:t[i-s];if(n!==c&&n>1&&c>1)return;let l=Math.max(n,c);if(n&&c)o[a-s]=Math.max(n,c);else{if(l>1)return;o[a-s]=0}}return o}static isValidBroadcast(e,t){let n=e.length,r=t.length;if(n>r)return!1;for(let i=1;i<=n;i++)if(e[n-i]!==1&&e[n-i]!==t[r-i])return!1;return!0}},W=class e{static size(t){return e.getSizeFromDimensionRange(t,0,t.length)}static convertShape(e,t=4){let n=e.length;if(n===0)return[];let r=Array(n),i=n-1;for(;i>=0;){if(e[i]%t===0){r[i]=e[i]/t;break}if(t%e[i]!==0)throw Error(`cannot convert shape`);r[i]=1,t/=e[i],i--}for(i--;i>=0;i--)r[i]=e[i];return r}static sizeFromDimension(t,n){if(n<0||n>t.length)throw Error(`invalid dimension of ${n} for sizeFromDimension as Tensor has ${t.length} dimensions.`);return e.getSizeFromDimensionRange(t,n,t.length)}static sizeToDimension(t,n){if(n<0||n>t.length)throw Error(`invalid dimension of ${n} for sizeToDimension as Tensor has ${t.length} dimensions.`);return e.getSizeFromDimensionRange(t,0,n)}static getSizeFromDimensionRange(e,t,n){let r=1;for(let i=t;i=0;--r)n[r]=n[r+1]*e[r+1];return n}static normalizeAxis(e,t){if(e<-t&&e>=t)throw Error(`unsupported axis for this operation.`);return e<0?e+t:e}static normalizeAxes(e,t){return e.map(n=>this.normalizeAxis(n,t??e.length))}static sortBasedOnPerm(e,t){return t?t.map(t=>e[t]):e.slice().reverse()}static padShape(e,t){let n=e.length;return e.map((e,r)=>e+t[r]+t[r+n])}static areEqual(e,t){return e.length===t.length?e.every((e,n)=>e===t[n]):!1}},hn=class e{static adjustPoolAttributes(e,t,n,r,i,a){if(!e&&n.length!==t.length-2)throw Error(`length of specified kernel shapes should be 2 less than length of input dimensions`);if(e)for(let e=0;e=n.length?n.push(t[e+2]):n[e]=t[e+2];for(let e=0;e=n[e]||a[e+n.length]>=n[e])throw Error(`pads should be smaller than kernel`)}}static adjustPadsBasedOnAutoPad(t,n,r,i,a,o,s){if(s){if(a.length!==2*(t.length-2))throw Error(`length of pads should be twice the length of data dimensions`);if(n.length!==t.length-2)throw Error(`length of strides should be the length of data dimensions`);if(i.length!==t.length-2)throw Error(`length of kernel shapes should be the length of data dimensions`);for(let c=0;c{"use strict";U(),yn=(e,t)=>new(Zt(t))(e)}),xn,Sn,Cn,wn,Tn,En,Dn,On,kn,An,jn=M(()=>{"use strict";fn(),xn=(e,t=!0)=>{if(e.byteLength%8!=0)throw Error(`Invalid Uint8Array length - must be a multiple of 8 (BigInt).`);let n=e.byteLength/8,r=new BigInt64Array(e.buffer,e.byteOffset,n),i=new Int32Array(n);for(let e=0;e2147483647n||t<-2147483648n)throw Error(`Overflow occurred when converting BigInt to Int32 at index ${e}: ${t}`);i[e]=Number(t)}return t?new Uint8Array(i.buffer):i},Sn=(e,t=!0)=>{if(e.byteLength%4!=0)throw Error(`Invalid Uint8Array length - must be a multiple of 4 (Int32).`);let n=e.byteLength/4,r=new Int32Array(e.buffer,e.byteOffset,n),i=BigInt64Array.from(r,BigInt);return t?new Uint8Array(i.buffer):i},Cn=1,wn=()=>Cn++,Tn=new Map([[`float32`,32],[`float16`,16],[`int32`,32],[`uint32`,32],[`int64`,64],[`uint64`,64],[`int8`,8],[`uint8`,8],[`int4`,4],[`uint4`,4]]),En=(e,t)=>{let n=Tn.get(e);if(!n)throw Error(`Unsupported data type.`);return t.length>0?Math.ceil(t.reduce((e,t)=>e*t)*n/8):0},Dn=class{constructor(e){this.shouldConvertInt64toInt32=!1,this.isInt64ToInt32Converted=!1;let{sessionId:t,context:n,tensor:r,dataType:i,shape:a,shouldConvertInt64toInt32:o=!1}=e;this.sessionId=t,this.mlContext=n,this.mlTensor=r,this.dataType=i,this.tensorShape=a,this.shouldConvertInt64toInt32=o}get tensor(){return this.mlTensor}get type(){return this.dataType}get shape(){return this.tensorShape}get byteLength(){return En(this.dataType,this.tensorShape)}destroy(){dn(`verbose`,()=>`[WebNN] TensorWrapper.destroy`),this.mlTensor.destroy()}write(e){this.mlContext.writeTensor(this.mlTensor,e)}async read(e,t){if(e){let e=await this.mlContext.readTensor(this.mlTensor),n=Sn(new Uint8Array(e));if(t){(t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)).set(n);return}else return n.buffer}else return t?this.mlContext.readTensor(this.mlTensor,t):this.mlContext.readTensor(this.mlTensor)}canReuseTensor(e,t,n){return this.mlContext===e&&this.dataType===t&&this.tensorShape.length===n.length&&this.tensorShape.every((e,t)=>e===n[t])}setIsInt64ToInt32Converted(e){this.isInt64ToInt32Converted=e}},On=class{constructor(e,t){this.tensorManager=e,this.wrapper=t}get tensorWrapper(){return this.wrapper}releaseTensor(){this.tensorWrapper&&(this.tensorManager.releaseTensor(this.tensorWrapper),this.wrapper=void 0)}async ensureTensor(e,t,n,r){let i=t,a=this.tensorManager.getMLContext(e),o=i===`int64`&&!a.opSupportLimits().input.dataTypes.includes(`int64`);if(o&&(i=`int32`,dn(`verbose`,()=>`[WebNN] TensorIdTracker.ensureTensor: convert dataType from int64 to int32`)),this.wrapper){if(this.wrapper.canReuseTensor(a,i,n))return this.wrapper.tensor;if(r){if(this.wrapper.byteLength!==En(i,n))throw Error(`Unable to copy data to tensor with different size.`);this.activeUpload=new Uint8Array(await this.wrapper.read())}this.tensorManager.releaseTensor(this.wrapper)}let s=typeof MLTensorUsage>`u`?void 0:MLTensorUsage.READ|MLTensorUsage.WRITE;return this.wrapper=await this.tensorManager.getCachedTensor(e,i,n,s,!0,!0,o),r&&this.activeUpload&&(this.wrapper.write(this.activeUpload),this.activeUpload=void 0),this.wrapper.tensor}upload(e){let t=e;if(this.wrapper)if(this.wrapper.shouldConvertInt64toInt32&&(t=xn(e,!0),this.wrapper.setIsInt64ToInt32Converted(!0)),t.byteLength===this.wrapper.byteLength){this.wrapper.write(t);return}else dn(`verbose`,()=>`Data size does not match tensor size. Releasing tensor.`),this.releaseTensor();this.activeUpload?this.activeUpload.set(t):this.activeUpload=new Uint8Array(t)}async download(e){if(this.activeUpload){let t=this.wrapper?.isInt64ToInt32Converted?Sn(this.activeUpload):this.activeUpload;if(e){e instanceof ArrayBuffer?new Uint8Array(e).set(t):new Uint8Array(e.buffer,e.byteOffset,e.byteLength).set(t);return}else return t.buffer}if(!this.wrapper)throw Error(`Tensor has not been created.`);return e?this.wrapper.read(this.wrapper?.shouldConvertInt64toInt32,e):this.wrapper.read(this.wrapper?.shouldConvertInt64toInt32)}},kn=class{constructor(e){this.backend=e,this.tensorTrackersById=new Map,this.freeTensors=[],this.externalTensors=new Set}getMLContext(e){let t=this.backend.getMLContext(e);if(!t)throw Error(`MLContext not found for session.`);return t}reserveTensorId(){let e=wn();return this.tensorTrackersById.set(e,new On(this)),e}releaseTensorId(e){let t=this.tensorTrackersById.get(e);t&&(this.tensorTrackersById.delete(e),t.tensorWrapper&&this.releaseTensor(t.tensorWrapper))}async ensureTensor(e,t,n,r,i){dn(`verbose`,()=>`[WebNN] TensorManager.ensureTensor {tensorId: ${t}, dataType: ${n}, shape: ${r}, copyOld: ${i}}`);let a=this.tensorTrackersById.get(t);if(!a)throw Error(`Tensor not found.`);return a.ensureTensor(e,n,r,i)}upload(e,t){let n=this.tensorTrackersById.get(e);if(!n)throw Error(`Tensor not found.`);n.upload(t)}async download(e,t){dn(`verbose`,()=>`[WebNN] TensorManager.download {tensorId: ${e}, dstBuffer: ${t?.byteLength}}`);let n=this.tensorTrackersById.get(e);if(!n)throw Error(`Tensor not found.`);return n.download(t)}releaseTensorsForSession(e){for(let t of this.freeTensors)t.sessionId===e&&t.destroy();this.freeTensors=this.freeTensors.filter(t=>t.sessionId!==e)}registerTensor(e,t,n,r){let i=this.getMLContext(e),a=wn(),o=new Dn({sessionId:e,context:i,tensor:t,dataType:n,shape:r});return this.tensorTrackersById.set(a,new On(this,o)),this.externalTensors.add(o),a}async getCachedTensor(e,t,n,r,i,a,o=!1){let s=this.getMLContext(e);for(let[r,i]of this.freeTensors.entries())if(i.canReuseTensor(s,t,n)){dn(`verbose`,()=>`[WebNN] Reusing tensor {dataType: ${t}, shape: ${n}}`);let i=this.freeTensors.splice(r,1)[0];return i.sessionId=e,i}dn(`verbose`,()=>`[WebNN] MLContext.createTensor {dataType: ${t}, shape: ${n}}`);let c=await s.createTensor({dataType:t,shape:n,dimensions:n,usage:r,writable:i,readable:a});return new Dn({sessionId:e,context:s,tensor:c,dataType:t,shape:n,shouldConvertInt64toInt32:o})}releaseTensor(e){this.externalTensors.has(e)&&this.externalTensors.delete(e),this.freeTensors.push(e)}},An=(...e)=>new kn(...e)}),Mn,Nn,Pn,Fn=M(()=>{"use strict";U(),Pt(),bn(),jn(),fn(),Mn=new Map([[1,`float32`],[10,`float16`],[6,`int32`],[12,`uint32`],[7,`int64`],[13,`uint64`],[22,`int4`],[21,`uint4`],[3,`int8`],[2,`uint8`],[9,`uint8`]]),Nn=(e,t)=>{if(e===t)return!0;if(e===void 0||t===void 0)return!1;let n=Object.keys(e).sort(),r=Object.keys(t).sort();return n.length===r.length&&n.every((n,i)=>n===r[i]&&e[n]===t[n])},Pn=class{constructor(e){this.tensorManager=An(this),this.mlContextBySessionId=new Map,this.sessionIdsByMLContext=new Map,this.mlContextCache=[],this.sessionGraphInputs=new Map,this.temporaryGraphInputs=[],this.temporarySessionTensorIds=new Map,ln(e.logLevel,!!e.debug)}get currentSessionId(){if(this.activeSessionId===void 0)throw Error(`No active session`);return this.activeSessionId}onRunStart(e){dn(`verbose`,()=>`[WebNN] onRunStart {sessionId: ${e}}`),this.activeSessionId=e}onRunEnd(e){dn(`verbose`,()=>`[WebNN] onRunEnd {sessionId: ${e}}`);let t=this.temporarySessionTensorIds.get(e);if(t){for(let e of t)dn(`verbose`,()=>`[WebNN] releasing temporary tensor {tensorId: ${e}}`),this.tensorManager.releaseTensorId(e);this.temporarySessionTensorIds.delete(e),this.activeSessionId=void 0}}async createMLContext(e){if(e instanceof GPUDevice){let t=this.mlContextCache.findIndex(t=>t.gpuDevice===e);if(t!==-1)return this.mlContextCache[t].mlContext;{let t=await navigator.ml.createContext(e);return this.mlContextCache.push({gpuDevice:e,mlContext:t}),t}}else if(e===void 0){let e=this.mlContextCache.findIndex(e=>e.options===void 0&&e.gpuDevice===void 0);if(e!==-1)return this.mlContextCache[e].mlContext;{let e=await navigator.ml.createContext();return this.mlContextCache.push({mlContext:e}),e}}let t=this.mlContextCache.findIndex(t=>Nn(t.options,e));if(t!==-1)return this.mlContextCache[t].mlContext;{let t=await navigator.ml.createContext(e);return this.mlContextCache.push({options:e,mlContext:t}),t}}registerMLContext(e,t){this.mlContextBySessionId.set(e,t);let n=this.sessionIdsByMLContext.get(t);n||(n=new Set,this.sessionIdsByMLContext.set(t,n)),n.add(e),this.temporaryGraphInputs.length>0&&(this.sessionGraphInputs.set(e,this.temporaryGraphInputs),this.temporaryGraphInputs=[])}onReleaseSession(e){this.sessionGraphInputs.delete(e);let t=this.mlContextBySessionId.get(e);if(!t)return;this.tensorManager.releaseTensorsForSession(e),this.mlContextBySessionId.delete(e);let n=this.sessionIdsByMLContext.get(t);if(n.delete(e),n.size===0){this.sessionIdsByMLContext.delete(t);let e=this.mlContextCache.findIndex(e=>e.mlContext===t);e!==-1&&this.mlContextCache.splice(e,1)}}getMLContext(e){return this.mlContextBySessionId.get(e)}reserveTensorId(){return this.tensorManager.reserveTensorId()}releaseTensorId(e){dn(`verbose`,()=>`[WebNN] releaseTensorId {tensorId: ${e}}`),this.tensorManager.releaseTensorId(e)}async ensureTensor(e,t,n,r,i){let a=Mn.get(n);if(!a)throw Error(`Unsupported ONNX data type: ${n}`);return this.tensorManager.ensureTensor(e??this.currentSessionId,t,a,r,i)}async createTemporaryTensor(e,t,n){dn(`verbose`,()=>`[WebNN] createTemporaryTensor {onnxDataType: ${t}, shape: ${n}}`);let r=Mn.get(t);if(!r)throw Error(`Unsupported ONNX data type: ${t}`);let i=this.tensorManager.reserveTensorId();await this.tensorManager.ensureTensor(e,i,r,n,!1);let a=this.temporarySessionTensorIds.get(e);return a?a.push(i):this.temporarySessionTensorIds.set(e,[i]),i}uploadTensor(e,t){if(!Nt().shouldTransferToMLTensor)throw Error(`Trying to upload to a MLTensor while shouldTransferToMLTensor is false`);dn(`verbose`,()=>`[WebNN] uploadTensor {tensorId: ${e}, data: ${t.byteLength}}`),this.tensorManager.upload(e,t)}async downloadTensor(e,t){return this.tensorManager.download(e,t)}createMLTensorDownloader(e,t){return async()=>{let n=await this.tensorManager.download(e);return yn(n,t)}}registerMLTensor(e,t,n,r){let i=Mn.get(n);if(!i)throw Error(`Unsupported ONNX data type: ${n}`);let a=this.tensorManager.registerTensor(e,t,i,r);return dn(`verbose`,()=>`[WebNN] registerMLTensor {tensor: ${t}, dataType: ${i}, dimensions: ${r}} -> {tensorId: ${a}}`),a}registerMLConstant(e,t,n,r,i,a,o=!1){if(!a)throw Error(`External mounted files are not available.`);let s=e;e.startsWith(`./`)&&(s=e.substring(2));let c=a.get(s);if(!c)throw Error(`File with name ${s} not found in preloaded files.`);if(t+n>c.byteLength)throw Error(`Out of bounds: data offset and length exceed the external file data size.`);let l=c.slice(t,t+n).buffer,u;switch(i.dataType){case`float32`:u=new Float32Array(l);break;case`float16`:u=typeof Float16Array<`u`&&Float16Array.from?new Float16Array(l):new Uint16Array(l);break;case`int32`:u=new Int32Array(l);break;case`uint32`:u=new Uint32Array(l);break;case`int64`:o?(u=xn(new Uint8Array(l),!1),i.dataType=`int32`):u=new BigInt64Array(l);break;case`uint64`:u=new BigUint64Array(l);break;case`int8`:u=new Int8Array(l);break;case`int4`:case`uint4`:case`uint8`:u=new Uint8Array(l);break;default:throw Error(`Unsupported data type: ${i.dataType} in creating WebNN Constant from external data.`)}return dn(`verbose`,()=>`[WebNN] registerMLConstant {dataType: ${i.dataType}, shape: ${i.shape}}} ${o?`(Note: it was int64 data type and registered to int32 as workaround)`:``}`),r.constant(i,u)}registerGraphInput(e){this.temporaryGraphInputs.push(e)}isGraphInput(e,t){let n=this.sessionGraphInputs.get(e);return n?n.includes(t):!1}isInt64Supported(e){return!!this.mlContextBySessionId.get(e)?.opSupportLimits().input.dataTypes.includes(`int64`)}flush(){}}}),In=M(()=>{"use strict";}),Ln,Rn,zn,Bn,Vn,Hn,Un,Wn,Gn,Kn=M(()=>{"use strict";fn(),In(),Ln=new Map([[64,250],[128,200],[256,200],[512,200],[2048,230],[4096,200],[8192,50],[16384,50],[32768,50],[65536,50],[131072,50],[262144,50],[524288,50],[1048576,50],[2097152,30],[4194304,20],[8388608,10],[12582912,10],[16777216,10],[26214400,15],[33554432,22],[44236800,2],[58982400,6],[67108864,6],[134217728,6],[167772160,6]]),Rn=[],zn=e=>Math.ceil(Number(e)/16)*16,Bn=e=>{for(let t=0;tVn++,Un=async(e,t,n,r)=>{let i=zn(n),a=e.device.createBuffer({size:i,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ});try{let o=e.getCommandEncoder();e.endComputePass(),o.copyBufferToBuffer(t,0,a,0,i),e.flush(),await a.mapAsync(GPUMapMode.READ);let s=a.getMappedRange();if(r){let e=r();return e.set(new Uint8Array(s,0,n)),e}else return new Uint8Array(s.slice(0,n))}finally{a.destroy()}},Wn=class{constructor(e){this.backend=e,this.storageCache=new Map,this.freeBuffers=new Map,this.freeUniformBuffers=new Map,this.buffersPending=[],this.capturedPendingBuffers=new Map;for(let[e]of Ln)Rn.push(e),this.freeBuffers.set(e,[]),this.freeUniformBuffers.set(e,[]);this.sessionCount=0}upload(e,t){let n=t.buffer,r=t.byteOffset,i=t.byteLength,a=zn(i),o=this.storageCache.get(e);if(!o)throw Error(`gpu data for uploading does not exist`);if(Number(o.originalSize)!==i)throw Error(`inconsistent data size. gpu data size=${o.originalSize}, data size=${i}`);let s=this.backend.device.createBuffer({mappedAtCreation:!0,size:a,usage:GPUBufferUsage.MAP_WRITE|GPUBufferUsage.COPY_SRC}),c=s.getMappedRange();new Uint8Array(c).set(new Uint8Array(n,r,i)),s.unmap();let l=this.backend.device.createCommandEncoder();l.copyBufferToBuffer(s,0,o.gpuData.buffer,0,a),this.backend.device.queue.submit([l.finish()]),s.destroy(),dn(`verbose`,()=>`[WebGPU] GpuDataManager.upload(id=${e})`)}memcpy(e,t){let n=this.storageCache.get(e);if(!n)throw Error(`source gpu data for memcpy does not exist`);let r=this.storageCache.get(t);if(!r)throw Error(`destination gpu data for memcpy does not exist`);if(n.originalSize!==r.originalSize)throw Error(`inconsistent source and destination gpu data size`);let i=zn(n.originalSize),a=this.backend.getCommandEncoder();this.backend.endComputePass(),a.copyBufferToBuffer(n.gpuData.buffer,0,r.gpuData.buffer,0,i)}registerExternalBuffer(e,t,n){let r;if(n){if(r=n[0],e===n[1])return dn(`verbose`,()=>`[WebGPU] GpuDataManager.registerExternalBuffer(size=${t}) => id=${r}, buffer is the same, skip.`),r;if(this.backend.capturedCommandList.has(this.backend.currentSessionId))throw Error(`Registering a different external buffer under graph capture mode is not supported yet. + Please use the previous external buffer!`)}else r=Hn();return this.storageCache.set(r,{gpuData:{id:r,type:0,buffer:e},originalSize:t}),dn(`verbose`,()=>`[WebGPU] GpuDataManager.registerExternalBuffer(size=${t}) => id=${r}, registered.`),r}unregisterExternalBuffer(e){e!==void 0&&(this.storageCache.delete(e),dn(`verbose`,()=>`[WebGPU] GpuDataManager.unregisterExternalBuffer() => id=${e}`))}create(e,t=GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST){let n=Bn(e),r,i=(t&GPUBufferUsage.STORAGE)===GPUBufferUsage.STORAGE,a=(t&GPUBufferUsage.UNIFORM)===GPUBufferUsage.UNIFORM;if(i||a){let e=(i?this.freeBuffers:this.freeUniformBuffers).get(n);r=e&&e.length>0?e.pop():this.backend.device.createBuffer({size:n,usage:t})}else r=this.backend.device.createBuffer({size:n,usage:t});let o={id:Hn(),type:0,buffer:r};return this.storageCache.set(o.id,{gpuData:o,originalSize:Number(e)}),dn(`verbose`,()=>`[WebGPU] GpuDataManager.create(size=${e}) => id=${o.id}`),o}get(e){return this.storageCache.get(e)?.gpuData}release(e){let t=typeof e==`bigint`?Number(e):e,n=this.storageCache.get(t);if(!n){if(this.storageCache.size===0)return 0;throw Error(`releasing data does not exist`)}return dn(`verbose`,()=>`[WebGPU] GpuDataManager.release(id=${t}), gpuDataId=${n.gpuData.id}`),this.storageCache.delete(t),this.buffersPending.push(n.gpuData.buffer),n.originalSize}async download(e,t){let n=this.storageCache.get(Number(e));if(!n)throw Error(`data does not exist`);await Un(this.backend,n.gpuData.buffer,n.originalSize,t)}refreshPendingBuffers(){if(this.buffersPending.length!==0)if(this.backend.sessionStatus===`default`){for(let e of this.buffersPending){let t=Ln.get(e.size);if((e.usage&GPUBufferUsage.STORAGE)===GPUBufferUsage.STORAGE){let n=this.freeBuffers.get(e.size)||[];t===void 0||n.length>=t?e.destroy():n.push(e)}else if((e.usage&GPUBufferUsage.UNIFORM)===GPUBufferUsage.UNIFORM){let n=this.freeUniformBuffers.get(e.size)||[];t===void 0||n.length>=t?e.destroy():n.push(e)}else e.destroy()}this.buffersPending=[]}else{let e=this.capturedPendingBuffers.get(this.backend.currentSessionId);e||(e=[],this.capturedPendingBuffers.set(this.backend.currentSessionId,e));for(let t of this.buffersPending)e.push(t);this.buffersPending=[]}}dispose(){this.freeBuffers.forEach(e=>{e.forEach(e=>{e.destroy()})}),this.freeUniformBuffers.forEach(e=>{e.forEach(e=>{e.destroy()})}),this.storageCache.forEach(e=>{e.gpuData.buffer.destroy()}),this.capturedPendingBuffers.forEach(e=>{e.forEach(e=>{e.destroy()})}),this.storageCache=new Map,this.freeBuffers=new Map,this.freeUniformBuffers=new Map,this.capturedPendingBuffers=new Map}onCreateSession(){this.sessionCount+=1}onReleaseSession(e){let t=this.capturedPendingBuffers.get(e);t&&(t.forEach(e=>{e.destroy()}),this.capturedPendingBuffers.delete(e)),--this.sessionCount,this.sessionCount===0&&(dn(`warning`,()=>`[WebGPU] Clearing webgpu buffer cache`),this.storageCache.forEach(e=>{e.gpuData.buffer.destroy()}),this.storageCache=new Map)}},Gn=(...e)=>new Wn(...e)}),qn,Jn,Yn=M(()=>{"use strict";qn=class{constructor(e){Object.assign(this,e)}get cacheKey(){return this.key||=Object.getOwnPropertyNames(this).sort().map(e=>`${this[e]}`).join(`;`),this.key}},Jn=e=>new qn(e)}),Xn,Zn,Qn,$n,K,er,tr,nr,rr,q,ir,J,Y,ar,or,sr,cr,X=M(()=>{"use strict";U(),G(),Xn=64,Zn=(e,t)=>{if(t===3)throw Error(`vec3 has same alignment as vec4, use vec4 instead`);switch(Number(e)){case 10:return t>1?`vec${t}`:`f16`;case 1:return t>1?`vec${t}`:`f32`;case 6:return t>1?`vec${t}`:`i32`;case 12:return t>1?`vec${t}`:`u32`;case 7:if(t>1)throw Error(`currently not supported vecX of uint64 yet`);return[`vec2`,`i32`];case 13:if(t>1)throw Error(`currently not supported vecX of uint64 yet`);return[`vec2`,`u32`];case 9:if(t!==4)throw Error(`bool must be vec4`);return[`u32`,`vec4`];case 22:return`i32`;case 21:return`u32`;default:throw Error(`Unknown data type: ${e}`)}},Qn=(e,t=1)=>{let n=Zn(e,t);return typeof n==`string`?n:n[0]},$n=(e,t=1)=>{let n=Zn(e,t);return typeof n==`string`?n:n[1]},K=(...e)=>{let t=[];return e.forEach(e=>{e.length!==0&&t.push({type:12,data:e},{type:12,data:W.computeStrides(e)})}),t},er=e=>e%4==0?4:e%2==0?2:1,tr=(e=`f32`,t,n=`0`)=>!t||t===1?`${e}(${n})`:`vec${t}<${e}>(${n})`,nr=(e,t,n)=>e===`f32`?n:t===1?`f32(${n})`:`vec${t}(${n})`,rr=(e,t)=>t===4?`(${e}.x + ${e}.y + ${e}.z + ${e}.w)`:t===2?`(${e}.x + ${e}.y)`:t===3?`(${e}.x + ${e}.y + ${e}.z)`:e,q=(e,t,n,r)=>e.startsWith(`uniforms.`)&&n>4?typeof t==`string`?r===`f16`?`${e}[(${t}) / 8][(${t}) % 8 / 4][(${t}) % 8 % 4]`:`${e}[(${t}) / 4][(${t}) % 4]`:r===`f16`?`${e}[${Math.floor(t/8)}][${Math.floor(t%8/4)}][${t%8%4}]`:`${e}[${Math.floor(t/4)}][${t%4}]`:n>1?`${e}[${t}]`:e,ir=(e,t,n,r,i)=>{let a=typeof n==`number`,o=a?n:n.length,s=[...Array(o).keys()],c=o<2?`u32`:o<=4?`vec${o}`:`array`,l=Zn(t,i),u=typeof l==`string`?l:l[1],d=typeof l==`string`?l:l[0],f={indices:c,value:u,storage:d,tensor:t},p=e=>typeof e==`string`?e:`${e}u`,m={offsetToIndices:!1,indicesToOffset:!1,broadcastedIndicesToOffset:!1,set:!1,setByIndices:!1,get:!1,getByIndices:!1},h=a?`uniforms.`:``,g=`${h}${e}_shape`,_=`${h}${e}_strides`,v=``;for(let e=0;e(m.offsetToIndices=!0,o<2?t:`o2i_${e}(${t})`),x=[];if(o>=2)for(let e=o-1;e>=0;e--)x.push(`${K(_,e,o)} * (indices[${e}])`);let S=o<2?``:` + }`,b=t=>(m.offsetToIndices=!0,o<2?t:`o2i_${e}(${t})`),x=[];if(o>=2)for(let e=o-1;e>=0;e--)x.push(`${q(_,e,o)} * (indices[${e}])`);let S=o<2?``:` fn i2o_${e}(indices: ${f.indices}) -> u32 { return ${x.join(`+`)}; - }`,C=t=>(m.indicesToOffset=!0,o<2?t:`i2o_${e}(${t})`),w=(...e)=>o===0?`0u`:`${f.indices}(${e.map(p).join(`,`)})`,T=(e,t)=>o<2?`${e}`:`${K(e,t,o)}`,E=(e,t,n)=>o<2?`${e}=${n};`:`${K(e,t,o)}=${n};`,D={},O=(t,n)=>{m.broadcastedIndicesToOffset=!0;let r=`${n.name}broadcastedIndicesTo${e}Offset`;if(r in D)return`${r}(${t})`;let i=[];for(let e=o-1;e>=0;e--){let t=n.indicesGet(`outputIndices`,e+n.rank-o);i.push(`${T(_,e)} * (${t} % ${T(g,e)})`)}return D[r]=`fn ${r}(outputIndices: ${n.type.indices}) -> u32 { + }`,C=t=>(m.indicesToOffset=!0,o<2?t:`i2o_${e}(${t})`),w=(...e)=>o===0?`0u`:`${f.indices}(${e.map(p).join(`,`)})`,T=(e,t)=>o<2?`${e}`:`${q(e,t,o)}`,E=(e,t,n)=>o<2?`${e}=${n};`:`${q(e,t,o)}=${n};`,D={},O=(t,n)=>{m.broadcastedIndicesToOffset=!0;let r=`${n.name}broadcastedIndicesTo${e}Offset`;if(r in D)return`${r}(${t})`;let i=[];for(let e=o-1;e>=0;e--){let t=n.indicesGet(`outputIndices`,e+n.rank-o);i.push(`${T(_,e)} * (${t} % ${T(g,e)})`)}return D[r]=`fn ${r}(outputIndices: ${n.type.indices}) -> u32 { return ${i.length>0?i.join(`+`):`0u`}; }`,`${r}(${t})`},k=(t,n)=>(()=>{if(f.storage===f.value)return`${e}[${t}]=${n};`;if(f.storage===`vec2`&&f.value===`i32`)return`${e}[${t}]=vec2(u32(${n}), select(0u, 0xFFFFFFFFu, ${n} < 0));`;if(f.storage===`vec2`&&f.value===`u32`)return`${e}[${t}]=vec2(u32(${n}), 0u);`;if(f.storage===`u32`&&f.value===`vec4`)return`${e}[${t}]=dot(vec4(0x1, 0x100, 0x10000, 0x1000000), vec4(${n}));`;throw Error(`not supported combination of storage type ${f.storage} and value type ${f.value} yet`)})(),A=t=>(()=>{if(f.storage===f.value)return`${e}[${t}]`;if(f.storage===`vec2`&&f.value===`i32`)return`i32(${e}[${t}].x)`;if(f.storage===`vec2`&&f.value===`u32`)return`u32(${e}[${t}].x)`;if(f.storage===`u32`&&f.value===`vec4`)return`vec4(bool(${e}[${t}] & 0xFFu), bool(${e}[${t}] & 0xFF00u), bool(${e}[${t}] & 0xFF0000u), bool(${e}[${t}] & 0xFF000000u))`;throw Error(`not supported combination of storage type ${f.storage} and value type ${f.value} yet`)})(),ee=o<2?``:` fn get_${e}ByIndices(indices: ${f.indices}) -> ${u} { @@ -41,8 +41,8 @@ var re=Object.defineProperty,ie=Object.getOwnPropertyDescriptor,ae=Object.getOwn }`,ie=o<2?``:(()=>{let t=s.map(e=>`d${e}: u32`).join(`, `),n=s.map(e=>`d${e}`).join(`, `);return` fn set_${e}(${t}, value: ${u}) { set_${e}ByIndices(${w(n)}, value); - }`})();return{impl:()=>{let e=[],t=!1;return m.offsetToIndices&&(e.push(y),t=!0),m.indicesToOffset&&(e.push(S),t=!0),m.broadcastedIndicesToOffset&&(Object.values(D).forEach(t=>e.push(t)),t=!0),m.set&&(e.push(ie),t=!0),m.setByIndices&&(e.push(re),t=!0),m.get&&(e.push(te),t=!0),m.getByIndices&&(e.push(ee),t=!0),!a&&t&&e.unshift(`const ${g} = ${f.indices}(${n.join(`,`)});`,`const ${_} = ${f.indices}(${U.computeStrides(n).join(`,`)});`),e.join(` -`)},type:f,offsetToIndices:b,indicesToOffset:C,broadcastedIndicesToOffset:O,indices:w,indicesGet:T,indicesSet:E,set:(...t)=>{if(t.length!==o+1)throw Error(`indices length must be ${o}`);let n=t[o];if(typeof n!=`string`)throw Error(`value must be string`);let r=t.slice(0,o).map(p).join(`,`);return o===0?k(`0u`,n):o===1?k(r[0],n):(m.set=!0,m.setByIndices=!0,m.indicesToOffset=!0,`set_${e}(${r}, ${n})`)},setByOffset:k,setByIndices:(t,n)=>o<2?k(t,n):(m.setByIndices=!0,m.indicesToOffset=!0,`set_${e}ByIndices(${t}, ${n});`),get:ne,getByOffset:A,getByIndices:j,usage:r,name:e,strides:_,shape:g,rank:o}},q=(e,t,n,r=1)=>ar(e,t,n,`input`,r),J=(e,t,n,r=1)=>ar(e,t,n,`output`,r),or=(e,t,n)=>ar(e,t,n,`atomicOutput`,1),sr=(e,t,n,r=1)=>ar(e,t,n,`internal`,r),cr=class{constructor(e,t){this.normalizedDispatchGroup=e,this.limits=t,this.internalVariables=[],this.variables=[],this.uniforms=[],this.variableIndex=0}guardAgainstOutOfBoundsWorkgroupSizes(e){return`if (global_idx >= ${typeof e==`number`?`${e}u`:e}) { return; }`}mainStart(e=Zn){let t=typeof e==`number`?e:e[0],n=typeof e==`number`?1:e[1],r=typeof e==`number`?1:e[2];if(t>this.limits.maxComputeWorkgroupSizeX||n>this.limits.maxComputeWorkgroupSizeY||r>this.limits.maxComputeWorkgroupSizeZ)throw Error(`workgroup size [${t}, ${n}, ${r}] exceeds the maximum workgroup size [${this.limits.maxComputeWorkgroupSizeX}, ${this.limits.maxComputeWorkgroupSizeY}, ${this.limits.maxComputeWorkgroupSizeZ}].`);if(t*n*r>this.limits.maxComputeInvocationsPerWorkgroup)throw Error(`workgroup size [${t}, ${n}, ${r}] exceeds the maximum workgroup invocations ${this.limits.maxComputeInvocationsPerWorkgroup}.`);let i=this.normalizedDispatchGroup[1]===1&&this.normalizedDispatchGroup[2]===1,a=i?`@builtin(global_invocation_id) global_id : vec3, + }`})();return{impl:()=>{let e=[],t=!1;return m.offsetToIndices&&(e.push(y),t=!0),m.indicesToOffset&&(e.push(S),t=!0),m.broadcastedIndicesToOffset&&(Object.values(D).forEach(t=>e.push(t)),t=!0),m.set&&(e.push(ie),t=!0),m.setByIndices&&(e.push(re),t=!0),m.get&&(e.push(te),t=!0),m.getByIndices&&(e.push(ee),t=!0),!a&&t&&e.unshift(`const ${g} = ${f.indices}(${n.join(`,`)});`,`const ${_} = ${f.indices}(${W.computeStrides(n).join(`,`)});`),e.join(` +`)},type:f,offsetToIndices:b,indicesToOffset:C,broadcastedIndicesToOffset:O,indices:w,indicesGet:T,indicesSet:E,set:(...t)=>{if(t.length!==o+1)throw Error(`indices length must be ${o}`);let n=t[o];if(typeof n!=`string`)throw Error(`value must be string`);let r=t.slice(0,o).map(p).join(`,`);return o===0?k(`0u`,n):o===1?k(r[0],n):(m.set=!0,m.setByIndices=!0,m.indicesToOffset=!0,`set_${e}(${r}, ${n})`)},setByOffset:k,setByIndices:(t,n)=>o<2?k(t,n):(m.setByIndices=!0,m.indicesToOffset=!0,`set_${e}ByIndices(${t}, ${n});`),get:ne,getByOffset:A,getByIndices:j,usage:r,name:e,strides:_,shape:g,rank:o}},J=(e,t,n,r=1)=>ir(e,t,n,`input`,r),Y=(e,t,n,r=1)=>ir(e,t,n,`output`,r),ar=(e,t,n)=>ir(e,t,n,`atomicOutput`,1),or=(e,t,n,r=1)=>ir(e,t,n,`internal`,r),sr=class{constructor(e,t){this.normalizedDispatchGroup=e,this.limits=t,this.internalVariables=[],this.variables=[],this.uniforms=[],this.variableIndex=0}guardAgainstOutOfBoundsWorkgroupSizes(e){return`if (global_idx >= ${typeof e==`number`?`${e}u`:e}) { return; }`}mainStart(e=Xn){let t=typeof e==`number`?e:e[0],n=typeof e==`number`?1:e[1],r=typeof e==`number`?1:e[2];if(t>this.limits.maxComputeWorkgroupSizeX||n>this.limits.maxComputeWorkgroupSizeY||r>this.limits.maxComputeWorkgroupSizeZ)throw Error(`workgroup size [${t}, ${n}, ${r}] exceeds the maximum workgroup size [${this.limits.maxComputeWorkgroupSizeX}, ${this.limits.maxComputeWorkgroupSizeY}, ${this.limits.maxComputeWorkgroupSizeZ}].`);if(t*n*r>this.limits.maxComputeInvocationsPerWorkgroup)throw Error(`workgroup size [${t}, ${n}, ${r}] exceeds the maximum workgroup invocations ${this.limits.maxComputeInvocationsPerWorkgroup}.`);let i=this.normalizedDispatchGroup[1]===1&&this.normalizedDispatchGroup[2]===1,a=i?`@builtin(global_invocation_id) global_id : vec3, @builtin(workgroup_id) workgroup_id : vec3, @builtin(local_invocation_index) local_idx : u32, @builtin(local_invocation_id) local_id : vec3`:`@builtin(global_invocation_id) global_id : vec3, @@ -60,13 +60,13 @@ var re=Object.defineProperty,ie=Object.getOwnPropertyDescriptor,ae=Object.getOwn struct Uniforms { ${e.join(`, `)} }; @group(0) @binding(${this.variableIndex}) var uniforms: Uniforms;`}get additionalImplementations(){return this.uniformDeclaration()+this.variables.map(e=>e.impl()).join(` `)+this.internalVariables.map(e=>e.impl()).join(` -`)}get variablesInfo(){if(this.uniforms.length===0)return;let e=e=>[12,10,1,6][[`u32`,`f16`,`f32`,`i32`].indexOf(e)];return this.uniforms.map(t=>[e(t.type),t.length??1])}},lr=(e,t)=>new cr(e,t)}),ur,dr,fr,X,pr,mr,hr,gr,_r,vr=M(()=>{"use strict";V(),W(),Xn(),Y(),ur=(e,t)=>{if(!e||e.length!==1)throw Error(`Transpose requires 1 input.`);if(t.length!==0&&t.length!==e[0].dims.length)throw Error(`perm size ${t.length} does not match input rank ${e[0].dims.length}`)},dr=(e,t)=>t.length===0?[...Array(e).keys()].reverse():t,fr=(e,t)=>U.sortBasedOnPerm(e,dr(e.length,t)),X=(e,t,n,r)=>{let i=`fn perm(i: ${r.type.indices}) -> ${n.type.indices} { - var a: ${n.type.indices};`;for(let n=0;n{let n=[],r=[];for(let i=0;i{let n=0;for(let r=0;r{let n=e.dataType,r=e.dims.length,i=dr(r,t),a=fr(e.dims,i),o=e.dims,s=a,c=r<2||mr(i,e.dims),l;if(c)return l=e=>{let t=q(`input`,n,o,4),r=J(`output`,n,s,4);return` +`)}get variablesInfo(){if(this.uniforms.length===0)return;let e=e=>[12,10,1,6][[`u32`,`f16`,`f32`,`i32`].indexOf(e)];return this.uniforms.map(t=>[e(t.type),t.length??1])}},cr=(e,t)=>new sr(e,t)}),lr,ur,dr,Z,fr,pr,mr,hr,gr,_r=M(()=>{"use strict";U(),G(),Yn(),X(),lr=(e,t)=>{if(!e||e.length!==1)throw Error(`Transpose requires 1 input.`);if(t.length!==0&&t.length!==e[0].dims.length)throw Error(`perm size ${t.length} does not match input rank ${e[0].dims.length}`)},ur=(e,t)=>t.length===0?[...Array(e).keys()].reverse():t,dr=(e,t)=>W.sortBasedOnPerm(e,ur(e.length,t)),Z=(e,t,n,r)=>{let i=`fn perm(i: ${r.type.indices}) -> ${n.type.indices} { + var a: ${n.type.indices};`;for(let n=0;n{let n=[],r=[];for(let i=0;i{let n=0;for(let r=0;r{let n=e.dataType,r=e.dims.length,i=ur(r,t),a=dr(e.dims,i),o=e.dims,s=a,c=r<2||pr(i,e.dims),l;if(c)return l=e=>{let t=J(`input`,n,o,4),r=Y(`output`,n,s,4);return` ${e.registerUniform(`output_size`,`u32`).declareVariables(t,r)} ${e.mainStart()} ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} output[global_idx] = input[global_idx]; - }`},{name:`TransposeCopy`,shaderCache:{inputDependencies:[`type`]},getRunData:()=>{let t=U.size(a);return{outputs:[{dims:a,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(t/64/4)},programUniforms:[{type:12,data:Math.ceil(t/4)}]}},getShaderSource:l};let{newShape:u,newPerm:d}=pr(e.dims,i),f=U.areEqual(d,[2,3,1]),p=U.areEqual(d,[3,1,2]);if(u.length===2||f||p){o=f?[u[0],u[1]*u[2]]:p?[u[0]*u[1],u[2]]:u,s=[o[1],o[0]];let t=16;return l=e=>{let r=q(`a`,n,o.length),i=J(`output`,n,s.length);return` + }`},{name:`TransposeCopy`,shaderCache:{inputDependencies:[`type`]},getRunData:()=>{let t=W.size(a);return{outputs:[{dims:a,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(t/64/4)},programUniforms:[{type:12,data:Math.ceil(t/4)}]}},getShaderSource:l};let{newShape:u,newPerm:d}=fr(e.dims,i),f=W.areEqual(d,[2,3,1]),p=W.areEqual(d,[3,1,2]);if(u.length===2||f||p){o=f?[u[0],u[1]*u[2]]:p?[u[0]*u[1],u[2]]:u,s=[o[1],o[0]];let t=16;return l=e=>{let r=J(`a`,n,o.length),i=Y(`output`,n,s.length);return` ${e.registerUniform(`output_size`,`u32`).declareVariables(r,i)} var tile : array, ${t}>; ${e.mainStart([t,t,1])} @@ -85,10 +85,10 @@ var re=Object.defineProperty,ie=Object.getOwnPropertyDescriptor,ae=Object.getOwn if (output_row < uniforms.output_shape[0] && output_col < uniforms.output_shape[1]) { ${i.setByIndices(`${i.type.indices}(output_row, output_col)`,`tile[local_id.x][local_id.y]`)} } - }`},{name:`TransposeShared`,shaderCache:{inputDependencies:[`type`]},getRunData:()=>{let n=U.size(a);return{outputs:[{dims:a,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(s[1]/t),y:Math.ceil(s[0]/t)},programUniforms:[{type:12,data:n},...G(o,s)]}},getShaderSource:l}}return l=e=>{let t=q(`a`,n,o.length),a=J(`output`,n,s.length);return` + }`},{name:`TransposeShared`,shaderCache:{inputDependencies:[`type`]},getRunData:()=>{let n=W.size(a);return{outputs:[{dims:a,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(s[1]/t),y:Math.ceil(s[0]/t)},programUniforms:[{type:12,data:n},...K(o,s)]}},getShaderSource:l}}return l=e=>{let t=J(`a`,n,o.length),a=Y(`output`,n,s.length);return` ${e.registerUniform(`output_size`,`u32`).declareVariables(t,a)} - ${X(i,r,t,a)} + ${Z(i,r,t,a)} ${e.mainStart()} ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} @@ -97,7 +97,7 @@ var re=Object.defineProperty,ie=Object.getOwnPropertyDescriptor,ae=Object.getOwn let aIndices = perm(indices); ${a.setByOffset(`global_idx`,t.getByIndices(`aIndices`))} - }`},{name:`Transpose`,shaderCache:{hint:`${t}`,inputDependencies:[`rank`]},getRunData:()=>{let t=U.size(a);return{outputs:[{dims:a,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(t/64)},programUniforms:[{type:12,data:t},...G(o,s)]}},getShaderSource:l}},gr=(e,t)=>{ur(e.inputs,t.perm),e.compute(hr(e.inputs[0],t.perm))},_r=e=>Yn({perm:e.perm})}),yr,br,xr,Sr,Cr,wr,Tr,Er,Dr,Or,kr,Ar,jr,Mr,Nr,Pr,Fr,Ir,Lr,Rr,zr,Br=M(()=>{"use strict";V(),W(),Y(),pi(),vr(),yr={max:`select(bestValue, candidate, candidate > bestValue)`,min:`select(bestValue, candidate, candidate < bestValue)`,mean:`bestValue + candidate`,sum:`bestValue + candidate`,prod:`bestValue * candidate`,sumSquare:`bestValue + candidate * candidate`,logSumExp:`bestValue + exp(candidate)`,l1:`bestValue + abs(candidate)`,l2:`bestValue + candidate * candidate`,logSum:`bestValue + candidate`},br={max:`select(bestValue, candidate, candidate > bestValue)`,min:`select(bestValue, candidate, candidate < bestValue)`,mean:`bestValue + candidate`,sum:`bestValue + candidate`,prod:`bestValue * candidate`,sumSquare:`bestValue + candidate`,logSumExp:`bestValue + candidate`,l1:`bestValue + candidate`,l2:`bestValue + candidate`,logSum:`bestValue + candidate`},xr={max:`_A[offset]`,min:`_A[offset]`,mean:`0`,sum:`0`,prod:`1`,sumSquare:`0`,logSumExp:`0`,l1:`0`,l2:`0`,logSum:`0`},Sr={max:`bestValue`,min:`bestValue`,sum:`bestValue`,prod:`bestValue`,sumSquare:`bestValue`,logSumExp:`log(bestValue)`,l1:`bestValue`,l2:`sqrt(bestValue)`,logSum:`log(bestValue)`},Cr=(e,t)=>{let n=[];for(let r=t-e;r{let n=[],r=e.length;for(let i=0;ie[t]);return[n,i]},Tr=(e,t)=>{let n=e.length+t.length,r=[],i=0;for(let a=0;a{for(let n=0;n{let n=[];if(!Er(e,t)){for(let r=0;rn.push(e))}return n},Or=(e,t,n,r,i,a,o)=>{let s=n[0].dims,c=U.size(a),l=U.size(o),u=q(`_A`,n[0].dataType,s),d=J(`output`,i,a),f=64;c===1&&(f=256);let p=` + }`},{name:`Transpose`,shaderCache:{hint:`${t}`,inputDependencies:[`rank`]},getRunData:()=>{let t=W.size(a);return{outputs:[{dims:a,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(t/64)},programUniforms:[{type:12,data:t},...K(o,s)]}},getShaderSource:l}},hr=(e,t)=>{lr(e.inputs,t.perm),e.compute(mr(e.inputs[0],t.perm))},gr=e=>Jn({perm:e.perm})}),vr,yr,br,xr,Sr,Cr,wr,Tr,Er,Dr,Or,kr,Ar,jr,Mr,Nr,Pr,Fr,Ir,Lr,Rr,zr=M(()=>{"use strict";U(),G(),X(),fi(),_r(),vr={max:`select(bestValue, candidate, candidate > bestValue)`,min:`select(bestValue, candidate, candidate < bestValue)`,mean:`bestValue + candidate`,sum:`bestValue + candidate`,prod:`bestValue * candidate`,sumSquare:`bestValue + candidate * candidate`,logSumExp:`bestValue + exp(candidate)`,l1:`bestValue + abs(candidate)`,l2:`bestValue + candidate * candidate`,logSum:`bestValue + candidate`},yr={max:`select(bestValue, candidate, candidate > bestValue)`,min:`select(bestValue, candidate, candidate < bestValue)`,mean:`bestValue + candidate`,sum:`bestValue + candidate`,prod:`bestValue * candidate`,sumSquare:`bestValue + candidate`,logSumExp:`bestValue + candidate`,l1:`bestValue + candidate`,l2:`bestValue + candidate`,logSum:`bestValue + candidate`},br={max:`_A[offset]`,min:`_A[offset]`,mean:`0`,sum:`0`,prod:`1`,sumSquare:`0`,logSumExp:`0`,l1:`0`,l2:`0`,logSum:`0`},xr={max:`bestValue`,min:`bestValue`,sum:`bestValue`,prod:`bestValue`,sumSquare:`bestValue`,logSumExp:`log(bestValue)`,l1:`bestValue`,l2:`sqrt(bestValue)`,logSum:`log(bestValue)`},Sr=(e,t)=>{let n=[];for(let r=t-e;r{let n=[],r=e.length;for(let i=0;ie[t]);return[n,i]},wr=(e,t)=>{let n=e.length+t.length,r=[],i=0;for(let a=0;a{for(let n=0;n{let n=[];if(!Tr(e,t)){for(let r=0;rn.push(e))}return n},Dr=(e,t,n,r,i,a,o)=>{let s=n[0].dims,c=W.size(a),l=W.size(o),u=J(`_A`,n[0].dataType,s),d=Y(`output`,i,a),f=64;c===1&&(f=256);let p=` var aBestValues : array; `,m=e=>` ${e.registerUniform(`reduceSize`,`u32`).declareVariables(u,d)} @@ -110,11 +110,11 @@ var re=Object.defineProperty,ie=Object.getOwnPropertyDescriptor,ae=Object.getOwn let outputIndex = global_idx / ${f}; let offset = outputIndex * uniforms.reduceSize; - var bestValue = f32(${xr[r]}); + var bestValue = f32(${br[r]}); let Length = uniforms.reduceSize; for (var k = local_idx; k < Length; k = k + ${f}) { let candidate = f32(${u.getByOffset(`offset + k`)}); - bestValue = ${yr[r]}; + bestValue = ${vr[r]}; } aBestValues[local_idx] = bestValue; workgroupBarrier(); @@ -125,7 +125,7 @@ var re=Object.defineProperty,ie=Object.getOwnPropertyDescriptor,ae=Object.getOwn let interval = DIV_CEIL(reduceSize, 2u); if (local_idx < currentSize) { let candidate = aBestValues[local_idx + interval]; - bestValue = ${br[r]}; + bestValue = ${yr[r]}; aBestValues[local_idx] = bestValue; } reduceSize = interval; @@ -133,9 +133,9 @@ var re=Object.defineProperty,ie=Object.getOwnPropertyDescriptor,ae=Object.getOwn } if (local_idx == 0u) { - ${d.setByOffset(`outputIndex`,`${r===`mean`?`${d.type.storage}(bestValue / f32(uniforms.reduceSize))`:`${d.type.storage}(${Sr[r]})`}`)}; + ${d.setByOffset(`outputIndex`,`${r===`mean`?`${d.type.storage}(bestValue / f32(uniforms.reduceSize))`:`${d.type.storage}(${xr[r]})`}`)}; } - }`;return{name:e,shaderCache:{hint:`${t};${f}`,inputDependencies:[`type`]},getShaderSource:m,getRunData:()=>({outputs:[{dims:a,dataType:i}],dispatchGroup:{x:c},programUniforms:[{type:12,data:l}]})}},kr=(e,t,n,r)=>{let i=e.inputs.length===1?n:Wr(e.inputs,n),a=i.axes;a.length===0&&!i.noopWithEmptyAxes&&(a=e.inputs[0].dims.map((e,t)=>t));let o=U.normalizeAxes(a,e.inputs[0].dims.length),s=o,c=e.inputs[0],l=Dr(s,e.inputs[0].dims.length);l.length>0&&(c=e.compute(hr(e.inputs[0],l),{inputs:[0],outputs:[-1]})[0],s=Cr(s.length,c.dims.length));let[u,d]=wr(c.dims,s),f=u;i.keepDims&&(f=Tr(u,o)),e.compute(Or(t,i.cacheKey,[c],r,e.inputs[0].dataType,f,d),{inputs:[c]})},Ar=(e,t)=>{kr(e,`ReduceMeanShared`,t,`mean`)},jr=(e,t)=>{kr(e,`ReduceL1Shared`,t,`l1`)},Mr=(e,t)=>{kr(e,`ReduceL2Shared`,t,`l2`)},Nr=(e,t)=>{kr(e,`ReduceLogSumExpShared`,t,`logSumExp`)},Pr=(e,t)=>{kr(e,`ReduceMaxShared`,t,`max`)},Fr=(e,t)=>{kr(e,`ReduceMinShared`,t,`min`)},Ir=(e,t)=>{kr(e,`ReduceProdShared`,t,`prod`)},Lr=(e,t)=>{kr(e,`ReduceSumShared`,t,`sum`)},Rr=(e,t)=>{kr(e,`ReduceSumSquareShared`,t,`sumSquare`)},zr=(e,t)=>{kr(e,`ReduceLogSumShared`,t,`logSum`)}}),Vr,Hr,Ur,Wr,Gr,Kr,qr,Jr,Yr,Xr,Zr,Qr,$r,ei,ti,ni,ri,ii,ai,oi,si,ci,li,ui,di,fi,pi=M(()=>{"use strict";V(),W(),Xn(),Y(),Br(),Vr=e=>{if(!e||e.length===0||e.length>2)throw Error(`Reduce op requires 1 or 2 inputs.`);if(e.length===2&&e[1].dims.length!==1)throw Error(`Invalid axes input dims.`)},Hr=e=>[``,``,`var value = ${e.getByIndices(`input_indices`)};`,``],Ur=(e,t,n,r,i,a,o=!1,s=!1)=>{let c=[],l=n[0].dims,u=l.length,d=U.normalizeAxes(i,u),f=!s&&d.length===0;l.forEach((e,t)=>{f||d.indexOf(t)>=0?o&&c.push(1):c.push(e)});let p=c.length,m=U.size(c);return{name:e,shaderCache:t,getShaderSource:e=>{let t=[],i=q(`_A`,n[0].dataType,u),s=J(`output`,a,p),c=r(i,s,d),m=c[2];for(let e=0,n=0;e=0?(o&&n++,m=`for(var j${e}: u32 = 0; j${e} < ${l[e]}; j${e}++) { + }`;return{name:e,shaderCache:{hint:`${t};${f}`,inputDependencies:[`type`]},getShaderSource:m,getRunData:()=>({outputs:[{dims:a,dataType:i}],dispatchGroup:{x:c},programUniforms:[{type:12,data:l}]})}},Or=(e,t,n,r)=>{let i=e.inputs.length===1?n:Ur(e.inputs,n),a=i.axes;a.length===0&&!i.noopWithEmptyAxes&&(a=e.inputs[0].dims.map((e,t)=>t));let o=W.normalizeAxes(a,e.inputs[0].dims.length),s=o,c=e.inputs[0],l=Er(s,e.inputs[0].dims.length);l.length>0&&(c=e.compute(mr(e.inputs[0],l),{inputs:[0],outputs:[-1]})[0],s=Sr(s.length,c.dims.length));let[u,d]=Cr(c.dims,s),f=u;i.keepDims&&(f=wr(u,o)),e.compute(Dr(t,i.cacheKey,[c],r,e.inputs[0].dataType,f,d),{inputs:[c]})},kr=(e,t)=>{Or(e,`ReduceMeanShared`,t,`mean`)},Ar=(e,t)=>{Or(e,`ReduceL1Shared`,t,`l1`)},jr=(e,t)=>{Or(e,`ReduceL2Shared`,t,`l2`)},Mr=(e,t)=>{Or(e,`ReduceLogSumExpShared`,t,`logSumExp`)},Nr=(e,t)=>{Or(e,`ReduceMaxShared`,t,`max`)},Pr=(e,t)=>{Or(e,`ReduceMinShared`,t,`min`)},Fr=(e,t)=>{Or(e,`ReduceProdShared`,t,`prod`)},Ir=(e,t)=>{Or(e,`ReduceSumShared`,t,`sum`)},Lr=(e,t)=>{Or(e,`ReduceSumSquareShared`,t,`sumSquare`)},Rr=(e,t)=>{Or(e,`ReduceLogSumShared`,t,`logSum`)}}),Br,Vr,Hr,Ur,Wr,Gr,Kr,qr,Jr,Yr,Xr,Zr,Qr,$r,ei,ti,ni,ri,ii,ai,oi,si,ci,li,ui,di,fi=M(()=>{"use strict";U(),G(),Yn(),X(),zr(),Br=e=>{if(!e||e.length===0||e.length>2)throw Error(`Reduce op requires 1 or 2 inputs.`);if(e.length===2&&e[1].dims.length!==1)throw Error(`Invalid axes input dims.`)},Vr=e=>[``,``,`var value = ${e.getByIndices(`input_indices`)};`,``],Hr=(e,t,n,r,i,a,o=!1,s=!1)=>{let c=[],l=n[0].dims,u=l.length,d=W.normalizeAxes(i,u),f=!s&&d.length===0;l.forEach((e,t)=>{f||d.indexOf(t)>=0?o&&c.push(1):c.push(e)});let p=c.length,m=W.size(c);return{name:e,shaderCache:t,getShaderSource:e=>{let t=[],i=J(`_A`,n[0].dataType,u),s=Y(`output`,a,p),c=r(i,s,d),m=c[2];for(let e=0,n=0;e=0?(o&&n++,m=`for(var j${e}: u32 = 0; j${e} < ${l[e]}; j${e}++) { ${c[2].includes(`last_index`)?`let last_index = j${e};`:``} ${i.indicesSet(`input_indices`,e,`j${e}`)} ${m} @@ -156,19 +156,19 @@ var re=Object.defineProperty,ie=Object.getOwnPropertyDescriptor,ae=Object.getOwn ${c[3]} ${c.length===4?s.setByOffset(`global_idx`,`value`):c.slice(4).join(` `)} - }`},getRunData:()=>({outputs:[{dims:c,dataType:a}],dispatchGroup:{x:Math.ceil(m/64)},programUniforms:[{type:12,data:m},...G(l,c)]})}},Wr=(e,t)=>{let n=[];return e[1].dims[0]>0&&e[1].getBigInt64Array().forEach(e=>n.push(Number(e))),Yn({axes:n,keepDims:t.keepDims,noopWithEmptyAxes:t.noopWithEmptyAxes})},Gr=(e,t,n,r)=>{let i=e.inputs,a=i.length===1?n:Wr(i,n);e.compute(Ur(t,{hint:a.cacheKey,inputDependencies:[`rank`]},[i[0]],a.noopWithEmptyAxes&&a.axes.length===0?Hr:r,a.axes,i[0].dataType,a.keepDims,a.noopWithEmptyAxes),{inputs:[0]})},Kr=(e,t)=>{Vr(e.inputs),Gr(e,`ReduceLogSum`,t,(e,t)=>[`var value = ${t.type.storage}(0);`,``,`value += ${e.getByIndices(`input_indices`)};`,`value = log(value);`])},qr=(e,t)=>{Vr(e.inputs),Gr(e,`ReduceL1`,t,(e,t)=>[`var value = ${t.type.storage}(0);`,``,`value += abs(${e.getByIndices(`input_indices`)});`,``])},Jr=(e,t)=>{Vr(e.inputs),Gr(e,`ReduceL2`,t,(e,t)=>[`var t = ${t.type.value}(0); var value = ${t.type.value}(0);`,``,`t = ${e.getByIndices(`input_indices`)}; value += (t * t);`,`value = sqrt(value);`])},Yr=(e,t)=>{Vr(e.inputs),Gr(e,`ReduceLogSumExp`,t,(e,t)=>[`var value = ${t.type.storage}(0);`,``,`value += exp(${e.getByIndices(`input_indices`)});`,`value = log(value);`])},Xr=(e,t)=>{Vr(e.inputs),Gr(e,`ReduceMax`,t,(e,t,n)=>{let r=[];for(let t=0;t=0||n.length===0)&&r.push(e.indicesSet(`input_indices`,t,0));return[`${r.join(` -`)}`,`var value = ${e.getByIndices(`input_indices`)};`,`value = max(value, ${e.getByIndices(`input_indices`)});`,``]})},Zr=(e,t)=>{Vr(e.inputs),Gr(e,`ReduceMean`,t,(t,n,r)=>{let i=1;for(let n=0;n=0||r.length===0)&&(i*=e.inputs[0].dims[n]);return[`var sum = f32(0);`,``,`sum += f32(${t.getByIndices(`input_indices`)});`,`let value = ${n.type.value}(sum / ${i});`]})},Qr=(e,t)=>{Vr(e.inputs),Gr(e,`ReduceMin`,t,(e,t,n)=>{let r=[];for(let t=0;t=0||n.length===0)&&r.push(`input_indices[${t}] = 0;`);return[`${r.join(` -`)}`,`var value = ${e.getByIndices(`input_indices`)};`,`value = min(value, ${e.getByIndices(`input_indices`)});`,``]})},$r=(e,t)=>{Vr(e.inputs),Gr(e,`ReduceProd`,t,(e,t)=>[`var value = ${t.type.storage}(1);`,``,`value *= ${e.getByIndices(`input_indices`)};`,``])},ei=(e,t)=>{Vr(e.inputs),Gr(e,`ReduceSum`,t,(e,t)=>[`var value = ${t.type.storage}(0);`,``,`value += ${e.getByIndices(`input_indices`)};`,``])},ti=(e,t)=>{Vr(e.inputs),Gr(e,`ReduceSumSquare`,t,(e,t)=>[`var t = ${t.type.value}(0); var value = ${t.type.value}(0);`,``,`t = ${e.getByIndices(`input_indices`)}; value += t * t;`,``])},ni=(e,t,n)=>{if(t.length===0)return n;let r=1,i=1;for(let n=0;n1024},ri=(e,t)=>{ni(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Zr(e,t):Ar(e,t)},ii=(e,t)=>{ni(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?qr(e,t):jr(e,t)},ai=(e,t)=>{ni(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Jr(e,t):Mr(e,t)},oi=(e,t)=>{ni(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Yr(e,t):Nr(e,t)},si=(e,t)=>{ni(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Xr(e,t):Pr(e,t)},ci=(e,t)=>{ni(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Qr(e,t):Fr(e,t)},li=(e,t)=>{ni(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?$r(e,t):Ir(e,t)},ui=(e,t)=>{ni(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?ei(e,t):Lr(e,t)},di=(e,t)=>{ni(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?ti(e,t):Rr(e,t)},fi=(e,t)=>{ni(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Kr(e,t):zr(e,t)}}),mi,hi,gi,_i,vi=M(()=>{"use strict";V(),Xn(),pi(),mi=e=>{if(!e||e.length===0||e.length>2)throw Error(`ArgMinMaxOp op requires 1 or 2 inputs.`);if(e[0].dataType!==1)throw Error(`Invalid input type.`)},hi=(e,t)=>{mi(e.inputs);let n=(e,n,r)=>{let i=[];for(let t=0;t=0||r.length===0)&&i.push(`input_indices[${t}] = 0;`);return[`${i.join(` + }`},getRunData:()=>({outputs:[{dims:c,dataType:a}],dispatchGroup:{x:Math.ceil(m/64)},programUniforms:[{type:12,data:m},...K(l,c)]})}},Ur=(e,t)=>{let n=[];return e[1].dims[0]>0&&e[1].getBigInt64Array().forEach(e=>n.push(Number(e))),Jn({axes:n,keepDims:t.keepDims,noopWithEmptyAxes:t.noopWithEmptyAxes})},Wr=(e,t,n,r)=>{let i=e.inputs,a=i.length===1?n:Ur(i,n);e.compute(Hr(t,{hint:a.cacheKey,inputDependencies:[`rank`]},[i[0]],a.noopWithEmptyAxes&&a.axes.length===0?Vr:r,a.axes,i[0].dataType,a.keepDims,a.noopWithEmptyAxes),{inputs:[0]})},Gr=(e,t)=>{Br(e.inputs),Wr(e,`ReduceLogSum`,t,(e,t)=>[`var value = ${t.type.storage}(0);`,``,`value += ${e.getByIndices(`input_indices`)};`,`value = log(value);`])},Kr=(e,t)=>{Br(e.inputs),Wr(e,`ReduceL1`,t,(e,t)=>[`var value = ${t.type.storage}(0);`,``,`value += abs(${e.getByIndices(`input_indices`)});`,``])},qr=(e,t)=>{Br(e.inputs),Wr(e,`ReduceL2`,t,(e,t)=>[`var t = ${t.type.value}(0); var value = ${t.type.value}(0);`,``,`t = ${e.getByIndices(`input_indices`)}; value += (t * t);`,`value = sqrt(value);`])},Jr=(e,t)=>{Br(e.inputs),Wr(e,`ReduceLogSumExp`,t,(e,t)=>[`var value = ${t.type.storage}(0);`,``,`value += exp(${e.getByIndices(`input_indices`)});`,`value = log(value);`])},Yr=(e,t)=>{Br(e.inputs),Wr(e,`ReduceMax`,t,(e,t,n)=>{let r=[];for(let t=0;t=0||n.length===0)&&r.push(e.indicesSet(`input_indices`,t,0));return[`${r.join(` +`)}`,`var value = ${e.getByIndices(`input_indices`)};`,`value = max(value, ${e.getByIndices(`input_indices`)});`,``]})},Xr=(e,t)=>{Br(e.inputs),Wr(e,`ReduceMean`,t,(t,n,r)=>{let i=1;for(let n=0;n=0||r.length===0)&&(i*=e.inputs[0].dims[n]);return[`var sum = f32(0);`,``,`sum += f32(${t.getByIndices(`input_indices`)});`,`let value = ${n.type.value}(sum / ${i});`]})},Zr=(e,t)=>{Br(e.inputs),Wr(e,`ReduceMin`,t,(e,t,n)=>{let r=[];for(let t=0;t=0||n.length===0)&&r.push(`input_indices[${t}] = 0;`);return[`${r.join(` +`)}`,`var value = ${e.getByIndices(`input_indices`)};`,`value = min(value, ${e.getByIndices(`input_indices`)});`,``]})},Qr=(e,t)=>{Br(e.inputs),Wr(e,`ReduceProd`,t,(e,t)=>[`var value = ${t.type.storage}(1);`,``,`value *= ${e.getByIndices(`input_indices`)};`,``])},$r=(e,t)=>{Br(e.inputs),Wr(e,`ReduceSum`,t,(e,t)=>[`var value = ${t.type.storage}(0);`,``,`value += ${e.getByIndices(`input_indices`)};`,``])},ei=(e,t)=>{Br(e.inputs),Wr(e,`ReduceSumSquare`,t,(e,t)=>[`var t = ${t.type.value}(0); var value = ${t.type.value}(0);`,``,`t = ${e.getByIndices(`input_indices`)}; value += t * t;`,``])},ti=(e,t,n)=>{if(t.length===0)return n;let r=1,i=1;for(let n=0;n1024},ni=(e,t)=>{ti(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Xr(e,t):kr(e,t)},ri=(e,t)=>{ti(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Kr(e,t):Ar(e,t)},ii=(e,t)=>{ti(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?qr(e,t):jr(e,t)},ai=(e,t)=>{ti(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Jr(e,t):Mr(e,t)},oi=(e,t)=>{ti(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Yr(e,t):Nr(e,t)},si=(e,t)=>{ti(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Zr(e,t):Pr(e,t)},ci=(e,t)=>{ti(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Qr(e,t):Fr(e,t)},li=(e,t)=>{ti(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?$r(e,t):Ir(e,t)},ui=(e,t)=>{ti(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?ei(e,t):Lr(e,t)},di=(e,t)=>{ti(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Gr(e,t):Rr(e,t)}}),pi,mi,hi,gi,_i=M(()=>{"use strict";U(),Yn(),fi(),pi=e=>{if(!e||e.length===0||e.length>2)throw Error(`ArgMinMaxOp op requires 1 or 2 inputs.`);if(e[0].dataType!==1)throw Error(`Invalid input type.`)},mi=(e,t)=>{pi(e.inputs);let n=(e,n,r)=>{let i=[];for(let t=0;t=0||r.length===0)&&i.push(`input_indices[${t}] = 0;`);return[`${i.join(` `)}`,`var value = ${e.getByIndices(`input_indices`)}; var best_index : i32 = 0;`,`if (${e.getByIndices(`input_indices`)} ${t.selectLastIndex>0?`<=`:`<`} value) { value = ${e.getByIndices(`input_indices`)}; best_index = i32(last_index); - }`,``,n.setByOffset(`global_idx`,`best_index`)]};e.compute(Ur(`ArgMin`,{hint:t.cacheKey,inputDependencies:[`rank`]},[e.inputs[0]],n,[t.axis],7,t.keepDims),{inputs:[0]})},gi=(e,t)=>{mi(e.inputs);let n=(e,n,r)=>{let i=[];for(let t=0;t=0||r.length===0)&&i.push(`input_indices[${t}] = 0;`);return[`${i.join(` + }`,``,n.setByOffset(`global_idx`,`best_index`)]};e.compute(Hr(`ArgMin`,{hint:t.cacheKey,inputDependencies:[`rank`]},[e.inputs[0]],n,[t.axis],7,t.keepDims),{inputs:[0]})},hi=(e,t)=>{pi(e.inputs);let n=(e,n,r)=>{let i=[];for(let t=0;t=0||r.length===0)&&i.push(`input_indices[${t}] = 0;`);return[`${i.join(` `)}`,`var value = ${e.getByIndices(`input_indices`)}; var best_index : i32 = 0;`,`if (${e.getByIndices(`input_indices`)} ${t.selectLastIndex>0?`>=`:`>`} value) { value = ${e.getByIndices(`input_indices`)}; best_index = i32(last_index); - }`,``,n.setByOffset(`global_idx`,`best_index`)]};e.compute(Ur(`argMax`,{hint:t.cacheKey,inputDependencies:[`rank`]},[e.inputs[0]],n,[t.axis],7,t.keepDims),{inputs:[0]})},_i=e=>Yn(e)}),yi,bi,xi,Si,Ci,wi,Ti,Ei,Di=M(()=>{"use strict";V(),W(),Ln(),Y(),yi=(e,t)=>{let n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5];if(o&&s)throw Error(`Attention cannot have both past and attention_bias`);if(n.dims.length!==3)throw Error(`Input "input" must have 3 dimensions`);let c=n.dims[0],l=n.dims[1],u=n.dims[2];if(i.dims.length!==1)throw Error(`Input "bias" is expected to have 1 dimensions`);if(r.dims.length!==2)throw Error(`Input "weights" is expected to have 2 dimensions`);if(r.dims[0]!==u)throw Error(`Input 1 dimension 0 should have same length as dimension 2 of input 0`);if(i.dims[0]!==r.dims[1])throw Error(`Input "bias" dimension 0 should have same length as dimension 1 of input "weights"`);let d=i.dims[0]/3,f=d,p=f;if(t.qkvHiddenSizes.length>0){if(t.qkvHiddenSizes.length!==3)throw Error(`qkv_hidden_sizes attribute should have 3 elements`);for(let e of t.qkvHiddenSizes)if(e%t.numHeads!==0)throw Error(`qkv_hidden_sizes should be divisible by num_heads`);d=t.qkvHiddenSizes[0],f=t.qkvHiddenSizes[1],p=t.qkvHiddenSizes[2]}let m=l;if(d!==f)throw Error(`qkv_hidden_sizes first element should be same as the second`);if(i.dims[0]!==d+f+p)throw Error(`Input "bias" dimension 0 should have same length as sum of Q/K/V hidden sizes`);let h=0;if(o){if(f!==p)throw Error(`Input "past" expect k_hidden_size == v_hidden_size`);if(o.dims.length!==5)throw Error(`Input "past" must have 5 dimensions`);if(o.dims[0]!==2)throw Error(`Input "past" first dimension must be 2`);if(o.dims[1]!==c)throw Error(`Input "past" second dimension must be batch_size`);if(o.dims[2]!==t.numHeads)throw Error(`Input "past" third dimension must be num_heads`);if(o.dims[4]!==f/t.numHeads)throw Error(`Input "past" fifth dimension must be k_hidden_size / num_heads`);t.pastPresentShareBuffer||(h=o.dims[3])}let g=m+h,_=-1,v=0;if(a)throw Error(`Mask not supported`);if(o)throw Error(`past is not supported`);if(s){if(s.dims.length!==4)throw Error(`Input "attention_bias" must have 4 dimensions`);if(s.dims[0]!==c||s.dims[1]!==t.numHeads||s.dims[2]!==l||s.dims[3]!==g)throw Error(`Expect "attention_bias" shape (batch_size, num_heads, sequence_length, total_sequence_length)`)}return{batchSize:c,sequenceLength:l,pastSequenceLength:h,kvSequenceLength:m,totalSequenceLength:g,maxSequenceLength:_,inputHiddenSize:u,hiddenSize:d,vHiddenSize:p,headSize:Math.floor(d/t.numHeads),vHeadSize:Math.floor(p/t.numHeads),numHeads:t.numHeads,isUnidirectional:!1,pastPresentShareBuffer:!1,maskFilterValue:t.maskFilterValue,maskType:v,scale:t.scale,broadcastResPosBias:!1,passPastInKv:!1,qkvFormat:1}},bi=(e,t,n)=>t&&e?` + }`,``,n.setByOffset(`global_idx`,`best_index`)]};e.compute(Hr(`argMax`,{hint:t.cacheKey,inputDependencies:[`rank`]},[e.inputs[0]],n,[t.axis],7,t.keepDims),{inputs:[0]})},gi=e=>Jn(e)}),vi,yi,bi,xi,Si,Ci,wi,Ti,Ei=M(()=>{"use strict";U(),G(),In(),X(),vi=(e,t)=>{let n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5];if(o&&s)throw Error(`Attention cannot have both past and attention_bias`);if(n.dims.length!==3)throw Error(`Input "input" must have 3 dimensions`);let c=n.dims[0],l=n.dims[1],u=n.dims[2];if(i.dims.length!==1)throw Error(`Input "bias" is expected to have 1 dimensions`);if(r.dims.length!==2)throw Error(`Input "weights" is expected to have 2 dimensions`);if(r.dims[0]!==u)throw Error(`Input 1 dimension 0 should have same length as dimension 2 of input 0`);if(i.dims[0]!==r.dims[1])throw Error(`Input "bias" dimension 0 should have same length as dimension 1 of input "weights"`);let d=i.dims[0]/3,f=d,p=f;if(t.qkvHiddenSizes.length>0){if(t.qkvHiddenSizes.length!==3)throw Error(`qkv_hidden_sizes attribute should have 3 elements`);for(let e of t.qkvHiddenSizes)if(e%t.numHeads!==0)throw Error(`qkv_hidden_sizes should be divisible by num_heads`);d=t.qkvHiddenSizes[0],f=t.qkvHiddenSizes[1],p=t.qkvHiddenSizes[2]}let m=l;if(d!==f)throw Error(`qkv_hidden_sizes first element should be same as the second`);if(i.dims[0]!==d+f+p)throw Error(`Input "bias" dimension 0 should have same length as sum of Q/K/V hidden sizes`);let h=0;if(o){if(f!==p)throw Error(`Input "past" expect k_hidden_size == v_hidden_size`);if(o.dims.length!==5)throw Error(`Input "past" must have 5 dimensions`);if(o.dims[0]!==2)throw Error(`Input "past" first dimension must be 2`);if(o.dims[1]!==c)throw Error(`Input "past" second dimension must be batch_size`);if(o.dims[2]!==t.numHeads)throw Error(`Input "past" third dimension must be num_heads`);if(o.dims[4]!==f/t.numHeads)throw Error(`Input "past" fifth dimension must be k_hidden_size / num_heads`);t.pastPresentShareBuffer||(h=o.dims[3])}let g=m+h,_=-1,v=0;if(a)throw Error(`Mask not supported`);if(o)throw Error(`past is not supported`);if(s){if(s.dims.length!==4)throw Error(`Input "attention_bias" must have 4 dimensions`);if(s.dims[0]!==c||s.dims[1]!==t.numHeads||s.dims[2]!==l||s.dims[3]!==g)throw Error(`Expect "attention_bias" shape (batch_size, num_heads, sequence_length, total_sequence_length)`)}return{batchSize:c,sequenceLength:l,pastSequenceLength:h,kvSequenceLength:m,totalSequenceLength:g,maxSequenceLength:_,inputHiddenSize:u,hiddenSize:d,vHiddenSize:p,headSize:Math.floor(d/t.numHeads),vHeadSize:Math.floor(p/t.numHeads),numHeads:t.numHeads,isUnidirectional:!1,pastPresentShareBuffer:!1,maskFilterValue:t.maskFilterValue,maskType:v,scale:t.scale,broadcastResPosBias:!1,passPastInKv:!1,qkvFormat:1}},yi=(e,t,n)=>t&&e?` let total_sequence_length_input = u32(${t.getByOffset(`0`)}); let present_sequence_length = max(total_sequence_length_input, uniforms.past_sequence_length); let is_subsequent_prompt: bool = sequence_length > 1 && sequence_length != total_sequence_length_input; @@ -181,7 +181,7 @@ var best_index : i32 = 0;`,`if (${e.getByIndices(`input_indices`)} ${t.selectLas `:` ${n?`let past_sequence_length = uniforms.past_sequence_length`:``}; let present_sequence_length = total_sequence_length; - `,xi=(e,t,n,r,i,a,o,s)=>{let c=tr(o?1:a),l=64,u=a/c;u{let n=J(`x`,e.dataType,e.dims,c),r=[n],i=o?q(`seq_lens`,o.dataType,o.dims):void 0;i&&r.push(i);let a=s?q(`total_sequence_length_input`,s.dataType,s.dims):void 0;a&&r.push(a);let u=er(e.dataType),d=[{name:`batch_size`,type:`u32`},{name:`num_heads`,type:`u32`},{name:`past_sequence_length`,type:`u32`},{name:`sequence_length`,type:`u32`},{name:`total_sequence_length`,type:`u32`},{name:`elements_per_thread`,type:`u32`}];return` + `,bi=(e,t,n,r,i,a,o,s)=>{let c=er(o?1:a),l=64,u=a/c;u{let n=Y(`x`,e.dataType,e.dims,c),r=[n],i=o?J(`seq_lens`,o.dataType,o.dims):void 0;i&&r.push(i);let a=s?J(`total_sequence_length_input`,s.dataType,s.dims):void 0;a&&r.push(a);let u=$n(e.dataType),d=[{name:`batch_size`,type:`u32`},{name:`num_heads`,type:`u32`},{name:`past_sequence_length`,type:`u32`},{name:`sequence_length`,type:`u32`},{name:`total_sequence_length`,type:`u32`},{name:`elements_per_thread`,type:`u32`}];return` var thread_max: array; var thread_sum: array; ${t.registerUniforms(d).declareVariables(...r)} @@ -190,7 +190,7 @@ var best_index : i32 = 0;`,`if (${e.getByIndices(`input_indices`)} ${t.selectLas let headIdx = workgroup_id.z % uniforms.num_heads; let sequence_length = uniforms.sequence_length; var total_sequence_length = uniforms.total_sequence_length; - ${bi(i,a,!1)} + ${yi(i,a,!1)} let local_offset = local_idx * uniforms.elements_per_thread; let offset = (global_idx / ${l}) * uniforms.total_sequence_length + local_offset; let seq_causal_length = ${o?`u32(past_sequence_length + workgroup_id.y + 1)`:`total_sequence_length`}; @@ -232,7 +232,7 @@ var best_index : i32 = 0;`,`if (${e.getByIndices(`input_indices`)} ${t.selectLas for (var total_seq_id: u32 = seq_causal_length; total_seq_id + local_offset < uniforms.total_sequence_length; total_seq_id++) { x[offset + total_seq_id] = ${n.type.value}(${u}(0)); }`:``}; - }`};return{name:`AttentionProbsSoftmax`,shaderCache:{hint:`${l};${p};${c}`,inputDependencies:h},getShaderSource:g,getRunData:()=>({outputs:[],dispatchGroup:{x:1,y:i,z:t*n},programUniforms:f})}},Si=(e,t,n,r,i,a,o,s,c)=>{let l=o+a.kvSequenceLength,u=[a.batchSize,a.numHeads,a.sequenceLength,l],d=e>1&&r,f=a.kvNumHeads?a.kvNumHeads:a.numHeads,p=d?[a.batchSize,f,l,a.headSize]:void 0,m=a.nReps?a.nReps:1,h=a.scale===0?1/Math.sqrt(a.headSize):a.scale,g=tr(a.headSize),_=a.headSize/g,v=12,y={x:Math.ceil(l/v),y:Math.ceil(a.sequenceLength/v),z:a.batchSize*a.numHeads},b=[{type:12,data:a.sequenceLength},{type:12,data:_},{type:12,data:l},{type:12,data:a.numHeads},{type:12,data:a.headSize},{type:1,data:h},{type:12,data:o},{type:12,data:a.kvSequenceLength},{type:12,data:m}],x=d&&r&&U.size(r.dims)>0,S=[`type`,`type`];x&&S.push(`type`),i&&S.push(`type`),s&&S.push(`type`),c&&S.push(`type`);let C=[{dims:u,dataType:t.dataType,gpuDataType:0}];d&&C.push({dims:p,dataType:t.dataType,gpuDataType:0});let w=e=>{let a=q(`q`,t.dataType,t.dims,g),o=q(`key`,n.dataType,n.dims,g),l=[a,o];if(x){let e=q(`past_key`,r.dataType,r.dims,g);l.push(e)}i&&l.push(q(`attention_bias`,i.dataType,i.dims));let f=s?q(`seq_lens`,s.dataType,s.dims):void 0;f&&l.push(f);let h=c?q(`total_sequence_length_input`,c.dataType,c.dims):void 0;h&&l.push(h);let _=J(`output`,t.dataType,u),y=[_];d&&y.push(J(`present_key`,t.dataType,p,g));let b=er(1,g),S=[{name:`M`,type:`u32`},{name:`K`,type:`u32`},{name:`N`,type:`u32`},{name:`num_heads`,type:`u32`},{name:`head_size`,type:`u32`},{name:`alpha`,type:`f32`},{name:`past_sequence_length`,type:`u32`},{name:`kv_sequence_length`,type:`u32`},{name:`n_reps`,type:`u32`}];return` + }`};return{name:`AttentionProbsSoftmax`,shaderCache:{hint:`${l};${p};${c}`,inputDependencies:h},getShaderSource:g,getRunData:()=>({outputs:[],dispatchGroup:{x:1,y:i,z:t*n},programUniforms:f})}},xi=(e,t,n,r,i,a,o,s,c)=>{let l=o+a.kvSequenceLength,u=[a.batchSize,a.numHeads,a.sequenceLength,l],d=e>1&&r,f=a.kvNumHeads?a.kvNumHeads:a.numHeads,p=d?[a.batchSize,f,l,a.headSize]:void 0,m=a.nReps?a.nReps:1,h=a.scale===0?1/Math.sqrt(a.headSize):a.scale,g=er(a.headSize),_=a.headSize/g,v=12,y={x:Math.ceil(l/v),y:Math.ceil(a.sequenceLength/v),z:a.batchSize*a.numHeads},b=[{type:12,data:a.sequenceLength},{type:12,data:_},{type:12,data:l},{type:12,data:a.numHeads},{type:12,data:a.headSize},{type:1,data:h},{type:12,data:o},{type:12,data:a.kvSequenceLength},{type:12,data:m}],x=d&&r&&W.size(r.dims)>0,S=[`type`,`type`];x&&S.push(`type`),i&&S.push(`type`),s&&S.push(`type`),c&&S.push(`type`);let C=[{dims:u,dataType:t.dataType,gpuDataType:0}];d&&C.push({dims:p,dataType:t.dataType,gpuDataType:0});let w=e=>{let a=J(`q`,t.dataType,t.dims,g),o=J(`key`,n.dataType,n.dims,g),l=[a,o];if(x){let e=J(`past_key`,r.dataType,r.dims,g);l.push(e)}i&&l.push(J(`attention_bias`,i.dataType,i.dims));let f=s?J(`seq_lens`,s.dataType,s.dims):void 0;f&&l.push(f);let h=c?J(`total_sequence_length_input`,c.dataType,c.dims):void 0;h&&l.push(h);let _=Y(`output`,t.dataType,u),y=[_];d&&y.push(Y(`present_key`,t.dataType,p,g));let b=$n(1,g),S=[{name:`M`,type:`u32`},{name:`K`,type:`u32`},{name:`N`,type:`u32`},{name:`num_heads`,type:`u32`},{name:`head_size`,type:`u32`},{name:`alpha`,type:`f32`},{name:`past_sequence_length`,type:`u32`},{name:`kv_sequence_length`,type:`u32`},{name:`n_reps`,type:`u32`}];return` const TILE_SIZE = ${v}u; var tileQ: array<${a.type.storage}, ${v*v}>; @@ -248,7 +248,7 @@ var best_index : i32 = 0;`,`if (${e.getByIndices(`input_indices`)} ${t.selectLas let n = workgroup_id.x * TILE_SIZE; let sequence_length = uniforms.M; var total_sequence_length = uniforms.N; - ${bi(f,h,!0)} + ${yi(f,h,!0)} let absKvHeadIdx = batchIdx * kv_num_heads + kvHeadIdx; let qOffset = workgroup_id.z * uniforms.M * uniforms.K + m * uniforms.K; ${x&&d?`let pastKeyOffset = absKvHeadIdx * uniforms.past_sequence_length * uniforms.K;`:``}; @@ -289,7 +289,7 @@ var best_index : i32 = 0;`,`if (${e.getByIndices(`input_indices`)} ${t.selectLas var sum: f32 = ${(()=>{switch(g){case 1:return`value`;case 2:return`value.x + value.y`;case 4:return`value.x + value.y + value.z + value.w`;default:throw Error(`Unsupported components: ${g}`)}})()}; output[outputIdx] = ${_.type.value} (sum * uniforms.alpha) + ${i?`attention_bias[outputIdx]`:`0.0`}; } - }`};return{name:`AttentionProbs`,shaderCache:{hint:`${g};${i!==void 0};${r!==void 0};${e}`,inputDependencies:S},getRunData:()=>({outputs:C,dispatchGroup:y,programUniforms:b}),getShaderSource:w}},Ci=(e,t,n,r,i,a,o=void 0,s=void 0)=>{let c=a+i.kvSequenceLength,l=i.nReps?i.nReps:1,u=i.vHiddenSize*l,d=e>1&&r,f=i.kvNumHeads?i.kvNumHeads:i.numHeads,p=d?[i.batchSize,f,c,i.headSize]:void 0,m=[i.batchSize,i.sequenceLength,u],h=12,g={x:Math.ceil(i.vHeadSize/h),y:Math.ceil(i.sequenceLength/h),z:i.batchSize*i.numHeads},_=[{type:12,data:i.sequenceLength},{type:12,data:c},{type:12,data:i.vHeadSize},{type:12,data:i.numHeads},{type:12,data:i.headSize},{type:12,data:u},{type:12,data:a},{type:12,data:i.kvSequenceLength},{type:12,data:l}],v=d&&r&&U.size(r.dims)>0,y=[`type`,`type`];v&&y.push(`type`),o&&y.push(`type`),s&&y.push(`type`);let b=[{dims:m,dataType:t.dataType,gpuDataType:0}];d&&b.push({dims:p,dataType:t.dataType,gpuDataType:0});let x=e=>{let i=q(`probs`,t.dataType,t.dims),a=q(`v`,n.dataType,n.dims),c=[i,a];v&&c.push(q(`past_value`,r.dataType,r.dims));let u=o?q(`seq_lens`,o.dataType,o.dims):void 0;o&&c.push(u);let f=s?q(`total_sequence_length_input`,s.dataType,s.dims):void 0;s&&c.push(f);let g=[J(`output`,t.dataType,m)];d&&g.push(J(`present_value`,t.dataType,p));let _=[{name:`M`,type:`u32`},{name:`K`,type:`u32`},{name:`N`,type:`u32`},{name:`num_heads`,type:`u32`},{name:`head_size`,type:`u32`},{name:`v_hidden_size`,type:`u32`},{name:`past_sequence_length`,type:`u32`},{name:`kv_sequence_length`,type:`u32`},{name:`n_reps`,type:`u32`}];return` + }`};return{name:`AttentionProbs`,shaderCache:{hint:`${g};${i!==void 0};${r!==void 0};${e}`,inputDependencies:S},getRunData:()=>({outputs:C,dispatchGroup:y,programUniforms:b}),getShaderSource:w}},Si=(e,t,n,r,i,a,o=void 0,s=void 0)=>{let c=a+i.kvSequenceLength,l=i.nReps?i.nReps:1,u=i.vHiddenSize*l,d=e>1&&r,f=i.kvNumHeads?i.kvNumHeads:i.numHeads,p=d?[i.batchSize,f,c,i.headSize]:void 0,m=[i.batchSize,i.sequenceLength,u],h=12,g={x:Math.ceil(i.vHeadSize/h),y:Math.ceil(i.sequenceLength/h),z:i.batchSize*i.numHeads},_=[{type:12,data:i.sequenceLength},{type:12,data:c},{type:12,data:i.vHeadSize},{type:12,data:i.numHeads},{type:12,data:i.headSize},{type:12,data:u},{type:12,data:a},{type:12,data:i.kvSequenceLength},{type:12,data:l}],v=d&&r&&W.size(r.dims)>0,y=[`type`,`type`];v&&y.push(`type`),o&&y.push(`type`),s&&y.push(`type`);let b=[{dims:m,dataType:t.dataType,gpuDataType:0}];d&&b.push({dims:p,dataType:t.dataType,gpuDataType:0});let x=e=>{let i=J(`probs`,t.dataType,t.dims),a=J(`v`,n.dataType,n.dims),c=[i,a];v&&c.push(J(`past_value`,r.dataType,r.dims));let u=o?J(`seq_lens`,o.dataType,o.dims):void 0;o&&c.push(u);let f=s?J(`total_sequence_length_input`,s.dataType,s.dims):void 0;s&&c.push(f);let g=[Y(`output`,t.dataType,m)];d&&g.push(Y(`present_value`,t.dataType,p));let _=[{name:`M`,type:`u32`},{name:`K`,type:`u32`},{name:`N`,type:`u32`},{name:`num_heads`,type:`u32`},{name:`head_size`,type:`u32`},{name:`v_hidden_size`,type:`u32`},{name:`past_sequence_length`,type:`u32`},{name:`kv_sequence_length`,type:`u32`},{name:`n_reps`,type:`u32`}];return` const TILE_SIZE = ${h}u; var tileQ: array<${i.type.value}, ${h*h}>; var tileV: array<${i.type.value}, ${h*h}>; @@ -303,7 +303,7 @@ var best_index : i32 = 0;`,`if (${e.getByIndices(`input_indices`)} ${t.selectLas let n = global_id.x; let sequence_length = uniforms.M; var total_sequence_length = uniforms.K; - ${bi(u,f,!0)} + ${yi(u,f,!0)} let offsetA = workgroup_id.z * uniforms.M * uniforms.K + m * uniforms.K; let absKvHeadIdx = batchIdx * kv_num_heads + kvHeadIdx; // kvHeadIdx is relative to the batch ${v&&d?`let pastValueOffset = absKvHeadIdx * uniforms.N * uniforms.past_sequence_length + n;`:``}; @@ -344,7 +344,7 @@ var best_index : i32 = 0;`,`if (${e.getByIndices(`input_indices`)} ${t.selectLas + headIdx * uniforms.N + n; output[outputIdx] = value; } - }`};return{name:`AttentionScore`,shaderCache:{hint:`${r!==void 0};${e}`,inputDependencies:y},getRunData:()=>({outputs:b,dispatchGroup:g,programUniforms:_}),getShaderSource:x}},wi=(e,t,n,r,i,a,o,s,c,l,u=void 0,d=void 0)=>{let f=Math.min(e.outputCount,1+(o?1:0)+(s?1:0)),p=f>1?l.pastSequenceLength:0,m=p+l.kvSequenceLength,h=c&&U.size(c.dims)>0?c:void 0,g=[t,n];f>1&&o&&U.size(o.dims)>0&&g.push(o),h&&g.push(h),u&&g.push(u),d&&g.push(d);let _=e.compute(Si(f,t,n,o,h,l,p,u,d),{inputs:g,outputs:f>1?[-1,1]:[-1]})[0];e.compute(xi(_,l.batchSize,l.numHeads,p,l.sequenceLength,m,u,d),{inputs:u&&d?[_,u,d]:[_],outputs:[]});let v=[_,r];f>1&&s&&U.size(s.dims)>0&&v.push(s),u&&v.push(u),d&&v.push(d),e.compute(Ci(f,_,r,s,l,p,u,d),{inputs:v,outputs:f>1?[0,2]:[0]})},Ti=(e,t)=>{let n=[t.batchSize,t.numHeads,t.sequenceLength,t.headSize],r=t.sequenceLength,i=t.inputHiddenSize,a=t.headSize,o=12,s={x:Math.ceil(t.headSize/o),y:Math.ceil(t.sequenceLength/o),z:t.batchSize*t.numHeads},c=[e.inputs[0],e.inputs[1],e.inputs[2]],l=[{type:12,data:r},{type:12,data:i},{type:12,data:a},{type:12,data:t.numHeads},{type:12,data:t.headSize},{type:12,data:t.hiddenSize},{type:12,data:t.hiddenSize+t.hiddenSize+t.vHiddenSize}],u=e=>{let t=J(`output_q`,c[0].dataType,n),r=J(`output_k`,c[0].dataType,n),i=J(`output_v`,c[0].dataType,n),a=q(`input`,c[0].dataType,c[0].dims),s=q(`weight`,c[1].dataType,c[1].dims),l=q(`bias`,c[2].dataType,c[2].dims),u=a.type.storage,d=[{name:`M`,type:`u32`},{name:`K`,type:`u32`},{name:`N`,type:`u32`},{name:`num_heads`,type:`u32`},{name:`head_size`,type:`u32`},{name:`hidden_size`,type:`u32`},{name:`ldb`,type:`u32`}];return` + }`};return{name:`AttentionScore`,shaderCache:{hint:`${r!==void 0};${e}`,inputDependencies:y},getRunData:()=>({outputs:b,dispatchGroup:g,programUniforms:_}),getShaderSource:x}},Ci=(e,t,n,r,i,a,o,s,c,l,u=void 0,d=void 0)=>{let f=Math.min(e.outputCount,1+(o?1:0)+(s?1:0)),p=f>1?l.pastSequenceLength:0,m=p+l.kvSequenceLength,h=c&&W.size(c.dims)>0?c:void 0,g=[t,n];f>1&&o&&W.size(o.dims)>0&&g.push(o),h&&g.push(h),u&&g.push(u),d&&g.push(d);let _=e.compute(xi(f,t,n,o,h,l,p,u,d),{inputs:g,outputs:f>1?[-1,1]:[-1]})[0];e.compute(bi(_,l.batchSize,l.numHeads,p,l.sequenceLength,m,u,d),{inputs:u&&d?[_,u,d]:[_],outputs:[]});let v=[_,r];f>1&&s&&W.size(s.dims)>0&&v.push(s),u&&v.push(u),d&&v.push(d),e.compute(Si(f,_,r,s,l,p,u,d),{inputs:v,outputs:f>1?[0,2]:[0]})},wi=(e,t)=>{let n=[t.batchSize,t.numHeads,t.sequenceLength,t.headSize],r=t.sequenceLength,i=t.inputHiddenSize,a=t.headSize,o=12,s={x:Math.ceil(t.headSize/o),y:Math.ceil(t.sequenceLength/o),z:t.batchSize*t.numHeads},c=[e.inputs[0],e.inputs[1],e.inputs[2]],l=[{type:12,data:r},{type:12,data:i},{type:12,data:a},{type:12,data:t.numHeads},{type:12,data:t.headSize},{type:12,data:t.hiddenSize},{type:12,data:t.hiddenSize+t.hiddenSize+t.vHiddenSize}],u=e=>{let t=Y(`output_q`,c[0].dataType,n),r=Y(`output_k`,c[0].dataType,n),i=Y(`output_v`,c[0].dataType,n),a=J(`input`,c[0].dataType,c[0].dims),s=J(`weight`,c[1].dataType,c[1].dims),l=J(`bias`,c[2].dataType,c[2].dims),u=a.type.storage,d=[{name:`M`,type:`u32`},{name:`K`,type:`u32`},{name:`N`,type:`u32`},{name:`num_heads`,type:`u32`},{name:`head_size`,type:`u32`},{name:`hidden_size`,type:`u32`},{name:`ldb`,type:`u32`}];return` const TILE_SIZE = ${o}u; var tileInput: array<${u}, ${o*o}>; var tileWeightQ: array<${u}, ${o*o}>; @@ -399,7 +399,7 @@ var best_index : i32 = 0;`,`if (${e.getByIndices(`input_indices`)} ${t.selectLas output_k[outputIdx] = valueK; output_v[outputIdx] = valueV; } - }`};return e.compute({name:`AttentionPrepare`,shaderCache:{inputDependencies:[`type`,`type`,`type`]},getRunData:()=>({outputs:[{dims:n,dataType:e.inputs[0].dataType,gpuDataType:0},{dims:n,dataType:e.inputs[0].dataType,gpuDataType:0},{dims:n,dataType:e.inputs[0].dataType,gpuDataType:0}],dispatchGroup:s,programUniforms:l}),getShaderSource:u},{inputs:c,outputs:[-1,-1,-1]})},Ei=(e,t)=>{let n=yi(e.inputs,t),[r,i,a]=Ti(e,n);return wi(e,r,i,a,e.inputs[4],void 0,void 0,void 0,e.inputs[5],n)}}),Oi,ki,Ai,ji,Mi=M(()=>{"use strict";$e(),V(),W(),Xn(),Y(),Oi=(e,t)=>{if(!e||e.length!==5)throw Error(`BatchNormalization requires 5 inputs`);let n=(e,t,n)=>{let r=t.length;if(r!==e.length)throw Error(`${n}: num dimensions != ${r}`);t.forEach((t,r)=>{if(t!==e[r])throw Error(`${n}: dim[${r}] do not match`)})};if(e[0].dims.length>1){let r=t.format===`NHWC`?t.spatial?e[0].dims.slice(-1):e[0].dims.slice(-1).concat(e[0].dims.slice(1,e[0].dims.length-1)):e[0].dims.slice(1,t.spatial?2:void 0);n(e[1].dims,r,`Invalid input scale`),n(e[2].dims,r,`Invalid input B`),n(e[3].dims,r,`Invalid input mean`),n(e[4].dims,r,`Invalid input var`)}else n(e[1].dims,[1],`Invalid input scale`),n(e[2].dims,[1],`Invalid input B`),n(e[3].dims,[1],`Invalid input mean`),n(e[4].dims,[1],`Invalid input var`)},ki=(e,t)=>{let{epsilon:n,spatial:r,format:i}=t,a=e[0].dims,o=r?tr(a[a.length-1]):1,s=i===`NHWC`&&a.length>1?o:1,c=U.size(a)/o,l=r,u=l?a.length:a,d=q(`x`,e[0].dataType,e[0].dims,o),f=q(`scale`,e[1].dataType,e[1].dims,s),p=q(`bias`,e[2].dataType,e[2].dims,s),m=q(`inputMean`,e[3].dataType,e[3].dims,s),h=q(`inputVar`,e[4].dataType,e[4].dims,s),g=J(`y`,e[0].dataType,u,o),_=()=>{let e=``;if(r)e=`let cOffset = ${a.length===1?`0u`:i===`NHWC`?`outputIndices[${a.length-1}] / ${o}`:`outputIndices[1]`};`;else if(i===`NCHW`)e=` + }`};return e.compute({name:`AttentionPrepare`,shaderCache:{inputDependencies:[`type`,`type`,`type`]},getRunData:()=>({outputs:[{dims:n,dataType:e.inputs[0].dataType,gpuDataType:0},{dims:n,dataType:e.inputs[0].dataType,gpuDataType:0},{dims:n,dataType:e.inputs[0].dataType,gpuDataType:0}],dispatchGroup:s,programUniforms:l}),getShaderSource:u},{inputs:c,outputs:[-1,-1,-1]})},Ti=(e,t)=>{let n=vi(e.inputs,t),[r,i,a]=wi(e,n);return Ci(e,r,i,a,e.inputs[4],void 0,void 0,void 0,e.inputs[5],n)}}),Di,Oi,ki,Ai,ji=M(()=>{"use strict";Ze(),U(),G(),Yn(),X(),Di=(e,t)=>{if(!e||e.length!==5)throw Error(`BatchNormalization requires 5 inputs`);let n=(e,t,n)=>{let r=t.length;if(r!==e.length)throw Error(`${n}: num dimensions != ${r}`);t.forEach((t,r)=>{if(t!==e[r])throw Error(`${n}: dim[${r}] do not match`)})};if(e[0].dims.length>1){let r=t.format===`NHWC`?t.spatial?e[0].dims.slice(-1):e[0].dims.slice(-1).concat(e[0].dims.slice(1,e[0].dims.length-1)):e[0].dims.slice(1,t.spatial?2:void 0);n(e[1].dims,r,`Invalid input scale`),n(e[2].dims,r,`Invalid input B`),n(e[3].dims,r,`Invalid input mean`),n(e[4].dims,r,`Invalid input var`)}else n(e[1].dims,[1],`Invalid input scale`),n(e[2].dims,[1],`Invalid input B`),n(e[3].dims,[1],`Invalid input mean`),n(e[4].dims,[1],`Invalid input var`)},Oi=(e,t)=>{let{epsilon:n,spatial:r,format:i}=t,a=e[0].dims,o=r?er(a[a.length-1]):1,s=i===`NHWC`&&a.length>1?o:1,c=W.size(a)/o,l=r,u=l?a.length:a,d=J(`x`,e[0].dataType,e[0].dims,o),f=J(`scale`,e[1].dataType,e[1].dims,s),p=J(`bias`,e[2].dataType,e[2].dims,s),m=J(`inputMean`,e[3].dataType,e[3].dims,s),h=J(`inputVar`,e[4].dataType,e[4].dims,s),g=Y(`y`,e[0].dataType,u,o),_=()=>{let e=``;if(r)e=`let cOffset = ${a.length===1?`0u`:i===`NHWC`?`outputIndices[${a.length-1}] / ${o}`:`outputIndices[1]`};`;else if(i===`NCHW`)e=` ${g.indicesSet(`outputIndices`,`0`,`0`)} let cOffset = ${g.indicesToOffset(`outputIndices`)};`;else{e=`var cIndices = ${f.type.indices}(0); cIndices[0] = outputIndices[${a.length-1}];`;for(let t=1;t` @@ -416,7 +416,7 @@ var best_index : i32 = 0;`,`if (${e.getByIndices(`input_indices`)} ${t.selectLas let x = ${d.getByOffset(`global_idx`)}; let value = (x - inputMean) * inverseSqrt(inputVar + epsilon) * scale + bias; ${g.setByOffset(`global_idx`,`value`)} - }`;return{name:`BatchNormalization`,shaderCache:{hint:`${t.epsilon}_${t.format}_${r}_${o}`,inputDependencies:l?[`rank`,`type`,`type`,`type`,`type`]:void 0},getShaderSource:v,getRunData:()=>({outputs:[{dims:e[0].dims,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(c/64)},programUniforms:l?[{type:12,data:c},...G(a)]:[{type:12,data:c}]})}},Ai=e=>Yn(e),ji=(e,t)=>{let{inputs:n,outputCount:r}=e,i=Ai({...t,outputCount:r});if(L.webgpu.validateInputContent&&Oi(n,i),t.trainingMode)throw Error(`BatchNormalization trainingMode is not supported yet.`);e.compute(ki(n,i))}}),Ni,Pi,Fi,Ii=M(()=>{"use strict";W(),Y(),Ni=e=>{if(e[0].dims.length!==3)throw Error(`input should have 3 dimensions`);if(![320,640,1280].includes(e[0].dims[2]))throw Error(`number of channels should be 320, 640 or 1280`);if(e[1].dims.length!==1)throw Error(`bias is expected to have 1 dimensions`);if(e[0].dims[2]!==e[1].dims[0])throw Error(`last dimension of input and bias are not the same`)},Pi=e=>{let t=e[0].dims,n=e[0].dims[2],r=U.size(t)/4,i=e[0].dataType,a=q(`input`,i,t,4),o=q(`bias`,i,[n],4),s=q(`residual`,i,t,4),c=J(`output`,i,t,4);return{name:`BiasAdd`,getRunData:()=>({outputs:[{dims:t,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(r/64)}}),getShaderSource:e=>` + }`;return{name:`BatchNormalization`,shaderCache:{hint:`${t.epsilon}_${t.format}_${r}_${o}`,inputDependencies:l?[`rank`,`type`,`type`,`type`,`type`]:void 0},getShaderSource:v,getRunData:()=>({outputs:[{dims:e[0].dims,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(c/64)},programUniforms:l?[{type:12,data:c},...K(a)]:[{type:12,data:c}]})}},ki=e=>Jn(e),Ai=(e,t)=>{let{inputs:n,outputCount:r}=e,i=ki({...t,outputCount:r});if(R.webgpu.validateInputContent&&Di(n,i),t.trainingMode)throw Error(`BatchNormalization trainingMode is not supported yet.`);e.compute(Oi(n,i))}}),Mi,Ni,Pi,Fi=M(()=>{"use strict";G(),X(),Mi=e=>{if(e[0].dims.length!==3)throw Error(`input should have 3 dimensions`);if(![320,640,1280].includes(e[0].dims[2]))throw Error(`number of channels should be 320, 640 or 1280`);if(e[1].dims.length!==1)throw Error(`bias is expected to have 1 dimensions`);if(e[0].dims[2]!==e[1].dims[0])throw Error(`last dimension of input and bias are not the same`)},Ni=e=>{let t=e[0].dims,n=e[0].dims[2],r=W.size(t)/4,i=e[0].dataType,a=J(`input`,i,t,4),o=J(`bias`,i,[n],4),s=J(`residual`,i,t,4),c=Y(`output`,i,t,4);return{name:`BiasAdd`,getRunData:()=>({outputs:[{dims:t,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(r/64)}}),getShaderSource:e=>` const channels = ${n}u / 4; ${e.declareVariables(a,o,s,c)} @@ -425,7 +425,7 @@ var best_index : i32 = 0;`,`if (${e.getByIndices(`input_indices`)} ${t.selectLas let value = ${a.getByOffset(`global_idx`)} + ${o.getByOffset(`global_idx % channels`)} + ${s.getByOffset(`global_idx`)}; ${c.setByOffset(`global_idx`,`value`)} - }`}},Fi=e=>{Ni(e.inputs),e.compute(Pi(e.inputs))}}),Li,Ri,zi,Bi,Vi,Hi,Ui,Wi,Gi,Ki,qi,Ji,Yi,Xi,Zi,Qi,$i,ea,ta,na,ra,ia,aa,oa,sa,ca,la,ua,da,fa,pa,ma,ha,ga,_a,va,ya,ba,xa,Sa,Ca,wa,Ta,Ea,Da,Oa=M(()=>{"use strict";V(),W(),Xn(),Y(),Li=(e,t,n,r,i,a,o)=>{let s=Math.ceil(t/4),c=``;c=typeof i==`string`?`${i}(a)`:i(`a`);let l=q(`inputData`,n,[s],4),u=J(`outputData`,r,[s],4),d=[{name:`vec_size`,type:`u32`}];return o&&d.push(...o),` + }`}},Pi=e=>{Mi(e.inputs),e.compute(Ni(e.inputs))}}),Ii,Li,Ri,zi,Bi,Vi,Hi,Ui,Wi,Gi,Ki,qi,Ji,Yi,Xi,Zi,Qi,$i,ea,ta,na,ra,ia,aa,oa,sa,ca,la,ua,da,fa,pa,ma,ha,ga,_a,va,ya,ba,xa,Sa,Ca,wa,Ta,Ea,Da=M(()=>{"use strict";U(),G(),Yn(),X(),Ii=(e,t,n,r,i,a,o)=>{let s=Math.ceil(t/4),c=``;c=typeof i==`string`?`${i}(a)`:i(`a`);let l=J(`inputData`,n,[s],4),u=Y(`outputData`,r,[s],4),d=[{name:`vec_size`,type:`u32`}];return o&&d.push(...o),` ${e.registerUniforms(d).declareVariables(l,u)} ${a??``} @@ -435,7 +435,7 @@ var best_index : i32 = 0;`,`if (${e.getByIndices(`input_indices`)} ${t.selectLas let a = ${l.getByOffset(`global_idx`)}; ${u.setByOffset(`global_idx`,c)} - }`},Ri=(e,t,n,r,i,a=e.dataType,o,s)=>{let c=[{type:12,data:Math.ceil(U.size(e.dims)/4)}];return o&&c.push(...o),{name:t,shaderCache:{hint:i,inputDependencies:[`type`]},getShaderSource:t=>Li(t,U.size(e.dims),e.dataType,a,n,r,s),getRunData:t=>({outputs:[{dims:e.dims,dataType:a}],dispatchGroup:{x:Math.ceil(U.size(t[0].dims)/64/4)},programUniforms:c})}},zi=e=>{e.compute(Ri(e.inputs[0],`Abs`,`abs`))},Bi=e=>{e.compute(Ri(e.inputs[0],`Acos`,`acos`))},Vi=e=>{e.compute(Ri(e.inputs[0],`Acosh`,`acosh`))},Hi=e=>{e.compute(Ri(e.inputs[0],`Asin`,`asin`))},Ui=e=>{e.compute(Ri(e.inputs[0],`Asinh`,`asinh`))},Wi=e=>{e.compute(Ri(e.inputs[0],`Atan`,`atan`))},Gi=e=>{e.compute(Ri(e.inputs[0],`Atanh`,`atanh`))},Ki=e=>Yn(e),qi=(e,t)=>{let n;switch(t.to){case 10:n=`vec4`;break;case 1:n=`vec4`;break;case 12:n=`vec4`;break;case 6:n=`vec4`;break;case 9:n=`vec4`;break;default:throw RangeError(`not supported type (specified in attribute 'to' from 'Cast' operator): ${t.to}`)}e.compute(Ri(e.inputs[0],`Cast`,n,void 0,t.cacheKey,t.to))},Ji=e=>{let t,n,r=e.length>=2&&e[1].data!==0,i=e.length>=3&&e[2].data!==0;switch(e[0].dataType){case 1:t=r?e[1].getFloat32Array()[0]:-34028234663852886e22,n=i?e[2].getFloat32Array()[0]:34028234663852886e22;break;case 10:t=r?e[1].getUint16Array()[0]:64511,n=i?e[2].getUint16Array()[0]:31743;break;default:throw Error(`Unsupport data type`)}return Yn({min:t,max:n})},Yi=(e,t)=>{let n=t||Ji(e.inputs),r=er(e.inputs[0].dataType);e.compute(Ri(e.inputs[0],`Clip`,e=>`clamp(${e}, vec4<${r}>(uniforms.min), vec4<${r}>(uniforms.max))`,void 0,n.cacheKey,void 0,[{type:e.inputs[0].dataType,data:n.min},{type:e.inputs[0].dataType,data:n.max}],[{name:`min`,type:r},{name:`max`,type:r}]),{inputs:[0]})},Xi=e=>{e.compute(Ri(e.inputs[0],`Ceil`,`ceil`))},Zi=e=>{e.compute(Ri(e.inputs[0],`Cos`,`cos`))},Qi=e=>{e.compute(Ri(e.inputs[0],`Cosh`,`cosh`))},$i=e=>Yn(e),ea=(e,t)=>{let n=er(e.inputs[0].dataType);e.compute(Ri(e.inputs[0],`Elu`,e=>`elu_vf32(${e})`,` + }`},Li=(e,t,n,r,i,a=e.dataType,o,s)=>{let c=[{type:12,data:Math.ceil(W.size(e.dims)/4)}];return o&&c.push(...o),{name:t,shaderCache:{hint:i,inputDependencies:[`type`]},getShaderSource:t=>Ii(t,W.size(e.dims),e.dataType,a,n,r,s),getRunData:t=>({outputs:[{dims:e.dims,dataType:a}],dispatchGroup:{x:Math.ceil(W.size(t[0].dims)/64/4)},programUniforms:c})}},Ri=e=>{e.compute(Li(e.inputs[0],`Abs`,`abs`))},zi=e=>{e.compute(Li(e.inputs[0],`Acos`,`acos`))},Bi=e=>{e.compute(Li(e.inputs[0],`Acosh`,`acosh`))},Vi=e=>{e.compute(Li(e.inputs[0],`Asin`,`asin`))},Hi=e=>{e.compute(Li(e.inputs[0],`Asinh`,`asinh`))},Ui=e=>{e.compute(Li(e.inputs[0],`Atan`,`atan`))},Wi=e=>{e.compute(Li(e.inputs[0],`Atanh`,`atanh`))},Gi=e=>Jn(e),Ki=(e,t)=>{let n;switch(t.to){case 10:n=`vec4`;break;case 1:n=`vec4`;break;case 12:n=`vec4`;break;case 6:n=`vec4`;break;case 9:n=`vec4`;break;default:throw RangeError(`not supported type (specified in attribute 'to' from 'Cast' operator): ${t.to}`)}e.compute(Li(e.inputs[0],`Cast`,n,void 0,t.cacheKey,t.to))},qi=e=>{let t,n,r=e.length>=2&&e[1].data!==0,i=e.length>=3&&e[2].data!==0;switch(e[0].dataType){case 1:t=r?e[1].getFloat32Array()[0]:-34028234663852886e22,n=i?e[2].getFloat32Array()[0]:34028234663852886e22;break;case 10:t=r?e[1].getUint16Array()[0]:64511,n=i?e[2].getUint16Array()[0]:31743;break;default:throw Error(`Unsupport data type`)}return Jn({min:t,max:n})},Ji=(e,t)=>{let n=t||qi(e.inputs),r=$n(e.inputs[0].dataType);e.compute(Li(e.inputs[0],`Clip`,e=>`clamp(${e}, vec4<${r}>(uniforms.min), vec4<${r}>(uniforms.max))`,void 0,n.cacheKey,void 0,[{type:e.inputs[0].dataType,data:n.min},{type:e.inputs[0].dataType,data:n.max}],[{name:`min`,type:r},{name:`max`,type:r}]),{inputs:[0]})},Yi=e=>{e.compute(Li(e.inputs[0],`Ceil`,`ceil`))},Xi=e=>{e.compute(Li(e.inputs[0],`Cos`,`cos`))},Zi=e=>{e.compute(Li(e.inputs[0],`Cosh`,`cosh`))},Qi=e=>Jn(e),$i=(e,t)=>{let n=$n(e.inputs[0].dataType);e.compute(Li(e.inputs[0],`Elu`,e=>`elu_vf32(${e})`,` const elu_alpha_ = ${n}(${t.alpha}); fn elu_f32(a: ${n}) -> ${n} { @@ -444,7 +444,7 @@ var best_index : i32 = 0;`,`if (${e.getByIndices(`input_indices`)} ${t.selectLas fn elu_vf32(v: vec4<${n}>) -> vec4<${n}> { return vec4(elu_f32(v.x), elu_f32(v.y), elu_f32(v.z), elu_f32(v.w)); - }`,t.cacheKey))},ta=(e=`f32`)=>` + }`,t.cacheKey))},ea=(e=`f32`)=>` const r0: ${e} = 0.3275911; const r1: ${e} = 0.254829592; const r2: ${e} = -0.284496736; @@ -456,15 +456,15 @@ fn erf_vf32(v: vec4<${e}>) -> vec4<${e}> { let absv = abs(v); let x = 1.0 / (1.0 + r0 * absv); return sign(v) * (1.0 - ((((r5 * x + r4) * x + r3) * x + r2) * x + r1) * x * exp(-absv * absv)); -}`,na=e=>{let t=er(e.inputs[0].dataType);e.compute(Ri(e.inputs[0],`Erf`,e=>`erf_vf32(${e})`,ta(t)))},ra=e=>{e.compute(Ri(e.inputs[0],`Exp`,`exp`))},ia=e=>{e.compute(Ri(e.inputs[0],`Floor`,`floor`))},aa=e=>{let t=er(e.inputs[0].dataType);e.compute(Ri(e.inputs[0],`Gelu`,e=>`0.5 * ${e} * (1.0 + erf_vf32(${e} * 0.7071067811865475))`,ta(t)))},oa=(e,t)=>{let n=er(e.inputs[0].dataType);e.compute(Ri(e.inputs[0],`LeakyRelu`,e=>`select(leaky_relu_alpha_ * ${e}, ${e}, ${e} >= vec4<${n}>(0.0))`,`const leaky_relu_alpha_ = ${n}(${t.alpha});`,t.cacheKey))},sa=e=>{e.compute(Ri(e.inputs[0],`Not`,e=>`!${e}`))},ca=e=>{e.compute(Ri(e.inputs[0],`Neg`,e=>`-${e}`))},la=e=>{e.compute(Ri(e.inputs[0],`Reciprocal`,e=>`1.0/${e}`))},ua=e=>{let t=er(e.inputs[0].dataType);e.compute(Ri(e.inputs[0],`Relu`,e=>`select(vec4<${t}>(0.0), ${e}, ${e} > vec4<${t}>(0.0))`))},da=e=>{e.compute(Ri(e.inputs[0],`Sigmoid`,e=>`(1.0 / (1.0 + exp(-${e})))`))},fa=e=>Yn(e),pa=(e,t)=>{let n=er(e.inputs[0].dataType);e.compute(Ri(e.inputs[0],`HardSigmoid`,e=>`max(vec4<${n}>(0.0), min(vec4<${n}>(1.0), ${t.alpha} * ${e} + vec4<${n}>(${t.beta})))`,void 0,t.cacheKey))},ma=e=>{e.compute(Ri(e.inputs[0],`Sin`,`sin`))},ha=e=>{e.compute(Ri(e.inputs[0],`Sinh`,`sinh`))},ga=e=>{e.compute(Ri(e.inputs[0],`Sqrt`,`sqrt`))},_a=e=>{e.compute(Ri(e.inputs[0],`Tan`,`tan`))},va=e=>`sign(${e}) * (1 - exp(-2 * abs(${e}))) / (1 + exp(-2 * abs(${e})))`,ya=e=>{e.compute(Ri(e.inputs[0],`Tanh`,va))},ba=(e=`f32`)=>` +}`,ta=e=>{let t=$n(e.inputs[0].dataType);e.compute(Li(e.inputs[0],`Erf`,e=>`erf_vf32(${e})`,ea(t)))},na=e=>{e.compute(Li(e.inputs[0],`Exp`,`exp`))},ra=e=>{e.compute(Li(e.inputs[0],`Floor`,`floor`))},ia=e=>{let t=$n(e.inputs[0].dataType);e.compute(Li(e.inputs[0],`Gelu`,e=>`0.5 * ${e} * (1.0 + erf_vf32(${e} * 0.7071067811865475))`,ea(t)))},aa=(e,t)=>{let n=$n(e.inputs[0].dataType);e.compute(Li(e.inputs[0],`LeakyRelu`,e=>`select(leaky_relu_alpha_ * ${e}, ${e}, ${e} >= vec4<${n}>(0.0))`,`const leaky_relu_alpha_ = ${n}(${t.alpha});`,t.cacheKey))},oa=e=>{e.compute(Li(e.inputs[0],`Not`,e=>`!${e}`))},sa=e=>{e.compute(Li(e.inputs[0],`Neg`,e=>`-${e}`))},ca=e=>{e.compute(Li(e.inputs[0],`Reciprocal`,e=>`1.0/${e}`))},la=e=>{let t=$n(e.inputs[0].dataType);e.compute(Li(e.inputs[0],`Relu`,e=>`select(vec4<${t}>(0.0), ${e}, ${e} > vec4<${t}>(0.0))`))},ua=e=>{e.compute(Li(e.inputs[0],`Sigmoid`,e=>`(1.0 / (1.0 + exp(-${e})))`))},da=e=>Jn(e),fa=(e,t)=>{let n=$n(e.inputs[0].dataType);e.compute(Li(e.inputs[0],`HardSigmoid`,e=>`max(vec4<${n}>(0.0), min(vec4<${n}>(1.0), ${t.alpha} * ${e} + vec4<${n}>(${t.beta})))`,void 0,t.cacheKey))},pa=e=>{e.compute(Li(e.inputs[0],`Sin`,`sin`))},ma=e=>{e.compute(Li(e.inputs[0],`Sinh`,`sinh`))},ha=e=>{e.compute(Li(e.inputs[0],`Sqrt`,`sqrt`))},ga=e=>{e.compute(Li(e.inputs[0],`Tan`,`tan`))},_a=e=>`sign(${e}) * (1 - exp(-2 * abs(${e}))) / (1 + exp(-2 * abs(${e})))`,va=e=>{e.compute(Li(e.inputs[0],`Tanh`,_a))},ya=(e=`f32`)=>` const fast_gelu_a: ${e} = 0.5; const fast_gelu_b: ${e} = 0.7978845608028654; const fast_gelu_c: ${e} = 0.035677408136300125; fn tanh_v(v: vec4<${e}>) -> vec4<${e}> { - return ${va(`v`)}; + return ${_a(`v`)}; } -`,xa=e=>`(fast_gelu_a + fast_gelu_a * tanh_v(${e} * (fast_gelu_c * ${e} * ${e} + fast_gelu_b))) * ${e}`,Sa=e=>{let t=er(e.inputs[0].dataType);e.compute(Ri(e.inputs[0],`FastGelu`,xa,ba(t),void 0,e.inputs[0].dataType))},Ca=(e,t)=>{let n=er(e.inputs[0].dataType);return e.compute(Ri(e.inputs[0],`ThresholdedRelu`,e=>`select(vec4<${n}>(0.0), ${e}, ${e} > thresholded_relu_alpha_)`,`const thresholded_relu_alpha_ = vec4<${n}>(${t.alpha});`,t.cacheKey)),0},wa=e=>{e.compute(Ri(e.inputs[0],`Log`,`log`))},Ta=(e,t)=>` +`,ba=e=>`(fast_gelu_a + fast_gelu_a * tanh_v(${e} * (fast_gelu_c * ${e} * ${e} + fast_gelu_b))) * ${e}`,xa=e=>{let t=$n(e.inputs[0].dataType);e.compute(Li(e.inputs[0],`FastGelu`,ba,ya(t),void 0,e.inputs[0].dataType))},Sa=(e,t)=>{let n=$n(e.inputs[0].dataType);return e.compute(Li(e.inputs[0],`ThresholdedRelu`,e=>`select(vec4<${n}>(0.0), ${e}, ${e} > thresholded_relu_alpha_)`,`const thresholded_relu_alpha_ = vec4<${n}>(${t.alpha});`,t.cacheKey)),0},Ca=e=>{e.compute(Li(e.inputs[0],`Log`,`log`))},wa=(e,t)=>` const alpha = vec4<${e}>(${t}); const one = ${e}(1.0); const zero = ${e}(0.0); @@ -481,13 +481,13 @@ fn quick_gelu_impl(x: vec4<${e}>) -> vec4<${e}> { } return x * x1; } -`,Ea=e=>`quick_gelu_impl(${e})`,Da=(e,t)=>{let n=er(e.inputs[0].dataType);e.compute(Ri(e.inputs[0],`QuickGelu`,Ea,Ta(n,t.alpha),t.cacheKey,e.inputs[0].dataType))}}),ka,Aa,ja,Ma=M(()=>{"use strict";W(),Y(),Oa(),ka=e=>{if(e[0].dims.length!==3)throw Error(`input should have 3 dimensions`);if(![2560,5120,10240].includes(e[0].dims[2]))throw Error(`hidden state should be 2560, 5120 or 10240`);if(e[1].dims.length!==1)throw Error(`bias is expected to have 1 dimensions`);if(e[0].dims[2]!==e[1].dims[0])throw Error(`last dimension of input and bias are not the same`)},Aa=e=>{let t=e[0].dims.slice();t[2]/=2;let n=q(`input`,e[0].dataType,e[0].dims,4),r=q(`bias`,e[0].dataType,[e[0].dims[2]],4),i=J(`output`,e[0].dataType,t,4),a=U.size(t)/4,o=$n(e[0].dataType);return{name:`BiasSplitGelu`,getRunData:()=>({outputs:[{dims:t,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(a/64)}}),getShaderSource:t=>` +`,Ta=e=>`quick_gelu_impl(${e})`,Ea=(e,t)=>{let n=$n(e.inputs[0].dataType);e.compute(Li(e.inputs[0],`QuickGelu`,Ta,wa(n,t.alpha),t.cacheKey,e.inputs[0].dataType))}}),Oa,ka,Aa,ja=M(()=>{"use strict";G(),X(),Da(),Oa=e=>{if(e[0].dims.length!==3)throw Error(`input should have 3 dimensions`);if(![2560,5120,10240].includes(e[0].dims[2]))throw Error(`hidden state should be 2560, 5120 or 10240`);if(e[1].dims.length!==1)throw Error(`bias is expected to have 1 dimensions`);if(e[0].dims[2]!==e[1].dims[0])throw Error(`last dimension of input and bias are not the same`)},ka=e=>{let t=e[0].dims.slice();t[2]/=2;let n=J(`input`,e[0].dataType,e[0].dims,4),r=J(`bias`,e[0].dataType,[e[0].dims[2]],4),i=Y(`output`,e[0].dataType,t,4),a=W.size(t)/4,o=Qn(e[0].dataType);return{name:`BiasSplitGelu`,getRunData:()=>({outputs:[{dims:t,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(a/64)}}),getShaderSource:t=>` const M_SQRT2 = sqrt(2.0); const halfChannels = ${e[0].dims[2]/4/2}u; ${t.declareVariables(n,r,i)} - ${ta(o)} + ${ea(o)} ${t.mainStart()} ${t.guardAgainstOutOfBoundsWorkgroupSizes(a)} @@ -499,7 +499,7 @@ fn quick_gelu_impl(x: vec4<${e}>) -> vec4<${e}> { let geluRight = valueRight * 0.5 * (erf_vf32(valueRight / M_SQRT2) + 1); ${i.setByOffset(`global_idx`,`valueLeft * geluRight`)} - }`}},ja=e=>{ka(e.inputs),e.compute(Aa(e.inputs))}}),Na,Pa,Fa,Ia,La,Ra,za,Ba,Va,Ha,Ua,Wa,Ga,Ka=M(()=>{"use strict";V(),W(),Y(),Na=(e,t,n,r,i,a,o,s,c,l,u,d)=>{let f,p;typeof s==`string`?f=p=(e,t)=>`${s}((${e}),(${t}))`:typeof s==`function`?f=p=s:(f=s.scalar,p=s.vector);let m=J(`outputData`,u,r.length,4),h=q(`aData`,c,t.length,4),g=q(`bData`,l,n.length,4),_;if(i)if(a){let e=U.size(t)===1,r=U.size(n)===1,i=t.length>0&&t[t.length-1]%4==0,a=n.length>0&&n[n.length-1]%4==0;_=e||r?m.setByOffset(`global_idx`,p(e?`${h.type.value}(${h.getByOffset(`0`)}.x)`:h.getByOffset(`global_idx`),r?`${g.type.value}(${g.getByOffset(`0`)}.x)`:g.getByOffset(`global_idx`))):` + }`}},Aa=e=>{Oa(e.inputs),e.compute(ka(e.inputs))}}),Ma,Na,Pa,Fa,Ia,La,Ra,za,Ba,Va,Ha,Ua,Wa,Ga=M(()=>{"use strict";U(),G(),X(),Ma=(e,t,n,r,i,a,o,s,c,l,u,d)=>{let f,p;typeof s==`string`?f=p=(e,t)=>`${s}((${e}),(${t}))`:typeof s==`function`?f=p=s:(f=s.scalar,p=s.vector);let m=Y(`outputData`,u,r.length,4),h=J(`aData`,c,t.length,4),g=J(`bData`,l,n.length,4),_;if(i)if(a){let e=W.size(t)===1,r=W.size(n)===1,i=t.length>0&&t[t.length-1]%4==0,a=n.length>0&&n[n.length-1]%4==0;_=e||r?m.setByOffset(`global_idx`,p(e?`${h.type.value}(${h.getByOffset(`0`)}.x)`:h.getByOffset(`global_idx`),r?`${g.type.value}(${g.getByOffset(`0`)}.x)`:g.getByOffset(`global_idx`))):` let outputIndices = ${m.offsetToIndices(`global_idx * 4u`)}; let offsetA = ${h.broadcastedIndicesToOffset(`outputIndices`,m)}; let offsetB = ${g.broadcastedIndicesToOffset(`outputIndices`,m)}; @@ -532,7 +532,7 @@ fn quick_gelu_impl(x: vec4<${e}>) -> vec4<${e}> { ${e.mainStart()} ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.vec_size`)} ${_} - }`},Pa=(e,t,n,r,i,a,o=n.dataType)=>{let s=n.dims.map(e=>Number(e)??1),c=r.dims.map(e=>Number(e)??1),l=!U.areEqual(s,c),u=s,d=U.size(s),f=!1,p=!1,m=[l];if(l){let e=hn.calcShape(s,c,!1);if(!e)throw Error(`Can't perform binary op on the given tensors`);u=e.slice(),d=U.size(u);let t=U.size(s)===1,n=U.size(c)===1,r=s.length>0&&s[s.length-1]%4==0,i=c.length>0&&c[c.length-1]%4==0;m.push(t),m.push(n),m.push(r),m.push(i);let a=1;for(let e=1;ee.toString()).join(`_`),inputDependencies:[`rank`,`rank`]},getShaderSource:e=>Na(e,s,c,u,f,l,p,i,n.dataType,r.dataType,o,a),getRunData:()=>({outputs:[{dims:u,dataType:o}],dispatchGroup:{x:Math.ceil(d/64/4)},programUniforms:[{type:12,data:Math.ceil(U.size(u)/4)},...G(s,c,u)]})}},Fa=(e,t,n,r,i,a)=>{e.compute(Pa(t,i??``,e.inputs[0],e.inputs[1],n,r,a))},Ia=e=>{Fa(e,`Add`,(e,t)=>`${e}+${t}`)},La=e=>{Fa(e,`Div`,(e,t)=>`${e}/${t}`)},Ra=e=>{Fa(e,`Equal`,{scalar:(e,t)=>`u32(${e}==${t})`,vector:(e,t)=>`vec4(${e}==${t})`},void 0,void 0,9)},za=e=>{Fa(e,`Mul`,(e,t)=>`${e}*${t}`)},Ba=e=>{let t=q(`input`,e.inputs[0].dataType,e.inputs[0].dims).type.value;Fa(e,`Pow`,{scalar:(e,t)=>`pow_custom(${e},${t})`,vector:(e,t)=>`pow_vector_custom(${e},${t})`},` + }`},Na=(e,t,n,r,i,a,o=n.dataType)=>{let s=n.dims.map(e=>Number(e)??1),c=r.dims.map(e=>Number(e)??1),l=!W.areEqual(s,c),u=s,d=W.size(s),f=!1,p=!1,m=[l];if(l){let e=mn.calcShape(s,c,!1);if(!e)throw Error(`Can't perform binary op on the given tensors`);u=e.slice(),d=W.size(u);let t=W.size(s)===1,n=W.size(c)===1,r=s.length>0&&s[s.length-1]%4==0,i=c.length>0&&c[c.length-1]%4==0;m.push(t),m.push(n),m.push(r),m.push(i);let a=1;for(let e=1;ee.toString()).join(`_`),inputDependencies:[`rank`,`rank`]},getShaderSource:e=>Ma(e,s,c,u,f,l,p,i,n.dataType,r.dataType,o,a),getRunData:()=>({outputs:[{dims:u,dataType:o}],dispatchGroup:{x:Math.ceil(d/64/4)},programUniforms:[{type:12,data:Math.ceil(W.size(u)/4)},...K(s,c,u)]})}},Pa=(e,t,n,r,i,a)=>{e.compute(Na(t,i??``,e.inputs[0],e.inputs[1],n,r,a))},Fa=e=>{Pa(e,`Add`,(e,t)=>`${e}+${t}`)},Ia=e=>{Pa(e,`Div`,(e,t)=>`${e}/${t}`)},La=e=>{Pa(e,`Equal`,{scalar:(e,t)=>`u32(${e}==${t})`,vector:(e,t)=>`vec4(${e}==${t})`},void 0,void 0,9)},Ra=e=>{Pa(e,`Mul`,(e,t)=>`${e}*${t}`)},za=e=>{let t=J(`input`,e.inputs[0].dataType,e.inputs[0].dims).type.value;Pa(e,`Pow`,{scalar:(e,t)=>`pow_custom(${e},${t})`,vector:(e,t)=>`pow_vector_custom(${e},${t})`},` fn pow_custom(a : ${t}, b : ${t}) -> ${t} { if (b == ${t}(0.0)) { return ${t}(1.0); @@ -545,7 +545,7 @@ fn quick_gelu_impl(x: vec4<${e}>) -> vec4<${e}> { // TODO: implement vectorized pow return vec4<${t}>(pow_custom(a.x, b.x), pow_custom(a.y, b.y), pow_custom(a.z, b.z), pow_custom(a.w, b.w)); } - `)},Va=e=>{Fa(e,`Sub`,(e,t)=>`${e}-${t}`)},Ha=e=>{Fa(e,`Greater`,{scalar:(e,t)=>`u32(${e}>${t})`,vector:(e,t)=>`vec4(${e}>${t})`},void 0,void 0,9)},Ua=e=>{Fa(e,`Less`,{scalar:(e,t)=>`u32(${e}<${t})`,vector:(e,t)=>`vec4(${e}<${t})`},void 0,void 0,9)},Wa=e=>{Fa(e,`GreaterOrEqual`,{scalar:(e,t)=>`u32(${e}>=${t})`,vector:(e,t)=>`vec4(${e}>=${t})`},void 0,void 0,9)},Ga=e=>{Fa(e,`LessOrEqual`,{scalar:(e,t)=>`u32(${e}<=${t})`,vector:(e,t)=>`vec4(${e}<=${t})`},void 0,void 0,9)}}),qa,Ja,Ya,Xa,Za,Qa,$a=M(()=>{"use strict";V(),W(),Xn(),Y(),qa=(e,t)=>{if(!e||e.length<1)throw Error(`too few inputs`);let n=0,r=e[n],i=r.dataType,a=r.dims.length;e.forEach((e,o)=>{if(o!==n){if(e.dataType!==i)throw Error(`input tensors should be one type`);if(e.dims.length!==a)throw Error(`input tensors should have the same shape`);e.dims.forEach((e,n)=>{if(n!==t&&e!==r.dims[n])throw Error(`non concat dimensions must match`)})}})},Ja=(e,t)=>` + `)},Ba=e=>{Pa(e,`Sub`,(e,t)=>`${e}-${t}`)},Va=e=>{Pa(e,`Greater`,{scalar:(e,t)=>`u32(${e}>${t})`,vector:(e,t)=>`vec4(${e}>${t})`},void 0,void 0,9)},Ha=e=>{Pa(e,`Less`,{scalar:(e,t)=>`u32(${e}<${t})`,vector:(e,t)=>`vec4(${e}<${t})`},void 0,void 0,9)},Ua=e=>{Pa(e,`GreaterOrEqual`,{scalar:(e,t)=>`u32(${e}>=${t})`,vector:(e,t)=>`vec4(${e}>=${t})`},void 0,void 0,9)},Wa=e=>{Pa(e,`LessOrEqual`,{scalar:(e,t)=>`u32(${e}<=${t})`,vector:(e,t)=>`vec4(${e}<=${t})`},void 0,void 0,9)}}),Ka,qa,Ja,Ya,Xa,Za,Qa=M(()=>{"use strict";U(),G(),Yn(),X(),Ka=(e,t)=>{if(!e||e.length<1)throw Error(`too few inputs`);let n=0,r=e[n],i=r.dataType,a=r.dims.length;e.forEach((e,o)=>{if(o!==n){if(e.dataType!==i)throw Error(`input tensors should be one type`);if(e.dims.length!==a)throw Error(`input tensors should have the same shape`);e.dims.forEach((e,n)=>{if(n!==t&&e!==r.dims[n])throw Error(`non concat dimensions must match`)})}})},qa=(e,t)=>` fn calculateInputIndex(index: u32) -> u32 { let sizeInConcatAxis = array(${t}); for (var i: u32 = 0u; i < ${e}; i += 1u ) { @@ -554,12 +554,12 @@ fn quick_gelu_impl(x: vec4<${e}>) -> vec4<${e}> { } } return ${e}u; - }`,Ya=(e,t)=>{let n=e.length,r=[];for(let i=0;i{let i=U.size(n),a=Array(e.length),o=Array(e.length),s=0,c=[],l=[],u=[{type:12,data:i}];for(let n=0;n`uniforms.sizeInConcatAxis${e}`).join(`,`),m=t=>` + }`,Ja=(e,t)=>{let n=e.length,r=[];for(let i=0;i{let i=W.size(n),a=Array(e.length),o=Array(e.length),s=0,c=[],l=[],u=[{type:12,data:i}];for(let n=0;n`uniforms.sizeInConcatAxis${e}`).join(`,`),m=t=>` ${(()=>{t.registerUniform(`outputSize`,`u32`);for(let n=0;n) -> vec4<${e}> { ${f} -= sizeInConcatAxis[inputIndex - 1u]; } - ${Ya(o,d)} - }`;return{name:`Concat`,shaderCache:{hint:`${t}`,inputDependencies:c},getRunData:()=>({outputs:[{dims:n,dataType:r}],dispatchGroup:{x:Math.ceil(i/64)},programUniforms:u}),getShaderSource:m}},Za=(e,t)=>{let n=e.inputs,r=n[0].dims,i=U.normalizeAxis(t.axis,r.length);qa(n,i);let a=r.slice();a[i]=n.reduce((e,t)=>e+(t.dims.length>i?t.dims[i]:0),0);let o=n.filter(e=>U.size(e.dims)>0);e.compute(Xa(o,i,a,n[0].dataType),{inputs:o})},Qa=e=>Yn({axis:e.axis})}),eo,to,no,ro,io=M(()=>{"use strict";V(),W(),eo=(e,t,n=`f32`)=>{switch(e.activation){case`Relu`:return`value = max(value, ${t}(0.0));`;case`Sigmoid`:return`value = (${t}(1.0) / (${t}(1.0) + exp(-value)));`;case`Clip`:return`value = clamp(value, ${t}(${n}(uniforms.clip_min)), ${t}(${n}(uniforms.clip_max)));`;case`HardSigmoid`:return`value = max(${t}(0.0), min(${t}(1.0), ${n}(uniforms.alpha) * value + ${n}(uniforms.beta)));`;case`LeakyRelu`:return`value = select(${n}(uniforms.alpha) * value, value, value >= ${t}(0.0));`;case`Tanh`:return`let e2x = exp(-2.0 * abs(value)); + ${Ja(o,d)} + }`;return{name:`Concat`,shaderCache:{hint:`${t}`,inputDependencies:c},getRunData:()=>({outputs:[{dims:n,dataType:r}],dispatchGroup:{x:Math.ceil(i/64)},programUniforms:u}),getShaderSource:m}},Xa=(e,t)=>{let n=e.inputs,r=n[0].dims,i=W.normalizeAxis(t.axis,r.length);Ka(n,i);let a=r.slice();a[i]=n.reduce((e,t)=>e+(t.dims.length>i?t.dims[i]:0),0);let o=n.filter(e=>W.size(e.dims)>0);e.compute(Ya(o,i,a,n[0].dataType),{inputs:o})},Za=e=>Jn({axis:e.axis})}),$a,eo,to,no,ro=M(()=>{"use strict";U(),G(),$a=(e,t,n=`f32`)=>{switch(e.activation){case`Relu`:return`value = max(value, ${t}(0.0));`;case`Sigmoid`:return`value = (${t}(1.0) / (${t}(1.0) + exp(-value)));`;case`Clip`:return`value = clamp(value, ${t}(${n}(uniforms.clip_min)), ${t}(${n}(uniforms.clip_max)));`;case`HardSigmoid`:return`value = max(${t}(0.0), min(${t}(1.0), ${n}(uniforms.alpha) * value + ${n}(uniforms.beta)));`;case`LeakyRelu`:return`value = select(${n}(uniforms.alpha) * value, value, value >= ${t}(0.0));`;case`Tanh`:return`let e2x = exp(-2.0 * abs(value)); value = sign(value) * (1.0 - e2x) / (1.0 + e2x); - `;case``:return``;default:throw Error(`Unsupported activation ${e.activation}`)}},to=(e,t)=>{e.activation===`Clip`?t.push({type:1,data:e.clipMax},{type:1,data:e.clipMin}):e.activation===`HardSigmoid`?t.push({type:1,data:e.alpha},{type:1,data:e.beta}):e.activation===`LeakyRelu`&&t.push({type:1,data:e.alpha})},no=(e,t)=>{e.activation===`Clip`?t.push({name:`clip_max`,type:`f32`},{name:`clip_min`,type:`f32`}):e.activation===`HardSigmoid`?t.push({name:`alpha`,type:`f32`},{name:`beta`,type:`f32`}):e.activation===`LeakyRelu`&&t.push({name:`alpha`,type:`f32`})},ro=e=>{let t=e?.activation||``;if(t===`HardSigmoid`){let[n,r]=e?.activation_params||[.2,.5];return{activation:t,alpha:n,beta:r}}else if(t===`Clip`){let[n,r]=e?.activation_params||[vn,yn];return{activation:t,clipMax:r,clipMin:n}}else if(t===`LeakyRelu`){let[n]=e?.activation_params||[.01];return{activation:t,alpha:n}}return{activation:t}}}),ao,oo,so=M(()=>{"use strict";ao=(e,t)=>{switch(e){case 1:return t;case 2:return`vec2<${t}>`;case 3:return`vec3<${t}>`;case 4:return`vec4<${t}>`;default:throw Error(`${e}-component is not supported.`)}},oo=e=>` + `;case``:return``;default:throw Error(`Unsupported activation ${e.activation}`)}},eo=(e,t)=>{e.activation===`Clip`?t.push({type:1,data:e.clipMax},{type:1,data:e.clipMin}):e.activation===`HardSigmoid`?t.push({type:1,data:e.alpha},{type:1,data:e.beta}):e.activation===`LeakyRelu`&&t.push({type:1,data:e.alpha})},to=(e,t)=>{e.activation===`Clip`?t.push({name:`clip_max`,type:`f32`},{name:`clip_min`,type:`f32`}):e.activation===`HardSigmoid`?t.push({name:`alpha`,type:`f32`},{name:`beta`,type:`f32`}):e.activation===`LeakyRelu`&&t.push({name:`alpha`,type:`f32`})},no=e=>{let t=e?.activation||``;if(t===`HardSigmoid`){let[n,r]=e?.activation_params||[.2,.5];return{activation:t,alpha:n,beta:r}}else if(t===`Clip`){let[n,r]=e?.activation_params||[_n,vn];return{activation:t,clipMax:r,clipMin:n}}else if(t===`LeakyRelu`){let[n]=e?.activation_params||[.01];return{activation:t,alpha:n}}return{activation:t}}}),io,ao,oo=M(()=>{"use strict";io=(e,t)=>{switch(e){case 1:return t;case 2:return`vec2<${t}>`;case 3:return`vec3<${t}>`;case 4:return`vec4<${t}>`;default:throw Error(`${e}-component is not supported.`)}},ao=e=>` ${e?`value = value + getBiasByOutputCoords(coords);`:``} - `}),co,lo=M(()=>{"use strict";co=e=>` + `}),so,co=M(()=>{"use strict";so=e=>` fn getIndexFromCoords4D(coords : vec4, shape : vec4) -> i32 { return dot(coords, vec4( shape.y * shape.z * shape.w, shape.z * shape.w, shape.w, 1)); @@ -586,14 +586,14 @@ fn getOutputIndexFromCoords(coords : vec4) -> i32 { return dot(coords, vec4( i32(${e}.x), i32(${e}.y), i32(${e}.z), 1)); } -`}),uo,fo,po=M(()=>{"use strict";V(),W(),Y(),io(),uo=(e,t,n,r,i)=>{let a=r-n;return` +`}),lo,uo,fo=M(()=>{"use strict";U(),G(),X(),ro(),lo=(e,t,n,r,i)=>{let a=r-n;return` ${Array.from({length:n}).map((n,o)=>` - if (${K(t.shape,o,t.rank)} != 1) { - ${t.indicesSet(e,o,K(i,o+a,r))} + if (${q(t.shape,o,t.rank)} != 1) { + ${t.indicesSet(e,o,q(i,o+a,r))} } else { ${t.indicesSet(e,o,0)} }`).join(``)} -`},fo=(e,t,n,r,i=!1,a)=>{let o=e[0].dims,s=e[1].dims,c=o[o.length-2],l=s[s.length-1],u=o[o.length-1],d=tr(l),f=tr(u),p=tr(c),m=U.size(n)/d/p,h=e.length>2,g=r?r.slice(0,-2):n.slice(0,-2),_=[U.size(g),c,l],v=[{type:12,data:m},{type:12,data:c},{type:12,data:l},{type:12,data:u}];to(t,v),v.push(...G(g,o,s)),h&&v.push(...G(e[2].dims)),v.push(...G(_));let y=r=>{let a=sr(`batch_dims`,e[0].dataType,g.length),c=q(`a`,e[0].dataType,o.length,f),l=q(`b`,e[1].dataType,s.length,d),u=J(`output`,e[0].dataType,_.length,d),m=$n(u.type.tensor),v=eo(t,u.type.value,m),y=[c,l],b=``;if(h){let t=i?d:1;y.push(q(`bias`,e[2].dataType,e[2].dims.length,t)),b=`${i?`value += bias[col / ${t}];`:`value += ${u.type.value}(bias[row + i]);`}`}let x=[{name:`output_size`,type:`u32`},{name:`M`,type:`u32`},{name:`N`,type:`u32`},{name:`K`,type:`u32`}];no(t,x);let S=()=>{let e=`var a_data: ${c.type.value};`;for(let t=0;t{let o=e[0].dims,s=e[1].dims,c=o[o.length-2],l=s[s.length-1],u=o[o.length-1],d=er(l),f=er(u),p=er(c),m=W.size(n)/d/p,h=e.length>2,g=r?r.slice(0,-2):n.slice(0,-2),_=[W.size(g),c,l],v=[{type:12,data:m},{type:12,data:c},{type:12,data:l},{type:12,data:u}];eo(t,v),v.push(...K(g,o,s)),h&&v.push(...K(e[2].dims)),v.push(...K(_));let y=r=>{let a=or(`batch_dims`,e[0].dataType,g.length),c=J(`a`,e[0].dataType,o.length,f),l=J(`b`,e[1].dataType,s.length,d),u=Y(`output`,e[0].dataType,_.length,d),m=Qn(u.type.tensor),v=$a(t,u.type.value,m),y=[c,l],b=``;if(h){let t=i?d:1;y.push(J(`bias`,e[2].dataType,e[2].dims.length,t)),b=`${i?`value += bias[col / ${t}];`:`value += ${u.type.value}(bias[row + i]);`}`}let x=[{name:`output_size`,type:`u32`},{name:`M`,type:`u32`},{name:`N`,type:`u32`},{name:`K`,type:`u32`}];to(t,x);let S=()=>{let e=`var a_data: ${c.type.value};`;for(let t=0;t) -> i32 { ${n.length===2?``:`let batch_indices = ${a.offsetToIndices(`batch`)};`} var a_indices: ${c.type.indices}; - ${uo(`a_indices`,c,c.rank-2,a.rank,`batch_indices`)} + ${lo(`a_indices`,c,c.rank-2,a.rank,`batch_indices`)} ${c.indicesSet(`a_indices`,c.rank-2,0)} ${c.indicesSet(`a_indices`,c.rank-1,0)} let a_offset = ${c.indicesToOffset(`a_indices`)}; var b_indices: ${l.type.indices}; - ${uo(`b_indices`,l,l.rank-2,a.rank,`batch_indices`)} + ${lo(`b_indices`,l,l.rank-2,a.rank,`batch_indices`)} ${l.indicesSet(`b_indices`,l.rank-2,0)} ${l.indicesSet(`b_indices`,l.rank-1,0)} let b_offset = ${l.indicesToOffset(`b_indices`)}; @@ -632,7 +632,7 @@ fn getOutputIndexFromCoords(coords : vec4) -> i32 { ${u.setByOffset(`offset / ${d}`,`value`)}; } } - `};return{name:`MatMulNaive`,shaderCache:{hint:`${t.activation};${d};${f};${p};${i}`,inputDependencies:h?[`rank`,`rank`,`rank`]:[`rank`,`rank`]},getRunData:()=>({outputs:[{dims:a?a(n):n,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(m/64)},programUniforms:v}),getShaderSource:y}}}),mo,ho,go,_o,vo,yo,bo,xo,So=M(()=>{"use strict";V(),W(),Y(),io(),po(),so(),mo=(e,t)=>e?` + `};return{name:`MatMulNaive`,shaderCache:{hint:`${t.activation};${d};${f};${p};${i}`,inputDependencies:h?[`rank`,`rank`,`rank`]:[`rank`,`rank`]},getRunData:()=>({outputs:[{dims:a?a(n):n,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(m/64)},programUniforms:v}),getShaderSource:y}}}),po,mo,ho,go,_o,vo,yo,bo,xo=M(()=>{"use strict";U(),G(),X(),ro(),fo(),oo(),po=(e,t)=>e?` mm_Asub[inputRow][inputCol] = mm_readA(batch, kStart + inputRow, globalRowStart / innerElementSize + inputCol${t?`, batchIndices`:``}); @@ -640,7 +640,7 @@ fn getOutputIndexFromCoords(coords : vec4) -> i32 { mm_Asub[inputRow][inputCol] = mm_readA(batch, globalRow + innerRow, kStart / innerElementSize + inputCol${t?`, batchIndices`:``}); - `,ho=(e,t)=>e?` + `,mo=(e,t)=>e?` let ACached0 = mm_Asub[k * innerElementSize][localRow]; let ACached1 = mm_Asub[k * innerElementSize + 1][localRow]; let ACached2 = mm_Asub[k * innerElementSize + 2][localRow]; @@ -657,7 +657,7 @@ fn getOutputIndexFromCoords(coords : vec4) -> i32 { acc[i] = BCached1 * ACached.y + acc[i]; acc[i] = BCached2 * ACached.z + acc[i]; ${t===3?``:`acc[i] = BCached3 * ACached.w + acc[i];`} - }`,go=(e,t,n=`f32`,r,i=!1,a=32,o=!1,s=32)=>{let c=t[1]*e[1],l=t[0]*e[0],u=i?c:a,d=i?a:c,f=u/t[0],p=a/t[1];if(!((i&&f===4&&e[1]===4||!i&&(f===3||f===4))&&u%t[0]===0&&a%t[1]===0&&e[0]===4))throw Error(`If transposeA ${i} is true, innerElementSize ${f} and workPerThread[1] ${e[1]} must be 4. + }`,ho=(e,t,n=`f32`,r,i=!1,a=32,o=!1,s=32)=>{let c=t[1]*e[1],l=t[0]*e[0],u=i?c:a,d=i?a:c,f=u/t[0],p=a/t[1];if(!((i&&f===4&&e[1]===4||!i&&(f===3||f===4))&&u%t[0]===0&&a%t[1]===0&&e[0]===4))throw Error(`If transposeA ${i} is true, innerElementSize ${f} and workPerThread[1] ${e[1]} must be 4. Otherwise, innerElementSize ${f} must be 3 or 4. tileAWidth ${u} must be divisible by workgroupSize[0]${t[0]}. tileInner ${a} must be divisible by workgroupSize[1] ${t[1]}. colPerThread ${e[0]} must be 4.`);return` var mm_Asub: array, ${u/f}>, ${d}>; @@ -694,7 +694,7 @@ fn main(@builtin(local_invocation_id) localId : vec3, for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) { let inputRow = tileRow + innerRow; let inputCol = tileCol; - ${mo(i,r)} + ${po(i,r)} } // Load one tile of B into local memory. @@ -713,7 +713,7 @@ fn main(@builtin(local_invocation_id) localId : vec3, let BCached2 = mm_Bsub[k * innerElementSize + 2][tileCol]; ${f===3?``:`let BCached3 = mm_Bsub[k * innerElementSize + 3][tileCol];`} - ${ho(i,f)} + ${mo(i,f)} } workgroupBarrier(); @@ -722,7 +722,7 @@ fn main(@builtin(local_invocation_id) localId : vec3, for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) { mm_write(batch, globalRow + innerRow, globalCol, acc[innerRow]); } -}`},_o=(e,t)=>e?` +}`},go=(e,t)=>e?` mm_Asub[inputRow][inputCol] = mm_readA(batch, kStart + inputRow, globalRowStart + inputCol${t?`, batchIndices`:``}); @@ -730,7 +730,7 @@ fn main(@builtin(local_invocation_id) localId : vec3, mm_Asub[inputRow][inputCol] = mm_readA(batch, globalRowStart + inputRow, kStart + inputCol${t?`, batchIndices`:``}); - `,vo=e=>e?`let ACached = mm_Asub[k][tileRow + innerRow];`:`let ACached = mm_Asub[tileRow + innerRow][k];`,yo=(e,t,n=`f32`,r,i=!1,a=32,o=!1,s=32,c=!1)=>{let l=e[1]*t[1],u=e[0]*t[0],d=i?l:a,f=i?a:l;if(!(f%t[1]===0&&d%t[0]===0&&a%t[1]===0))throw Error(`tileAHight ${f} must be divisible by workgroupSize[1]${t[1]}, tileAWidth ${d} must be divisible by workgroupSize[0]${t[0]}, tileInner ${a} must be divisible by workgroupSize[1]${t[1]}`);let p=f/t[1],m=d/t[0],h=a/t[1],g=c?` + `,_o=e=>e?`let ACached = mm_Asub[k][tileRow + innerRow];`:`let ACached = mm_Asub[tileRow + innerRow][k];`,vo=(e,t,n=`f32`,r,i=!1,a=32,o=!1,s=32,c=!1)=>{let l=e[1]*t[1],u=e[0]*t[0],d=i?l:a,f=i?a:l;if(!(f%t[1]===0&&d%t[0]===0&&a%t[1]===0))throw Error(`tileAHight ${f} must be divisible by workgroupSize[1]${t[1]}, tileAWidth ${d} must be divisible by workgroupSize[0]${t[0]}, tileInner ${a} must be divisible by workgroupSize[1]${t[1]}`);let p=f/t[1],m=d/t[0],h=a/t[1],g=c?` let localRow = i32(localId.y); let localCol = i32(localId.x); let globalRowStart = i32(workgroupId.y) * ${l}; @@ -741,7 +741,7 @@ fn main(@builtin(local_invocation_id) localId : vec3, // Load one tile of A into local memory. for (var inputRow = localRow; inputRow < ${f}; inputRow = inputRow + ${t[1]}) { for (var inputCol = localCol; inputCol < ${d}; inputCol = inputCol + ${t[0]}) { - ${_o(i,r)} + ${go(i,r)} } } // Load one tile of B into local memory. @@ -796,7 +796,7 @@ for (var t = 0; t < num_tiles; t = t + 1) { for (var innerCol = 0; innerCol < ${m}; innerCol = innerCol + 1) { let inputRow = tileRowA + innerRow; let inputCol = tileColA + innerCol; - ${_o(i,r)} + ${go(i,r)} } } @@ -821,7 +821,7 @@ for (var t = 0; t < num_tiles; t = t + 1) { } for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) { - ${vo(i)} + ${_o(i)} for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) { acc[innerRow][innerCol] = acc[innerRow][innerCol] + ACached * BCached[innerCol]; } @@ -856,14 +856,14 @@ fn main(@builtin(local_invocation_id) localId : vec3, var acc : array, rowPerThread>; ${g} } -`},bo=(e,t,n,r,i=!1)=>{let[a,o,s,c]=r,l=$n(r[0].type.tensor);return` - fn mm_readA(batch: i32, row: i32, colIn: i32, batchIndices: ${a.type.indices}) -> ${ao(e,l)} { - var value = ${ao(e,l)}(0.0); +`},yo=(e,t,n,r,i=!1)=>{let[a,o,s,c]=r,l=Qn(r[0].type.tensor);return` + fn mm_readA(batch: i32, row: i32, colIn: i32, batchIndices: ${a.type.indices}) -> ${io(e,l)} { + var value = ${io(e,l)}(0.0); let col = colIn * ${e}; if(row < uniforms.dim_a_outer && col < uniforms.dim_inner) { var aIndices: ${o.type.indices}; - ${uo(`aIndices`,o,o.rank-2,a.rank,`batchIndices`)} + ${lo(`aIndices`,o,o.rank-2,a.rank,`batchIndices`)} ${o.indicesSet(`aIndices`,o.rank-2,`u32(row)`)} ${o.indicesSet(`aIndices`,o.rank-1,`u32(colIn)`)} value = ${o.getByIndices(`aIndices`)}; @@ -871,13 +871,13 @@ fn main(@builtin(local_invocation_id) localId : vec3, return value; } - fn mm_readB(batch: i32, row: i32, colIn: i32, batchIndices: ${a.type.indices}) -> ${ao(e,l)} { - var value = ${ao(e,l)}(0.0); + fn mm_readB(batch: i32, row: i32, colIn: i32, batchIndices: ${a.type.indices}) -> ${io(e,l)} { + var value = ${io(e,l)}(0.0); let col = colIn * ${e}; if(row < uniforms.dim_inner && col < uniforms.dim_b_outer) { var bIndices: ${s.type.indices}; - ${uo(`bIndices`,s,s.rank-2,a.rank,`batchIndices`)} + ${lo(`bIndices`,s,s.rank-2,a.rank,`batchIndices`)} ${s.indicesSet(`bIndices`,s.rank-2,`u32(row)`)} ${s.indicesSet(`bIndices`,s.rank-1,`u32(colIn)`)} value = ${s.getByIndices(`bIndices`)}; @@ -885,21 +885,21 @@ fn main(@builtin(local_invocation_id) localId : vec3, return value; } - fn mm_write(batch: i32, row: i32, colIn: i32, valueIn: ${ao(e,l)}) { + fn mm_write(batch: i32, row: i32, colIn: i32, valueIn: ${io(e,l)}) { let col = colIn * ${e}; if (row < uniforms.dim_a_outer && col < uniforms.dim_b_outer) { var value = valueIn; let coords = vec3(batch, row, colIn); - ${t?`value = value + ${i?`bias[colIn]`:`${ao(e,l)}(bias[row])`};`:``} + ${t?`value = value + ${i?`bias[colIn]`:`${io(e,l)}(bias[row])`};`:``} ${n} ${c.setByIndices(`vec3(coords)`,`value`)} } } - `},xo=(e,t,n,r,i=!1,a)=>{let o=e[0].dims,s=e[1].dims,c=o.slice(0,-2),l=s.slice(0,-2),u=r?r.slice(0,-2):n.slice(0,-2),d=U.size(u),f=o[o.length-2],p=o[o.length-1],m=s[s.length-1],h=p%4==0&&m%4==0,g=f<=8?[4,1,1]:[4,4,1],_=[8,8,1],v=[Math.ceil(m/_[0]/g[0]),Math.ceil(f/_[1]/g[1]),Math.ceil(d/_[2]/g[2])],y=h?4:1,b=[...c,f,p/y],x=b.length,S=[...l,p,m/y],C=S.length,w=[d,f,m/y],T=[{type:6,data:f},{type:6,data:m},{type:6,data:p}];to(t,T),T.push(...G(u,b,S));let E=[`rank`,`rank`],D=e.length>2;D&&(T.push(...G(e[2].dims)),E.push(`rank`)),T.push(...G(w));let O=n=>{let r=u.length,a=sr(`batchDims`,e[0].dataType,r,1),o=$n(e[0].dataType),s=q(`a`,e[0].dataType,x,y),c=q(`b`,e[1].dataType,C,y),l=J(`result`,e[0].dataType,w.length,y),d=[s,c];if(D){let t=i?y:1;d.push(q(`bias`,e[2].dataType,e[2].dims.length,t))}let f=[{name:`dim_a_outer`,type:`i32`},{name:`dim_b_outer`,type:`i32`},{name:`dim_inner`,type:`i32`}];no(t,f);let p=$n(l.type.tensor),m=eo(t,l.type.value,p),v=bo(y,D,m,[a,s,c,l],i);return` + `},bo=(e,t,n,r,i=!1,a)=>{let o=e[0].dims,s=e[1].dims,c=o.slice(0,-2),l=s.slice(0,-2),u=r?r.slice(0,-2):n.slice(0,-2),d=W.size(u),f=o[o.length-2],p=o[o.length-1],m=s[s.length-1],h=p%4==0&&m%4==0,g=f<=8?[4,1,1]:[4,4,1],_=[8,8,1],v=[Math.ceil(m/_[0]/g[0]),Math.ceil(f/_[1]/g[1]),Math.ceil(d/_[2]/g[2])],y=h?4:1,b=[...c,f,p/y],x=b.length,S=[...l,p,m/y],C=S.length,w=[d,f,m/y],T=[{type:6,data:f},{type:6,data:m},{type:6,data:p}];eo(t,T),T.push(...K(u,b,S));let E=[`rank`,`rank`],D=e.length>2;D&&(T.push(...K(e[2].dims)),E.push(`rank`)),T.push(...K(w));let O=n=>{let r=u.length,a=or(`batchDims`,e[0].dataType,r,1),o=Qn(e[0].dataType),s=J(`a`,e[0].dataType,x,y),c=J(`b`,e[1].dataType,C,y),l=Y(`result`,e[0].dataType,w.length,y),d=[s,c];if(D){let t=i?y:1;d.push(J(`bias`,e[2].dataType,e[2].dims.length,t))}let f=[{name:`dim_a_outer`,type:`i32`},{name:`dim_b_outer`,type:`i32`},{name:`dim_inner`,type:`i32`}];to(t,f);let p=Qn(l.type.tensor),m=$a(t,l.type.value,p),v=yo(y,D,m,[a,s,c,l],i);return` ${n.registerUniforms(f).registerInternalVariables(a).declareVariables(...d,l)} ${v} - ${h?go(g,_,o,a):yo(g,_,o,a)} - `};return{name:`MatMul`,shaderCache:{hint:`${g};${t.activation};${h};${i}`,inputDependencies:E},getRunData:()=>({outputs:[{dims:a?a(n):n,dataType:e[0].dataType}],dispatchGroup:{x:v[0],y:v[1],z:v[2]},programUniforms:T}),getShaderSource:O}}}),Co,wo,To=M(()=>{"use strict";V(),pn(),Y(),io(),so(),lo(),So(),Co=(e,t,n,r,i=!1,a,o=4,s=4,c=4,l=`f32`)=>{let u=e=>{switch(e){case 1:return`resData = x[xIndex];`;case 3:return`resData = vec3<${l}>(x[xIndex], x[xIndex + 1], x[xIndex + 2]);`;case 4:return`resData = x[xIndex / 4];`;default:throw Error(`innerElementSize ${e} is not supported.`)}},d=e=>{switch(e){case 1:return`return w[row * i32(uniforms.w_shape[3]) + colIn];`;case 4:return`return w[row * i32(uniforms.w_shape[3]) / 4 + colIn];`;default:throw Error(`innerElementSize ${e} is not supported.`)}},f=e?` + ${h?ho(g,_,o,a):vo(g,_,o,a)} + `};return{name:`MatMul`,shaderCache:{hint:`${g};${t.activation};${h};${i}`,inputDependencies:E},getRunData:()=>({outputs:[{dims:a?a(n):n,dataType:e[0].dataType}],dispatchGroup:{x:v[0],y:v[1],z:v[2]},programUniforms:T}),getShaderSource:O}}}),So,Co,wo=M(()=>{"use strict";U(),fn(),X(),ro(),oo(),co(),xo(),So=(e,t,n,r,i=!1,a,o=4,s=4,c=4,l=`f32`)=>{let u=e=>{switch(e){case 1:return`resData = x[xIndex];`;case 3:return`resData = vec3<${l}>(x[xIndex], x[xIndex + 1], x[xIndex + 2]);`;case 4:return`resData = x[xIndex / 4];`;default:throw Error(`innerElementSize ${e} is not supported.`)}},d=e=>{switch(e){case 1:return`return w[row * i32(uniforms.w_shape[3]) + colIn];`;case 4:return`return w[row * i32(uniforms.w_shape[3]) / 4 + colIn];`;default:throw Error(`innerElementSize ${e} is not supported.`)}},f=e?` let coord = vec4(batch, xRow, xCol, xCh); `:` let coord = vec4(batch, xCh, xRow, xCol); @@ -926,7 +926,7 @@ fn main(@builtin(local_invocation_id) localId : vec3, let xRow = outRow * uniforms.stride[0] + uniforms.dilation[0] * WRow - uniforms.pad[0]; let xCol = outCol * uniforms.stride[1] + uniforms.dilation[1] * WCol - uniforms.pad[1]; let xCh = ${_} % inChannels; - var resData = ${ao(o,l)}(0.0); + var resData = ${io(o,l)}(0.0); // The bounds checking is always needed since we use it to pad zero for // the 'same' padding type. if (xRow >= 0 && xRow < ${m} && xCol >= 0 && xCol < ${h}) { @@ -941,24 +941,24 @@ fn main(@builtin(local_invocation_id) localId : vec3, if (row < uniforms.dim_a_outer && col < uniforms.dim_inner) { ${v} } - return ${ao(o,l)}(0.0);`:r&&n?` + return ${io(o,l)}(0.0);`:r&&n?` let col = colIn * ${o}; ${v}`:` let col = colIn * ${o}; if (row < uniforms.dim_inner && col < uniforms.dim_b_outer) { ${v} } - return ${ao(o,l)}(0.0);`,b=e?r&&n?d(s):` + return ${io(o,l)}(0.0);`,b=e?r&&n?d(s):` let col = colIn * ${s}; if (row < uniforms.dim_inner && col < uniforms.dim_b_outer) { ${d(s)} } - return ${ao(s,l)}(0.0);`:` + return ${io(s,l)}(0.0);`:` let col = colIn * ${s}; if (row < uniforms.dim_inner && col < uniforms.dim_a_outer) { ${d(s)} } - return ${ao(s,l)}(0.0);`,x=ao(c,l),S=ao(e?o:s,l),C=ao(e?s:o,l),w=eo(a,x,l);return` + return ${io(s,l)}(0.0);`,x=io(c,l),S=io(e?o:s,l),C=io(e?s:o,l),w=$a(a,x,l);return` fn mm_readA(batch: i32, row : i32, colIn : i32) -> ${S} { ${e?y:b} } @@ -974,32 +974,32 @@ fn main(@builtin(local_invocation_id) localId : vec3, var value = valueIn; let outWidth = ${e?`i32(uniforms.result_shape[2])`:`i32(uniforms.result_shape[3])`}; ${p} - ${oo(i)} + ${ao(i)} ${w} setOutputAtCoords(coords[0], coords[1], coords[2], coords[3], value); } - }`},wo=(e,t,n,r,i,a,o,s,c)=>{let l=t.format===`NHWC`,u=l?e[0].dims[3]:e[0].dims[1],d=n[0],f=l?n[2]:n[3],p=l?n[1]:n[2],m=l?n[3]:n[1],h=l&&(u%4==0||u%3==0)&&m%4==0,g=l?m:f*p,_=l?f*p:m,v=[8,8,1],y=r<=8?[4,1,1]:[4,4,1],b=[Math.ceil(g/v[0]/y[0]),Math.ceil(_/v[1]/y[1]),Math.ceil(d/v[2]/y[2])];H(`verbose`,()=>`[conv2d_mm_webgpu] dispatch = ${b}`);let x=h?l&&u%4!=0?3:4:1,S=v[1]*y[1],C=v[0]*y[0],w=Math.max(v[0]*x,v[1]),T=r%S===0,E=i%C===0,D=a%w===0,O=h?[x,4,4]:[1,1,1],k=[{type:6,data:r},{type:6,data:i},{type:6,data:a},{type:6,data:[t.pads[0],t.pads[1]]},{type:6,data:t.strides},{type:6,data:t.dilations}];to(t,k),k.push(...G(e[0].dims,e[1].dims));let A=[`rank`,`rank`];o&&(k.push(...G(e[2].dims)),A.push(`rank`)),k.push(...G(n));let ee=r=>{let i=[{name:`dim_a_outer`,type:`i32`},{name:`dim_b_outer`,type:`i32`},{name:`dim_inner`,type:`i32`},{name:`pad`,type:`i32`,length:2},{name:`stride`,type:`i32`,length:2},{name:`dilation`,type:`i32`,length:2}];no(t,i);let a=h?4:1,c=$n(e[0].dataType),u=` + }`},Co=(e,t,n,r,i,a,o,s,c)=>{let l=t.format===`NHWC`,u=l?e[0].dims[3]:e[0].dims[1],d=n[0],f=l?n[2]:n[3],p=l?n[1]:n[2],m=l?n[3]:n[1],h=l&&(u%4==0||u%3==0)&&m%4==0,g=l?m:f*p,_=l?f*p:m,v=[8,8,1],y=r<=8?[4,1,1]:[4,4,1],b=[Math.ceil(g/v[0]/y[0]),Math.ceil(_/v[1]/y[1]),Math.ceil(d/v[2]/y[2])];dn(`verbose`,()=>`[conv2d_mm_webgpu] dispatch = ${b}`);let x=h?l&&u%4!=0?3:4:1,S=v[1]*y[1],C=v[0]*y[0],w=Math.max(v[0]*x,v[1]),T=r%S===0,E=i%C===0,D=a%w===0,O=h?[x,4,4]:[1,1,1],k=[{type:6,data:r},{type:6,data:i},{type:6,data:a},{type:6,data:[t.pads[0],t.pads[1]]},{type:6,data:t.strides},{type:6,data:t.dilations}];eo(t,k),k.push(...K(e[0].dims,e[1].dims));let A=[`rank`,`rank`];o&&(k.push(...K(e[2].dims)),A.push(`rank`)),k.push(...K(n));let ee=r=>{let i=[{name:`dim_a_outer`,type:`i32`},{name:`dim_b_outer`,type:`i32`},{name:`dim_inner`,type:`i32`},{name:`pad`,type:`i32`,length:2},{name:`stride`,type:`i32`,length:2},{name:`dilation`,type:`i32`,length:2}];to(t,i);let a=h?4:1,c=Qn(e[0].dataType),u=` fn setOutputAtIndex(flatIndex : i32, value : ${h?`vec4<${c}>`:c}) { result[flatIndex] = ${h?`vec4<${c}>`:c}(value); } fn setOutputAtCoords(d0 : i32, d1 : i32, d2 : i32, d3 : i32, value : ${h?`vec4<${c}>`:c}) { let flatIndex = getOutputIndexFromCoords(vec4(d0, d1, d2, d3)); setOutputAtIndex(flatIndex ${h?`/ 4`:``}, value); - }`,d=q(`x`,e[0].dataType,e[0].dims.length,x===3?1:x),f=q(`w`,e[1].dataType,e[1].dims.length,a),p=[d,f],m=J(`result`,e[0].dataType,n.length,a);if(o){let t=q(`bias`,e[2].dataType,e[2].dims.length,a);p.push(t),u+=` + }`,d=J(`x`,e[0].dataType,e[0].dims.length,x===3?1:x),f=J(`w`,e[1].dataType,e[1].dims.length,a),p=[d,f],m=Y(`result`,e[0].dataType,n.length,a);if(o){let t=J(`bias`,e[2].dataType,e[2].dims.length,a);p.push(t),u+=` fn getBiasByOutputCoords(coords : vec4) -> ${h?`vec4<${c}>`:c} { return bias[coords.${l?`w`:`y`}${h?`/ 4`:``}]; }`}return` - ${co(`uniforms.result_strides`)} + ${so(`uniforms.result_strides`)} //struct Uniforms { xShape : vec4, wShape : vec4, outShape : vec4, // outShapeStrides: vec3, filterDims : vec2, pad : vec2, stride : vec2, // dilation : vec2, dimAOuter : i32, dimBOuter : i32, dimInner : i32 }; ${r.registerUniforms(i).declareVariables(...p,m)} ${u} - ${Co(l,T,E,D,o,t,O[0],O[1],O[2],c)} - ${h?go(y,v,c,void 0,!l,w):yo(y,v,c,void 0,!l,w,!1,void 0,s)}`};return{name:`Conv2DMatMul`,shaderCache:{hint:`${t.cacheKey};${x};${h};${T};${E};${D};${S};${C};${w}`,inputDependencies:A},getRunData:()=>({outputs:[{dims:c?c(n):n,dataType:e[0].dataType}],dispatchGroup:{x:b[0],y:b[1],z:b[2]},programUniforms:k}),getShaderSource:ee}}}),Eo,Do,Oo,ko,Ao,jo,Mo,No,Po=M(()=>{"use strict";V(),pn(),W(),Y(),io(),so(),Eo=e=>{let t=1;for(let n=0;ntypeof e==`number`?[e,e,e]:e,Oo=(e,t)=>t<=1?e:e+(e-1)*(t-1),ko=(e,t,n,r=1)=>{let i=Oo(t,r);return Math.floor((e[0]*(n-1)-n+i)/2)},Ao=(e,t,n,r,i)=>{i??=ko(e,t[0],r[0]);let a=[0,0,0,n];for(let n=0;n<3;n++)e[n]+2*i>=t[n]&&(a[n]=Math.trunc((e[n]-t[n]+2*i)/r[n]+1));return a},jo=(e,t,n,r,i,a,o,s,c,l)=>{let u,d,f,p;if(e===`VALID`&&(e=0),typeof e==`number`){u={top:e,bottom:e,left:e,right:e,front:e,back:e};let m=Ao([t,n,r,1],[s,c,l],1,[i,a,o],e);d=m[0],f=m[1],p=m[2]}else if(Array.isArray(e)){if(!e.every((e,t,n)=>e===n[0]))throw Error(`Unsupported padding parameter: ${e}`);u={top:e[0],bottom:e[1],left:e[2],right:e[3],front:e[4],back:e[5]};let m=Ao([t,n,r,1],[s,c,l],1,[i,a,o],e[0]);d=m[0],f=m[1],p=m[2]}else if(e===`SAME_UPPER`){d=Math.ceil(t/i),f=Math.ceil(n/a),p=Math.ceil(r/o);let e=(d-1)*i+s-t,m=(f-1)*a+c-n,h=(p-1)*o+l-r,g=Math.floor(e/2),_=e-g,v=Math.floor(m/2),y=m-v,b=Math.floor(h/2),x=h-b;u={top:v,bottom:y,left:b,right:x,front:g,back:_}}else throw Error(`Unknown padding parameter: ${e}`);return{padInfo:u,outDepth:d,outHeight:f,outWidth:p}},Mo=(e,t,n,r,i,a=!1,o=`channelsLast`)=>{let s,c,l,u,d;if(o===`channelsLast`)[s,c,l,u,d]=e;else if(o===`channelsFirst`)[s,d,c,l,u]=e;else throw Error(`Unknown dataFormat ${o}`);let[f,,p,m,h]=t,[g,_,v]=Do(n),[y,b,x]=Do(r),S=Oo(p,y),C=Oo(m,b),w=Oo(h,x),{padInfo:T,outDepth:E,outHeight:D,outWidth:O}=jo(i,c,l,u,g,_,v,S,C,w),k=a?f*d:f,A=[0,0,0,0,0];return o===`channelsFirst`?A=[s,k,E,D,O]:o===`channelsLast`&&(A=[s,E,D,O,k]),{batchSize:s,dataFormat:o,inDepth:c,inHeight:l,inWidth:u,inChannels:d,outDepth:E,outHeight:D,outWidth:O,outChannels:k,padInfo:T,strideDepth:g,strideHeight:_,strideWidth:v,filterDepth:p,filterHeight:m,filterWidth:h,effectiveFilterDepth:S,effectiveFilterHeight:C,effectiveFilterWidth:w,dilationDepth:y,dilationHeight:b,dilationWidth:x,inShape:e,outShape:A,filterShape:t}},No=(e,t,n,r,i,a)=>{let o=a===`channelsLast`,s=o?e[0].dims[3]:e[0].dims[1],c=!1,l=[64,1,1],u={x:n.map((e,t)=>t)},d=[Math.ceil(Eo(u.x.map(e=>n[e]))/l[0]),1,1];H(`verbose`,()=>`[conv3d_naive_webgpu] dispatch = ${d}`);let f=c?o&&s%4!=0?3:4:1,p=U.size(n),m=[{type:12,data:p},{type:12,data:r},{type:12,data:i},{type:12,data:t.strides},{type:12,data:t.dilations}];to(t,m),m.push(...G(e[0].dims,e[1].dims));let h=[`rank`,`rank`],g=e.length===3;g&&(m.push(...G(e[2].dims)),h.push(`rank`)),m.push(...G(n));let _=a=>{let s=[{name:`output_size`,type:`u32`},{name:`filter_dims`,type:`u32`,length:r.length},{name:`pads`,type:`u32`,length:i.length},{name:`strides`,type:`u32`,length:t.strides.length},{name:`dilations`,type:`u32`,length:t.dilations.length}];no(t,s);let l=c?4:1,u=$n(e[0].dataType),d=q(`x`,e[0].dataType,e[0].dims.length,f===3?1:f),p=q(`W`,e[1].dataType,e[1].dims.length,l),m=[d,p],h=J(`result`,e[0].dataType,n.length,l),_=``;if(g){let t=q(`bias`,e[2].dataType,e[2].dims.length,l);m.push(t),_+=` + ${So(l,T,E,D,o,t,O[0],O[1],O[2],c)} + ${h?ho(y,v,c,void 0,!l,w):vo(y,v,c,void 0,!l,w,!1,void 0,s)}`};return{name:`Conv2DMatMul`,shaderCache:{hint:`${t.cacheKey};${x};${h};${T};${E};${D};${S};${C};${w}`,inputDependencies:A},getRunData:()=>({outputs:[{dims:c?c(n):n,dataType:e[0].dataType}],dispatchGroup:{x:b[0],y:b[1],z:b[2]},programUniforms:k}),getShaderSource:ee}}}),To,Eo,Do,Oo,ko,Ao,jo,Mo,No=M(()=>{"use strict";U(),fn(),G(),X(),ro(),oo(),To=e=>{let t=1;for(let n=0;ntypeof e==`number`?[e,e,e]:e,Do=(e,t)=>t<=1?e:e+(e-1)*(t-1),Oo=(e,t,n,r=1)=>{let i=Do(t,r);return Math.floor((e[0]*(n-1)-n+i)/2)},ko=(e,t,n,r,i)=>{i??=Oo(e,t[0],r[0]);let a=[0,0,0,n];for(let n=0;n<3;n++)e[n]+2*i>=t[n]&&(a[n]=Math.trunc((e[n]-t[n]+2*i)/r[n]+1));return a},Ao=(e,t,n,r,i,a,o,s,c,l)=>{let u,d,f,p;if(e===`VALID`&&(e=0),typeof e==`number`){u={top:e,bottom:e,left:e,right:e,front:e,back:e};let m=ko([t,n,r,1],[s,c,l],1,[i,a,o],e);d=m[0],f=m[1],p=m[2]}else if(Array.isArray(e)){if(!e.every((e,t,n)=>e===n[0]))throw Error(`Unsupported padding parameter: ${e}`);u={top:e[0],bottom:e[1],left:e[2],right:e[3],front:e[4],back:e[5]};let m=ko([t,n,r,1],[s,c,l],1,[i,a,o],e[0]);d=m[0],f=m[1],p=m[2]}else if(e===`SAME_UPPER`){d=Math.ceil(t/i),f=Math.ceil(n/a),p=Math.ceil(r/o);let e=(d-1)*i+s-t,m=(f-1)*a+c-n,h=(p-1)*o+l-r,g=Math.floor(e/2),_=e-g,v=Math.floor(m/2),y=m-v,b=Math.floor(h/2),x=h-b;u={top:v,bottom:y,left:b,right:x,front:g,back:_}}else throw Error(`Unknown padding parameter: ${e}`);return{padInfo:u,outDepth:d,outHeight:f,outWidth:p}},jo=(e,t,n,r,i,a=!1,o=`channelsLast`)=>{let s,c,l,u,d;if(o===`channelsLast`)[s,c,l,u,d]=e;else if(o===`channelsFirst`)[s,d,c,l,u]=e;else throw Error(`Unknown dataFormat ${o}`);let[f,,p,m,h]=t,[g,_,v]=Eo(n),[y,b,x]=Eo(r),S=Do(p,y),C=Do(m,b),w=Do(h,x),{padInfo:T,outDepth:E,outHeight:D,outWidth:O}=Ao(i,c,l,u,g,_,v,S,C,w),k=a?f*d:f,A=[0,0,0,0,0];return o===`channelsFirst`?A=[s,k,E,D,O]:o===`channelsLast`&&(A=[s,E,D,O,k]),{batchSize:s,dataFormat:o,inDepth:c,inHeight:l,inWidth:u,inChannels:d,outDepth:E,outHeight:D,outWidth:O,outChannels:k,padInfo:T,strideDepth:g,strideHeight:_,strideWidth:v,filterDepth:p,filterHeight:m,filterWidth:h,effectiveFilterDepth:S,effectiveFilterHeight:C,effectiveFilterWidth:w,dilationDepth:y,dilationHeight:b,dilationWidth:x,inShape:e,outShape:A,filterShape:t}},Mo=(e,t,n,r,i,a)=>{let o=a===`channelsLast`,s=o?e[0].dims[3]:e[0].dims[1],c=!1,l=[64,1,1],u={x:n.map((e,t)=>t)},d=[Math.ceil(To(u.x.map(e=>n[e]))/l[0]),1,1];dn(`verbose`,()=>`[conv3d_naive_webgpu] dispatch = ${d}`);let f=c?o&&s%4!=0?3:4:1,p=W.size(n),m=[{type:12,data:p},{type:12,data:r},{type:12,data:i},{type:12,data:t.strides},{type:12,data:t.dilations}];eo(t,m),m.push(...K(e[0].dims,e[1].dims));let h=[`rank`,`rank`],g=e.length===3;g&&(m.push(...K(e[2].dims)),h.push(`rank`)),m.push(...K(n));let _=a=>{let s=[{name:`output_size`,type:`u32`},{name:`filter_dims`,type:`u32`,length:r.length},{name:`pads`,type:`u32`,length:i.length},{name:`strides`,type:`u32`,length:t.strides.length},{name:`dilations`,type:`u32`,length:t.dilations.length}];to(t,s);let l=c?4:1,u=Qn(e[0].dataType),d=J(`x`,e[0].dataType,e[0].dims.length,f===3?1:f),p=J(`W`,e[1].dataType,e[1].dims.length,l),m=[d,p],h=Y(`result`,e[0].dataType,n.length,l),_=``;if(g){let t=J(`bias`,e[2].dataType,e[2].dims.length,l);m.push(t),_+=` fn getBiasByOutputCoords(coords : array) -> ${c?`vec4<${u}>`:u} { - return bias[${o?K(`coords`,4,5):K(`coords`,1,5)}${c?`/ 4`:``}]; - }`}let v=ao(f,u),y=eo(t,v,u);return` + return bias[${o?q(`coords`,4,5):q(`coords`,1,5)}${c?`/ 4`:``}]; + }`}let v=io(f,u),y=$a(t,v,u);return` ${_} fn getX(d0 : u32, d1 : u32, d2 : u32, d3 : u32, d4 : u32) -> f32 { let aIndices = array(d0, d1, d2, d3, d4); @@ -1013,18 +1013,18 @@ fn main(@builtin(local_invocation_id) localId : vec3, ${a.mainStart()} ${a.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} let coords = ${h.offsetToIndices(`global_idx`)}; - let batch = ${K(`coords`,0,d.rank)}; - let d2 = ${o?K(`coords`,d.rank-1,d.rank):K(`coords`,1,d.rank)}; - let xFRCCorner = vec3(${o?K(`coords`,1,d.rank):K(`coords`,2,d.rank)}, - ${o?K(`coords`,2,d.rank):K(`coords`,3,d.rank)}, - ${o?K(`coords`,3,d.rank):K(`coords`,4,d.rank)}) * uniforms.strides - uniforms.pads; + let batch = ${q(`coords`,0,d.rank)}; + let d2 = ${o?q(`coords`,d.rank-1,d.rank):q(`coords`,1,d.rank)}; + let xFRCCorner = vec3(${o?q(`coords`,1,d.rank):q(`coords`,2,d.rank)}, + ${o?q(`coords`,2,d.rank):q(`coords`,3,d.rank)}, + ${o?q(`coords`,3,d.rank):q(`coords`,4,d.rank)}) * uniforms.strides - uniforms.pads; let xFCorner = xFRCCorner.x; let xRCorner = xFRCCorner.y; let xCCorner = xFRCCorner.z; - let xShapeY = ${o?K(`uniforms.x_shape`,1,d.rank):K(`uniforms.x_shape`,2,d.rank)}; - let xShapeZ = ${o?K(`uniforms.x_shape`,2,d.rank):K(`uniforms.x_shape`,3,d.rank)}; - let xShapeW = ${o?K(`uniforms.x_shape`,3,d.rank):K(`uniforms.x_shape`,4,d.rank)}; - let xShapeU = ${o?K(`uniforms.x_shape`,4,d.rank):K(`uniforms.x_shape`,1,d.rank)}; + let xShapeY = ${o?q(`uniforms.x_shape`,1,d.rank):q(`uniforms.x_shape`,2,d.rank)}; + let xShapeZ = ${o?q(`uniforms.x_shape`,2,d.rank):q(`uniforms.x_shape`,3,d.rank)}; + let xShapeW = ${o?q(`uniforms.x_shape`,3,d.rank):q(`uniforms.x_shape`,4,d.rank)}; + let xShapeU = ${o?q(`uniforms.x_shape`,4,d.rank):q(`uniforms.x_shape`,1,d.rank)}; let inputDepthNearestVec4 = (xShapeU / 4) * 4; let inputDepthVec4Remainder = xShapeU % 4; @@ -1104,7 +1104,7 @@ fn main(@builtin(local_invocation_id) localId : vec3, ${g?`value = value + getBiasByOutputCoords(coords)`:``}; ${y} result[global_idx] = f32(value); - }`};return{name:`Conv3DNaive`,shaderCache:{hint:`${t.cacheKey};${o};${f};${g}`,inputDependencies:h},getRunData:()=>({outputs:[{dims:n,dataType:e[0].dataType}],dispatchGroup:{x:d[0],y:d[1],z:d[2]},programUniforms:m}),getShaderSource:_}}}),Fo,Io,Lo=M(()=>{"use strict";V(),W(),Y(),io(),Fo=(e,t,n,r)=>{let i=e.length>2,a=i?`value += b[output_channel];`:``,o=e[0].dims,s=e[1].dims,c=t.format===`NHWC`,l=c?n[3]:n[1],u=l/t.group,d=c&&u>=4?tr(l):1,f=U.size(n)/d,p=[{type:12,data:f},{type:12,data:t.dilations},{type:12,data:[t.strides[0],t.strides[1]]},{type:12,data:[t.pads[0],t.pads[1]]},{type:12,data:u}];to(t,p),p.push(...G(o,[s[0],s[1],s[2],s[3]/d]));let m=i?[`rank`,`rank`,`rank`]:[`rank`,`rank`];p.push(...G([n[0],n[1],n[2],n[3]/d]));let h=r=>{let l=J(`output`,e[0].dataType,n.length,d),u=$n(l.type.tensor),f=eo(t,l.type.value,u),p=q(`x`,e[0].dataType,o.length),m=q(`w`,e[1].dataType,s.length,d),h=[p,m];i&&h.push(q(`b`,e[2].dataType,e[2].dims,d));let g=[{name:`output_size`,type:`u32`},{name:`dilations`,type:`u32`,length:t.dilations.length},{name:`strides`,type:`u32`,length:2},{name:`pads`,type:`u32`,length:2},{name:`output_channels_per_group`,type:`u32`}];no(t,g);let _=c?` + }`};return{name:`Conv3DNaive`,shaderCache:{hint:`${t.cacheKey};${o};${f};${g}`,inputDependencies:h},getRunData:()=>({outputs:[{dims:n,dataType:e[0].dataType}],dispatchGroup:{x:d[0],y:d[1],z:d[2]},programUniforms:m}),getShaderSource:_}}}),Po,Fo,Io=M(()=>{"use strict";U(),G(),X(),ro(),Po=(e,t,n,r)=>{let i=e.length>2,a=i?`value += b[output_channel];`:``,o=e[0].dims,s=e[1].dims,c=t.format===`NHWC`,l=c?n[3]:n[1],u=l/t.group,d=c&&u>=4?er(l):1,f=W.size(n)/d,p=[{type:12,data:f},{type:12,data:t.dilations},{type:12,data:[t.strides[0],t.strides[1]]},{type:12,data:[t.pads[0],t.pads[1]]},{type:12,data:u}];eo(t,p),p.push(...K(o,[s[0],s[1],s[2],s[3]/d]));let m=i?[`rank`,`rank`,`rank`]:[`rank`,`rank`];p.push(...K([n[0],n[1],n[2],n[3]/d]));let h=r=>{let l=Y(`output`,e[0].dataType,n.length,d),u=Qn(l.type.tensor),f=$a(t,l.type.value,u),p=J(`x`,e[0].dataType,o.length),m=J(`w`,e[1].dataType,s.length,d),h=[p,m];i&&h.push(J(`b`,e[2].dataType,e[2].dims,d));let g=[{name:`output_size`,type:`u32`},{name:`dilations`,type:`u32`,length:t.dilations.length},{name:`strides`,type:`u32`,length:2},{name:`pads`,type:`u32`,length:2},{name:`output_channels_per_group`,type:`u32`}];to(t,g);let _=c?` for (var wHeight: u32 = 0u; wHeight < uniforms.w_shape[0]; wHeight++) { let xHeight = xRCCorner.x + wHeight * uniforms.dilations[0]; @@ -1166,7 +1166,7 @@ fn main(@builtin(local_invocation_id) localId : vec3, ${a} ${f} ${l.setByOffset(`global_idx`,`value`)} - }`};return{name:`GroupedConv`,shaderCache:{hint:`${t.cacheKey}_${d}`,inputDependencies:m},getRunData:()=>({outputs:[{dims:r?r(n):n,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(f/64)},programUniforms:p}),getShaderSource:h}},Io=(e,t,n,r)=>{let i=e.length>2,a=tr(n[3]),o=tr(n[2]),s=U.size(n)/a/o,c=[e[0].dims[0],e[0].dims[1],e[0].dims[2],e[0].dims[3]/a],l=[e[1].dims[0],e[1].dims[1],e[1].dims[2],e[1].dims[3]/a],u=[n[0],n[1],n[2],n[3]/a],d=[{type:12,data:s},{type:6,data:[t.strides[0],t.strides[1]]},{type:6,data:[t.pads[0],t.pads[1]]}];to(t,d),d.push(...G(c,l,u));let f=(o-1)*t.strides[1]+l[1],p=n=>{let r=J(`output`,e[0].dataType,u.length,a),s=$n(r.type.tensor),d=eo(t,r.type.value,s),p=q(`x`,e[0].dataType,c.length,a),m=q(`w`,e[1].dataType,l.length,a),h=[p,m];i&&h.push(q(`b`,e[2].dataType,e[2].dims,a));let g=i?`value += b[output_channel];`:``,_=[{name:`output_size`,type:`u32`},{name:`strides`,type:`i32`,length:2},{name:`pads`,type:`i32`,length:2}];return no(t,_),` + }`};return{name:`GroupedConv`,shaderCache:{hint:`${t.cacheKey}_${d}`,inputDependencies:m},getRunData:()=>({outputs:[{dims:r?r(n):n,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(f/64)},programUniforms:p}),getShaderSource:h}},Fo=(e,t,n,r)=>{let i=e.length>2,a=er(n[3]),o=er(n[2]),s=W.size(n)/a/o,c=[e[0].dims[0],e[0].dims[1],e[0].dims[2],e[0].dims[3]/a],l=[e[1].dims[0],e[1].dims[1],e[1].dims[2],e[1].dims[3]/a],u=[n[0],n[1],n[2],n[3]/a],d=[{type:12,data:s},{type:6,data:[t.strides[0],t.strides[1]]},{type:6,data:[t.pads[0],t.pads[1]]}];eo(t,d),d.push(...K(c,l,u));let f=(o-1)*t.strides[1]+l[1],p=n=>{let r=Y(`output`,e[0].dataType,u.length,a),s=Qn(r.type.tensor),d=$a(t,r.type.value,s),p=J(`x`,e[0].dataType,c.length,a),m=J(`w`,e[1].dataType,l.length,a),h=[p,m];i&&h.push(J(`b`,e[2].dataType,e[2].dims,a));let g=i?`value += b[output_channel];`:``,_=[{name:`output_size`,type:`u32`},{name:`strides`,type:`i32`,length:2},{name:`pads`,type:`i32`,length:2}];return to(t,_),` ${n.registerUniforms(_).declareVariables(...h,r)} ${n.mainStart()} ${n.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} @@ -1211,7 +1211,7 @@ fn main(@builtin(local_invocation_id) localId : vec3, ${d} ${r.set(`batch`,`row`,`col + i`,`output_channel`,`value`)}; } - }`};return{name:`GroupedConv-Vectorize`,shaderCache:{hint:`${t.cacheKey};${a};${o};${f};${l[0]};${l[1]}`,inputDependencies:i?[`rank`,`rank`,`type`]:[`rank`,`rank`]},getRunData:()=>({outputs:[{dims:r?r(n):n,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(s/64)},programUniforms:d}),getShaderSource:p}}}),Ro,zo,Bo,Vo,Ho,Uo,Wo,Go,Ko,qo=M(()=>{"use strict";W(),To(),Po(),So(),Lo(),io(),po(),vr(),Ro=(e,t,n,r,i,a)=>{let o=e[0],s=e.slice(a?1:2,a?3:4),c=s.length,l=t[0],u=t.slice(2).map((e,t)=>e+(e-1)*(n[t]-1)),d=s.map((e,t)=>e+r[t]+r[t+c]).map((e,t)=>Math.floor((e-u[t]+i[t])/i[t]));return d.splice(0,0,o),d.splice(a?3:1,0,l),d},zo=[2,3,1,0],Bo=(e,t)=>{if(!e||e.length!==2&&e.length!==3)throw Error(`Conv requires 2 or 3 inputs`);if(e[0].dims.length>5)throw Error(`greater than 5D is not supported`);if(e[0].dims.length!==e[1].dims.length)throw Error(`filter does not have same dimension as input`);let n=e[0].dims[t.format===`NHWC`?e[0].dims.length-1:1],r=e[1].dims[1]*t.group;if(n!==r)throw Error(`FILTER_IN_CHANNEL should be equal to DATA_CHANNEL`);if(e.length===3&&(e[2].dims.length!==1||e[1].dims[0]!==e[2].dims[0]))throw Error(`invalid bias`);let i=e[0].dims.length-2;if(t.dilations.length!==i)throw Error(`dilations should be ${i}D`);if(t.strides.length!==i)throw Error(`strides should be ${i}D`);if(t.pads.length!==i*2)throw Error(`pads should be ${i*2}D`);if(t.kernelShape.length!==0&&t.kernelShape.length!==e[1].dims.length-2)throw Error(`invalid kernel shape`)},Vo=(e,t)=>{let n=e.kernelShape.slice();n.length{let t=ro(e),n=e.format,r=[`NOTSET`,`VALID`,`SAME_UPPER`,`SAME_LOWER`][e.auto_pad],i=e.dilations,a=e.group,o=e.kernel_shape,s=e.pads,c=e.strides,l=e.w_is_const();return{autoPad:r,format:n,dilations:i,group:a,kernelShape:o,pads:s,strides:c,wIsConst:l,...t,cacheKey:`${e.format};${t.activation};`}},Uo=(e,t,n,r)=>{let i=n.format===`NHWC`,a=Ro(t[0].dims,t[1].dims,n.dilations,n.pads,n.strides,i);if(n.group!==1){let o=[t[0]];if(i){let r=e.kernelCustomData.wT??e.compute(hr(t[1],zo),{inputs:[1],outputs:[n.wIsConst?-2:-1]})[0];n.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=r),o.push(r)}else o.push(t[1]);t.length===3&&o.push(t[2]),!e.adapterInfo.isArchitecture(`ampere`)&&i&&t[1].dims[0]===n.group&&t[1].dims[1]===1&&n.dilations[0]===1&&n.dilations[1]===1?e.compute(Io(o,n,a,r),{inputs:o}):e.compute(Fo(o,n,a,r),{inputs:o});return}let o=t.length===3,s=t[0].dims[i?1:2],c=t[0].dims[i?2:3],l=t[0].dims[i?3:1],u=t[1].dims[2],d=t[1].dims[3],f=a[i?1:2],p=a[i?2:3],m=a[i?3:1],h=i&&u===s&&d===c&&n.pads[0]===0&&n.pads[1]===0;if(h||u===1&&d===1&&n.dilations[0]===1&&n.dilations[1]===1&&n.strides[0]===1&&n.strides[1]===1&&n.pads[0]===0&&n.pads[1]===0){let u=a[0],d,g,_,v=[];if(i){let r=e.kernelCustomData.wT??e.compute(hr(t[1],zo),{inputs:[1],outputs:[n.wIsConst?-2:-1]})[0];if(n.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=r),h){let e=s*c*l;d=t[0].reshape([1,u,e]),g=r.reshape([1,e,m]),_=[1,u,m]}else d=t[0].reshape([u,s*c,l]),g=r.reshape([1,l,m]),_=[u,f*p,m];v.push(d),v.push(g)}else d=t[0].reshape([u,l,s*c]),g=t[1].reshape([1,m,l]),_=[u,m,f*p],v.push(g),v.push(d);o&&v.push(t[2]);let y=_[2],b=v[0].dims[v[0].dims.length-1];y<8&&b<8?e.compute(fo(v,n,a,_,i,r),{inputs:v}):e.compute(xo(v,n,a,_,i,r),{inputs:v});return}let g=!0,_=e.kernelCustomData.wT??e.compute(hr(t[1],zo),{inputs:[1],outputs:[n.wIsConst?-2:-1]})[0];n.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=_);let v=[t[0],_];o&&v.push(t[2]);let y=i?f*p:m,b=i?m:f*p,x=u*d*l;e.compute(wo(v,n,a,y,b,x,o,g,r),{inputs:v})},Wo=(e,t)=>{let n=t.format===`NHWC`,r=[e.inputs[0].reshape(n?[e.inputs[0].dims[0],1,e.inputs[0].dims[1],e.inputs[0].dims[2]]:[e.inputs[0].dims[0],e.inputs[0].dims[1],1,e.inputs[0].dims[2]]),e.inputs[1].reshape([e.inputs[1].dims[0],e.inputs[1].dims[1],1,e.inputs[1].dims[2]])];e.inputs.length===3&&r.push(e.inputs[2]);let i=[0,t.pads[0],0,t.pads[1]],a=[1].concat(t.strides),o=[1].concat(t.dilations),s=[1].concat(t.kernelShape),c=Vo({...t,pads:i,strides:a,dilations:o,kernelShape:s},r);Uo(e,r,c,e=>n?[e[0],e[2],e[3]]:[e[0],e[1],e[3]])},Go=(e,t,n)=>{let r=n.format===`NHWC`?`channelsLast`:`channelsFirst`,i=Vo(n,t),a=n.autoPad===`NOTSET`?n.pads:n.autoPad,o=Mo(t[0].dims,t[1].dims,n.strides,n.dilations,a,!1,r);e.compute(No(t,i,o.outShape,[o.filterDepth,o.filterHeight,o.filterWidth],[o.padInfo.front,o.padInfo.top,o.padInfo.left],r))},Ko=(e,t)=>{if(Bo(e.inputs,t),e.inputs[0].dims.length===3)Wo(e,t);else if(e.inputs[0].dims.length===5)Go(e,e.inputs,t);else{let n=Vo(t,e.inputs);Uo(e,e.inputs,n)}}}),Jo,Yo=M(()=>{"use strict";V(),pn(),W(),Y(),Jo=(e,t,n)=>{let r=e.length>2,i=t.outputShape,a=t.format===`NHWC`,o=t.group,s=e[1].dims,c=s[2]/o,l=s[3],u=a?tr(c):1,d=a&&l===1&&c>=4,f=d?Math.floor(c/4)*4:Math.floor(c/u)*u,p=c-f,m=a?tr(l):1,h=a?l===1?u:m:1,g=U.size(i)/m,_=[Math.ceil(g/64),1,1];H(`verbose`,()=>`[conv2d_backprop_webgpu] dispatch = ${_}`);let v=[`rank`,`rank`],y=[t.strides[0],t.strides[1]],b=[t.kernelShape[a?1:2],t.kernelShape[a?2:3]],x=[t.dilations[0],t.dilations[1]],S=[b[0]+(t.dilations[0]<=1?0:(t.kernelShape[a?1:2]-1)*(t.dilations[0]-1)),b[1]+(t.dilations[1]<=1?0:(t.kernelShape[a?2:3]-1)*(t.dilations[1]-1))],C=[S[0]-1-Math.floor((t.pads[0]+t.pads[2])/2),S[1]-1-Math.floor((t.pads[1]+t.pads[3])/2)],w=[{type:12,data:g},{type:12,data:y},{type:12,data:b},{type:12,data:x},{type:12,data:S},{type:6,data:C},{type:12,data:f},{type:12,data:c},{type:12,data:l},...G(e[0].dims,e[1].dims)];r&&(w.push(...G(e[2].dims)),v.push(`rank`)),w.push(...G(i));let T=t=>{let n=[{name:`output_size`,type:`u32`},{name:`strides`,type:`u32`,length:y.length},{name:`filter_dims`,type:`u32`,length:b.length},{name:`dilations`,type:`u32`,length:b.length},{name:`effective_filter_dims`,type:`u32`,length:S.length},{name:`pads`,type:`i32`,length:C.length},{name:`input_channels_per_group_int`,type:`u32`},{name:`input_channels_per_group`,type:`u32`},{name:`output_channels_per_group`,type:`u32`}],o=$n(e[0].dataType),s=a?1:2,c=a?2:3,l=a?3:1,f=q(`W`,e[1].dataType,e[1].dims.length,h),g=q(`Dy`,e[0].dataType,e[0].dims.length,u),_=[g,f];r&&_.push(q(`bias`,e[2].dataType,[i[l]].length,m));let v=J(`result`,e[0].dataType,i.length,m),x=()=>{let e=``;if(d)u===4?e+=` + }`};return{name:`GroupedConv-Vectorize`,shaderCache:{hint:`${t.cacheKey};${a};${o};${f};${l[0]};${l[1]}`,inputDependencies:i?[`rank`,`rank`,`type`]:[`rank`,`rank`]},getRunData:()=>({outputs:[{dims:r?r(n):n,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(s/64)},programUniforms:d}),getShaderSource:p}}}),Lo,Ro,zo,Bo,Vo,Ho,Uo,Wo,Go,Ko=M(()=>{"use strict";G(),wo(),No(),xo(),Io(),ro(),fo(),_r(),Lo=(e,t,n,r,i,a)=>{let o=e[0],s=e.slice(a?1:2,a?3:4),c=s.length,l=t[0],u=t.slice(2).map((e,t)=>e+(e-1)*(n[t]-1)),d=s.map((e,t)=>e+r[t]+r[t+c]).map((e,t)=>Math.floor((e-u[t]+i[t])/i[t]));return d.splice(0,0,o),d.splice(a?3:1,0,l),d},Ro=[2,3,1,0],zo=(e,t)=>{if(!e||e.length!==2&&e.length!==3)throw Error(`Conv requires 2 or 3 inputs`);if(e[0].dims.length>5)throw Error(`greater than 5D is not supported`);if(e[0].dims.length!==e[1].dims.length)throw Error(`filter does not have same dimension as input`);let n=e[0].dims[t.format===`NHWC`?e[0].dims.length-1:1],r=e[1].dims[1]*t.group;if(n!==r)throw Error(`FILTER_IN_CHANNEL should be equal to DATA_CHANNEL`);if(e.length===3&&(e[2].dims.length!==1||e[1].dims[0]!==e[2].dims[0]))throw Error(`invalid bias`);let i=e[0].dims.length-2;if(t.dilations.length!==i)throw Error(`dilations should be ${i}D`);if(t.strides.length!==i)throw Error(`strides should be ${i}D`);if(t.pads.length!==i*2)throw Error(`pads should be ${i*2}D`);if(t.kernelShape.length!==0&&t.kernelShape.length!==e[1].dims.length-2)throw Error(`invalid kernel shape`)},Bo=(e,t)=>{let n=e.kernelShape.slice();n.length{let t=no(e),n=e.format,r=[`NOTSET`,`VALID`,`SAME_UPPER`,`SAME_LOWER`][e.auto_pad],i=e.dilations,a=e.group,o=e.kernel_shape,s=e.pads,c=e.strides,l=e.w_is_const();return{autoPad:r,format:n,dilations:i,group:a,kernelShape:o,pads:s,strides:c,wIsConst:l,...t,cacheKey:`${e.format};${t.activation};`}},Ho=(e,t,n,r)=>{let i=n.format===`NHWC`,a=Lo(t[0].dims,t[1].dims,n.dilations,n.pads,n.strides,i);if(n.group!==1){let o=[t[0]];if(i){let r=e.kernelCustomData.wT??e.compute(mr(t[1],Ro),{inputs:[1],outputs:[n.wIsConst?-2:-1]})[0];n.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=r),o.push(r)}else o.push(t[1]);t.length===3&&o.push(t[2]),!e.adapterInfo.isArchitecture(`ampere`)&&i&&t[1].dims[0]===n.group&&t[1].dims[1]===1&&n.dilations[0]===1&&n.dilations[1]===1?e.compute(Fo(o,n,a,r),{inputs:o}):e.compute(Po(o,n,a,r),{inputs:o});return}let o=t.length===3,s=t[0].dims[i?1:2],c=t[0].dims[i?2:3],l=t[0].dims[i?3:1],u=t[1].dims[2],d=t[1].dims[3],f=a[i?1:2],p=a[i?2:3],m=a[i?3:1],h=i&&u===s&&d===c&&n.pads[0]===0&&n.pads[1]===0;if(h||u===1&&d===1&&n.dilations[0]===1&&n.dilations[1]===1&&n.strides[0]===1&&n.strides[1]===1&&n.pads[0]===0&&n.pads[1]===0){let u=a[0],d,g,_,v=[];if(i){let r=e.kernelCustomData.wT??e.compute(mr(t[1],Ro),{inputs:[1],outputs:[n.wIsConst?-2:-1]})[0];if(n.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=r),h){let e=s*c*l;d=t[0].reshape([1,u,e]),g=r.reshape([1,e,m]),_=[1,u,m]}else d=t[0].reshape([u,s*c,l]),g=r.reshape([1,l,m]),_=[u,f*p,m];v.push(d),v.push(g)}else d=t[0].reshape([u,l,s*c]),g=t[1].reshape([1,m,l]),_=[u,m,f*p],v.push(g),v.push(d);o&&v.push(t[2]);let y=_[2],b=v[0].dims[v[0].dims.length-1];y<8&&b<8?e.compute(uo(v,n,a,_,i,r),{inputs:v}):e.compute(bo(v,n,a,_,i,r),{inputs:v});return}let g=!0,_=e.kernelCustomData.wT??e.compute(mr(t[1],Ro),{inputs:[1],outputs:[n.wIsConst?-2:-1]})[0];n.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=_);let v=[t[0],_];o&&v.push(t[2]);let y=i?f*p:m,b=i?m:f*p,x=u*d*l;e.compute(Co(v,n,a,y,b,x,o,g,r),{inputs:v})},Uo=(e,t)=>{let n=t.format===`NHWC`,r=[e.inputs[0].reshape(n?[e.inputs[0].dims[0],1,e.inputs[0].dims[1],e.inputs[0].dims[2]]:[e.inputs[0].dims[0],e.inputs[0].dims[1],1,e.inputs[0].dims[2]]),e.inputs[1].reshape([e.inputs[1].dims[0],e.inputs[1].dims[1],1,e.inputs[1].dims[2]])];e.inputs.length===3&&r.push(e.inputs[2]);let i=[0,t.pads[0],0,t.pads[1]],a=[1].concat(t.strides),o=[1].concat(t.dilations),s=[1].concat(t.kernelShape),c=Bo({...t,pads:i,strides:a,dilations:o,kernelShape:s},r);Ho(e,r,c,e=>n?[e[0],e[2],e[3]]:[e[0],e[1],e[3]])},Wo=(e,t,n)=>{let r=n.format===`NHWC`?`channelsLast`:`channelsFirst`,i=Bo(n,t),a=n.autoPad===`NOTSET`?n.pads:n.autoPad,o=jo(t[0].dims,t[1].dims,n.strides,n.dilations,a,!1,r);e.compute(Mo(t,i,o.outShape,[o.filterDepth,o.filterHeight,o.filterWidth],[o.padInfo.front,o.padInfo.top,o.padInfo.left],r))},Go=(e,t)=>{if(zo(e.inputs,t),e.inputs[0].dims.length===3)Uo(e,t);else if(e.inputs[0].dims.length===5)Wo(e,e.inputs,t);else{let n=Bo(t,e.inputs);Ho(e,e.inputs,n)}}}),qo,Jo=M(()=>{"use strict";U(),fn(),G(),X(),qo=(e,t,n)=>{let r=e.length>2,i=t.outputShape,a=t.format===`NHWC`,o=t.group,s=e[1].dims,c=s[2]/o,l=s[3],u=a?er(c):1,d=a&&l===1&&c>=4,f=d?Math.floor(c/4)*4:Math.floor(c/u)*u,p=c-f,m=a?er(l):1,h=a?l===1?u:m:1,g=W.size(i)/m,_=[Math.ceil(g/64),1,1];dn(`verbose`,()=>`[conv2d_backprop_webgpu] dispatch = ${_}`);let v=[`rank`,`rank`],y=[t.strides[0],t.strides[1]],b=[t.kernelShape[a?1:2],t.kernelShape[a?2:3]],x=[t.dilations[0],t.dilations[1]],S=[b[0]+(t.dilations[0]<=1?0:(t.kernelShape[a?1:2]-1)*(t.dilations[0]-1)),b[1]+(t.dilations[1]<=1?0:(t.kernelShape[a?2:3]-1)*(t.dilations[1]-1))],C=[S[0]-1-Math.floor((t.pads[0]+t.pads[2])/2),S[1]-1-Math.floor((t.pads[1]+t.pads[3])/2)],w=[{type:12,data:g},{type:12,data:y},{type:12,data:b},{type:12,data:x},{type:12,data:S},{type:6,data:C},{type:12,data:f},{type:12,data:c},{type:12,data:l},...K(e[0].dims,e[1].dims)];r&&(w.push(...K(e[2].dims)),v.push(`rank`)),w.push(...K(i));let T=t=>{let n=[{name:`output_size`,type:`u32`},{name:`strides`,type:`u32`,length:y.length},{name:`filter_dims`,type:`u32`,length:b.length},{name:`dilations`,type:`u32`,length:b.length},{name:`effective_filter_dims`,type:`u32`,length:S.length},{name:`pads`,type:`i32`,length:C.length},{name:`input_channels_per_group_int`,type:`u32`},{name:`input_channels_per_group`,type:`u32`},{name:`output_channels_per_group`,type:`u32`}],o=Qn(e[0].dataType),s=a?1:2,c=a?2:3,l=a?3:1,f=J(`W`,e[1].dataType,e[1].dims.length,h),g=J(`Dy`,e[0].dataType,e[0].dims.length,u),_=[g,f];r&&_.push(J(`bias`,e[2].dataType,[i[l]].length,m));let v=Y(`result`,e[0].dataType,i.length,m),x=()=>{let e=``;if(d)u===4?e+=` let xValue = ${g.getByOffset(`x_offset`)}; let wValue = ${f.getByOffset(`w_offset`)}; dotProd = dotProd + dot(xValue, wValue); @@ -1299,7 +1299,7 @@ fn main(@builtin(local_invocation_id) localId : vec3, ${t.registerUniforms(n).declareVariables(..._,v)} ${t.mainStart()} ${t.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)}; - ${T}}`};return{name:`ConvTranspose2D`,shaderCache:{hint:`${t.cacheKey};${u}${h}${m}${d}${p}`,inputDependencies:v},getRunData:()=>({dispatchGroup:{x:_[0],y:_[1],z:_[2]},outputs:[{dims:n?n(i):i,dataType:e[0].dataType}],programUniforms:w}),getShaderSource:T}}}),Xo,Zo,Qo,$o,es,ts,ns,rs,os,ss=M(()=>{"use strict";Yo(),io(),vr(),Xo=(e,t,n,r,i,a)=>(e-1)*t+n+(r-1)*i+1-a,Zo=(e,t,n,r,i)=>{let a=Math.floor(e/2);t===`SAME_UPPER`?(n[r]=a,n[i]=e-a):t===`SAME_LOWER`&&(n[r]=e-a,n[i]=a)},Qo=(e,t,n,r,i,a,o,s,c,l)=>{let u=e.length-2,d=l.length===0;c.length{let n=e.kernelShape.slice();if(e.kernelShape.length===0||e.kernelShape.reduce((e,t)=>e*t,1)===0){n.length=0;for(let e=2;ee+t,0)===0){let e=t[0].dims.length-2;c=Array(e).fill(1)}let l=e.strides.slice();if(l.reduce((e,t)=>e+t,0)===0){let e=t[0].dims.length-2;l=Array(e).fill(1)}Qo(s,n,c,e.autoPad,e.group,i,l,r,o,a);let u=Object.assign({},e);return Object.assign(u,{kernelShape:n,pads:i,outputPadding:o,outputShape:a,dilations:c,strides:l}),u},es=e=>{let t=ro(e),n=e.format,r=[`NOTSET`,`VALID`,`SAME_UPPER`,`SAME_LOWER`][typeof e.autoPad>`u`?0:e.autoPad],i=e.dilations,a=e.group,o=e.kernelShape,s=e.pads,c=e.strides,l=e.wIsConst(),u=e.outputPadding,d=e.outputShape;return{autoPad:r,format:n,dilations:i,group:a,kernelShape:o,outputPadding:u,outputShape:d,pads:s,strides:c,wIsConst:l,...t,cacheKey:`${e.format};${t.activation};`}},ts=(e,t)=>{if(!e||e.length!==2&&e.length!==3)throw Error(`Conv requires 2 or 3 inputs`);if(e[0].dims.length!==4&&e[0].dims.length!==3)throw Error(`currently only support 2-dimensional conv`);if(e[0].dims.length!==e[1].dims.length)throw Error(`filter does not have same dimension as input`);let n=e[0].dims[t.format===`NHWC`?e[0].dims.length-1:1],r=e[1].dims[0];if(n!==r)throw Error(`FILTER_IN_CHANNEL should be equal to DATA_CHANNEL`);let i=e[1].dims[1]*t.group;if(e.length===3&&(e[2].dims.length!==1||e[2].dims[0]!==i))throw Error(`invalid bias`);let a=e[0].dims.length-2;if(t.dilations.reduce((e,t)=>e+t,0)>0&&t.dilations.length!==a)throw Error(`dilations should be ${a}D`);if(t.strides.reduce((e,t)=>e+t,0)>0&&t.strides.length!==a)throw Error(`strides should be ${a}D`);if(t.pads.reduce((e,t)=>e+t,0)>0&&t.pads.length!==a*2)throw Error(`pads should be ${a*2}D`);if(t.outputPadding.length!==a&&t.outputPadding.length!==0)throw Error(`output_padding should be ${a}D`);if(t.kernelShape.reduce((e,t)=>e+t,0)>0&&t.kernelShape.length!==0&&t.kernelShape.length!==e[1].dims.length-2)throw Error(`invalid kernel shape`);if(t.outputShape.length!==0&&t.outputShape.length!==e[0].dims.length-2)throw Error(`invalid output shape`)},ns=(e,t,n,r)=>{let i=e.kernelCustomData.wT??e.compute(hr(t[1],[2,3,0,1]),{inputs:[1],outputs:[n.wIsConst?-2:-1]})[0];n.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=i);let a=[t[0],i];t.length===3&&a.push(t[2]),e.compute(Jo(a,n,r),{inputs:a})},rs=(e,t)=>{let n=t.format===`NHWC`,r=[e.inputs[0].reshape(n?[e.inputs[0].dims[0],1,e.inputs[0].dims[1],e.inputs[0].dims[2]]:[e.inputs[0].dims[0],e.inputs[0].dims[1],1,e.inputs[0].dims[2]]),e.inputs[1].reshape([e.inputs[1].dims[0],e.inputs[1].dims[1],1,e.inputs[1].dims[2]])];e.inputs.length===3&&r.push(e.inputs[2]);let i=t.kernelShape;(i.length===0||i[0]===0)&&(i=[e.inputs[1].dims[2]]);let a=t.dilations;(a.length===0||a[0]===0)&&(a=[1]);let o=t.strides;(o.length===0||o[0]===0)&&(o=[1]);let s=t.pads;s.length===0&&(s=[0,0]),s=[0,s[0],0,s[1]],o=[1].concat(o),a=[1].concat(a),i=[1].concat(i);let c=t.outputPadding;c=[0].concat(c);let l=$o({...t,pads:s,strides:o,dilations:a,kernelShape:i,outputPadding:c},r);ns(e,r,l,e=>n?[e[0],e[2],e[3]]:[e[0],e[1],e[3]])},os=(e,t)=>{if(ts(e.inputs,t),e.inputs[0].dims.length===3)rs(e,t);else{let n=$o(t,e.inputs);ns(e,e.inputs,n)}}}),cs,ls,us,ds=M(()=>{"use strict";V(),W(),Xn(),Y(),cs=(e,t,n,r)=>{let i=U.size(t),a=t.length,o=q(`input`,e,a),s=J(`output`,e,a),c=n.dataType===6?n.getInt32Array()[0]:Number(n.getBigInt64Array()[0]),l=U.normalizeAxis(c,a),u=e=>{let t=` i32(${o.indicesGet(`inputIndices`,`uniforms.axis`)}) `,n=K(`uniforms.input_shape`,`uniforms.axis`,a),i=r.reverse?t+(r.exclusive?` + 1`:``):`0`,c=r.reverse?n:t+(r.exclusive?``:` + 1`);return` + ${T}}`};return{name:`ConvTranspose2D`,shaderCache:{hint:`${t.cacheKey};${u}${h}${m}${d}${p}`,inputDependencies:v},getRunData:()=>({dispatchGroup:{x:_[0],y:_[1],z:_[2]},outputs:[{dims:n?n(i):i,dataType:e[0].dataType}],programUniforms:w}),getShaderSource:T}}}),Yo,Xo,Zo,Qo,$o,es,ts,ns,rs,os=M(()=>{"use strict";Jo(),ro(),_r(),Yo=(e,t,n,r,i,a)=>(e-1)*t+n+(r-1)*i+1-a,Xo=(e,t,n,r,i)=>{let a=Math.floor(e/2);t===`SAME_UPPER`?(n[r]=a,n[i]=e-a):t===`SAME_LOWER`&&(n[r]=e-a,n[i]=a)},Zo=(e,t,n,r,i,a,o,s,c,l)=>{let u=e.length-2,d=l.length===0;c.length{let n=e.kernelShape.slice();if(e.kernelShape.length===0||e.kernelShape.reduce((e,t)=>e*t,1)===0){n.length=0;for(let e=2;ee+t,0)===0){let e=t[0].dims.length-2;c=Array(e).fill(1)}let l=e.strides.slice();if(l.reduce((e,t)=>e+t,0)===0){let e=t[0].dims.length-2;l=Array(e).fill(1)}Zo(s,n,c,e.autoPad,e.group,i,l,r,o,a);let u=Object.assign({},e);return Object.assign(u,{kernelShape:n,pads:i,outputPadding:o,outputShape:a,dilations:c,strides:l}),u},$o=e=>{let t=no(e),n=e.format,r=[`NOTSET`,`VALID`,`SAME_UPPER`,`SAME_LOWER`][typeof e.autoPad>`u`?0:e.autoPad],i=e.dilations,a=e.group,o=e.kernelShape,s=e.pads,c=e.strides,l=e.wIsConst(),u=e.outputPadding,d=e.outputShape;return{autoPad:r,format:n,dilations:i,group:a,kernelShape:o,outputPadding:u,outputShape:d,pads:s,strides:c,wIsConst:l,...t,cacheKey:`${e.format};${t.activation};`}},es=(e,t)=>{if(!e||e.length!==2&&e.length!==3)throw Error(`Conv requires 2 or 3 inputs`);if(e[0].dims.length!==4&&e[0].dims.length!==3)throw Error(`currently only support 2-dimensional conv`);if(e[0].dims.length!==e[1].dims.length)throw Error(`filter does not have same dimension as input`);let n=e[0].dims[t.format===`NHWC`?e[0].dims.length-1:1],r=e[1].dims[0];if(n!==r)throw Error(`FILTER_IN_CHANNEL should be equal to DATA_CHANNEL`);let i=e[1].dims[1]*t.group;if(e.length===3&&(e[2].dims.length!==1||e[2].dims[0]!==i))throw Error(`invalid bias`);let a=e[0].dims.length-2;if(t.dilations.reduce((e,t)=>e+t,0)>0&&t.dilations.length!==a)throw Error(`dilations should be ${a}D`);if(t.strides.reduce((e,t)=>e+t,0)>0&&t.strides.length!==a)throw Error(`strides should be ${a}D`);if(t.pads.reduce((e,t)=>e+t,0)>0&&t.pads.length!==a*2)throw Error(`pads should be ${a*2}D`);if(t.outputPadding.length!==a&&t.outputPadding.length!==0)throw Error(`output_padding should be ${a}D`);if(t.kernelShape.reduce((e,t)=>e+t,0)>0&&t.kernelShape.length!==0&&t.kernelShape.length!==e[1].dims.length-2)throw Error(`invalid kernel shape`);if(t.outputShape.length!==0&&t.outputShape.length!==e[0].dims.length-2)throw Error(`invalid output shape`)},ts=(e,t,n,r)=>{let i=e.kernelCustomData.wT??e.compute(mr(t[1],[2,3,0,1]),{inputs:[1],outputs:[n.wIsConst?-2:-1]})[0];n.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=i);let a=[t[0],i];t.length===3&&a.push(t[2]),e.compute(qo(a,n,r),{inputs:a})},ns=(e,t)=>{let n=t.format===`NHWC`,r=[e.inputs[0].reshape(n?[e.inputs[0].dims[0],1,e.inputs[0].dims[1],e.inputs[0].dims[2]]:[e.inputs[0].dims[0],e.inputs[0].dims[1],1,e.inputs[0].dims[2]]),e.inputs[1].reshape([e.inputs[1].dims[0],e.inputs[1].dims[1],1,e.inputs[1].dims[2]])];e.inputs.length===3&&r.push(e.inputs[2]);let i=t.kernelShape;(i.length===0||i[0]===0)&&(i=[e.inputs[1].dims[2]]);let a=t.dilations;(a.length===0||a[0]===0)&&(a=[1]);let o=t.strides;(o.length===0||o[0]===0)&&(o=[1]);let s=t.pads;s.length===0&&(s=[0,0]),s=[0,s[0],0,s[1]],o=[1].concat(o),a=[1].concat(a),i=[1].concat(i);let c=t.outputPadding;c=[0].concat(c);let l=Qo({...t,pads:s,strides:o,dilations:a,kernelShape:i,outputPadding:c},r);ts(e,r,l,e=>n?[e[0],e[2],e[3]]:[e[0],e[1],e[3]])},rs=(e,t)=>{if(es(e.inputs,t),e.inputs[0].dims.length===3)ns(e,t);else{let n=Qo(t,e.inputs);ts(e,e.inputs,n)}}}),ss,cs,ls,us=M(()=>{"use strict";U(),G(),Yn(),X(),ss=(e,t,n,r)=>{let i=W.size(t),a=t.length,o=J(`input`,e,a),s=Y(`output`,e,a),c=n.dataType===6?n.getInt32Array()[0]:Number(n.getBigInt64Array()[0]),l=W.normalizeAxis(c,a),u=e=>{let t=` i32(${o.indicesGet(`inputIndices`,`uniforms.axis`)}) `,n=q(`uniforms.input_shape`,`uniforms.axis`,a),i=r.reverse?t+(r.exclusive?` + 1`:``):`0`,c=r.reverse?n:t+(r.exclusive?``:` + 1`);return` ${e.registerUniform(`outputSize`,`u32`).registerUniform(`axis`,`u32`).declareVariables(o,s)} ${e.mainStart()} ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.outputSize`)} @@ -1312,12 +1312,12 @@ fn main(@builtin(local_invocation_id) localId : vec3, sum = sum + ${o.getByIndices(`inputIndices`)}; } ${s.setByOffset(`global_idx`,`sum`)}; - }`};return{name:`CumSum`,shaderCache:{hint:r.cacheKey,inputDependencies:[`rank`]},getRunData:()=>({outputs:[{dims:t,dataType:e}],dispatchGroup:{x:Math.ceil(i/64)},programUniforms:[{type:12,data:i},{type:12,data:l},...G(t,t)]}),getShaderSource:u}},ls=(e,t)=>{let n=e.inputs[0].dims,r=e.inputs[0].dataType,i=e.inputs[1];e.compute(cs(r,n,i,t),{inputs:[0]})},us=e=>{let t=e.exclusive===1,n=e.reverse===1;return Yn({exclusive:t,reverse:n})}}),fs,ps,ms,hs,gs,_s=M(()=>{"use strict";V(),W(),Xn(),Y(),fs=e=>{if(!e||e.length!==1)throw Error(`DepthToSpace requires 1 input.`);if(e[0].dims.length!==4)throw Error(`DepthToSpace requires 4D input.`)},ps=(e,t,n,r)=>{let i=[];i.push(`fn perm(i: ${r.type.indices}) -> ${n.type.indices} { + }`};return{name:`CumSum`,shaderCache:{hint:r.cacheKey,inputDependencies:[`rank`]},getRunData:()=>({outputs:[{dims:t,dataType:e}],dispatchGroup:{x:Math.ceil(i/64)},programUniforms:[{type:12,data:i},{type:12,data:l},...K(t,t)]}),getShaderSource:u}},cs=(e,t)=>{let n=e.inputs[0].dims,r=e.inputs[0].dataType,i=e.inputs[1];e.compute(ss(r,n,i,t),{inputs:[0]})},ls=e=>{let t=e.exclusive===1,n=e.reverse===1;return Jn({exclusive:t,reverse:n})}}),ds,fs,ps,ms,hs,gs=M(()=>{"use strict";U(),G(),Yn(),X(),ds=e=>{if(!e||e.length!==1)throw Error(`DepthToSpace requires 1 input.`);if(e[0].dims.length!==4)throw Error(`DepthToSpace requires 4D input.`)},fs=(e,t,n,r)=>{let i=[];i.push(`fn perm(i: ${r.type.indices}) -> ${n.type.indices} { var a: ${n.type.indices};`);for(let r=0;r{let n,r,i,a,o,s,c=t.format===`NHWC`,l=t.blocksize,u=t.mode===`DCR`;c?([n,r,i,a]=e.dims,o=u?[n,r,i,l,l,a/l**2]:[n,r,i,a/l**2,l,l],s=u?[0,1,3,2,4,5]:[0,1,4,2,5,3]):([n,r,i,a]=[e.dims[0],e.dims[2],e.dims[3],e.dims[1]],o=u?[n,l,l,a/l**2,r,i]:[n,a/l**2,l,l,r,i],s=u?[0,3,4,1,5,2]:[0,1,4,2,5,3]);let d=e.reshape(o),f=d.dims.length,p=e.dataType,m=q(`a`,p,f),h=J(`output`,p,f),g=e=>` +`)},ps=(e,t)=>{let n,r,i,a,o,s,c=t.format===`NHWC`,l=t.blocksize,u=t.mode===`DCR`;c?([n,r,i,a]=e.dims,o=u?[n,r,i,l,l,a/l**2]:[n,r,i,a/l**2,l,l],s=u?[0,1,3,2,4,5]:[0,1,4,2,5,3]):([n,r,i,a]=[e.dims[0],e.dims[2],e.dims[3],e.dims[1]],o=u?[n,l,l,a/l**2,r,i]:[n,a/l**2,l,l,r,i],s=u?[0,3,4,1,5,2]:[0,1,4,2,5,3]);let d=e.reshape(o),f=d.dims.length,p=e.dataType,m=J(`a`,p,f),h=Y(`output`,p,f),g=e=>` ${e.registerUniform(`output_size`,`u32`).declareVariables(m,h)} - ${ps(s,f,m,h)} + ${fs(s,f,m,h)} ${e.mainStart()} ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} @@ -1326,8 +1326,8 @@ fn main(@builtin(local_invocation_id) localId : vec3, let aIndices = perm(indices); ${h.setByOffset(`global_idx`,m.getByIndices(`aIndices`))} - }`;return{name:`DepthToSpace`,shaderCache:{hint:`${e.dims};${t.blocksize};${t.mode}`,inputDependencies:[`rank`]},getRunData:e=>{let t=c?[n,r*l,i*l,a/l**2]:[n,a/l**2,r*l,i*l],o=U.size(t),u=d.dims,f=U.sortBasedOnPerm(u,s);return{outputs:[{dims:t,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(o/64)},programUniforms:[{type:12,data:o},...G(u,f)]}},getShaderSource:g}},hs=(e,t)=>{fs(e.inputs),e.compute(ms(e.inputs[0],t))},gs=e=>Yn({blocksize:e.blocksize,mode:e.mode,format:e.format})}),vs,ys,bs,xs,Ss,Cs,ws,Ts,Es,Ds,Os,ks=M(()=>{"use strict";V(),W(),Xn(),Y(),vs=`[a-zA-Z]|\\.\\.\\.`,ys=`(`+vs+`)+`,bs=`^`+ys+`$`,xs=`(`+ys+`,)*`+ys,Ss=`^`+xs+`$`,Cs=class{constructor(e=-1){this.symbolToIndices=new Map,this.inputIndex=e}addSymbol(e,t){let n=this.symbolToIndices.get(e);n===void 0?n=[t]:n.push(t),this.symbolToIndices.set(e,n)}},ws=class{constructor(e,t){this.equation=t,this.hasEllipsis=!1,this.symbolToInfo=new Map,this.lhs=[],this.outputDims=[];let[n,r]=t.includes(`->`)?t.split(`->`,2):[t,``];if(!n.match(RegExp(Ss)))throw Error(`Invalid LHS term`);if(n.split(`,`).forEach((t,n)=>{let r=e[n].dims.slice();if(!t.match(RegExp(bs)))throw Error(`Invalid LHS term`);let i=this.processTerm(t,!0,r,n);this.lhs.push(i)}),r===``)r+=[...this.symbolToInfo.entries()].filter(([e,t])=>t.count===1||e===`...`).map(([e])=>e).join(``);else if(!r.match(RegExp(ys)))throw Error(`Invalid RHS`);r.match(RegExp(vs,`g`))?.forEach(e=>{if(e===`...`)this.outputDims=this.outputDims.concat(this.ellipsisDims);else{let t=this.symbolToInfo.get(e);if(t===void 0)throw Error(`Invalid RHS symbol`);this.outputDims.push(t.dimValue)}}),this.rhs=this.processTerm(r,!1,this.outputDims)}addSymbol(e,t,n){let r=this.symbolToInfo.get(e);if(r!==void 0){if(r.dimValue!==t&&r.count!==1)throw Error(`Dimension mismatch`);r.count++,r.inputIndices.push(n)}else r={count:1,dimValue:t,inputIndices:[n]};this.symbolToInfo.set(e,r)}processTerm(e,t,n,r=-1){let i=n.length,a=!1,o=[],s=0;if(!e.match(RegExp(bs))&&!t&&e!==``)throw Error(`Invalid LHS term`);let c=e.match(RegExp(vs,`g`)),l=new Cs(r);return c?.forEach((e,u)=>{if(e===`...`){if(a)throw Error(`Only one ellipsis is allowed per input term`);a=!0;let e=i-c.length+1;if(e<0)throw Error(`Ellipsis out of bounds`);if(o=n.slice(s,s+e),this.hasEllipsis){if(this.ellipsisDims.length!==o.length||this.ellipsisDims.toString()!==o.toString())throw Error(`Ellipsis dimensions mismatch`)}else if(t)this.hasEllipsis=!0,this.ellipsisDims=o;else throw Error(`Ellipsis must be specified in the LHS`);for(let e=0;ee+`_max`,Es=(e,t,n,r)=>{let i=e.map(e=>e.length).map((e,n)=>q(`input${n}`,t,e)),a=U.size(r),o=J(`output`,t,r.length),s=[...n.symbolToInfo.keys()].filter(e=>!n.rhs.symbolToIndices.has(e)),c=e=>{let t=[],r=`var prod = 1.0;`,a=`var sum = 0.0;`,c=`sum += prod;`,l=[],u=[],d=[],f=[],p=n.symbolToInfo.size===n.rhs.symbolToIndices.size;n.symbolToInfo.forEach((e,r)=>{if(n.rhs.symbolToIndices.has(r)){let a=n.rhs.symbolToIndices.get(r)?.[0];a!==void 0&&n.lhs.forEach((n,s)=>{if(e.inputIndices.includes(s)){let e=n.symbolToIndices.get(r);if(e===void 0)throw Error(`Invalid symbol error`);e.forEach(e=>{t.push(`${i[s].indicesSet(`input${s}Indices`,e,o.indicesGet(`outputIndices`,a))}`)})}})}else n.lhs.forEach((t,n)=>{if(e.inputIndices.includes(n)){let e=t.symbolToIndices.get(r);if(e===void 0)throw Error(`Invalid symbol error`);e.forEach(e=>{l.push(`${i[n].indicesSet(`input${n}Indices`,e,`${r}`)}`)}),f.push(`prod *= ${i[n].getByIndices(`input${n}Indices`)};`)}}),u.push(`for(var ${r}: u32 = 0; ${r} < uniforms.${Ts(r)}; ${r}++) {`),d.push(`}`)});let m=p?[...t,`let sum = ${i.map((e,t)=>e.getByIndices(`input${t}Indices`)).join(` * `)};`]:[...t,a,...u,...l,r,...f,c,...d];return` - ${e.registerUniforms(s.map(e=>({name:`${Ts(e)}`,type:`u32`}))).registerUniform(`outputSize`,`u32`).declareVariables(...i,o)} + }`;return{name:`DepthToSpace`,shaderCache:{hint:`${e.dims};${t.blocksize};${t.mode}`,inputDependencies:[`rank`]},getRunData:e=>{let t=c?[n,r*l,i*l,a/l**2]:[n,a/l**2,r*l,i*l],o=W.size(t),u=d.dims,f=W.sortBasedOnPerm(u,s);return{outputs:[{dims:t,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(o/64)},programUniforms:[{type:12,data:o},...K(u,f)]}},getShaderSource:g}},ms=(e,t)=>{ds(e.inputs),e.compute(ps(e.inputs[0],t))},hs=e=>Jn({blocksize:e.blocksize,mode:e.mode,format:e.format})}),_s,vs,ys,bs,xs,Ss,Cs,ws,Ts,Es,Ds,Os=M(()=>{"use strict";U(),G(),Yn(),X(),_s=`[a-zA-Z]|\\.\\.\\.`,vs=`(`+_s+`)+`,ys=`^`+vs+`$`,bs=`(`+vs+`,)*`+vs,xs=`^`+bs+`$`,Ss=class{constructor(e=-1){this.symbolToIndices=new Map,this.inputIndex=e}addSymbol(e,t){let n=this.symbolToIndices.get(e);n===void 0?n=[t]:n.push(t),this.symbolToIndices.set(e,n)}},Cs=class{constructor(e,t){this.equation=t,this.hasEllipsis=!1,this.symbolToInfo=new Map,this.lhs=[],this.outputDims=[];let[n,r]=t.includes(`->`)?t.split(`->`,2):[t,``];if(!n.match(RegExp(xs)))throw Error(`Invalid LHS term`);if(n.split(`,`).forEach((t,n)=>{let r=e[n].dims.slice();if(!t.match(RegExp(ys)))throw Error(`Invalid LHS term`);let i=this.processTerm(t,!0,r,n);this.lhs.push(i)}),r===``)r+=[...this.symbolToInfo.entries()].filter(([e,t])=>t.count===1||e===`...`).map(([e])=>e).join(``);else if(!r.match(RegExp(vs)))throw Error(`Invalid RHS`);r.match(RegExp(_s,`g`))?.forEach(e=>{if(e===`...`)this.outputDims=this.outputDims.concat(this.ellipsisDims);else{let t=this.symbolToInfo.get(e);if(t===void 0)throw Error(`Invalid RHS symbol`);this.outputDims.push(t.dimValue)}}),this.rhs=this.processTerm(r,!1,this.outputDims)}addSymbol(e,t,n){let r=this.symbolToInfo.get(e);if(r!==void 0){if(r.dimValue!==t&&r.count!==1)throw Error(`Dimension mismatch`);r.count++,r.inputIndices.push(n)}else r={count:1,dimValue:t,inputIndices:[n]};this.symbolToInfo.set(e,r)}processTerm(e,t,n,r=-1){let i=n.length,a=!1,o=[],s=0;if(!e.match(RegExp(ys))&&!t&&e!==``)throw Error(`Invalid LHS term`);let c=e.match(RegExp(_s,`g`)),l=new Ss(r);return c?.forEach((e,u)=>{if(e===`...`){if(a)throw Error(`Only one ellipsis is allowed per input term`);a=!0;let e=i-c.length+1;if(e<0)throw Error(`Ellipsis out of bounds`);if(o=n.slice(s,s+e),this.hasEllipsis){if(this.ellipsisDims.length!==o.length||this.ellipsisDims.toString()!==o.toString())throw Error(`Ellipsis dimensions mismatch`)}else if(t)this.hasEllipsis=!0,this.ellipsisDims=o;else throw Error(`Ellipsis must be specified in the LHS`);for(let e=0;ee+`_max`,Ts=(e,t,n,r)=>{let i=e.map(e=>e.length).map((e,n)=>J(`input${n}`,t,e)),a=W.size(r),o=Y(`output`,t,r.length),s=[...n.symbolToInfo.keys()].filter(e=>!n.rhs.symbolToIndices.has(e)),c=e=>{let t=[],r=`var prod = 1.0;`,a=`var sum = 0.0;`,c=`sum += prod;`,l=[],u=[],d=[],f=[],p=n.symbolToInfo.size===n.rhs.symbolToIndices.size;n.symbolToInfo.forEach((e,r)=>{if(n.rhs.symbolToIndices.has(r)){let a=n.rhs.symbolToIndices.get(r)?.[0];a!==void 0&&n.lhs.forEach((n,s)=>{if(e.inputIndices.includes(s)){let e=n.symbolToIndices.get(r);if(e===void 0)throw Error(`Invalid symbol error`);e.forEach(e=>{t.push(`${i[s].indicesSet(`input${s}Indices`,e,o.indicesGet(`outputIndices`,a))}`)})}})}else n.lhs.forEach((t,n)=>{if(e.inputIndices.includes(n)){let e=t.symbolToIndices.get(r);if(e===void 0)throw Error(`Invalid symbol error`);e.forEach(e=>{l.push(`${i[n].indicesSet(`input${n}Indices`,e,`${r}`)}`)}),f.push(`prod *= ${i[n].getByIndices(`input${n}Indices`)};`)}}),u.push(`for(var ${r}: u32 = 0; ${r} < uniforms.${ws(r)}; ${r}++) {`),d.push(`}`)});let m=p?[...t,`let sum = ${i.map((e,t)=>e.getByIndices(`input${t}Indices`)).join(` * `)};`]:[...t,a,...u,...l,r,...f,c,...d];return` + ${e.registerUniforms(s.map(e=>({name:`${ws(e)}`,type:`u32`}))).registerUniform(`outputSize`,`u32`).declareVariables(...i,o)} ${e.mainStart()} ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.outputSize`)} @@ -1337,7 +1337,7 @@ fn main(@builtin(local_invocation_id) localId : vec3, ${m.join(` `)}; ${o.setByOffset(`global_idx`,`sum`)}; - }`};return{name:`Einsum`,shaderCache:{hint:n.equation,inputDependencies:e.map(()=>`rank`)},getRunData:()=>{let i=s.filter(e=>n.symbolToInfo.has(e)).map(e=>({type:12,data:n.symbolToInfo.get(e)?.dimValue||0}));i.push({type:12,data:a});let o=e.map((e,t)=>[...G(e)]).reduce((e,t)=>e.concat(t),i);return o.push(...G(r)),{outputs:[{dims:r,dataType:t}],dispatchGroup:{x:Math.ceil(a/64)},programUniforms:o}},getShaderSource:c}},Ds=(e,t)=>{let n=new ws(e.inputs,t.equation),r=n.outputDims,i=e.inputs.map((e,t)=>e.dims);e.compute(Es(i,e.inputs[0].dataType,n,r))},Os=e=>{let t=e.equation.replace(/\s+/g,``);return Yn({equation:t})}}),As,js,Ms,Ns,Ps,Fs=M(()=>{"use strict";V(),W(),Y(),As=e=>{if(!e||e.length!==2)throw Error(`Expand requires 2 input.`);let t=e[0].dims,n=Array.from(e[1].getBigInt64Array(),Number),r=n.length{let n=e.length-t.length,r=[];for(let t=0;te.length>t.length?js(e,t):js(t,e),Ns=e=>{let t=e[0].dims,n=Array.from(e[1].getBigInt64Array(),Number),r=Ms(t,n),i=e[0].dataType,a=i===9||U.size(t)===1,o=i===9||t.length>0&&t[t.length-1]%4==0?4:1,s=a||r.length>0&&r[r.length-1]%4==0?4:1,c=Math.ceil(U.size(r)/s),l=e=>{let n=q(`input`,i,t.length,o),a=J(`output`,i,r.length,s),c;if(i===9){let e=(e,t,r=``)=>` + }`};return{name:`Einsum`,shaderCache:{hint:n.equation,inputDependencies:e.map(()=>`rank`)},getRunData:()=>{let i=s.filter(e=>n.symbolToInfo.has(e)).map(e=>({type:12,data:n.symbolToInfo.get(e)?.dimValue||0}));i.push({type:12,data:a});let o=e.map((e,t)=>[...K(e)]).reduce((e,t)=>e.concat(t),i);return o.push(...K(r)),{outputs:[{dims:r,dataType:t}],dispatchGroup:{x:Math.ceil(a/64)},programUniforms:o}},getShaderSource:c}},Es=(e,t)=>{let n=new Cs(e.inputs,t.equation),r=n.outputDims,i=e.inputs.map((e,t)=>e.dims);e.compute(Ts(i,e.inputs[0].dataType,n,r))},Ds=e=>{let t=e.equation.replace(/\s+/g,``);return Jn({equation:t})}}),ks,As,js,Ms,Ns,Ps=M(()=>{"use strict";U(),G(),X(),ks=e=>{if(!e||e.length!==2)throw Error(`Expand requires 2 input.`);let t=e[0].dims,n=Array.from(e[1].getBigInt64Array(),Number),r=n.length{let n=e.length-t.length,r=[];for(let t=0;te.length>t.length?As(e,t):As(t,e),Ms=e=>{let t=e[0].dims,n=Array.from(e[1].getBigInt64Array(),Number),r=js(t,n),i=e[0].dataType,a=i===9||W.size(t)===1,o=i===9||t.length>0&&t[t.length-1]%4==0?4:1,s=a||r.length>0&&r[r.length-1]%4==0?4:1,c=Math.ceil(W.size(r)/s),l=e=>{let n=J(`input`,i,t.length,o),a=Y(`output`,i,r.length,s),c;if(i===9){let e=(e,t,r=``)=>` let outputIndices${t} = ${a.offsetToIndices(`outputOffset + ${t}u`)}; let offset${t} = ${n.broadcastedIndicesToOffset(`outputIndices${t}`,a)}; let index${t} = offset${t} / 4u; @@ -1360,22 +1360,22 @@ fn main(@builtin(local_invocation_id) localId : vec3, ${e.registerUniform(`vec_size`,`u32`).declareVariables(n,a)} ${e.mainStart()} ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.vec_size`)} - ${c}`},u=[{type:12,data:c},...G(t,r)];return{name:`Expand`,shaderCache:{hint:`${r.length};${o}${s}`,inputDependencies:[`rank`]},getShaderSource:l,getRunData:()=>({outputs:[{dims:r,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(c/64)},programUniforms:u})}},Ps=e=>{As(e.inputs),e.compute(Ns(e.inputs),{inputs:[0]})}}),Is,Ls,Rs=M(()=>{"use strict";V(),W(),Y(),Oa(),Is=e=>{let t=e[0].dataType,n=U.size(e[0].dims),r=U.size(e[1].dims),i=r%4==0,a=e=>{let n=q(`x`,t,[1],4),r=q(`bias`,t,[1],4),a=J(`y`,t,[1],4),o=[{name:`output_vec_size`,type:`u32`},{name:`bias_size`,type:`u32`}],s=e=>` + ${c}`},u=[{type:12,data:c},...K(t,r)];return{name:`Expand`,shaderCache:{hint:`${r.length};${o}${s}`,inputDependencies:[`rank`]},getShaderSource:l,getRunData:()=>({outputs:[{dims:r,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(c/64)},programUniforms:u})}},Ns=e=>{ks(e.inputs),e.compute(Ms(e.inputs),{inputs:[0]})}}),Fs,Is,Ls=M(()=>{"use strict";U(),G(),X(),Da(),Fs=e=>{let t=e[0].dataType,n=W.size(e[0].dims),r=W.size(e[1].dims),i=r%4==0,a=e=>{let n=J(`x`,t,[1],4),r=J(`bias`,t,[1],4),a=Y(`y`,t,[1],4),o=[{name:`output_vec_size`,type:`u32`},{name:`bias_size`,type:`u32`}],s=e=>` let bias${e}_offset: u32 = (global_idx * 4 + ${e}) % uniforms.bias_size; let bias${e} = ${r.getByOffset(`bias${e}_offset / 4`)}[bias${e}_offset % 4];`,c=i?` let bias = ${r.getByOffset(`global_idx % (uniforms.bias_size / 4)`)};`:`${s(0)}${s(1)}${s(2)}${s(3)} let bias = ${n.type.value}(bias0, bias1, bias2, bias3);`;return`${e.registerUniforms(o).declareVariables(n,r,a)} - ${ba(er(t))} + ${ya($n(t))} - ${e.mainStart(Zn)} + ${e.mainStart(Xn)} ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_vec_size`)} let x = ${n.getByOffset(`global_idx`)}; ${c} let x_in = x + bias; - ${a.setByOffset(`global_idx`,xa(`x_in`))} - }`};return{name:`FastGeluWithBias`,shaderCache:{hint:`${i}`,inputDependencies:[`type`,`type`]},getShaderSource:a,getRunData:e=>({outputs:[{dims:e[0].dims,dataType:e[0].dataType}],programUniforms:[{type:12,data:Math.ceil(n/4)},{type:12,data:r}],dispatchGroup:{x:Math.ceil(n/Zn/4)}})}},Ls=e=>{e.inputs.length<2||U.size(e.inputs[1].dims)===0?Sa(e):e.compute(Is(e.inputs))}}),zs,Bs,Vs,Hs,Us=M(()=>{"use strict";V(),W(),Xn(),Y(),zs=e=>{if(!e||e.length!==2)throw Error(`Gather requires 2 inputs.`)},Bs=(e,t)=>{let n=e[0].dims,r=e[1].dims,i=n.length,a=U.normalizeAxis(t.axis,i),o=n.slice(0);o.splice(a,1,...r);let s=n[a],c=e[0].dataType===9?4:1,l=Math.ceil(U.size(o)/c),u=[{type:12,data:l},{type:6,data:s},{type:12,data:a},...G(e[0].dims,e[1].dims,o)],d=t=>{let n=q(`data`,e[0].dataType,e[0].dims.length,c),s=q(`inputIndices`,e[1].dataType,e[1].dims.length),l=J(`output`,e[0].dataType,o.length,c),u=e=>{let t=r.length,c=`var indicesIndices${e} = ${s.type.indices}(0);`;for(let n=0;n1?`indicesIndices${e}[${n}]`:`indicesIndices${e}`} = ${o.length>1?`outputIndices${e}[uniforms.axis + ${n}]`:`outputIndices${e}`};`;c+=` + ${a.setByOffset(`global_idx`,ba(`x_in`))} + }`};return{name:`FastGeluWithBias`,shaderCache:{hint:`${i}`,inputDependencies:[`type`,`type`]},getShaderSource:a,getRunData:e=>({outputs:[{dims:e[0].dims,dataType:e[0].dataType}],programUniforms:[{type:12,data:Math.ceil(n/4)},{type:12,data:r}],dispatchGroup:{x:Math.ceil(n/Xn/4)}})}},Is=e=>{e.inputs.length<2||W.size(e.inputs[1].dims)===0?xa(e):e.compute(Fs(e.inputs))}}),Rs,zs,Bs,Vs,Hs=M(()=>{"use strict";U(),G(),Yn(),X(),Rs=e=>{if(!e||e.length!==2)throw Error(`Gather requires 2 inputs.`)},zs=(e,t)=>{let n=e[0].dims,r=e[1].dims,i=n.length,a=W.normalizeAxis(t.axis,i),o=n.slice(0);o.splice(a,1,...r);let s=n[a],c=e[0].dataType===9?4:1,l=Math.ceil(W.size(o)/c),u=[{type:12,data:l},{type:6,data:s},{type:12,data:a},...K(e[0].dims,e[1].dims,o)],d=t=>{let n=J(`data`,e[0].dataType,e[0].dims.length,c),s=J(`inputIndices`,e[1].dataType,e[1].dims.length),l=Y(`output`,e[0].dataType,o.length,c),u=e=>{let t=r.length,c=`var indicesIndices${e} = ${s.type.indices}(0);`;for(let n=0;n1?`indicesIndices${e}[${n}]`:`indicesIndices${e}`} = ${o.length>1?`outputIndices${e}[uniforms.axis + ${n}]`:`outputIndices${e}`};`;c+=` var idx${e} = ${s.getByIndices(`indicesIndices${e}`)}; if (idx${e} < 0) { idx${e} = idx${e} + uniforms.axisDimLimit; @@ -1406,7 +1406,7 @@ fn main(@builtin(local_invocation_id) localId : vec3, ${t.mainStart()} ${t.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.outputSize`)} ${d} - }`};return{name:`Gather`,shaderCache:{hint:t.cacheKey,inputDependencies:[`rank`,`rank`]},getRunData:()=>({outputs:[{dims:o,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(l/64)},programUniforms:u}),getShaderSource:d}},Vs=e=>Yn({axis:e.axis}),Hs=(e,t)=>{let n=e.inputs;zs(n),e.compute(Bs(e.inputs,t))}}),Ws,Gs,Ks,qs=M(()=>{"use strict";V(),W(),Y(),Ws=(e,t,n,r,i,a,o,s,c)=>{let l=[{type:12,data:a},{type:12,data:r},{type:12,data:i},{type:12,data:n},{type:12,data:o},{type:12,data:s},{type:12,data:c}],u=[a];l.push(...G(t.dims,u));let d=e=>{let r=q(`indices_data`,t.dataType,t.dims.length),a=J(`input_slice_offsets_data`,12,1,1),o=[r,a],s=[{name:`output_size`,type:`u32`},{name:`batch_dims`,type:`u32`},{name:`input_dims`,type:`u32`,length:i.length},{name:`sizes_from_slice_dims_data`,type:`u32`,length:n.length},{name:`num_slices_per_batch`,type:`u32`},{name:`input_batch_stride`,type:`u32`},{name:`num_slice_dims`,type:`u32`}];return` + }`};return{name:`Gather`,shaderCache:{hint:t.cacheKey,inputDependencies:[`rank`,`rank`]},getRunData:()=>({outputs:[{dims:o,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(l/64)},programUniforms:u}),getShaderSource:d}},Bs=e=>Jn({axis:e.axis}),Vs=(e,t)=>{let n=e.inputs;Rs(n),e.compute(zs(e.inputs,t))}}),Us,Ws,Gs,Ks=M(()=>{"use strict";U(),G(),X(),Us=(e,t,n,r,i,a,o,s,c)=>{let l=[{type:12,data:a},{type:12,data:r},{type:12,data:i},{type:12,data:n},{type:12,data:o},{type:12,data:s},{type:12,data:c}],u=[a];l.push(...K(t.dims,u));let d=e=>{let r=J(`indices_data`,t.dataType,t.dims.length),a=Y(`input_slice_offsets_data`,12,1,1),o=[r,a],s=[{name:`output_size`,type:`u32`},{name:`batch_dims`,type:`u32`},{name:`input_dims`,type:`u32`,length:i.length},{name:`sizes_from_slice_dims_data`,type:`u32`,length:n.length},{name:`num_slices_per_batch`,type:`u32`},{name:`input_batch_stride`,type:`u32`},{name:`num_slice_dims`,type:`u32`}];return` ${e.registerUniforms(s).declareVariables(...o)} ${e.mainStart()} ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} @@ -1425,13 +1425,13 @@ fn main(@builtin(local_invocation_id) localId : vec3, } input_slice_offsets_data[global_idx] = base_offset + u32(relative_slice_offset); - }`};return e.compute({name:`computeSliceOffsets`,shaderCache:{hint:`${i.length}_${n.length}`,inputDependencies:[`rank`]},getRunData:()=>({outputs:[{dims:u,dataType:e.inputs[1].dataType}],dispatchGroup:{x:Math.ceil(a/64)},programUniforms:l}),getShaderSource:d},{inputs:[t],outputs:[-1]})[0]},Gs=(e,t)=>{let n=e.inputs,r=n[0].dims,i=n[0].dataType,a=n[1].dims,o=a[a.length-1],s=U.sizeToDimension(a,a.length-1),c=U.sizeFromDimension(r,t.batchDims+o),l=U.sizeToDimension(r,t.batchDims),u=U.sizeFromDimension(r,t.batchDims),d=s/l,f=Array(o),p=c;for(let e=0;er.length)throw Error(`last dimension of indices must not be larger than rank of input tensor`);let g=a.slice(0,-1).concat(r.slice(h)),_=U.size(g),v=[{type:12,data:_},{type:12,data:c},...G(n[0].dims,m.dims,g)],y=e=>{let t=q(`data`,n[0].dataType,n[0].dims.length),r=q(`slice_offsets`,12,m.dims.length),i=J(`output`,n[0].dataType,g.length);return` + }`};return e.compute({name:`computeSliceOffsets`,shaderCache:{hint:`${i.length}_${n.length}`,inputDependencies:[`rank`]},getRunData:()=>({outputs:[{dims:u,dataType:e.inputs[1].dataType}],dispatchGroup:{x:Math.ceil(a/64)},programUniforms:l}),getShaderSource:d},{inputs:[t],outputs:[-1]})[0]},Ws=(e,t)=>{let n=e.inputs,r=n[0].dims,i=n[0].dataType,a=n[1].dims,o=a[a.length-1],s=W.sizeToDimension(a,a.length-1),c=W.sizeFromDimension(r,t.batchDims+o),l=W.sizeToDimension(r,t.batchDims),u=W.sizeFromDimension(r,t.batchDims),d=s/l,f=Array(o),p=c;for(let e=0;er.length)throw Error(`last dimension of indices must not be larger than rank of input tensor`);let g=a.slice(0,-1).concat(r.slice(h)),_=W.size(g),v=[{type:12,data:_},{type:12,data:c},...K(n[0].dims,m.dims,g)],y=e=>{let t=J(`data`,n[0].dataType,n[0].dims.length),r=J(`slice_offsets`,12,m.dims.length),i=Y(`output`,n[0].dataType,g.length);return` ${e.registerUniform(`output_size`,`u32`).registerUniform(`slice_size`,`u32`).declareVariables(t,r,i)} ${e.mainStart()} ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} let slice_offset = slice_offsets[global_idx / uniforms.slice_size]; output[global_idx] = data[u32(slice_offset) + global_idx % uniforms.slice_size]; - }`};e.compute({name:`GatherND`,shaderCache:{hint:t.cacheKey,inputDependencies:[`rank`,`rank`]},getRunData:()=>({outputs:[{dims:g,dataType:i}],dispatchGroup:{x:Math.ceil(_/64)},programUniforms:v}),getShaderSource:y},{inputs:[n[0],m]})},Ks=e=>({batchDims:e.batch_dims,cacheKey:``})}),Js,Ys,Xs,Zs,Qs=M(()=>{"use strict";V(),W(),Xn(),Y(),Js=(e,t)=>{if(e.length<3||e.length>4)throw Error(`GatherBlockQuantized requires 3 or 4 inputs.`);let n=U.normalizeAxis(t.quantizeAxis,e[0].dims.length),r=t.blockSize,i=e[0],a=e[2],o=e.length===4?e[3]:void 0;if(a.dims.length!==i.dims.length||!i.dims.map((e,t)=>t===n?Math.ceil(e/r)===a.dims[t]:e===a.dims[t]).reduce((e,t)=>e&&t,!0))throw Error(`Scales must have the same rank as the input tensor and the dims should match except on gatherAxis.`);if(o){if(o.dataType!==i.dataType)throw Error(`Zero point must have the same data type as the input tensor.`);if(o.dims.length!==a.dims.length||!o.dims.map((e,t)=>e===a.dims[t]).reduce((e,t)=>e&&t,!0))throw Error(`Zero point must have the same rank as the input tensor and the dims should match except on quantizeAxis.`)}},Ys=(e,t)=>{let n=e[0].dims,r=e[1].dims,i=n.length,a=U.normalizeAxis(t.gatherAxis,i),o=U.normalizeAxis(t.quantizeAxis,i),s=n.slice(0);s.splice(a,1,...r);let c=U.size(s),l=e[2].dataType,u=e[0].dataType===22,d=[{type:12,data:c},{type:12,data:o},{type:12,data:a},{type:12,data:t.blockSize},...G(...e.map((e,t)=>e.dims),s)],f=t=>{let i=q(`data`,e[0].dataType,e[0].dims.length),o=q(`inputIndices`,e[1].dataType,e[1].dims.length),c=q(`scales`,e[2].dataType,e[2].dims.length),d=e.length>3?q(`zeroPoint`,e[3].dataType,e[3].dims.length):void 0,f=J(`output`,l,s.length),p=[i,o,c];d&&p.push(d);let m=[{name:`output_size`,type:`u32`},{name:`quantize_axis`,type:`u32`},{name:`gather_axis`,type:`u32`},{name:`block_size`,type:`u32`}];return` + }`};e.compute({name:`GatherND`,shaderCache:{hint:t.cacheKey,inputDependencies:[`rank`,`rank`]},getRunData:()=>({outputs:[{dims:g,dataType:i}],dispatchGroup:{x:Math.ceil(_/64)},programUniforms:v}),getShaderSource:y},{inputs:[n[0],m]})},Gs=e=>({batchDims:e.batch_dims,cacheKey:``})}),qs,Js,Ys,Xs,Zs=M(()=>{"use strict";U(),G(),Yn(),X(),qs=(e,t)=>{if(e.length<3||e.length>4)throw Error(`GatherBlockQuantized requires 3 or 4 inputs.`);let n=W.normalizeAxis(t.quantizeAxis,e[0].dims.length),r=t.blockSize,i=e[0],a=e[2],o=e.length===4?e[3]:void 0;if(a.dims.length!==i.dims.length||!i.dims.map((e,t)=>t===n?Math.ceil(e/r)===a.dims[t]:e===a.dims[t]).reduce((e,t)=>e&&t,!0))throw Error(`Scales must have the same rank as the input tensor and the dims should match except on gatherAxis.`);if(o){if(o.dataType!==i.dataType)throw Error(`Zero point must have the same data type as the input tensor.`);if(o.dims.length!==a.dims.length||!o.dims.map((e,t)=>e===a.dims[t]).reduce((e,t)=>e&&t,!0))throw Error(`Zero point must have the same rank as the input tensor and the dims should match except on quantizeAxis.`)}},Js=(e,t)=>{let n=e[0].dims,r=e[1].dims,i=n.length,a=W.normalizeAxis(t.gatherAxis,i),o=W.normalizeAxis(t.quantizeAxis,i),s=n.slice(0);s.splice(a,1,...r);let c=W.size(s),l=e[2].dataType,u=e[0].dataType===22,d=[{type:12,data:c},{type:12,data:o},{type:12,data:a},{type:12,data:t.blockSize},...K(...e.map((e,t)=>e.dims),s)],f=t=>{let i=J(`data`,e[0].dataType,e[0].dims.length),o=J(`inputIndices`,e[1].dataType,e[1].dims.length),c=J(`scales`,e[2].dataType,e[2].dims.length),d=e.length>3?J(`zeroPoint`,e[3].dataType,e[3].dims.length):void 0,f=Y(`output`,l,s.length),p=[i,o,c];d&&p.push(d);let m=[{name:`output_size`,type:`u32`},{name:`quantize_axis`,type:`u32`},{name:`gather_axis`,type:`u32`},{name:`block_size`,type:`u32`}];return` ${t.registerUniforms(m).declareVariables(...p,f)} ${t.mainStart()} let output_indices = ${f.offsetToIndices(`global_idx`)}; @@ -1474,10 +1474,10 @@ fn main(@builtin(local_invocation_id) localId : vec3, let packed_8bit_zero_points = (packed_4bit_zero_points >> (4 * (zero_point_index % 2))) & 0x0f0f0f0f; let zero_point_vec = ${u?`unpack4xI8`:`unpack4xU8`}(u32(packed_8bit_zero_points)); let zero_point = zero_point_vec[zero_point_index / 2];`:`var zero_point = 0`}; - let dequantized_data = ${er(l)}(quantized_data - zero_point) * scale; + let dequantized_data = ${$n(l)}(quantized_data - zero_point) * scale; ${f.setByOffset(`global_idx`,`dequantized_data`)}; - }`};return{name:`GatherBlockQuantized`,shaderCache:{hint:`${t.cacheKey};${e.filter((e,t)=>t!==1).map(e=>e.dims.join(`_`)).join(`;`)}`,inputDependencies:Array.from({length:e.length},(e,t)=>`rank`)},getRunData:()=>({outputs:[{dims:s,dataType:l}],dispatchGroup:{x:Math.ceil(c/64)},programUniforms:d}),getShaderSource:f}},Xs=(e,t)=>{let n=e.inputs;Js(n,t),e.compute(Ys(e.inputs,t))},Zs=e=>Yn({blockSize:e.blockSize,gatherAxis:e.gatherAxis,quantizeAxis:e.quantizeAxis})}),$s,ec,tc,nc,rc=M(()=>{"use strict";V(),W(),Xn(),Y(),$s=e=>{if(!e||e.length!==2)throw Error(`GatherElements requires 2 inputs.`);if(e[0].dims.length<1)throw Error(`GatherElements requires that the data input be rank >= 1.`);if(e[0].dims.length!==e[1].dims.length)throw Error(`GatherElements requires that the data input and - indices input tensors be of same rank.`)},ec=(e,t)=>{let n=e[0].dims,r=e[0].dataType,i=n.length,a=e[1].dims,o=e[1].dataType,s=U.normalizeAxis(t.axis,i),c=n[s],l=a.slice(0),u=U.size(l),d=q(`input`,r,i),f=q(`indicesInput`,o,a.length),p=J(`output`,r,l.length),m=[{type:12,data:u},{type:6,data:c},{type:12,data:s}];return m.push(...G(n,a,l)),{name:`GatherElements`,shaderCache:{inputDependencies:[`rank`,`rank`]},getRunData:()=>({outputs:[{dims:l,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(u/64)},programUniforms:m}),getShaderSource:e=>` + }`};return{name:`GatherBlockQuantized`,shaderCache:{hint:`${t.cacheKey};${e.filter((e,t)=>t!==1).map(e=>e.dims.join(`_`)).join(`;`)}`,inputDependencies:Array.from({length:e.length},(e,t)=>`rank`)},getRunData:()=>({outputs:[{dims:s,dataType:l}],dispatchGroup:{x:Math.ceil(c/64)},programUniforms:d}),getShaderSource:f}},Ys=(e,t)=>{let n=e.inputs;qs(n,t),e.compute(Js(e.inputs,t))},Xs=e=>Jn({blockSize:e.blockSize,gatherAxis:e.gatherAxis,quantizeAxis:e.quantizeAxis})}),Qs,$s,ec,tc,nc=M(()=>{"use strict";U(),G(),Yn(),X(),Qs=e=>{if(!e||e.length!==2)throw Error(`GatherElements requires 2 inputs.`);if(e[0].dims.length<1)throw Error(`GatherElements requires that the data input be rank >= 1.`);if(e[0].dims.length!==e[1].dims.length)throw Error(`GatherElements requires that the data input and + indices input tensors be of same rank.`)},$s=(e,t)=>{let n=e[0].dims,r=e[0].dataType,i=n.length,a=e[1].dims,o=e[1].dataType,s=W.normalizeAxis(t.axis,i),c=n[s],l=a.slice(0),u=W.size(l),d=J(`input`,r,i),f=J(`indicesInput`,o,a.length),p=Y(`output`,r,l.length),m=[{type:12,data:u},{type:6,data:c},{type:12,data:s}];return m.push(...K(n,a,l)),{name:`GatherElements`,shaderCache:{inputDependencies:[`rank`,`rank`]},getRunData:()=>({outputs:[{dims:l,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(u/64)},programUniforms:m}),getShaderSource:e=>` ${e.registerUniform(`outputSize`,`u32`).registerUniform(`axisDimLimit`,`i32`).registerUniform(`axis`,`u32`).declareVariables(d,f,p)} ${e.mainStart()} ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.outputSize`)} @@ -1493,7 +1493,7 @@ fn main(@builtin(local_invocation_id) localId : vec3, let value = ${d.getByIndices(`inputIndices`)}; ${p.setByOffset(`global_idx`,`value`)}; - }`}},tc=e=>Yn({axis:e.axis}),nc=(e,t)=>{let n=e.inputs;$s(n),e.compute(ec(e.inputs,t))}}),ic,ac,oc,sc,cc=M(()=>{"use strict";V(),W(),Y(),ic=e=>{if(!e)throw Error(`Input is missing`);if(e.length<2||e.length>3)throw Error(`Invaid input number.`);if(e.length===3&&e[2].dims.length>2)throw Error(`Invalid input shape of C`);if(e[0].dataType!==e[1].dataType||e.length===3&&e[0].dataType!==e[2].dataType)throw Error(`Input types are mismatched`)},ac=(e,t)=>{let n=e[0].dims.slice(),r=e[1].dims.slice(),[i,a,o]=_n.getShapeOfGemmResult(n,t.transA,r,t.transB,e.length===3?e[2].dims:void 0),s=[i,a];if(!s)throw Error(`Can't use gemm on the given tensors`);let c=16,l=Math.ceil(a/c),u=Math.ceil(i/c),d=!0,f=U.size(s),p=[{type:12,data:d?l:f},{type:12,data:i},{type:12,data:a},{type:12,data:o},{type:1,data:t.alpha},{type:1,data:t.beta}],m=[`type`,`type`];e.length===3&&(p.push(...G(e[2].dims)),m.push(`rank`)),p.push(...G(s));let h=n=>{let r=``;t.transA&&t.transB?r=`value += a[k * uniforms.M + m] * b[n * uniforms.K + k];`:t.transA&&!t.transB?r=`value += a[k * uniforms.M + m] * b[k * uniforms.N + n];`:!t.transA&&t.transB?r=`value += a[m * uniforms.K + k] * b[n * uniforms.K + k];`:!t.transA&&!t.transB&&(r=`value += a[m * uniforms.K + k] * b[k * uniforms.N + n];`);let i=t.alpha===1?``:`value *= uniforms.alpha;`,a=q(`a`,e[0].dataType,e[0].dims),o=q(`b`,e[1].dataType,e[1].dims),c=a.type.value,l=null,u=[a,o];e.length===3&&(l=q(`c`,e[2].dataType,e[2].dims.length),u.push(l));let d=J(`output`,e[0].dataType,s.length);u.push(d);let f=[{name:`output_size`,type:`u32`},{name:`M`,type:`u32`},{name:`N`,type:`u32`},{name:`K`,type:`u32`},{name:`alpha`,type:`f32`},{name:`beta`,type:`f32`}];return` + }`}},ec=e=>Jn({axis:e.axis}),tc=(e,t)=>{let n=e.inputs;Qs(n),e.compute($s(e.inputs,t))}}),rc,ic,ac,oc,sc=M(()=>{"use strict";U(),G(),X(),rc=e=>{if(!e)throw Error(`Input is missing`);if(e.length<2||e.length>3)throw Error(`Invaid input number.`);if(e.length===3&&e[2].dims.length>2)throw Error(`Invalid input shape of C`);if(e[0].dataType!==e[1].dataType||e.length===3&&e[0].dataType!==e[2].dataType)throw Error(`Input types are mismatched`)},ic=(e,t)=>{let n=e[0].dims.slice(),r=e[1].dims.slice(),[i,a,o]=gn.getShapeOfGemmResult(n,t.transA,r,t.transB,e.length===3?e[2].dims:void 0),s=[i,a];if(!s)throw Error(`Can't use gemm on the given tensors`);let c=16,l=Math.ceil(a/c),u=Math.ceil(i/c),d=!0,f=W.size(s),p=[{type:12,data:d?l:f},{type:12,data:i},{type:12,data:a},{type:12,data:o},{type:1,data:t.alpha},{type:1,data:t.beta}],m=[`type`,`type`];e.length===3&&(p.push(...K(e[2].dims)),m.push(`rank`)),p.push(...K(s));let h=n=>{let r=``;t.transA&&t.transB?r=`value += a[k * uniforms.M + m] * b[n * uniforms.K + k];`:t.transA&&!t.transB?r=`value += a[k * uniforms.M + m] * b[k * uniforms.N + n];`:!t.transA&&t.transB?r=`value += a[m * uniforms.K + k] * b[n * uniforms.K + k];`:!t.transA&&!t.transB&&(r=`value += a[m * uniforms.K + k] * b[k * uniforms.N + n];`);let i=t.alpha===1?``:`value *= uniforms.alpha;`,a=J(`a`,e[0].dataType,e[0].dims),o=J(`b`,e[1].dataType,e[1].dims),c=a.type.value,l=null,u=[a,o];e.length===3&&(l=J(`c`,e[2].dataType,e[2].dims.length),u.push(l));let d=Y(`output`,e[0].dataType,s.length);u.push(d);let f=[{name:`output_size`,type:`u32`},{name:`M`,type:`u32`},{name:`N`,type:`u32`},{name:`K`,type:`u32`},{name:`alpha`,type:`f32`},{name:`beta`,type:`f32`}];return` ${n.registerUniforms(f).declareVariables(...u)} ${n.mainStart()} @@ -1510,7 +1510,7 @@ fn main(@builtin(local_invocation_id) localId : vec3, ${i} ${l==null?``:`let cOffset = ${l.broadcastedIndicesToOffset(`vec2(m, n)`,d)}; value += ${c}(uniforms.beta) * ${l.getByOffset(`cOffset`)};`} output[global_idx] = value; - }`},g=n=>{let r=q(`a`,e[0].dataType,e[0].dims),i=q(`b`,e[1].dataType,e[1].dims),a=null,o=[r,i];e.length===3&&(a=q(`c`,e[2].dataType,e[2].dims.length),o.push(a));let l=J(`output`,e[0].dataType,s.length);o.push(l);let u=[{name:`num_tile_n`,type:`u32`},{name:`M`,type:`u32`},{name:`N`,type:`u32`},{name:`K`,type:`u32`},{name:`alpha`,type:`f32`},{name:`beta`,type:`f32`}],d=``,f=``;t.transA&&t.transB?(f=` + }`},g=n=>{let r=J(`a`,e[0].dataType,e[0].dims),i=J(`b`,e[1].dataType,e[1].dims),a=null,o=[r,i];e.length===3&&(a=J(`c`,e[2].dataType,e[2].dims.length),o.push(a));let l=Y(`output`,e[0].dataType,s.length);o.push(l);let u=[{name:`num_tile_n`,type:`u32`},{name:`M`,type:`u32`},{name:`N`,type:`u32`},{name:`K`,type:`u32`},{name:`alpha`,type:`f32`},{name:`beta`,type:`f32`}],d=``,f=``;t.transA&&t.transB?(f=` var col = tile_row_start + local_id.x; var row = k_start + local_id.y; if (col < uniforms.M && row < uniforms.K) { @@ -1602,7 +1602,7 @@ fn main(@builtin(local_invocation_id) localId : vec3, if (m < uniforms.M && n < uniforms.N) { output[m * uniforms.N + n] = value; } - }`};return d?{name:`GemmShared`,shaderCache:{hint:`${t.cacheKey}`,inputDependencies:m},getRunData:()=>({outputs:[{dims:s,dataType:e[0].dataType}],dispatchGroup:{x:l*u},programUniforms:p}),getShaderSource:g}:{name:`Gemm`,shaderCache:{hint:`${t.cacheKey}`,inputDependencies:m},getRunData:()=>({outputs:[{dims:s,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(f/64)},programUniforms:p}),getShaderSource:h}},oc=e=>{let t=e.transA,n=e.transB,r=e.alpha,i=e.beta;return{transA:t,transB:n,alpha:r,beta:i,cacheKey:`${e.transA};${e.transB};${e.alpha===1}`}},sc=(e,t)=>{ic(e.inputs),e.compute(ac(e.inputs,t))}}),lc,uc,dc,fc,pc,mc,hc,gc,_c,vc,yc,bc,xc,Sc,Cc=M(()=>{"use strict";V(),W(),Xn(),Y(),[lc,uc,dc,fc]=[0,1,2,3],pc=e=>{if(e[0].dims.length!==4)throw Error(`only 4-D tensor is supported.`);if(e[0].dims.length!==e[1].dims.length)throw Error(`input dimensions must be equal to grid dimensions`);if(e[0].dims.length-2!==e[1].dims[e[1].dims.length-1])throw Error(`last dimension of grid must be equal to ${e[0].dims.length-2}`);if(e[0].dims[0]!==e[1].dims[0])throw Error(`grid batch size must match input batch size`)},mc=` + }`};return d?{name:`GemmShared`,shaderCache:{hint:`${t.cacheKey}`,inputDependencies:m},getRunData:()=>({outputs:[{dims:s,dataType:e[0].dataType}],dispatchGroup:{x:l*u},programUniforms:p}),getShaderSource:g}:{name:`Gemm`,shaderCache:{hint:`${t.cacheKey}`,inputDependencies:m},getRunData:()=>({outputs:[{dims:s,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(f/64)},programUniforms:p}),getShaderSource:h}},ac=e=>{let t=e.transA,n=e.transB,r=e.alpha,i=e.beta;return{transA:t,transB:n,alpha:r,beta:i,cacheKey:`${e.transA};${e.transB};${e.alpha===1}`}},oc=(e,t)=>{rc(e.inputs),e.compute(ic(e.inputs,t))}}),cc,lc,uc,dc,fc,pc,mc,hc,gc,_c,vc,yc,bc,xc,Sc=M(()=>{"use strict";U(),G(),Yn(),X(),[cc,lc,uc,dc]=[0,1,2,3],fc=e=>{if(e[0].dims.length!==4)throw Error(`only 4-D tensor is supported.`);if(e[0].dims.length!==e[1].dims.length)throw Error(`input dimensions must be equal to grid dimensions`);if(e[0].dims.length-2!==e[1].dims[e[1].dims.length-1])throw Error(`last dimension of grid must be equal to ${e[0].dims.length-2}`);if(e[0].dims[0]!==e[1].dims[0])throw Error(`grid batch size must match input batch size`)},pc=` fn gs_get_cubic_coeffs(x: f32) -> vec4 { let cubic_alpha = -0.75f; let x_abs = abs(x); @@ -1613,7 +1613,7 @@ fn main(@builtin(local_invocation_id) localId : vec3, coeffs[3] = (((cubic_alpha * (2 - x_abs) - 5 * cubic_alpha) * (2 - x_abs) + 8 * cubic_alpha) * (2 - x_abs) - 4 * cubic_alpha); return coeffs; } -`,hc=e=>` +`,mc=e=>` fn gs_bicubic_interpolate(p: mat4x4<${e}>, x: f32, y: f32) -> ${e} { var v: vec4; var coeffs = gs_get_cubic_coeffs(x); @@ -1624,7 +1624,7 @@ fn main(@builtin(local_invocation_id) localId : vec3, let pixel = ${e}(coeffs[0] * v[0] + coeffs[1] * v[1] + coeffs[2] * v[2] + coeffs[3] * v[3]); return pixel; } -`,gc=e=>` +`,hc=e=>` fn gs_denormalize(n: f32, length: i32) -> f32 { ${e.alignCorners===0?` // alignCorners: false => [-1, 1] to [-0.5, length - 0.5] @@ -1634,7 +1634,7 @@ fn main(@builtin(local_invocation_id) localId : vec3, return (n + 1.0) / 2.0 * (f32(length - 1)); `} } -`,_c=e=>` +`,gc=e=>` ${e.paddingMode===`reflection`?` fn gs_reflect(x: i32, x_min: f32, x_max: f32) -> u32 { var dx = 0.0; @@ -1661,39 +1661,39 @@ fn main(@builtin(local_invocation_id) localId : vec3, } return u32(fx); }`:``} -`,vc=(e,t,n)=>` +`,_c=(e,t,n)=>` fn pixel_at_grid(r: i32, c: i32, H: i32, W: i32, batch: u32, channel: u32, border: vec4) -> ${t} { var pixel = ${t}(0); var indices = vec4(0); - indices[${lc}] = batch; - indices[${uc}] = channel;`+(()=>{switch(n.paddingMode){case`zeros`:return` + indices[${cc}] = batch; + indices[${lc}] = channel;`+(()=>{switch(n.paddingMode){case`zeros`:return` if (r >= 0 && r < H && c >=0 && c < W) { - indices[${dc}] = u32(r); - indices[${fc}] = u32(c); + indices[${uc}] = u32(r); + indices[${dc}] = u32(c); } else { return ${t}(0); } `;case`border`:return` - indices[${dc}] = u32(clamp(r, 0, H - 1)); - indices[${fc}] = u32(clamp(c, 0, W - 1)); + indices[${uc}] = u32(clamp(r, 0, H - 1)); + indices[${dc}] = u32(clamp(c, 0, W - 1)); `;case`reflection`:return` - indices[${dc}] = gs_reflect(r, border[1], border[3]); - indices[${fc}] = gs_reflect(c, border[0], border[2]); + indices[${uc}] = gs_reflect(r, border[1], border[3]); + indices[${dc}] = gs_reflect(c, border[0], border[2]); `;default:throw Error(`padding mode ${n.paddingMode} is not supported`)}})()+` return ${e.getByIndices(`indices`)}; } -`,yc=(e,t,n)=>(()=>{switch(n.mode){case`nearest`:return` - let result = pixel_at_grid(i32(round(y)), i32(round(x)), H_in, W_in, indices[${lc}], indices[${uc}], border); +`,vc=(e,t,n)=>(()=>{switch(n.mode){case`nearest`:return` + let result = pixel_at_grid(i32(round(y)), i32(round(x)), H_in, W_in, indices[${cc}], indices[${lc}], border); `;case`bilinear`:return` let x1 = i32(floor(x)); let y1 = i32(floor(y)); let x2 = x1 + 1; let y2 = y1 + 1; - let p11 = pixel_at_grid(y1, x1, H_in, W_in, indices[${lc}], indices[${uc}], border); - let p12 = pixel_at_grid(y1, x2, H_in, W_in, indices[${lc}], indices[${uc}], border); - let p21 = pixel_at_grid(y2, x1, H_in, W_in, indices[${lc}], indices[${uc}], border); - let p22 = pixel_at_grid(y2, x2, H_in, W_in, indices[${lc}], indices[${uc}], border); + let p11 = pixel_at_grid(y1, x1, H_in, W_in, indices[${cc}], indices[${lc}], border); + let p12 = pixel_at_grid(y1, x2, H_in, W_in, indices[${cc}], indices[${lc}], border); + let p21 = pixel_at_grid(y2, x1, H_in, W_in, indices[${cc}], indices[${lc}], border); + let p22 = pixel_at_grid(y2, x2, H_in, W_in, indices[${cc}], indices[${lc}], border); let dx2 = ${t}(f32(x2) - x); let dx1 = ${t}(x - f32(x1)); @@ -1706,25 +1706,25 @@ fn main(@builtin(local_invocation_id) localId : vec3, var p: mat4x4<${t}>; for (var h = 0; h < 4; h++) { for (var w = 0; w < 4; w++) { - p[h][w] = pixel_at_grid(h + y0, w + x0, H_in, W_in, indices[${lc}], indices[${uc}], border); + p[h][w] = pixel_at_grid(h + y0, w + x0, H_in, W_in, indices[${cc}], indices[${lc}], border); } } let dx = x - f32(x0 + 1); let dy = y - f32(y0 + 1); let result = gs_bicubic_interpolate(p, dx, dy); - `;default:throw Error(`mode ${n.mode} is not supported`)}})()+`${e.setByOffset(`global_idx`,`result`)}`,bc=(e,t)=>{let n=q(`x`,e[0].dataType,e[0].dims.length),r=[e[1].dims[0],e[1].dims[1],e[1].dims[2]],i=q(`grid`,e[1].dataType,r.length,2),a=[e[0].dims[0],e[0].dims[1],e[1].dims[1],e[1].dims[2]];t.format===`NHWC`&&(a=[e[0].dims[0],e[1].dims[1],e[1].dims[2],e[0].dims[3]],[lc,uc,dc,fc]=[0,3,1,2]);let o=J(`output`,e[0].dataType,a.length),s=n.type.value,c=U.size(a),l=[{type:12,data:c},...G(e[0].dims,r,a)],u=e=>` + `;default:throw Error(`mode ${n.mode} is not supported`)}})()+`${e.setByOffset(`global_idx`,`result`)}`,yc=(e,t)=>{let n=J(`x`,e[0].dataType,e[0].dims.length),r=[e[1].dims[0],e[1].dims[1],e[1].dims[2]],i=J(`grid`,e[1].dataType,r.length,2),a=[e[0].dims[0],e[0].dims[1],e[1].dims[1],e[1].dims[2]];t.format===`NHWC`&&(a=[e[0].dims[0],e[1].dims[1],e[1].dims[2],e[0].dims[3]],[cc,lc,uc,dc]=[0,3,1,2]);let o=Y(`output`,e[0].dataType,a.length),s=n.type.value,c=W.size(a),l=[{type:12,data:c},...K(e[0].dims,r,a)],u=e=>` ${e.registerUniform(`output_size`,`u32`).declareVariables(n,i,o)} - ${mc} - ${hc(s)} + ${pc} + ${mc(s)} + ${hc(t)} ${gc(t)} - ${_c(t)} - ${vc(n,s,t)} + ${_c(n,s,t)} ${e.mainStart()} ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} - let H_in = i32(uniforms.x_shape[${dc}]); - let W_in = i32(uniforms.x_shape[${fc}]); + let H_in = i32(uniforms.x_shape[${uc}]); + let W_in = i32(uniforms.x_shape[${dc}]); ${t.alignCorners===0?` let x_min = -0.5; @@ -1740,35 +1740,35 @@ fn main(@builtin(local_invocation_id) localId : vec3, let border = vec4(x_min, y_min, x_max, y_max); let indices = ${o.offsetToIndices(`global_idx`)}; - var grid_indices = vec3(indices[${lc}], indices[${dc}], indices[${fc}]); + var grid_indices = vec3(indices[${cc}], indices[${uc}], indices[${dc}]); let nxy = ${i.getByIndices(`grid_indices`)}; var x = gs_denormalize(f32(nxy[0]), W_in); var y = gs_denormalize(f32(nxy[1]), H_in); - ${yc(o,s,t)} - }`;return{name:`GridSample`,shaderCache:{hint:`${t.cacheKey}`,inputDependencies:[`type`,`type`]},getRunData:e=>{let t=U.size(a);return{outputs:[{dims:a,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(t/64)},programUniforms:l}},getShaderSource:u}},xc=(e,t)=>{pc(e.inputs),e.compute(bc(e.inputs,t))},Sc=e=>Yn({alignCorners:e.align_corners,mode:e.mode,paddingMode:e.padding_mode,format:e.format})}),wc,Tc,Ec,Dc,Oc,kc,Ac,jc=M(()=>{"use strict";V(),W(),Xn(),Ln(),Di(),Y(),vr(),wc=(e,t)=>e.length>t&&e[t].dims.length>0?e[t]:void 0,Tc=(e,t)=>{let n=e[0],r=wc(e,1),i=wc(e,2),a=wc(e,3),o=wc(e,4),s=wc(e,5),c=wc(e,6),l=wc(e,7);if(n.dims.length!==3&&n.dims.length!==5)throw Error(`Input query is expected to have 3 or 5 dimensions`);let u=n.dims[0],d=n.dims[1],f=n.dims.length===3?n.dims[2]:t.numHeads*n.dims[4],p=d,m=0,h=0,g=Math.floor(f/t.numHeads);if(c&&l&&U.size(c.dims)&&U.size(l.dims)){if(c.dims.length!==4)throw Error(`Input "past_key" is expected to have 4 dimensions`);if(c.dims[0]!==u||c.dims[1]!==t.numHeads||c.dims[3]!==g)throw Error(`Input "past_key" shape (batch_size, num_heads, past_sequence_length, head_size)`);if(l.dims[0]!==u||l.dims[1]!==t.numHeads||l.dims[3]!==g)throw Error(`Input "past_value" shape (batch_size, num_heads, past_sequence_length, head_size)`);if(c.dims[2]!==l.dims[2])throw Error(`Input "past_key" and "past_value" shall have same dim 2 (past_sequence_length)`);if(l.dims.length!==4)throw Error(`Input "past_value" is expected to have 4 dimensions`);m=c.dims[2],h=c.dims[2]}else if(c&&U.size(c.dims)||l&&U.size(l.dims))throw Error(`Input "past_key" and "past_value" shall be both present or both absent`);let _;if(r&&U.size(r.dims)>0){if(n.dims.length!==3)throw Error(`Input "query" is expected to have 3 dimensions when key is given`);if(r.dims.length<3||r.dims.length>5)throw Error(`Input "key" is expected to have 3, 4, or 5 dimensions`);if(n.dims[0]!==r.dims[0])throw Error(`Input "query" and "key" shall have same dim 0 (batch size)`);if(r.dims.length===3){if(r.dims[2]!==n.dims[2])throw Error(`Input "query" and "key" shall have same dim 2 (hidden_size)`);_=2,p=r.dims[1]}else if(r.dims.length===5){if(r.dims[2]!==t.numHeads||r.dims[3]!==2||r.dims[4]!==g)throw Error(`Expect "key" shape (batch_size, kv_sequence_length, num_heads, 2, head_size) for packed kv`);if(i)throw Error(`Expect "value" be none when "key" has packed kv format.`);_=5,p=r.dims[1]}else{if(r.dims[1]!==t.numHeads||r.dims[3]!==g)throw Error(`Expect "key" shape (batch_size, num_heads, kv_sequence_length, head_size) for past_key`);_=0,p=r.dims[2]}}else{if(n.dims.length!==5)throw Error(`Input "query" is expected to have 5 dimensions when key is empty`);if(n.dims[2]!==t.numHeads||n.dims[3]!==3)throw Error(`Expect "query" shape (batch_size, kv_sequence_length, num_heads, 3, head_size) for packed kv`);_=3}if(a&&U.size(a.dims)>0){if(a.dims.length!==1)throw Error(`Input "bias" is expected to have 1 dimension`);if(r&&r.dims.length===5&&r.dims[3]===2)throw Error(`bias is not allowed for packed kv.`)}let v=m+p,y=0;if(o&&U.size(o.dims)>0){y=8;let e=o.dims;throw e.length===1?e[0]===u?y=1:e[0]===3*u+2&&(y=3):e.length===2&&e[0]===u&&e[1]===v&&(y=5),y===8?Error(`Input "key_padding_mask" shape shall be (batch_size) or (batch_size, total_sequence_length)`):Error(`Mask not supported`)}let b=!1,x=f;if(i&&U.size(i.dims)>0){if(i.dims.length!==3&&i.dims.length!==4)throw Error(`Input "value" is expected to have 3 or 4 dimensions`);if(n.dims[0]!==i.dims[0])throw Error(`Input "query" and "value" shall have same dim 0 (batch_size)`);if(i.dims.length===3){if(p!==i.dims[1])throw Error(`Input "key" and "value" shall have the same dim 1 (kv_sequence_length)`);x=i.dims[2]}else{if(p!==i.dims[2])throw Error(`Input "key" and "value" shall have the same dim 2 (kv_sequence_length)`);x=i.dims[1]*i.dims[3],b=!0}}let S=!1;if(o&&U.size(o.dims)>0)throw Error(`Key padding mask is not supported`);if(s&&U.size(s.dims)>0){if(s.dims.length!==4)throw Error(`Input "attention_bias" is expected to have 4 dimensions`);if(s.dims[0]!==u||s.dims[1]!==t.numHeads||s.dims[2]!==d||s.dims[3]!==v)throw Error(`Expect "attention_bias" shape (batch_size, num_heads, sequence_length, total_sequence_length)`)}return{batchSize:u,sequenceLength:d,pastSequenceLength:m,kvSequenceLength:p,totalSequenceLength:v,maxSequenceLength:h,inputHiddenSize:0,hiddenSize:f,vHiddenSize:x,headSize:g,vHeadSize:Math.floor(x/t.numHeads),numHeads:t.numHeads,isUnidirectional:!1,pastPresentShareBuffer:!1,maskFilterValue:t.maskFilterValue,maskType:y,scale:t.scale,broadcastResPosBias:S,passPastInKv:b,qkvFormat:_}},Ec=e=>Yn({...e}),Dc=Yn({perm:[0,2,1,3]}),Oc=(e,t,n,r,i,a,o)=>{let s=[r,i,a],c=U.size(s),l=[{type:12,data:c},{type:12,data:o},{type:12,data:a}],u=e=>{let r=J(`qkv_with_bias`,t.dataType,s),i=q(`qkv`,t.dataType,s),a=q(`bias`,n.dataType,s),o=[{name:`output_size`,type:`u32`},{name:`bias_offset`,type:`u32`},{name:`hidden_size`,type:`u32`}];return` + ${vc(o,s,t)} + }`;return{name:`GridSample`,shaderCache:{hint:`${t.cacheKey}`,inputDependencies:[`type`,`type`]},getRunData:e=>{let t=W.size(a);return{outputs:[{dims:a,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(t/64)},programUniforms:l}},getShaderSource:u}},bc=(e,t)=>{fc(e.inputs),e.compute(yc(e.inputs,t))},xc=e=>Jn({alignCorners:e.align_corners,mode:e.mode,paddingMode:e.padding_mode,format:e.format})}),Cc,wc,Tc,Ec,Dc,Oc,kc,Ac=M(()=>{"use strict";U(),G(),Yn(),In(),Ei(),X(),_r(),Cc=(e,t)=>e.length>t&&e[t].dims.length>0?e[t]:void 0,wc=(e,t)=>{let n=e[0],r=Cc(e,1),i=Cc(e,2),a=Cc(e,3),o=Cc(e,4),s=Cc(e,5),c=Cc(e,6),l=Cc(e,7);if(n.dims.length!==3&&n.dims.length!==5)throw Error(`Input query is expected to have 3 or 5 dimensions`);let u=n.dims[0],d=n.dims[1],f=n.dims.length===3?n.dims[2]:t.numHeads*n.dims[4],p=d,m=0,h=0,g=Math.floor(f/t.numHeads);if(c&&l&&W.size(c.dims)&&W.size(l.dims)){if(c.dims.length!==4)throw Error(`Input "past_key" is expected to have 4 dimensions`);if(c.dims[0]!==u||c.dims[1]!==t.numHeads||c.dims[3]!==g)throw Error(`Input "past_key" shape (batch_size, num_heads, past_sequence_length, head_size)`);if(l.dims[0]!==u||l.dims[1]!==t.numHeads||l.dims[3]!==g)throw Error(`Input "past_value" shape (batch_size, num_heads, past_sequence_length, head_size)`);if(c.dims[2]!==l.dims[2])throw Error(`Input "past_key" and "past_value" shall have same dim 2 (past_sequence_length)`);if(l.dims.length!==4)throw Error(`Input "past_value" is expected to have 4 dimensions`);m=c.dims[2],h=c.dims[2]}else if(c&&W.size(c.dims)||l&&W.size(l.dims))throw Error(`Input "past_key" and "past_value" shall be both present or both absent`);let _;if(r&&W.size(r.dims)>0){if(n.dims.length!==3)throw Error(`Input "query" is expected to have 3 dimensions when key is given`);if(r.dims.length<3||r.dims.length>5)throw Error(`Input "key" is expected to have 3, 4, or 5 dimensions`);if(n.dims[0]!==r.dims[0])throw Error(`Input "query" and "key" shall have same dim 0 (batch size)`);if(r.dims.length===3){if(r.dims[2]!==n.dims[2])throw Error(`Input "query" and "key" shall have same dim 2 (hidden_size)`);_=2,p=r.dims[1]}else if(r.dims.length===5){if(r.dims[2]!==t.numHeads||r.dims[3]!==2||r.dims[4]!==g)throw Error(`Expect "key" shape (batch_size, kv_sequence_length, num_heads, 2, head_size) for packed kv`);if(i)throw Error(`Expect "value" be none when "key" has packed kv format.`);_=5,p=r.dims[1]}else{if(r.dims[1]!==t.numHeads||r.dims[3]!==g)throw Error(`Expect "key" shape (batch_size, num_heads, kv_sequence_length, head_size) for past_key`);_=0,p=r.dims[2]}}else{if(n.dims.length!==5)throw Error(`Input "query" is expected to have 5 dimensions when key is empty`);if(n.dims[2]!==t.numHeads||n.dims[3]!==3)throw Error(`Expect "query" shape (batch_size, kv_sequence_length, num_heads, 3, head_size) for packed kv`);_=3}if(a&&W.size(a.dims)>0){if(a.dims.length!==1)throw Error(`Input "bias" is expected to have 1 dimension`);if(r&&r.dims.length===5&&r.dims[3]===2)throw Error(`bias is not allowed for packed kv.`)}let v=m+p,y=0;if(o&&W.size(o.dims)>0){y=8;let e=o.dims;throw e.length===1?e[0]===u?y=1:e[0]===3*u+2&&(y=3):e.length===2&&e[0]===u&&e[1]===v&&(y=5),y===8?Error(`Input "key_padding_mask" shape shall be (batch_size) or (batch_size, total_sequence_length)`):Error(`Mask not supported`)}let b=!1,x=f;if(i&&W.size(i.dims)>0){if(i.dims.length!==3&&i.dims.length!==4)throw Error(`Input "value" is expected to have 3 or 4 dimensions`);if(n.dims[0]!==i.dims[0])throw Error(`Input "query" and "value" shall have same dim 0 (batch_size)`);if(i.dims.length===3){if(p!==i.dims[1])throw Error(`Input "key" and "value" shall have the same dim 1 (kv_sequence_length)`);x=i.dims[2]}else{if(p!==i.dims[2])throw Error(`Input "key" and "value" shall have the same dim 2 (kv_sequence_length)`);x=i.dims[1]*i.dims[3],b=!0}}let S=!1;if(o&&W.size(o.dims)>0)throw Error(`Key padding mask is not supported`);if(s&&W.size(s.dims)>0){if(s.dims.length!==4)throw Error(`Input "attention_bias" is expected to have 4 dimensions`);if(s.dims[0]!==u||s.dims[1]!==t.numHeads||s.dims[2]!==d||s.dims[3]!==v)throw Error(`Expect "attention_bias" shape (batch_size, num_heads, sequence_length, total_sequence_length)`)}return{batchSize:u,sequenceLength:d,pastSequenceLength:m,kvSequenceLength:p,totalSequenceLength:v,maxSequenceLength:h,inputHiddenSize:0,hiddenSize:f,vHiddenSize:x,headSize:g,vHeadSize:Math.floor(x/t.numHeads),numHeads:t.numHeads,isUnidirectional:!1,pastPresentShareBuffer:!1,maskFilterValue:t.maskFilterValue,maskType:y,scale:t.scale,broadcastResPosBias:S,passPastInKv:b,qkvFormat:_}},Tc=e=>Jn({...e}),Ec=Jn({perm:[0,2,1,3]}),Dc=(e,t,n,r,i,a,o)=>{let s=[r,i,a],c=W.size(s),l=[{type:12,data:c},{type:12,data:o},{type:12,data:a}],u=e=>{let r=Y(`qkv_with_bias`,t.dataType,s),i=J(`qkv`,t.dataType,s),a=J(`bias`,n.dataType,s),o=[{name:`output_size`,type:`u32`},{name:`bias_offset`,type:`u32`},{name:`hidden_size`,type:`u32`}];return` ${e.registerUniforms(o).declareVariables(i,a,r)} ${e.mainStart()} ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} let bias_offset_idx = (global_idx % uniforms.hidden_size) + uniforms.bias_offset; qkv_with_bias[global_idx] = qkv[global_idx] + bias[bias_offset_idx]; - }`};return e.compute({name:`MultiHeadAttentionAddBias`,shaderCache:{inputDependencies:[`type`,`type`]},getRunData:()=>({outputs:[{dims:s,dataType:t.dataType,gpuDataType:0}],dispatchGroup:{x:Math.ceil(c/64)},programUniforms:l}),getShaderSource:u},{inputs:[t,n],outputs:[-1]})[0]},kc=(e,t,n,r,i,a,o,s)=>{let c=a;if(o&&U.size(o.dims)>0){if(r===1)throw Error(`AddBiasReshape is not implemented. Please export your model with packed QKV or KV`);return c=Oc(e,a,o,t,r,n*i,s),c=c.reshape([t,r,n,i]),n===1||r===1?c:e.compute(hr(c,Dc.perm),{inputs:[c],outputs:[-1]})[0]}else return a.dims.length===3&&(c=a.reshape([t,r,n,i])),n===1||r===1?c:e.compute(hr(c,Dc.perm),{inputs:[c],outputs:[-1]})[0]},Ac=(e,t)=>{let n=Tc(e.inputs,t),r=e.inputs[0],i=wc(e.inputs,1),a=wc(e.inputs,2),o=wc(e.inputs,3),s=wc(e.inputs,4),c=wc(e.inputs,5),l=wc(e.inputs,6),u=wc(e.inputs,7);if(r.dims.length===5)throw Error(`Packed QKV is not implemented`);if(i?.dims.length===5)throw Error(`Packed KV is not implemented`);let d=i&&a&&i.dims.length===4&&a.dims.length===4,f=kc(e,n.batchSize,n.numHeads,n.sequenceLength,n.headSize,r,o,0);if(d)return wi(e,f,i,a,s,void 0,l,u,c,n);if(!i||!a)throw Error(`key and value must be provided`);let p=kc(e,n.batchSize,n.numHeads,n.kvSequenceLength,n.headSize,i,o,n.hiddenSize),m=kc(e,n.batchSize,n.numHeads,n.kvSequenceLength,n.vHeadSize,a,o,2*n.hiddenSize);wi(e,f,p,m,s,void 0,l,u,c,n)}}),Mc,Nc,Pc,Fc,Ic,Lc,Rc,zc=M(()=>{"use strict";V(),W(),Xn(),Y(),Mc=e=>{if(!e||e.length<1)throw Error(`too few inputs`)},Nc=(e,t)=>{let n=[],r=t.numOutputs;return e[1].dims[0]>0&&(e[1].getBigInt64Array().forEach(e=>n.push(Number(e))),r=n.length),Yn({numOutputs:r,axis:t.axis,splitSizes:n})},Pc=e=>` + }`};return e.compute({name:`MultiHeadAttentionAddBias`,shaderCache:{inputDependencies:[`type`,`type`]},getRunData:()=>({outputs:[{dims:s,dataType:t.dataType,gpuDataType:0}],dispatchGroup:{x:Math.ceil(c/64)},programUniforms:l}),getShaderSource:u},{inputs:[t,n],outputs:[-1]})[0]},Oc=(e,t,n,r,i,a,o,s)=>{let c=a;if(o&&W.size(o.dims)>0){if(r===1)throw Error(`AddBiasReshape is not implemented. Please export your model with packed QKV or KV`);return c=Dc(e,a,o,t,r,n*i,s),c=c.reshape([t,r,n,i]),n===1||r===1?c:e.compute(mr(c,Ec.perm),{inputs:[c],outputs:[-1]})[0]}else return a.dims.length===3&&(c=a.reshape([t,r,n,i])),n===1||r===1?c:e.compute(mr(c,Ec.perm),{inputs:[c],outputs:[-1]})[0]},kc=(e,t)=>{let n=wc(e.inputs,t),r=e.inputs[0],i=Cc(e.inputs,1),a=Cc(e.inputs,2),o=Cc(e.inputs,3),s=Cc(e.inputs,4),c=Cc(e.inputs,5),l=Cc(e.inputs,6),u=Cc(e.inputs,7);if(r.dims.length===5)throw Error(`Packed QKV is not implemented`);if(i?.dims.length===5)throw Error(`Packed KV is not implemented`);let d=i&&a&&i.dims.length===4&&a.dims.length===4,f=Oc(e,n.batchSize,n.numHeads,n.sequenceLength,n.headSize,r,o,0);if(d)return Ci(e,f,i,a,s,void 0,l,u,c,n);if(!i||!a)throw Error(`key and value must be provided`);let p=Oc(e,n.batchSize,n.numHeads,n.kvSequenceLength,n.headSize,i,o,n.hiddenSize),m=Oc(e,n.batchSize,n.numHeads,n.kvSequenceLength,n.vHeadSize,a,o,2*n.hiddenSize);Ci(e,f,p,m,s,void 0,l,u,c,n)}}),jc,Mc,Nc,Pc,Fc,Ic,Lc,Rc=M(()=>{"use strict";U(),G(),Yn(),X(),jc=e=>{if(!e||e.length<1)throw Error(`too few inputs`)},Mc=(e,t)=>{let n=[],r=t.numOutputs;return e[1].dims[0]>0&&(e[1].getBigInt64Array().forEach(e=>n.push(Number(e))),r=n.length),Jn({numOutputs:r,axis:t.axis,splitSizes:n})},Nc=e=>` fn calculateOutputIndex(index: u32) -> u32 { for (var i: u32 = 0u; i < ${e}u; i += 1u ) { - if (index < ${K(`uniforms.size_in_split_axis`,`i`,e)}) { + if (index < ${q(`uniforms.size_in_split_axis`,`i`,e)}) { return i; } } return ${e}u; -}`,Fc=e=>{let t=e.length,n=[];for(let r=0;r{let t=e.length,n=[];for(let r=0;r{let n=e[0].dims,r=U.size(n),i=e[0].dataType,a=U.normalizeAxis(t.axis,n.length),o=Array(t.numOutputs),s=q(`input`,i,n.length),c=Array(t.numOutputs),l=[],u=[],d=0,f=[{type:12,data:r}];for(let r=0;r` + }`},Fc=(e,t)=>{let n=e[0].dims,r=W.size(n),i=e[0].dataType,a=W.normalizeAxis(t.axis,n.length),o=Array(t.numOutputs),s=J(`input`,i,n.length),c=Array(t.numOutputs),l=[],u=[],d=0,f=[{type:12,data:r}];for(let r=0;r` ${e.registerUniform(`input_size`,`u32`).registerUniform(`size_in_split_axis`,`u32`,c.length).declareVariables(s,...o)} - ${Pc(c.length)} - ${Fc(o)} + ${Nc(c.length)} + ${Pc(o)} ${e.mainStart()} ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.input_size`)} @@ -1777,14 +1777,14 @@ fn calculateOutputIndex(index: u32) -> u32 { var index = ${s.indicesGet(`indices`,a)}; let output_number = calculateOutputIndex(index); if (output_number != 0) { - index -= ${K(`uniforms.size_in_split_axis`,`output_number - 1u`,c.length)}; + index -= ${q(`uniforms.size_in_split_axis`,`output_number - 1u`,c.length)}; ${s.indicesSet(`indices`,a,`index`)}; } writeBufferData(output_number, indices, global_idx); - }`;return{name:`Split`,shaderCache:{hint:t.cacheKey,inputDependencies:[`rank`]},getShaderSource:p,getRunData:()=>({outputs:l,dispatchGroup:{x:Math.ceil(r/64)},programUniforms:f})}},Lc=(e,t)=>{Mc(e.inputs);let n=e.inputs.length===1?t:Nc(e.inputs,t);e.compute(Ic(e.inputs,n),{inputs:[0]})},Rc=e=>{let t=e.axis,n=e.splitSizes,r=e.numOutputs<0?n.length:e.numOutputs;if(r!==n.length)throw Error(`numOutputs and splitSizes lengh must be equal`);return Yn({axis:t,numOutputs:r,splitSizes:n})}}),Bc,Vc,Hc,Uc=M(()=>{"use strict";V(),W(),Xn(),Y(),Bc=(e,t)=>{let[n,r,i,a]=e,{numHeads:o,rotaryEmbeddingDim:s}=t;if(n.dims.length!==3&&n.dims.length!==4)throw Error(`Input 'x' is expected to have 3 or 4 dimensions, got ${n.dims.length}`);if(!U.areEqual(r.dims,[])&&!U.areEqual(r.dims,[1])&&r.dims.length!==2)throw Error(`Input 'position_ids' is expected to have 0, 1, or 2 dimensions, got ${r.dims.length}`);if(i.dims.length!==2)throw Error(`Input 'cos_cache' is expected to have 2 dimensions, got ${i.dims.length}`);if(a.dims.length!==2)throw Error(`Input 'sin_cache' is expected to have 2 dimensions, got ${a.dims.length}`);if(!U.areEqual(i.dims,a.dims))throw Error(`Inputs 'cos_cache' and 'sin_cache' are expected to have the same shape`);if(s>0&&o===0)throw Error(`num_heads must be provided if rotary_embedding_dim is specified`);let c=n.dims[0],l=n.dims[n.dims.length-2],u=i.dims[0],d=U.sizeFromDimension(n.dims,1)/l,f=s===0?i.dims[1]*2:d/o;if(s>f)throw Error(`rotary_embedding_dim must be less than or equal to head_size`);if(r.dims.length===2){if(c!==r.dims[0])throw Error(`Input 'position_ids' dimension 0 should be of size batch_size, got ${r.dims[0]}`);if(l!==r.dims[1])throw Error(`Input 'position_ids' dimension 1 should be of size sequence_length, got ${r.dims[1]}`)}if(f/2!==i.dims[1]&&s/2!==i.dims[1])throw Error(`Input 'cos_cache' dimension 1 should be same as head_size / 2 or rotary_embedding_dim / 2, got ${i.dims[1]}`);if(l>u)throw Error(`Updating cos_cache and sin_cache in RotaryEmbedding is not currently supported`)},Vc=(e,t)=>{let{interleaved:n,numHeads:r,rotaryEmbeddingDim:i,scale:a}=t,o=e[0].dims[0],s=U.sizeFromDimension(e[0].dims,1),c=e[0].dims[e[0].dims.length-2],l=s/c,u=e[2].dims[1],d=i===0?u*2:l/r,f=[o,c,l/d,d-u],p=U.computeStrides(f),m=[{type:1,data:a},{type:12,data:f},{type:12,data:p},...e[0].dims.length===3?Array({type:12,data:[s,l,d,1]}):[],...e[0].dims.length===4?Array({type:12,data:[s,d,c*d,1]}):[],...G(e[0].dims,e[1].dims,e[2].dims,e[3].dims,e[0].dims)],h=t=>{let r=q(`input`,e[0].dataType,e[0].dims.length),i=q(`position_ids`,e[1].dataType,e[1].dims.length),a=q(`cos_cache`,e[2].dataType,e[2].dims.length),o=q(`sin_cache`,e[3].dataType,e[3].dims.length),s=J(`output`,e[0].dataType,e[0].dims.length);return t.registerUniforms([{name:`scale`,type:`f32`},{name:`global_shape`,type:`u32`,length:f.length},{name:`global_strides`,type:`u32`,length:p.length},{name:`input_output_strides`,type:`u32`,length:p.length}]),` + }`;return{name:`Split`,shaderCache:{hint:t.cacheKey,inputDependencies:[`rank`]},getShaderSource:p,getRunData:()=>({outputs:l,dispatchGroup:{x:Math.ceil(r/64)},programUniforms:f})}},Ic=(e,t)=>{jc(e.inputs);let n=e.inputs.length===1?t:Mc(e.inputs,t);e.compute(Fc(e.inputs,n),{inputs:[0]})},Lc=e=>{let t=e.axis,n=e.splitSizes,r=e.numOutputs<0?n.length:e.numOutputs;if(r!==n.length)throw Error(`numOutputs and splitSizes lengh must be equal`);return Jn({axis:t,numOutputs:r,splitSizes:n})}}),zc,Bc,Vc,Hc=M(()=>{"use strict";U(),G(),Yn(),X(),zc=(e,t)=>{let[n,r,i,a]=e,{numHeads:o,rotaryEmbeddingDim:s}=t;if(n.dims.length!==3&&n.dims.length!==4)throw Error(`Input 'x' is expected to have 3 or 4 dimensions, got ${n.dims.length}`);if(!W.areEqual(r.dims,[])&&!W.areEqual(r.dims,[1])&&r.dims.length!==2)throw Error(`Input 'position_ids' is expected to have 0, 1, or 2 dimensions, got ${r.dims.length}`);if(i.dims.length!==2)throw Error(`Input 'cos_cache' is expected to have 2 dimensions, got ${i.dims.length}`);if(a.dims.length!==2)throw Error(`Input 'sin_cache' is expected to have 2 dimensions, got ${a.dims.length}`);if(!W.areEqual(i.dims,a.dims))throw Error(`Inputs 'cos_cache' and 'sin_cache' are expected to have the same shape`);if(s>0&&o===0)throw Error(`num_heads must be provided if rotary_embedding_dim is specified`);let c=n.dims[0],l=n.dims[n.dims.length-2],u=i.dims[0],d=W.sizeFromDimension(n.dims,1)/l,f=s===0?i.dims[1]*2:d/o;if(s>f)throw Error(`rotary_embedding_dim must be less than or equal to head_size`);if(r.dims.length===2){if(c!==r.dims[0])throw Error(`Input 'position_ids' dimension 0 should be of size batch_size, got ${r.dims[0]}`);if(l!==r.dims[1])throw Error(`Input 'position_ids' dimension 1 should be of size sequence_length, got ${r.dims[1]}`)}if(f/2!==i.dims[1]&&s/2!==i.dims[1])throw Error(`Input 'cos_cache' dimension 1 should be same as head_size / 2 or rotary_embedding_dim / 2, got ${i.dims[1]}`);if(l>u)throw Error(`Updating cos_cache and sin_cache in RotaryEmbedding is not currently supported`)},Bc=(e,t)=>{let{interleaved:n,numHeads:r,rotaryEmbeddingDim:i,scale:a}=t,o=e[0].dims[0],s=W.sizeFromDimension(e[0].dims,1),c=e[0].dims[e[0].dims.length-2],l=s/c,u=e[2].dims[1],d=i===0?u*2:l/r,f=[o,c,l/d,d-u],p=W.computeStrides(f),m=[{type:1,data:a},{type:12,data:f},{type:12,data:p},...e[0].dims.length===3?Array({type:12,data:[s,l,d,1]}):[],...e[0].dims.length===4?Array({type:12,data:[s,d,c*d,1]}):[],...K(e[0].dims,e[1].dims,e[2].dims,e[3].dims,e[0].dims)],h=t=>{let r=J(`input`,e[0].dataType,e[0].dims.length),i=J(`position_ids`,e[1].dataType,e[1].dims.length),a=J(`cos_cache`,e[2].dataType,e[2].dims.length),o=J(`sin_cache`,e[3].dataType,e[3].dims.length),s=Y(`output`,e[0].dataType,e[0].dims.length);return t.registerUniforms([{name:`scale`,type:`f32`},{name:`global_shape`,type:`u32`,length:f.length},{name:`global_strides`,type:`u32`,length:p.length},{name:`input_output_strides`,type:`u32`,length:p.length}]),` ${t.declareVariables(r,i,a,o,s)} - ${t.mainStart(Zn)} + ${t.mainStart(Xn)} let half_rotary_emb_dim = uniforms.${a.name}_shape[1]; let bsnh = global_idx / uniforms.global_strides % uniforms.global_shape; let size = uniforms.global_shape[0] * uniforms.global_strides[0]; @@ -1792,7 +1792,7 @@ fn calculateOutputIndex(index: u32) -> u32 { if (bsnh[3] < half_rotary_emb_dim) { let position_ids_idx = - ${i.broadcastedIndicesToOffset(`bsnh.xy`,J(``,i.type.tensor,2))}; + ${i.broadcastedIndicesToOffset(`bsnh.xy`,Y(``,i.type.tensor,2))}; let position_id = u32(${i.getByOffset(`position_ids_idx`)}) + select(0, bsnh[1], position_ids_idx == 0); let i = dot(bsnh, uniforms.input_output_strides) + select(0, bsnh[3], ${n}); @@ -1807,7 +1807,7 @@ fn calculateOutputIndex(index: u32) -> u32 { let k = dot(bsnh, uniforms.input_output_strides) + half_rotary_emb_dim; ${s.setByOffset(`k`,r.getByOffset(`k`))} } - }`};return{name:`RotaryEmbedding`,shaderCache:{hint:Yn({interleaved:n}).cacheKey,inputDependencies:[`rank`,`rank`,`rank`,`rank`]},getShaderSource:h,getRunData:()=>({outputs:[{dims:e[0].dims,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(U.size(f)/Zn)},programUniforms:m})}},Hc=(e,t)=>{Bc(e.inputs,t),e.compute(Vc(e.inputs,t))}}),Wc,Gc,Kc,qc,Jc,Yc=M(()=>{"use strict";Xn(),V(),Di(),jc(),zc(),vr(),Uc(),Y(),Wc=(e,t)=>{if(t.doRotary&&e.length<=7)throw Error(`cos_cache and sin_cache inputs are required if do_rotary is specified`);let n=e[0],r=e[1],i=e[2],a=e[3],o=e[4];if(t.doRotary!==0&&e.length<=7)throw Error(`cos_cast and sin_cache are expected if do_rotary attribute is non-zero`);if(t.localWindowSize!==-1)throw Error(`Local attention is not supported`);if(t.softcap!==0)throw Error(`Softcap is not supported`);if(t.rotaryInterleaved!==0)throw Error(`Rotary interleaved is not supported`);if(t.smoothSoftmax)throw Error(`Smooth softmax is not supported`);if(n.dims.length!==3&&n.dims.length!==5)throw Error(`Input query is expected to have 3 or 5 dimensions`);let s=!1,c=n.dims[0],l=n.dims[1],u=n.dims.length===3?s?n.dims[2]/3:n.dims[2]:t.numHeads*n.dims[4],d=l,f=0,p=!r||r.dims.length===0,m=Math.floor(p?u/(t.numHeads+2*t.kvNumHeads):u/t.numHeads);p&&(u=m*t.numHeads);let h=a&&a.dims.length!==0,g=o&&o.dims.length!==0;if(h&&a.dims.length===4&&a.dims[0]===c&&a.dims[1]!==t.kvNumHeads&&a.dims[2]===t.kvNumHeads&&a.dims[3]===m)throw Error(`BSNH pastKey/pastValue is not supported`);if(h&&g){if(a.dims.length!==4)throw Error(`Input "past_key" is expected to have 4 dimensions`);if(o.dims.length!==4)throw Error(`Input "past_value" is expected to have 4 dimensions`);f=a.dims[2]}else if(h||g)throw Error(`Input "past_key" and "past_value" shall be both present or both absent`);let _=1;if(r&&r.dims.length>0){if(n.dims.length!==3)throw Error(`Input "query" is expected to have 3 dimensions when key is given`);if(r.dims.length<3||r.dims.length>5)throw Error(`Input "key" is expected to have 3, 4, or 5 dimensions`);if(n.dims[0]!==r.dims[0])throw Error(`Input "query" and "key" shall have same dim 0 (batch size)`);if(r.dims.length===3){if(n.dims[2]%r.dims[2]!==0)throw Error(`Dimension 2 of "query" should be a multiple of "key"`);d=r.dims[1]}else if(r.dims.length===5){if(r.dims[2]!==t.numHeads||r.dims[3]!==2||r.dims[4]!==m)throw Error(`Expect "key" shape (batch_size, kv_sequence_length, num_heads, 2, head_size) for packed kv`);if(i)throw Error(`Expect "value" be none when "key" has packed kv format.`);d=r.dims[1]}else{if(r.dims[1]!==t.numHeads||r.dims[3]!==m)throw Error(`Expect "key" shape (batch_size, num_heads, kv_sequence_length, head_size) for past_key`);d=r.dims[2]}}else{if(n.dims.length!==3&&n.dims.length!==5)throw Error(`Input "query" is expected to have 3 or 5 dimensions when key is empty`);if(n.dims.length===5&&(n.dims[2]!==t.numHeads||n.dims[3]!==3))throw Error(`Expect "query" shape (batch_size, kv_sequence_length, num_heads, 3, head_size) for packed kv`);_=3}let v=0,y=!1,b=t.kvNumHeads?m*t.kvNumHeads:u;if(i&&i.dims.length>0){if(i.dims.length!==3&&i.dims.length!==4)throw Error(`Input "value" is expected to have 3 or 4 dimensions`);if(n.dims[0]!==i.dims[0])throw Error(`Input "query" and "value" shall have same dim 0 (batch_size)`);if(i.dims.length===3){if(d!==i.dims[1])throw Error(`Input "key" and "value" shall have the same dim 1 (kv_sequence_length)`);b=i.dims[2]}else{if(d!==i.dims[2])throw Error(`Input "past_key" and "past_value" shall have the same dim 2 (kv_sequence_length)`);b=i.dims[1]*i.dims[3],y=!0}}let x=e.length>4?e[5]:void 0;if(x&&x.dims.length!==1&&x.dims[0]!==c)throw Error(`Input "seqlens" is expected to have 1 dimension and the same dim 0 as batch_size`);return{batchSize:c,sequenceLength:l,pastSequenceLength:f,kvSequenceLength:d,totalSequenceLength:-1,maxSequenceLength:-1,inputHiddenSize:0,hiddenSize:u,vHiddenSize:b,headSize:m,vHeadSize:Math.floor(b/t.kvNumHeads),numHeads:t.numHeads,kvNumHeads:t.kvNumHeads,nReps:t.numHeads/t.kvNumHeads,pastPresentShareBuffer:!1,maskType:v,scale:t.scale,broadcastResPosBias:!1,passPastInKv:y,qkvFormat:_}},Gc=Yn({perm:[0,2,1,3]}),Kc=(e,t,n)=>{let r=t,i=n.kvNumHeads;return t.dims.length===3&&n.kvSequenceLength!==0&&(r=t.reshape([n.batchSize,n.kvSequenceLength,i,n.headSize]),r=e.compute(hr(r,Gc.perm),{inputs:[r],outputs:[-1]})[0]),r},qc=(e,t,n,r)=>{let i=7,a=[`type`,`type`],o=[e*t],s=e*t,c=[{type:12,data:s},{type:12,data:t},{type:12,data:e}],l=e=>{let t=q(`seq_lens`,n.dataType,n.dims),a=q(`total_seq_lens`,r.dataType,r.dims),s=J(`pos_ids`,i,o),c=[{name:`output_size`,type:`u32`},{name:`sequence_length`,type:`u32`},{name:`batch_size`,type:`u32`}];return` + }`};return{name:`RotaryEmbedding`,shaderCache:{hint:Jn({interleaved:n}).cacheKey,inputDependencies:[`rank`,`rank`,`rank`,`rank`]},getShaderSource:h,getRunData:()=>({outputs:[{dims:e[0].dims,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(W.size(f)/Xn)},programUniforms:m})}},Vc=(e,t)=>{zc(e.inputs,t),e.compute(Bc(e.inputs,t))}}),Uc,Wc,Gc,Kc,qc,Jc=M(()=>{"use strict";Yn(),U(),Ei(),Ac(),Rc(),_r(),Hc(),X(),Uc=(e,t)=>{if(t.doRotary&&e.length<=7)throw Error(`cos_cache and sin_cache inputs are required if do_rotary is specified`);let n=e[0],r=e[1],i=e[2],a=e[3],o=e[4];if(t.doRotary!==0&&e.length<=7)throw Error(`cos_cast and sin_cache are expected if do_rotary attribute is non-zero`);if(t.localWindowSize!==-1)throw Error(`Local attention is not supported`);if(t.softcap!==0)throw Error(`Softcap is not supported`);if(t.rotaryInterleaved!==0)throw Error(`Rotary interleaved is not supported`);if(t.smoothSoftmax)throw Error(`Smooth softmax is not supported`);if(n.dims.length!==3&&n.dims.length!==5)throw Error(`Input query is expected to have 3 or 5 dimensions`);let s=!1,c=n.dims[0],l=n.dims[1],u=n.dims.length===3?s?n.dims[2]/3:n.dims[2]:t.numHeads*n.dims[4],d=l,f=0,p=!r||r.dims.length===0,m=Math.floor(p?u/(t.numHeads+2*t.kvNumHeads):u/t.numHeads);p&&(u=m*t.numHeads);let h=a&&a.dims.length!==0,g=o&&o.dims.length!==0;if(h&&a.dims.length===4&&a.dims[0]===c&&a.dims[1]!==t.kvNumHeads&&a.dims[2]===t.kvNumHeads&&a.dims[3]===m)throw Error(`BSNH pastKey/pastValue is not supported`);if(h&&g){if(a.dims.length!==4)throw Error(`Input "past_key" is expected to have 4 dimensions`);if(o.dims.length!==4)throw Error(`Input "past_value" is expected to have 4 dimensions`);f=a.dims[2]}else if(h||g)throw Error(`Input "past_key" and "past_value" shall be both present or both absent`);let _=1;if(r&&r.dims.length>0){if(n.dims.length!==3)throw Error(`Input "query" is expected to have 3 dimensions when key is given`);if(r.dims.length<3||r.dims.length>5)throw Error(`Input "key" is expected to have 3, 4, or 5 dimensions`);if(n.dims[0]!==r.dims[0])throw Error(`Input "query" and "key" shall have same dim 0 (batch size)`);if(r.dims.length===3){if(n.dims[2]%r.dims[2]!==0)throw Error(`Dimension 2 of "query" should be a multiple of "key"`);d=r.dims[1]}else if(r.dims.length===5){if(r.dims[2]!==t.numHeads||r.dims[3]!==2||r.dims[4]!==m)throw Error(`Expect "key" shape (batch_size, kv_sequence_length, num_heads, 2, head_size) for packed kv`);if(i)throw Error(`Expect "value" be none when "key" has packed kv format.`);d=r.dims[1]}else{if(r.dims[1]!==t.numHeads||r.dims[3]!==m)throw Error(`Expect "key" shape (batch_size, num_heads, kv_sequence_length, head_size) for past_key`);d=r.dims[2]}}else{if(n.dims.length!==3&&n.dims.length!==5)throw Error(`Input "query" is expected to have 3 or 5 dimensions when key is empty`);if(n.dims.length===5&&(n.dims[2]!==t.numHeads||n.dims[3]!==3))throw Error(`Expect "query" shape (batch_size, kv_sequence_length, num_heads, 3, head_size) for packed kv`);_=3}let v=0,y=!1,b=t.kvNumHeads?m*t.kvNumHeads:u;if(i&&i.dims.length>0){if(i.dims.length!==3&&i.dims.length!==4)throw Error(`Input "value" is expected to have 3 or 4 dimensions`);if(n.dims[0]!==i.dims[0])throw Error(`Input "query" and "value" shall have same dim 0 (batch_size)`);if(i.dims.length===3){if(d!==i.dims[1])throw Error(`Input "key" and "value" shall have the same dim 1 (kv_sequence_length)`);b=i.dims[2]}else{if(d!==i.dims[2])throw Error(`Input "past_key" and "past_value" shall have the same dim 2 (kv_sequence_length)`);b=i.dims[1]*i.dims[3],y=!0}}let x=e.length>4?e[5]:void 0;if(x&&x.dims.length!==1&&x.dims[0]!==c)throw Error(`Input "seqlens" is expected to have 1 dimension and the same dim 0 as batch_size`);return{batchSize:c,sequenceLength:l,pastSequenceLength:f,kvSequenceLength:d,totalSequenceLength:-1,maxSequenceLength:-1,inputHiddenSize:0,hiddenSize:u,vHiddenSize:b,headSize:m,vHeadSize:Math.floor(b/t.kvNumHeads),numHeads:t.numHeads,kvNumHeads:t.kvNumHeads,nReps:t.numHeads/t.kvNumHeads,pastPresentShareBuffer:!1,maskType:v,scale:t.scale,broadcastResPosBias:!1,passPastInKv:y,qkvFormat:_}},Wc=Jn({perm:[0,2,1,3]}),Gc=(e,t,n)=>{let r=t,i=n.kvNumHeads;return t.dims.length===3&&n.kvSequenceLength!==0&&(r=t.reshape([n.batchSize,n.kvSequenceLength,i,n.headSize]),r=e.compute(mr(r,Wc.perm),{inputs:[r],outputs:[-1]})[0]),r},Kc=(e,t,n,r)=>{let i=7,a=[`type`,`type`],o=[e*t],s=e*t,c=[{type:12,data:s},{type:12,data:t},{type:12,data:e}],l=e=>{let t=J(`seq_lens`,n.dataType,n.dims),a=J(`total_seq_lens`,r.dataType,r.dims),s=Y(`pos_ids`,i,o),c=[{name:`output_size`,type:`u32`},{name:`sequence_length`,type:`u32`},{name:`batch_size`,type:`u32`}];return` ${e.registerUniforms(c).declareVariables(t,a,s)} ${e.mainStart()} ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} @@ -1838,7 +1838,7 @@ fn calculateOutputIndex(index: u32) -> u32 { ${s.setByOffset(`global_idx`,`seqlen`)} }; } - `};return{name:`GeneratePositionIds`,shaderCache:{hint:`${e};${t}`,inputDependencies:a},getRunData:()=>({outputs:[{dims:o,dataType:i}],dispatchGroup:{x:Math.ceil(s/64)},programUniforms:c}),getShaderSource:l}},Jc=(e,t)=>{let n=Wc(e.inputs,t);if(e.inputs[0].dims.length===5)throw Error(`Packed QKV is not implemented`);if(e.inputs[1]?.dims.length===5)throw Error(`Packed KV is not implemented`);let r=e.inputs[0],i=e.inputs[1]&&e.inputs[1].dims.length>0?e.inputs[1]:void 0,a=e.inputs[2]&&e.inputs[2].dims.length>0?e.inputs[2]:void 0,o=e.inputs[3]&&e.inputs[3].dims.length!==0?e.inputs[3]:void 0,s=e.inputs[4]&&e.inputs[4].dims.length!==0?e.inputs[4]:void 0,c=e.inputs.length>4?e.inputs[5]:void 0,l=e.inputs.length>5?e.inputs[6]:void 0,u=n.kvNumHeads?n.kvNumHeads:n.numHeads,d=Yn({axis:2,numOutputs:3,splitSizes:[n.numHeads*n.headSize,u*n.headSize,u*n.headSize]}),[f,p,m]=!i&&!a?e.compute(Ic([r],d),{inputs:[r],outputs:[-1,-1,-1]}):[r,i,a],h,g;if(t.doRotary){let r=e.compute(qc(n.batchSize,n.sequenceLength,c,l),{inputs:[c,l],outputs:[-1]})[0],i=e.inputs[7],a=e.inputs[8],o=Yn({interleaved:t.rotaryInterleaved!==0,numHeads:n.numHeads,rotaryEmbeddingDim:0,scale:t.scale}),s=[f,r,i,a],u=[-1];h=e.compute(Vc(s,o),{inputs:s,outputs:u})[0],s.splice(0,1,p);let d=Yn({interleaved:t.rotaryInterleaved!==0,numHeads:n.kvNumHeads,rotaryEmbeddingDim:0,scale:t.scale});g=e.compute(Vc(s,d),{inputs:s,outputs:u})[0]}let _=kc(e,n.batchSize,n.numHeads,n.sequenceLength,n.headSize,t.doRotary?h:f,void 0,0),v=Kc(e,t.doRotary?g:p,n),y=Kc(e,m,n);wi(e,_,v,y,void 0,void 0,o,s,void 0,n,c,l)}}),Xc,Zc,Qc,$c,el=M(()=>{"use strict";V(),W(),vr(),Y(),Xc=(e,t,n,r,i,a,o,s)=>{let c=tr(a),l=c===1?`f32`:`vec${c}f`,u=c===1?`vec2f`:`mat2x${c}f`,d=i*o,f=64;d===1&&(f=256);let p=[i,o,a/c],m=[i,o,2],h=[`rank`,`type`,`type`],g=[];g.push(...G(p,m));let _=e=>{let i=q(`x`,t.dataType,3,c),a=q(`scale`,n.dataType,n.dims),o=q(`bias`,r.dataType,r.dims),d=J(`output`,1,3,2),p=[i,a,o,d];return` + `};return{name:`GeneratePositionIds`,shaderCache:{hint:`${e};${t}`,inputDependencies:a},getRunData:()=>({outputs:[{dims:o,dataType:i}],dispatchGroup:{x:Math.ceil(s/64)},programUniforms:c}),getShaderSource:l}},qc=(e,t)=>{let n=Uc(e.inputs,t);if(e.inputs[0].dims.length===5)throw Error(`Packed QKV is not implemented`);if(e.inputs[1]?.dims.length===5)throw Error(`Packed KV is not implemented`);let r=e.inputs[0],i=e.inputs[1]&&e.inputs[1].dims.length>0?e.inputs[1]:void 0,a=e.inputs[2]&&e.inputs[2].dims.length>0?e.inputs[2]:void 0,o=e.inputs[3]&&e.inputs[3].dims.length!==0?e.inputs[3]:void 0,s=e.inputs[4]&&e.inputs[4].dims.length!==0?e.inputs[4]:void 0,c=e.inputs.length>4?e.inputs[5]:void 0,l=e.inputs.length>5?e.inputs[6]:void 0,u=n.kvNumHeads?n.kvNumHeads:n.numHeads,d=Jn({axis:2,numOutputs:3,splitSizes:[n.numHeads*n.headSize,u*n.headSize,u*n.headSize]}),[f,p,m]=!i&&!a?e.compute(Fc([r],d),{inputs:[r],outputs:[-1,-1,-1]}):[r,i,a],h,g;if(t.doRotary){let r=e.compute(Kc(n.batchSize,n.sequenceLength,c,l),{inputs:[c,l],outputs:[-1]})[0],i=e.inputs[7],a=e.inputs[8],o=Jn({interleaved:t.rotaryInterleaved!==0,numHeads:n.numHeads,rotaryEmbeddingDim:0,scale:t.scale}),s=[f,r,i,a],u=[-1];h=e.compute(Bc(s,o),{inputs:s,outputs:u})[0],s.splice(0,1,p);let d=Jn({interleaved:t.rotaryInterleaved!==0,numHeads:n.kvNumHeads,rotaryEmbeddingDim:0,scale:t.scale});g=e.compute(Bc(s,d),{inputs:s,outputs:u})[0]}let _=Oc(e,n.batchSize,n.numHeads,n.sequenceLength,n.headSize,t.doRotary?h:f,void 0,0),v=Gc(e,t.doRotary?g:p,n),y=Gc(e,m,n);Ci(e,_,v,y,void 0,void 0,o,s,void 0,n,c,l)}}),Yc,Xc,Zc,Qc,$c=M(()=>{"use strict";U(),G(),_r(),X(),Yc=(e,t,n,r,i,a,o,s)=>{let c=er(a),l=c===1?`f32`:`vec${c}f`,u=c===1?`vec2f`:`mat2x${c}f`,d=i*o,f=64;d===1&&(f=256);let p=[i,o,a/c],m=[i,o,2],h=[`rank`,`type`,`type`],g=[];g.push(...K(p,m));let _=e=>{let i=J(`x`,t.dataType,3,c),a=J(`scale`,n.dataType,n.dims),o=J(`bias`,r.dataType,r.dims),d=Y(`output`,1,3,2),p=[i,a,o,d];return` var workgroup_shared : array<${u}, ${f}>; const workgroup_size = ${f}u; ${e.declareVariables(...p)} @@ -1864,15 +1864,15 @@ fn calculateOutputIndex(index: u32) -> u32 { workgroupBarrier(); } if (local_idx == 0) { - let sum_final = ${ir(`workgroup_shared[0][0]`,c)} / f32(hight * ${c}); - let squared_sum_final = ${ir(`workgroup_shared[0][1]`,c)} / f32(hight * ${c}); + let sum_final = ${rr(`workgroup_shared[0][0]`,c)} / f32(hight * ${c}); + let squared_sum_final = ${rr(`workgroup_shared[0][1]`,c)} / f32(hight * ${c}); let inv_std_dev = inverseSqrt(squared_sum_final - sum_final * sum_final + f32(${s})); let channel_scale = inv_std_dev * f32(scale[channel]); let channel_shift = f32(bias[channel]) - sum_final * channel_scale; output[workgroup_index] = vec2f(channel_scale, channel_shift); } - }`};return e.compute({name:`InstanceNormComputeChannelScaleShift`,shaderCache:{hint:`${c};${s};${f}`,inputDependencies:h},getRunData:()=>({outputs:[{dims:m,dataType:1}],dispatchGroup:{x:d},programUniforms:g}),getShaderSource:_},{inputs:[t,n,r],outputs:[-1]})[0]},Zc=(e,t,n)=>{let r=t[0].dims,i=r,a=2,o=r[0],s=r[1],c=U.sizeFromDimension(r,a),l=tr(c),u=U.size(i)/l,d=Xc(e,t[0],t[1],t[2],o,c,s,n.epsilon),f=[o,s,c/l],p=[o,s],m=[`type`,`none`],h=e=>{let n=q(`x`,t[0].dataType,f.length,l),r=q(`scale_shift`,1,p.length,2),i=J(`output`,t[0].dataType,f.length,l),a=[n,r,i];return` + }`};return e.compute({name:`InstanceNormComputeChannelScaleShift`,shaderCache:{hint:`${c};${s};${f}`,inputDependencies:h},getRunData:()=>({outputs:[{dims:m,dataType:1}],dispatchGroup:{x:d},programUniforms:g}),getShaderSource:_},{inputs:[t,n,r],outputs:[-1]})[0]},Xc=(e,t,n)=>{let r=t[0].dims,i=r,a=2,o=r[0],s=r[1],c=W.sizeFromDimension(r,a),l=er(c),u=W.size(i)/l,d=Yc(e,t[0],t[1],t[2],o,c,s,n.epsilon),f=[o,s,c/l],p=[o,s],m=[`type`,`none`],h=e=>{let n=J(`x`,t[0].dataType,f.length,l),r=J(`scale_shift`,1,p.length,2),i=Y(`output`,t[0].dataType,f.length,l),a=[n,r,i];return` ${e.registerUniform(`output_size`,`u32`).declareVariables(...a)} ${e.mainStart()} ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} @@ -1882,7 +1882,7 @@ fn calculateOutputIndex(index: u32) -> u32 { let scale_shift = ${r.getByIndices(`vec2(batch, channel)`)}; let value = ${n.getByOffset(`global_idx`)} * ${i.type.value}(scale_shift.x) + ${i.type.value}(scale_shift.y); ${i.setByOffset(`global_idx`,`value`)}; - }`};e.compute({name:`InstanceNormalization`,shaderCache:{hint:`${l}`,inputDependencies:m},getRunData:()=>({outputs:[{dims:i,dataType:t[0].dataType}],dispatchGroup:{x:Math.ceil(u/64)},programUniforms:[{type:12,data:u},...G(f,p,f)]}),getShaderSource:h},{inputs:[t[0],d]})},Qc=(e,t,n)=>{let r=t[0].dims,i=r,a=r[0],o=r[r.length-1],s=U.sizeFromDimension(r,1)/o,c=tr(o),l=U.size(i)/c,u=[{type:12,data:s},{type:12,data:Math.floor(o/c)}],d=[`type`,`type`],f=!1,p=[0,r.length-1];for(let e=0;er[p[t]])),h=Xc(e,m,t[1],t[2],a,s,o,n.epsilon),g=e=>{let n=$n(t[0].dataType),r=c===1?`vec2f`:`mat${c}x2f`,a=e=>{let t=e===0?`x`:`y`,r=c===1?`f32`:`vec${c}f`;switch(c){case 1:return`${n}(${r}(scale.${t}))`;case 2:return`vec2<${n}>(${r}(scale[0].${t}, scale[1].${t}))`;case 4:return`vec4<${n}>(${r}(scale[0].${t}, scale[1].${t}, scale[2].${t}, scale[3].${t}))`;default:throw Error(`Not supported compoents ${c}`)}},o=q(`input`,t[0].dataType,t[0].dims,c),s=J(`output`,t[0].dataType,i,c);return` + }`};e.compute({name:`InstanceNormalization`,shaderCache:{hint:`${l}`,inputDependencies:m},getRunData:()=>({outputs:[{dims:i,dataType:t[0].dataType}],dispatchGroup:{x:Math.ceil(u/64)},programUniforms:[{type:12,data:u},...K(f,p,f)]}),getShaderSource:h},{inputs:[t[0],d]})},Zc=(e,t,n)=>{let r=t[0].dims,i=r,a=r[0],o=r[r.length-1],s=W.sizeFromDimension(r,1)/o,c=er(o),l=W.size(i)/c,u=[{type:12,data:s},{type:12,data:Math.floor(o/c)}],d=[`type`,`type`],f=!1,p=[0,r.length-1];for(let e=0;er[p[t]])),h=Yc(e,m,t[1],t[2],a,s,o,n.epsilon),g=e=>{let n=Qn(t[0].dataType),r=c===1?`vec2f`:`mat${c}x2f`,a=e=>{let t=e===0?`x`:`y`,r=c===1?`f32`:`vec${c}f`;switch(c){case 1:return`${n}(${r}(scale.${t}))`;case 2:return`vec2<${n}>(${r}(scale[0].${t}, scale[1].${t}))`;case 4:return`vec4<${n}>(${r}(scale[0].${t}, scale[1].${t}, scale[2].${t}, scale[3].${t}))`;default:throw Error(`Not supported compoents ${c}`)}},o=J(`input`,t[0].dataType,t[0].dims,c),s=Y(`output`,t[0].dataType,i,c);return` @group(0) @binding(0) var input : array<${o.type.storage}>; @group(0) @binding(1) var scale_input : array<${r}>; @group(0) @binding(2) var output : array<${s.type.storage}>; @@ -1896,35 +1896,35 @@ fn calculateOutputIndex(index: u32) -> u32 { let scale_offset = current_image_number * uniforms.C + current_channel_number; let scale = scale_input[scale_offset]; output[global_idx] = fma(input[global_idx], ${a(0)}, ${a(1)}); - }`};e.compute({name:`InstanceNormalizationNHWC`,shaderCache:{hint:`${c}`,inputDependencies:d},getRunData:()=>({outputs:[{dims:i,dataType:t[0].dataType}],dispatchGroup:{x:Math.ceil(l/64)},programUniforms:u}),getShaderSource:g},{inputs:[t[0],h]})},$c=(e,t)=>{t.format===`NHWC`?Qc(e,e.inputs,t):Zc(e,e.inputs,t)}}),tl,nl,rl,il=M(()=>{"use strict";V(),W(),Y(),tl=e=>{if(!e||e.length<2)throw Error(`layerNorm requires at least 2 inputs.`)},nl=(e,t,n)=>{let r=t.simplified,i=e[0].dims,a=e[1],o=!r&&e[2],s=i,c=U.normalizeAxis(t.axis,i.length),l=U.sizeToDimension(i,c),u=U.sizeFromDimension(i,c),d=U.size(a.dims),f=o?U.size(o.dims):0;if(d!==u||o&&f!==u)throw Error(`Size of X.shape()[axis:] == ${u}. + }`};e.compute({name:`InstanceNormalizationNHWC`,shaderCache:{hint:`${c}`,inputDependencies:d},getRunData:()=>({outputs:[{dims:i,dataType:t[0].dataType}],dispatchGroup:{x:Math.ceil(l/64)},programUniforms:u}),getShaderSource:g},{inputs:[t[0],h]})},Qc=(e,t)=>{t.format===`NHWC`?Zc(e,e.inputs,t):Xc(e,e.inputs,t)}}),el,tl,nl,rl=M(()=>{"use strict";U(),G(),X(),el=e=>{if(!e||e.length<2)throw Error(`layerNorm requires at least 2 inputs.`)},tl=(e,t,n)=>{let r=t.simplified,i=e[0].dims,a=e[1],o=!r&&e[2],s=i,c=W.normalizeAxis(t.axis,i.length),l=W.sizeToDimension(i,c),u=W.sizeFromDimension(i,c),d=W.size(a.dims),f=o?W.size(o.dims):0;if(d!==u||o&&f!==u)throw Error(`Size of X.shape()[axis:] == ${u}. Size of scale and bias (if provided) must match this. - Got scale size of ${d} and bias size of ${f}`);let p=[];for(let e=0;e1,v=n>2,y=t=>{let n=$n(e[0].dataType),i=[q(`x`,e[0].dataType,e[0].dims,m),q(`scale`,a.dataType,a.dims,m)];o&&i.push(q(`bias`,o.dataType,o.dims,m)),i.push(J(`output`,e[0].dataType,s,m)),_&&i.push(J(`mean_data_output`,1,p)),v&&i.push(J(`inv_std_output`,1,p));let c=[{name:`norm_count`,type:`u32`},{name:`norm_size`,type:`f32`},{name:`norm_size_vectorized`,type:`u32`},{name:`epsilon`,type:`f32`}];return` + Got scale size of ${d} and bias size of ${f}`);let p=[];for(let e=0;e1,v=n>2,y=t=>{let n=Qn(e[0].dataType),i=[J(`x`,e[0].dataType,e[0].dims,m),J(`scale`,a.dataType,a.dims,m)];o&&i.push(J(`bias`,o.dataType,o.dims,m)),i.push(Y(`output`,e[0].dataType,s,m)),_&&i.push(Y(`mean_data_output`,1,p)),v&&i.push(Y(`inv_std_output`,1,p));let c=[{name:`norm_count`,type:`u32`},{name:`norm_size`,type:`f32`},{name:`norm_size_vectorized`,type:`u32`},{name:`epsilon`,type:`f32`}];return` ${t.registerUniforms(c).declareVariables(...i)} ${t.mainStart()} ${t.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.norm_count`)} let offset = global_idx * uniforms.norm_size_vectorized; - var mean_vector = ${nr(`f32`,m)}; - var mean_square_vector = ${nr(`f32`,m)}; + var mean_vector = ${tr(`f32`,m)}; + var mean_square_vector = ${tr(`f32`,m)}; for (var h: u32 = 0u; h < uniforms.norm_size_vectorized; h++) { - let value = ${rr(n,m,`x[h + offset]`)}; + let value = ${nr(n,m,`x[h + offset]`)}; mean_vector += value; mean_square_vector += value * value; } - let mean = ${ir(`mean_vector`,m)} / uniforms.norm_size; - let inv_std_dev = inverseSqrt(${ir(`mean_square_vector`,m)} / uniforms.norm_size ${r?``:`- mean * mean`} + uniforms.epsilon); + let mean = ${rr(`mean_vector`,m)} / uniforms.norm_size; + let inv_std_dev = inverseSqrt(${rr(`mean_square_vector`,m)} / uniforms.norm_size ${r?``:`- mean * mean`} + uniforms.epsilon); for (var j: u32 = 0; j < uniforms.norm_size_vectorized; j++) { - let f32input = ${rr(n,m,`x[j + offset]`)}; - let f32scale = ${rr(n,m,`scale[j]`)}; + let f32input = ${nr(n,m,`x[j + offset]`)}; + let f32scale = ${nr(n,m,`scale[j]`)}; output[j + offset] = ${i[0].type.value}((f32input ${r?``:`- mean`}) * inv_std_dev * f32scale - ${o?`+ ${rr(n,m,`bias[j]`)}`:``} + ${o?`+ ${nr(n,m,`bias[j]`)}`:``} ); } ${_?`mean_data_output[global_idx] = mean`:``}; ${v?`inv_std_output[global_idx] = inv_std_dev`:``}; - }`},b=[{dims:s,dataType:e[0].dataType}];return _&&b.push({dims:p,dataType:1}),v&&b.push({dims:p,dataType:1}),{name:`LayerNormalization`,shaderCache:{hint:`${m};${n};${r}`,inputDependencies:h},getRunData:()=>({outputs:b,dispatchGroup:{x:Math.ceil(l/64)},programUniforms:g}),getShaderSource:y}},rl=(e,t)=>{tl(e.inputs),e.compute(nl(e.inputs,t,e.outputCount))}}),al,ol,sl=M(()=>{"use strict";W(),po(),So(),al=e=>{if(!e||e.length!==2)throw Error(`MatMul requires 2 inputs.`);if(e[0].dims[e[0].dims.length-1]!==e[1].dims[e[1].dims.length-2])throw Error(`shared dimension does not match.`)},ol=e=>{al(e.inputs);let t=hn.calcShape(e.inputs[0].dims,e.inputs[1].dims,!0);if(!t)throw Error(`Can't use matmul on the given tensors`);let n=t[t.length-1],r=e.inputs[0].dims[e.inputs[0].dims.length-1];if(n<8&&r<8)e.compute(fo(e.inputs,{activation:``},t));else{let i=t[t.length-2],a=U.size(e.inputs[0].dims.slice(0,-2)),o=U.size(e.inputs[1].dims.slice(0,-2));if(a!==1&&i===1&&o===1){let i=e.inputs[0].reshape([1,a,r]),o=e.inputs[1].reshape([1,r,n]),s=[1,a,n],c=[i,o];e.compute(xo(c,{activation:``},t,s),{inputs:c})}else e.compute(xo(e.inputs,{activation:``},t))}}}),cl,ll,ul,dl,fl,pl=M(()=>{"use strict";V(),W(),Xn(),Y(),cl=(e,t)=>{if(e.length<3||e.length>4)throw Error(`MatMulNBits requires 3 or 4 inputs`);let n=e[0],r=n.dims.length;if(n.dims[r-1]!==t.k)throw Error(`The last dim of input shape does not match the k value`);let i=Math.floor((t.k+t.blockSize-1)/t.blockSize),a=t.blockSize/8*t.bits,o=e[1];if(!U.areEqual(o.dims,[t.n,i,a]))throw Error(`The second inputs must be 3D tensor with shape N X nBlocksPerCol X blobSize`);let s=e[2].dims;if(U.size(s)!==t.n*i)throw Error(`scales input size error.`);if(e.length===4){let n=e[3].dims,r=t.bits>4?t.n*i:t.n*Math.floor((i+1)/2);if(U.size(n)!==r)throw Error(`zeroPoints input size error.`)}},ll=(e,t)=>{let n=e[0].dims,r=n.length,i=n[r-2],a=t.k,o=t.n,s=n.slice(0,r-2),c=U.size(s),l=e[1].dims[2]/4,u=e[0].dataType,d=tr(t.k),f=tr(l),p=tr(o),m=s.concat([i,o]),h=i>1&&o/p%2==0?2:1,g=U.size(m)/p/h,_=64,v=[],y=[c,i,a/d],b=U.convertShape(e[1].dims).slice();b.splice(-1,1,l/f),v.push(...G(y)),v.push(...G(b)),v.push(...G(e[2].dims)),e.length===4&&v.push(...G(U.convertShape(e[3].dims)));let x=[c,i,o/p];v.push(...G(x));let S=n=>{let r=y.length,i=q(`a`,e[0].dataType,r,d),a=q(`b`,12,b.length,f),o=q(`scales`,e[2].dataType,e[2].dims.length),s=[i,a,o],c=e.length===4?q(`zero_points`,12,e[3].dims.length):void 0;c&&s.push(c);let u=x.length,m=J(`output`,e[0].dataType,u,p),g=$n(e[0].dataType),v=(()=>{switch(d){case 1:return`array<${g}, 8>`;case 2:return`mat4x2<${g}>`;case 4:return`mat2x4<${g}>`;default:throw Error(`${d}-component is not supported.`)}})(),S=()=>{let e=` + }`},b=[{dims:s,dataType:e[0].dataType}];return _&&b.push({dims:p,dataType:1}),v&&b.push({dims:p,dataType:1}),{name:`LayerNormalization`,shaderCache:{hint:`${m};${n};${r}`,inputDependencies:h},getRunData:()=>({outputs:b,dispatchGroup:{x:Math.ceil(l/64)},programUniforms:g}),getShaderSource:y}},nl=(e,t)=>{el(e.inputs),e.compute(tl(e.inputs,t,e.outputCount))}}),il,al,ol=M(()=>{"use strict";G(),fo(),xo(),il=e=>{if(!e||e.length!==2)throw Error(`MatMul requires 2 inputs.`);if(e[0].dims[e[0].dims.length-1]!==e[1].dims[e[1].dims.length-2])throw Error(`shared dimension does not match.`)},al=e=>{il(e.inputs);let t=mn.calcShape(e.inputs[0].dims,e.inputs[1].dims,!0);if(!t)throw Error(`Can't use matmul on the given tensors`);let n=t[t.length-1],r=e.inputs[0].dims[e.inputs[0].dims.length-1];if(n<8&&r<8)e.compute(uo(e.inputs,{activation:``},t));else{let i=t[t.length-2],a=W.size(e.inputs[0].dims.slice(0,-2)),o=W.size(e.inputs[1].dims.slice(0,-2));if(a!==1&&i===1&&o===1){let i=e.inputs[0].reshape([1,a,r]),o=e.inputs[1].reshape([1,r,n]),s=[1,a,n],c=[i,o];e.compute(bo(c,{activation:``},t,s),{inputs:c})}else e.compute(bo(e.inputs,{activation:``},t))}}}),sl,cl,ll,ul,dl,fl=M(()=>{"use strict";U(),G(),Yn(),X(),sl=(e,t)=>{if(e.length<3||e.length>4)throw Error(`MatMulNBits requires 3 or 4 inputs`);let n=e[0],r=n.dims.length;if(n.dims[r-1]!==t.k)throw Error(`The last dim of input shape does not match the k value`);let i=Math.floor((t.k+t.blockSize-1)/t.blockSize),a=t.blockSize/8*t.bits,o=e[1];if(!W.areEqual(o.dims,[t.n,i,a]))throw Error(`The second inputs must be 3D tensor with shape N X nBlocksPerCol X blobSize`);let s=e[2].dims;if(W.size(s)!==t.n*i)throw Error(`scales input size error.`);if(e.length===4){let n=e[3].dims,r=t.bits>4?t.n*i:t.n*Math.floor((i+1)/2);if(W.size(n)!==r)throw Error(`zeroPoints input size error.`)}},cl=(e,t)=>{let n=e[0].dims,r=n.length,i=n[r-2],a=t.k,o=t.n,s=n.slice(0,r-2),c=W.size(s),l=e[1].dims[2]/4,u=e[0].dataType,d=er(t.k),f=er(l),p=er(o),m=s.concat([i,o]),h=i>1&&o/p%2==0?2:1,g=W.size(m)/p/h,_=64,v=[],y=[c,i,a/d],b=W.convertShape(e[1].dims).slice();b.splice(-1,1,l/f),v.push(...K(y)),v.push(...K(b)),v.push(...K(e[2].dims)),e.length===4&&v.push(...K(W.convertShape(e[3].dims)));let x=[c,i,o/p];v.push(...K(x));let S=n=>{let r=y.length,i=J(`a`,e[0].dataType,r,d),a=J(`b`,12,b.length,f),o=J(`scales`,e[2].dataType,e[2].dims.length),s=[i,a,o],c=e.length===4?J(`zero_points`,12,e[3].dims.length):void 0;c&&s.push(c);let u=x.length,m=Y(`output`,e[0].dataType,u,p),g=Qn(e[0].dataType),v=(()=>{switch(d){case 1:return`array<${g}, 8>`;case 2:return`mat4x2<${g}>`;case 4:return`mat2x4<${g}>`;default:throw Error(`${d}-component is not supported.`)}})(),S=()=>{let e=` // reuse a data var input_offset = ${i.indicesToOffset(`${i.type.indices}(batch, row, word_offset)`)}; var a_data: ${v}; @@ -2001,7 +2001,7 @@ fn calculateOutputIndex(index: u32) -> u32 { } ${m.setByIndices(`${m.type.indices}(batch, row, col + local_id.x)`,`output_value`)}; } - }`};return{name:`MatMulNBits`,shaderCache:{hint:`${t.blockSize};${t.bits};${d};${f};${p};${h};${_}`,inputDependencies:Array(e.length).fill(`rank`)},getRunData:()=>({outputs:[{dims:m,dataType:u}],dispatchGroup:{x:g},programUniforms:v}),getShaderSource:S}},ul=(e,t)=>{let n=e[0].dims,r=n.length,i=n[r-2],a=t.k,o=t.n,s=n.slice(0,r-2),c=U.size(s),l=e[1].dims[2]/4,u=e[0].dataType,d=tr(t.k),f=tr(l),p=s.concat([i,o]),m=128,h=o%8==0?8:o%4==0?4:1,g=m/h,_=g*f*8,v=_/d,y=_/t.blockSize,b=U.size(p)/h,x=[],S=[c,i,a/d],C=U.convertShape(e[1].dims).slice();C.splice(-1,1,l/f),x.push(...G(S)),x.push(...G(C)),x.push(...G(e[2].dims)),e.length===4&&x.push(...G(U.convertShape(e[3].dims)));let w=[c,i,o];x.push(...G(w));let T=n=>{let r=S.length,i=q(`a`,e[0].dataType,r,d),a=q(`b`,12,C.length,f),o=q(`scales`,e[2].dataType,e[2].dims.length),s=[i,a,o],c=e.length===4?q(`zero_points`,12,e[3].dims.length):void 0;c&&s.push(c);let l=w.length,u=J(`output`,e[0].dataType,l),p=$n(e[0].dataType),_=()=>{switch(d){case 1:return` + }`};return{name:`MatMulNBits`,shaderCache:{hint:`${t.blockSize};${t.bits};${d};${f};${p};${h};${_}`,inputDependencies:Array(e.length).fill(`rank`)},getRunData:()=>({outputs:[{dims:m,dataType:u}],dispatchGroup:{x:g},programUniforms:v}),getShaderSource:S}},ll=(e,t)=>{let n=e[0].dims,r=n.length,i=n[r-2],a=t.k,o=t.n,s=n.slice(0,r-2),c=W.size(s),l=e[1].dims[2]/4,u=e[0].dataType,d=er(t.k),f=er(l),p=s.concat([i,o]),m=128,h=o%8==0?8:o%4==0?4:1,g=m/h,_=g*f*8,v=_/d,y=_/t.blockSize,b=W.size(p)/h,x=[],S=[c,i,a/d],C=W.convertShape(e[1].dims).slice();C.splice(-1,1,l/f),x.push(...K(S)),x.push(...K(C)),x.push(...K(e[2].dims)),e.length===4&&x.push(...K(W.convertShape(e[3].dims)));let w=[c,i,o];x.push(...K(w));let T=n=>{let r=S.length,i=J(`a`,e[0].dataType,r,d),a=J(`b`,12,C.length,f),o=J(`scales`,e[2].dataType,e[2].dims.length),s=[i,a,o],c=e.length===4?J(`zero_points`,12,e[3].dims.length):void 0;c&&s.push(c);let l=w.length,u=Y(`output`,e[0].dataType,l),p=Qn(e[0].dataType),_=()=>{switch(d){case 1:return` let a_data0 = vec4<${p}>(sub_a[word_offset], sub_a[word_offset + 1], sub_a[word_offset + 2], sub_a[word_offset + 3]); let a_data1 = vec4<${p}>(sub_a[word_offset + 4], sub_a[word_offset + 5], sub_a[word_offset + 6], sub_a[word_offset + 7]);`;case 2:return` let a_data0 = vec4<${p}>(sub_a[word_offset], sub_a[word_offset + 1]); @@ -2075,15 +2075,15 @@ fn calculateOutputIndex(index: u32) -> u32 { ${u.setByIndices(`${u.type.indices}(batch, row, col + local_idx)`,`output_value`)} } } - }`};return{name:`BlockwiseMatMulNBits32`,shaderCache:{hint:`${t.blockSize};${d};${f};${g};${h}`,inputDependencies:Array(e.length).fill(`rank`)},getRunData:()=>({outputs:[{dims:p,dataType:u}],dispatchGroup:{x:b},programUniforms:x}),getShaderSource:T}},dl=(e,t)=>{cl(e.inputs,t),t.blockSize===32&&e.adapterInfo.isVendor(`intel`)&&e.adapterInfo.isArchitecture(`gen-12lp`)?e.compute(ul(e.inputs,t)):e.compute(ll(e.inputs,t))},fl=e=>Yn(e)}),ml,hl,gl,_l,vl,yl,bl,xl,Sl,Cl=M(()=>{"use strict";V(),W(),Y(),ml=e=>{if(!e||e.length<1)throw Error(`Too few inputs`);if(e[0].dataType!==1&&e[0].dataType!==10)throw Error(`Input type must be float or float16.`);if(e.length>=2){let t=e[0].dims.length*2===e[1].dims[0];if(e.length===4&&(t=e[3].dims[0]*2===e[1].dims[0]),!t)throw Error(`The pads should be a 1D tensor of shape [2 * input_rank] or [2 * num_axes].`)}},hl=(e,t,n)=>{let r=``;for(let i=t-1;i>=0;--i)r+=` - k = i32(${e.indicesGet(`indices`,i)}) - ${K(`uniforms.pads`,i,n)}; + }`};return{name:`BlockwiseMatMulNBits32`,shaderCache:{hint:`${t.blockSize};${d};${f};${g};${h}`,inputDependencies:Array(e.length).fill(`rank`)},getRunData:()=>({outputs:[{dims:p,dataType:u}],dispatchGroup:{x:b},programUniforms:x}),getShaderSource:T}},ul=(e,t)=>{sl(e.inputs,t),t.blockSize===32&&e.adapterInfo.isVendor(`intel`)&&e.adapterInfo.isArchitecture(`gen-12lp`)?e.compute(ll(e.inputs,t)):e.compute(cl(e.inputs,t))},dl=e=>Jn(e)}),pl,ml,hl,gl,_l,vl,yl,bl,xl,Sl=M(()=>{"use strict";U(),G(),X(),pl=e=>{if(!e||e.length<1)throw Error(`Too few inputs`);if(e[0].dataType!==1&&e[0].dataType!==10)throw Error(`Input type must be float or float16.`);if(e.length>=2){let t=e[0].dims.length*2===e[1].dims[0];if(e.length===4&&(t=e[3].dims[0]*2===e[1].dims[0]),!t)throw Error(`The pads should be a 1D tensor of shape [2 * input_rank] or [2 * num_axes].`)}},ml=(e,t,n)=>{let r=``;for(let i=t-1;i>=0;--i)r+=` + k = i32(${e.indicesGet(`indices`,i)}) - ${q(`uniforms.pads`,i,n)}; if (k < 0) { break; } - if (k >= i32(${K(`uniforms.x_shape`,i,t)})) { + if (k >= i32(${q(`uniforms.x_shape`,i,t)})) { break; } - offset += k * i32(${K(`uniforms.x_strides`,i,t)}); + offset += k * i32(${q(`uniforms.x_strides`,i,t)}); `;return` value = ${e.type.value}(uniforms.constant_value); for (var i = 0; i < 1; i++) { @@ -2092,53 +2092,53 @@ fn calculateOutputIndex(index: u32) -> u32 { ${r} value = x[offset]; } - `},gl=(e,t,n)=>{let r=``;for(let i=t-1;i>=0;--i)r+=` - k = i32(${e.indicesGet(`indices`,i)}) - ${K(`uniforms.pads`,i,n)}; + `},hl=(e,t,n)=>{let r=``;for(let i=t-1;i>=0;--i)r+=` + k = i32(${e.indicesGet(`indices`,i)}) - ${q(`uniforms.pads`,i,n)}; if (k < 0) { k = -k; } { - let _2n_1 = 2 * (i32(${K(`uniforms.x_shape`,i,t)}) - 1); + let _2n_1 = 2 * (i32(${q(`uniforms.x_shape`,i,t)}) - 1); k = k % _2n_1; - if(k >= i32(${K(`uniforms.x_shape`,i,t)})) { + if(k >= i32(${q(`uniforms.x_shape`,i,t)})) { k = _2n_1 - k; } } - offset += k * i32(${K(`uniforms.x_strides`,i,t)}); + offset += k * i32(${q(`uniforms.x_strides`,i,t)}); `;return` var offset = 0; var k = 0; ${r} value = x[offset]; - `},_l=(e,t,n)=>{let r=``;for(let i=t-1;i>=0;--i)r+=` - k = i32(${e.indicesGet(`indices`,i)}) - ${K(`uniforms.pads`,i,n)}; + `},gl=(e,t,n)=>{let r=``;for(let i=t-1;i>=0;--i)r+=` + k = i32(${e.indicesGet(`indices`,i)}) - ${q(`uniforms.pads`,i,n)}; if (k < 0) { k = 0; } - if (k >= i32(${K(`uniforms.x_shape`,i,t)})) { - k = i32(${K(`uniforms.x_shape`,i,t)}) - 1; + if (k >= i32(${q(`uniforms.x_shape`,i,t)})) { + k = i32(${q(`uniforms.x_shape`,i,t)}) - 1; } - offset += k * i32(${K(`uniforms.x_strides`,i,t)}); + offset += k * i32(${q(`uniforms.x_strides`,i,t)}); `;return` var offset = 0; var k = 0; ${r} value = x[offset]; - `},vl=(e,t,n)=>{let r=``;for(let i=t-1;i>=0;--i)r+=` - k = i32(${e.indicesGet(`indices`,i)}) - ${K(`uniforms.pads`,i,n)}; + `},_l=(e,t,n)=>{let r=``;for(let i=t-1;i>=0;--i)r+=` + k = i32(${e.indicesGet(`indices`,i)}) - ${q(`uniforms.pads`,i,n)}; if (k < 0) { - k += i32(${K(`uniforms.x_shape`,i,t)}]); + k += i32(${q(`uniforms.x_shape`,i,t)}]); } - if (k >= i32(${K(`uniforms.x_shape`,i,t)})) { - k -= i32(${K(`uniforms.x_shape`,i,t)}); + if (k >= i32(${q(`uniforms.x_shape`,i,t)})) { + k -= i32(${q(`uniforms.x_shape`,i,t)}); } - offset += k * i32(${K(`uniforms.x_strides`,i,t)}); + offset += k * i32(${q(`uniforms.x_strides`,i,t)}); `;return` var offset = 0; var k = 0; ${r} value = x[offset]; - `},yl=(e,t,n)=>{switch(n.mode){case 0:return hl(e,t,n.pads.length);case 1:return gl(e,t,n.pads.length);case 2:return _l(e,t,n.pads.length);case 3:return vl(e,t,n.pads.length);default:throw Error(`Invalid mode`)}},bl=(e,t)=>{let n=U.padShape(e[0].dims.slice(),t.pads),r=e[0].dims,i=U.size(n),a=[{type:12,data:i},{type:6,data:t.pads}],o=e.length>=3&&e[2].data;t.mode===0&&a.push({type:o?e[2].dataType:1,data:t.value}),a.push(...G(e[0].dims,n));let s=[`rank`],c=i=>{let a=J(`output`,e[0].dataType,n.length),s=q(`x`,e[0].dataType,r.length),c=s.type.value,l=yl(a,r.length,t),u=[{name:`output_size`,type:`u32`},{name:`pads`,type:`i32`,length:t.pads.length}];return t.mode===0&&u.push({name:`constant_value`,type:o?c:`f32`}),` + `},vl=(e,t,n)=>{switch(n.mode){case 0:return ml(e,t,n.pads.length);case 1:return hl(e,t,n.pads.length);case 2:return gl(e,t,n.pads.length);case 3:return _l(e,t,n.pads.length);default:throw Error(`Invalid mode`)}},yl=(e,t)=>{let n=W.padShape(e[0].dims.slice(),t.pads),r=e[0].dims,i=W.size(n),a=[{type:12,data:i},{type:6,data:t.pads}],o=e.length>=3&&e[2].data;t.mode===0&&a.push({type:o?e[2].dataType:1,data:t.value}),a.push(...K(e[0].dims,n));let s=[`rank`],c=i=>{let a=Y(`output`,e[0].dataType,n.length),s=J(`x`,e[0].dataType,r.length),c=s.type.value,l=vl(a,r.length,t),u=[{name:`output_size`,type:`u32`},{name:`pads`,type:`i32`,length:t.pads.length}];return t.mode===0&&u.push({name:`constant_value`,type:o?c:`f32`}),` ${i.registerUniforms(u).declareVariables(s,a)} ${i.mainStart()} ${i.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} @@ -2148,7 +2148,7 @@ fn calculateOutputIndex(index: u32) -> u32 { var value = ${c}(0); ${l} output[global_idx] = value; - }`};return{name:`Pad`,shaderCache:{hint:`${t.mode}${o}`,inputDependencies:s},getRunData:()=>({outputs:[{dims:n,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(U.size(n)/64)},programUniforms:a}),getShaderSource:c}},xl=(e,t)=>{if(e.length>1){let n=e[1].getBigInt64Array(),r=e.length>=3&&e[2].data?e[2].dataType===10?e[2].getUint16Array()[0]:e[2].getFloat32Array()[0]:0,i=e[0].dims.length,a=new Int32Array(2*i).fill(0);if(e.length>=4){let t=e[3].getBigInt64Array();for(let e=0;ea[Number(t)]=Number(e));let o=[];return a.forEach(e=>o.push(e)),{mode:t.mode,value:r,pads:o}}else return t},Sl=(e,t)=>{ml(e.inputs);let n=xl(e.inputs,t);e.compute(bl(e.inputs,n),{inputs:[0]})}}),Z,wl,Tl,El,Dl,Ol,kl,Al,jl,Ml,Nl,Pl,Fl,Il,Ll,Rl,zl,Bl,Vl,Hl=M(()=>{"use strict";$e(),V(),W(),Y(),Z=e=>{if(L.webgpu.validateInputContent&&(!e||e.length!==1))throw Error(`Pool ops requires 1 input.`)},wl=(e,t,n)=>{let r=t.format===`NHWC`,i=e.dims.slice();r&&i.splice(1,0,i.pop());let a=Object.hasOwnProperty.call(t,`dilations`),o=t.kernelShape.slice(),s=t.strides.slice(),c=a?t.dilations.slice():[],l=t.pads.slice();gn.adjustPoolAttributes(n,i,o,s,c,l);let u=gn.computePoolOutputShape(n,i,s,c,o,l,t.autoPad),d=Object.assign({},t);a?Object.assign(d,{kernelShape:o,strides:s,pads:l,dilations:c,cacheKey:t.cacheKey}):Object.assign(d,{kernelShape:o,strides:s,pads:l,cacheKey:t.cacheKey});let f=u.slice();return f.push(f.splice(1,1)[0]),[d,r?f:u]},Tl=(e,t)=>{let n=t.format===`NHWC`,r=U.size(e),i=U.size(t.kernelShape),a=[{type:12,data:r},{type:12,data:i}],o=[{name:`outputSize`,type:`u32`},{name:`kernelSize`,type:`u32`}];if(t.kernelShape.length<=2){let e=t.kernelShape[t.kernelShape.length-1],n=t.strides[t.strides.length-1],r=t.pads[t.pads.length/2-1],i=t.pads[t.pads.length-1],s=!!(r+i);a.push({type:12,data:e},{type:12,data:n},{type:12,data:r},{type:12,data:i}),o.push({name:`kw`,type:`u32`},{name:`sw`,type:`u32`},{name:`pwStart`,type:`u32`},{name:`pwEnd`,type:`u32`});let c=!1;if(t.kernelShape.length===2){let e=t.kernelShape[t.kernelShape.length-2],n=t.strides[t.strides.length-2],r=t.pads[t.pads.length/2-2],i=t.pads[t.pads.length-2];c=!!(r+i),a.push({type:12,data:e},{type:12,data:n},{type:12,data:r},{type:12,data:i}),o.push({name:`kh`,type:`u32`},{name:`sh`,type:`u32`},{name:`phStart`,type:`u32`},{name:`phEnd`,type:`u32`})}return[a,o,!0,s,c]}else{if(n)throw Error(`Pooling with kernelShape.length > 2 is not supported for NHWC format.`);let e=U.computeStrides(t.kernelShape);a.push({type:12,data:e},{type:12,data:t.pads},{type:12,data:t.strides}),o.push({name:`kernelStrides`,type:`u32`,length:e.length},{name:`pads`,type:`u32`,length:t.pads.length},{name:`strides`,type:`u32`,length:t.strides.length});let r=t.pads.reduce((e,t)=>e+t);return[a,o,!!r,!1,!1]}},El=(e,t,n,r,i,a,o,s,c,l,u,d)=>{let f=i.format===`NHWC`,p=t.type.value,m=J(`output`,t.type.tensor,r);if(i.kernelShape.length<=2){let r=``,l=``,h=``,g=n-(f?2:1);if(r=u?` + }`};return{name:`Pad`,shaderCache:{hint:`${t.mode}${o}`,inputDependencies:s},getRunData:()=>({outputs:[{dims:n,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(W.size(n)/64)},programUniforms:a}),getShaderSource:c}},bl=(e,t)=>{if(e.length>1){let n=e[1].getBigInt64Array(),r=e.length>=3&&e[2].data?e[2].dataType===10?e[2].getUint16Array()[0]:e[2].getFloat32Array()[0]:0,i=e[0].dims.length,a=new Int32Array(2*i).fill(0);if(e.length>=4){let t=e[3].getBigInt64Array();for(let e=0;ea[Number(t)]=Number(e));let o=[];return a.forEach(e=>o.push(e)),{mode:t.mode,value:r,pads:o}}else return t},xl=(e,t)=>{pl(e.inputs);let n=bl(e.inputs,t);e.compute(yl(e.inputs,n),{inputs:[0]})}}),Cl,wl,Tl,El,Dl,Ol,kl,Al,jl,Ml,Nl,Pl,Fl,Il,Ll,Rl,zl,Bl,Vl,Hl=M(()=>{"use strict";Ze(),U(),G(),X(),Cl=e=>{if(R.webgpu.validateInputContent&&(!e||e.length!==1))throw Error(`Pool ops requires 1 input.`)},wl=(e,t,n)=>{let r=t.format===`NHWC`,i=e.dims.slice();r&&i.splice(1,0,i.pop());let a=Object.hasOwnProperty.call(t,`dilations`),o=t.kernelShape.slice(),s=t.strides.slice(),c=a?t.dilations.slice():[],l=t.pads.slice();hn.adjustPoolAttributes(n,i,o,s,c,l);let u=hn.computePoolOutputShape(n,i,s,c,o,l,t.autoPad),d=Object.assign({},t);a?Object.assign(d,{kernelShape:o,strides:s,pads:l,dilations:c,cacheKey:t.cacheKey}):Object.assign(d,{kernelShape:o,strides:s,pads:l,cacheKey:t.cacheKey});let f=u.slice();return f.push(f.splice(1,1)[0]),[d,r?f:u]},Tl=(e,t)=>{let n=t.format===`NHWC`,r=W.size(e),i=W.size(t.kernelShape),a=[{type:12,data:r},{type:12,data:i}],o=[{name:`outputSize`,type:`u32`},{name:`kernelSize`,type:`u32`}];if(t.kernelShape.length<=2){let e=t.kernelShape[t.kernelShape.length-1],n=t.strides[t.strides.length-1],r=t.pads[t.pads.length/2-1],i=t.pads[t.pads.length-1],s=!!(r+i);a.push({type:12,data:e},{type:12,data:n},{type:12,data:r},{type:12,data:i}),o.push({name:`kw`,type:`u32`},{name:`sw`,type:`u32`},{name:`pwStart`,type:`u32`},{name:`pwEnd`,type:`u32`});let c=!1;if(t.kernelShape.length===2){let e=t.kernelShape[t.kernelShape.length-2],n=t.strides[t.strides.length-2],r=t.pads[t.pads.length/2-2],i=t.pads[t.pads.length-2];c=!!(r+i),a.push({type:12,data:e},{type:12,data:n},{type:12,data:r},{type:12,data:i}),o.push({name:`kh`,type:`u32`},{name:`sh`,type:`u32`},{name:`phStart`,type:`u32`},{name:`phEnd`,type:`u32`})}return[a,o,!0,s,c]}else{if(n)throw Error(`Pooling with kernelShape.length > 2 is not supported for NHWC format.`);let e=W.computeStrides(t.kernelShape);a.push({type:12,data:e},{type:12,data:t.pads},{type:12,data:t.strides}),o.push({name:`kernelStrides`,type:`u32`,length:e.length},{name:`pads`,type:`u32`,length:t.pads.length},{name:`strides`,type:`u32`,length:t.strides.length});let r=t.pads.reduce((e,t)=>e+t);return[a,o,!!r,!1,!1]}},El=(e,t,n,r,i,a,o,s,c,l,u,d)=>{let f=i.format===`NHWC`,p=t.type.value,m=Y(`output`,t.type.tensor,r);if(i.kernelShape.length<=2){let r=``,l=``,h=``,g=n-(f?2:1);if(r=u?` for (var i: u32 = 0u; i < uniforms.kw; i++) { xIndices[${g}] = indices[${g}] * uniforms.sw - uniforms.pwStart + i; if (xIndices[${g}] < 0 || xIndices[${g}] @@ -2223,23 +2223,23 @@ fn calculateOutputIndex(index: u32) -> u32 { for (var i: u32 = 0u; i < uniforms.kernelSize; i++) { var offset = i; for (var j = 0u; j < ${r-1}u; j++) { - offsets[j] = offset / ${K(`uniforms.kernelStrides`,`j`,r)}; - offset -= offsets[j] * ${K(`uniforms.kernelStrides`,`j`,r)}; + offsets[j] = offset / ${q(`uniforms.kernelStrides`,`j`,r)}; + offset -= offsets[j] * ${q(`uniforms.kernelStrides`,`j`,r)}; } offsets[${r-1}] = offset; isPad = false; for (var j = ${n-r}u; j < ${n}u; j++) { - xIndices[j] = indices[j] * ${K(`uniforms.strides`,`j - ${n-r}u`,r)} - + offsets[j - ${n-r}u] - ${K(`uniforms.pads`,`j - 2u`,u)}; + xIndices[j] = indices[j] * ${q(`uniforms.strides`,`j - ${n-r}u`,r)} + + offsets[j - ${n-r}u] - ${q(`uniforms.pads`,`j - 2u`,u)}; ${d} } ${o} output[global_idx] = value; - }`}},Dl=e=>`${e.format};${e.ceilMode};${e.autoPad};${e.kernelShape.length}`,Ol=e=>`${Dl(e)};${e.countIncludePad}`,kl=e=>`${Dl(e)};${e.storageOrder};${e.dilations}`,Al=e=>({format:e.format,autoPad:[`NOTSET`,`VALID`,`SAME_UPPER`,`SAME_LOWER`][e.auto_pad],ceilMode:e.ceil_mode,kernelShape:e.kernel_shape,strides:e.strides,pads:e.pads}),jl=(e,t,n,r)=>{let[i,a]=wl(t,r,n),o=q(`x`,t.dataType,t.dims.length),s=o.type.value,c=`value += x_val;`,l=``;i.countIncludePad?l+=`value /= ${s}(uniforms.kernelSize);`:l+=`value /= ${s}(i32(uniforms.kernelSize) - pad);`;let[u,d,f,p,m]=Tl(a,i);u.push(...G(t.dims,a));let h=[`rank`];return{name:e,shaderCache:{hint:`${r.cacheKey};${f};${p};${m}`,inputDependencies:h},getRunData:()=>({outputs:[{dims:a,dataType:t.dataType}],dispatchGroup:{x:Math.ceil(U.size(a)/64)},programUniforms:u}),getShaderSource:e=>El(e,o,t.dims.length,a.length,i,c,l,0,d,f,p,m)}},Ml=e=>{let t=e.count_include_pad!==0,n=Al(e);if(n.ceilMode!==0)throw Error(`using ceil() in shape computation is not yet supported for AveragePool`);let r={countIncludePad:t,...n,cacheKey:``};return{...r,cacheKey:Ol(r)}},Nl=(e,t)=>{Z(e.inputs),e.compute(jl(`AveragePool`,e.inputs[0],!1,t))},Pl={autoPad:``,ceilMode:0,countIncludePad:!1,kernelShape:[],strides:[],pads:[],storageOrder:0,dilations:[]},Fl=e=>{let t=e.format;return{format:t,...Pl,cacheKey:t}},Il=(e,t)=>{Z(e.inputs),e.compute(jl(`GlobalAveragePool`,e.inputs[0],!0,t))},Ll=(e,t,n,r)=>{let[i,a]=wl(t,r,n),o=` + }`}},Dl=e=>`${e.format};${e.ceilMode};${e.autoPad};${e.kernelShape.length}`,Ol=e=>`${Dl(e)};${e.countIncludePad}`,kl=e=>`${Dl(e)};${e.storageOrder};${e.dilations}`,Al=e=>({format:e.format,autoPad:[`NOTSET`,`VALID`,`SAME_UPPER`,`SAME_LOWER`][e.auto_pad],ceilMode:e.ceil_mode,kernelShape:e.kernel_shape,strides:e.strides,pads:e.pads}),jl=(e,t,n,r)=>{let[i,a]=wl(t,r,n),o=J(`x`,t.dataType,t.dims.length),s=o.type.value,c=`value += x_val;`,l=``;i.countIncludePad?l+=`value /= ${s}(uniforms.kernelSize);`:l+=`value /= ${s}(i32(uniforms.kernelSize) - pad);`;let[u,d,f,p,m]=Tl(a,i);u.push(...K(t.dims,a));let h=[`rank`];return{name:e,shaderCache:{hint:`${r.cacheKey};${f};${p};${m}`,inputDependencies:h},getRunData:()=>({outputs:[{dims:a,dataType:t.dataType}],dispatchGroup:{x:Math.ceil(W.size(a)/64)},programUniforms:u}),getShaderSource:e=>El(e,o,t.dims.length,a.length,i,c,l,0,d,f,p,m)}},Ml=e=>{let t=e.count_include_pad!==0,n=Al(e);if(n.ceilMode!==0)throw Error(`using ceil() in shape computation is not yet supported for AveragePool`);let r={countIncludePad:t,...n,cacheKey:``};return{...r,cacheKey:Ol(r)}},Nl=(e,t)=>{Cl(e.inputs),e.compute(jl(`AveragePool`,e.inputs[0],!1,t))},Pl={autoPad:``,ceilMode:0,countIncludePad:!1,kernelShape:[],strides:[],pads:[],storageOrder:0,dilations:[]},Fl=e=>{let t=e.format;return{format:t,...Pl,cacheKey:t}},Il=(e,t)=>{Cl(e.inputs),e.compute(jl(`GlobalAveragePool`,e.inputs[0],!0,t))},Ll=(e,t,n,r)=>{let[i,a]=wl(t,r,n),o=` value = max(x_val, value); - `,s=``,c=q(`x`,t.dataType,t.dims.length),l=[`rank`],[u,d,f,p,m]=Tl(a,i);return u.push(...G(t.dims,a)),{name:e,shaderCache:{hint:`${r.cacheKey};${f};${p};${m}`,inputDependencies:l},getRunData:()=>({outputs:[{dims:a,dataType:t.dataType}],dispatchGroup:{x:Math.ceil(U.size(a)/64)},programUniforms:u}),getShaderSource:e=>El(e,c,t.dims.length,a.length,i,o,s,t.dataType===10?-65504:-1e5,d,f,p,m)}},Rl=(e,t)=>{Z(e.inputs),e.compute(Ll(`MaxPool`,e.inputs[0],!1,t))},zl=e=>{let t=e.storage_order,n=e.dilations,r=Al(e);if(t!==0)throw Error(`column major storage order is not yet supported for MaxPool`);if(r.ceilMode!==0)throw Error(`using ceil() in shape computation is not yet supported for MaxPool`);let i={storageOrder:t,dilations:n,...r,cacheKey:``};return{...i,cacheKey:kl(i)}},Bl=e=>{let t=e.format;return{format:t,...Pl,cacheKey:t}},Vl=(e,t)=>{Z(e.inputs),e.compute(Ll(`GlobalMaxPool`,e.inputs[0],!0,t))}}),Ul,Wl,Gl,Kl,ql=M(()=>{"use strict";V(),W(),Xn(),Y(),Ul=(e,t)=>{if(e.length<2||e.length>3)throw Error(`DequantizeLinear requires 2 or 3 inputs.`);if(e.length===3&&e[1].dims===e[2].dims)throw Error(`x-scale and x-zero-point must have the same shape.`);if(e.length===3&&e[0].dataType!==e[2].dataType)throw Error(`x and x-zero-point must have the same data type.`);if(e[0].dataType===6&&e.length>2)throw Error(`In the case of dequantizing int32 there is no zero point.`);if(e[1].dims.length!==0&&e[1].dims.length!==1&&e[1].dims.length!==e[0].dims.length)throw Error(`scale input must be a scalar, a 1D tensor, or have the same rank as the input tensor.`);if(e.length>2){if(e[0].dataType!==e[2].dataType)throw Error(`x and x-zero-point must have the same data type.`);if(e[1].dims.length!==e[2].dims.length)throw Error(`scale and zero-point inputs must have the same rank.`);if(!e[1].dims.map((t,n)=>t===e[2].dims[n]).reduce((e,t)=>e&&t,!0))throw Error(`scale and zero-point inputs must have the same shape.`)}if(t.blockSize>0){if(e[1].dims.length===0||e[1].dims.length===1&&e[1].dims[0]===1)throw Error(`blockSize must be set only for block quantization.`);if(!e[1].dims.map((n,r)=>r===t.axis||n===e[0].dims[r]).reduce((e,t)=>e&&t,!0))throw Error(`For block qunatization, scale input shape to match the input shape except for the axis`);if(e[1].dims.length!==e[0].dims.length)throw Error(`For block qunatization the scale input rank must be the same as the x rank.`);let n=e[0].dims[t.axis],r=e[1].dims[t.axis];if(t.blockSizeMath.ceil(n/(r-1)-1))throw Error(`blockSize must be with in the range [ceil(dI / Si), ceil(dI / (Si - 1) - 1)].`)}},Wl=(e,t)=>{let n=U.normalizeAxis(t.axis,e[0].dims.length),r=e[0].dataType,i=r===3,a=e[0].dims,o=e[1].dataType,s=U.size(a),c=r===3||r===2,l=c?[Math.ceil(U.size(e[0].dims)/4)]:e[0].dims,u=e[1].dims,d=e.length>2?e[2]:void 0,f=d?c?[Math.ceil(U.size(d.dims)/4)]:d.dims:void 0,p=u.length===0||u.length===1&&u[0]===1,m=p===!1&&u.length===1,h=tr(s),g=p&&(!c||h===4),_=g?h:1,v=g&&!c?h:1,y=q(`input`,c?12:r,l.length,v),b=q(`scale`,o,u.length),x=d?q(`zero_point`,c?12:r,f.length):void 0,S=J(`output`,o,a.length,_),C=[y,b];x&&C.push(x);let w=[l,u];d&&w.push(f);let T=[{type:12,data:s/_},{type:12,data:n},{type:12,data:t.blockSize},...G(...w,a)],E=e=>{let t=[{name:`output_size`,type:`u32`},{name:`axis`,type:`u32`},{name:`block_size`,type:`u32`}];return` + `,s=``,c=J(`x`,t.dataType,t.dims.length),l=[`rank`],[u,d,f,p,m]=Tl(a,i);return u.push(...K(t.dims,a)),{name:e,shaderCache:{hint:`${r.cacheKey};${f};${p};${m}`,inputDependencies:l},getRunData:()=>({outputs:[{dims:a,dataType:t.dataType}],dispatchGroup:{x:Math.ceil(W.size(a)/64)},programUniforms:u}),getShaderSource:e=>El(e,c,t.dims.length,a.length,i,o,s,t.dataType===10?-65504:-1e5,d,f,p,m)}},Rl=(e,t)=>{Cl(e.inputs),e.compute(Ll(`MaxPool`,e.inputs[0],!1,t))},zl=e=>{let t=e.storage_order,n=e.dilations,r=Al(e);if(t!==0)throw Error(`column major storage order is not yet supported for MaxPool`);if(r.ceilMode!==0)throw Error(`using ceil() in shape computation is not yet supported for MaxPool`);let i={storageOrder:t,dilations:n,...r,cacheKey:``};return{...i,cacheKey:kl(i)}},Bl=e=>{let t=e.format;return{format:t,...Pl,cacheKey:t}},Vl=(e,t)=>{Cl(e.inputs),e.compute(Ll(`GlobalMaxPool`,e.inputs[0],!0,t))}}),Ul,Wl,Gl,Kl,ql=M(()=>{"use strict";U(),G(),Yn(),X(),Ul=(e,t)=>{if(e.length<2||e.length>3)throw Error(`DequantizeLinear requires 2 or 3 inputs.`);if(e.length===3&&e[1].dims===e[2].dims)throw Error(`x-scale and x-zero-point must have the same shape.`);if(e.length===3&&e[0].dataType!==e[2].dataType)throw Error(`x and x-zero-point must have the same data type.`);if(e[0].dataType===6&&e.length>2)throw Error(`In the case of dequantizing int32 there is no zero point.`);if(e[1].dims.length!==0&&e[1].dims.length!==1&&e[1].dims.length!==e[0].dims.length)throw Error(`scale input must be a scalar, a 1D tensor, or have the same rank as the input tensor.`);if(e.length>2){if(e[0].dataType!==e[2].dataType)throw Error(`x and x-zero-point must have the same data type.`);if(e[1].dims.length!==e[2].dims.length)throw Error(`scale and zero-point inputs must have the same rank.`);if(!e[1].dims.map((t,n)=>t===e[2].dims[n]).reduce((e,t)=>e&&t,!0))throw Error(`scale and zero-point inputs must have the same shape.`)}if(t.blockSize>0){if(e[1].dims.length===0||e[1].dims.length===1&&e[1].dims[0]===1)throw Error(`blockSize must be set only for block quantization.`);if(!e[1].dims.map((n,r)=>r===t.axis||n===e[0].dims[r]).reduce((e,t)=>e&&t,!0))throw Error(`For block qunatization, scale input shape to match the input shape except for the axis`);if(e[1].dims.length!==e[0].dims.length)throw Error(`For block qunatization the scale input rank must be the same as the x rank.`);let n=e[0].dims[t.axis],r=e[1].dims[t.axis];if(t.blockSizeMath.ceil(n/(r-1)-1))throw Error(`blockSize must be with in the range [ceil(dI / Si), ceil(dI / (Si - 1) - 1)].`)}},Wl=(e,t)=>{let n=W.normalizeAxis(t.axis,e[0].dims.length),r=e[0].dataType,i=r===3,a=e[0].dims,o=e[1].dataType,s=W.size(a),c=r===3||r===2,l=c?[Math.ceil(W.size(e[0].dims)/4)]:e[0].dims,u=e[1].dims,d=e.length>2?e[2]:void 0,f=d?c?[Math.ceil(W.size(d.dims)/4)]:d.dims:void 0,p=u.length===0||u.length===1&&u[0]===1,m=p===!1&&u.length===1,h=er(s),g=p&&(!c||h===4),_=g?h:1,v=g&&!c?h:1,y=J(`input`,c?12:r,l.length,v),b=J(`scale`,o,u.length),x=d?J(`zero_point`,c?12:r,f.length):void 0,S=Y(`output`,o,a.length,_),C=[y,b];x&&C.push(x);let w=[l,u];d&&w.push(f);let T=[{type:12,data:s/_},{type:12,data:n},{type:12,data:t.blockSize},...K(...w,a)],E=e=>{let t=[{name:`output_size`,type:`u32`},{name:`axis`,type:`u32`},{name:`block_size`,type:`u32`}];return` ${e.registerUniforms(t).declareVariables(...C,S)} ${e.mainStart()} ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} @@ -2277,12 +2277,12 @@ fn calculateOutputIndex(index: u32) -> u32 { let zero_point_value = zero_point_vec[zero_point_offset % 4];`:`let zero_point_value = ${x.getByIndices(`scale_indices`)};`:`let zero_point_value = ${c?i?`i32`:`u32`:y.type.value}(0);`}; // Compute and write output ${S.setByOffset(`global_idx`,`${S.type.value}(x_value - zero_point_value) * scale_value`)}; - }`};return{name:`DequantizeLinear`,shaderCache:{hint:t.cacheKey,inputDependencies:x?[`rank`,`rank`,`rank`]:[`rank`,`rank`]},getShaderSource:E,getRunData:()=>({outputs:[{dims:a,dataType:o}],dispatchGroup:{x:Math.ceil(s/_/64),y:1,z:1},programUniforms:T})}},Gl=(e,t)=>{Ul(e.inputs,t),e.compute(Wl(e.inputs,t))},Kl=e=>Yn({axis:e.axis,blockSize:e.blockSize})}),Jl,Yl,Xl,Zl=M(()=>{"use strict";$e(),V(),Y(),Jl=(e,t,n)=>{let r=e===t,i=et&&n>0;if(r||i||a)throw Error(`Range these inputs' contents are invalid.`)},Yl=(e,t,n,r)=>{let i=Math.abs(Math.ceil((t-e)/n)),a=[i],o=i,s=[{type:12,data:o},{type:r,data:e},{type:r,data:n},...G(a)],c=e=>{let t=J(`output`,r,a.length),n=t.type.value,i=[{name:`outputSize`,type:`u32`},{name:`start`,type:n},{name:`delta`,type:n}];return` + }`};return{name:`DequantizeLinear`,shaderCache:{hint:t.cacheKey,inputDependencies:x?[`rank`,`rank`,`rank`]:[`rank`,`rank`]},getShaderSource:E,getRunData:()=>({outputs:[{dims:a,dataType:o}],dispatchGroup:{x:Math.ceil(s/_/64),y:1,z:1},programUniforms:T})}},Gl=(e,t)=>{Ul(e.inputs,t),e.compute(Wl(e.inputs,t))},Kl=e=>Jn({axis:e.axis,blockSize:e.blockSize})}),Jl,Yl,Xl,Zl=M(()=>{"use strict";Ze(),U(),X(),Jl=(e,t,n)=>{let r=e===t,i=et&&n>0;if(r||i||a)throw Error(`Range these inputs' contents are invalid.`)},Yl=(e,t,n,r)=>{let i=Math.abs(Math.ceil((t-e)/n)),a=[i],o=i,s=[{type:12,data:o},{type:r,data:e},{type:r,data:n},...K(a)],c=e=>{let t=Y(`output`,r,a.length),n=t.type.value,i=[{name:`outputSize`,type:`u32`},{name:`start`,type:n},{name:`delta`,type:n}];return` ${e.registerUniforms(i).declareVariables(t)} ${e.mainStart()} ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.outputSize`)} output[global_idx] = uniforms.start + ${n}(global_idx) * uniforms.delta; - }`};return{name:`Range`,shaderCache:{hint:`${r}`},getShaderSource:c,getRunData:()=>({outputs:[{dims:a,dataType:r}],dispatchGroup:{x:Math.ceil(o/64)},programUniforms:s})}},Xl=e=>{let t=0,n=0,r=0;e.inputs[0].dataType===6?(t=e.inputs[0].getInt32Array()[0],n=e.inputs[1].getInt32Array()[0],r=e.inputs[2].getInt32Array()[0]):e.inputs[0].dataType===1&&(t=e.inputs[0].getFloat32Array()[0],n=e.inputs[1].getFloat32Array()[0],r=e.inputs[2].getFloat32Array()[0]),L.webgpu.validateInputContent&&Jl(t,n,r),e.compute(Yl(t,n,r,e.inputs[0].dataType),{inputs:[]})}}),Ql,$l,eu,tu,nu,ru,iu=M(()=>{"use strict";V(),W(),Xn(),Y(),Ql=(e,t,n,r)=>{if(e!==`none`&&r!==`i32`&&r!==`u32`&&r!==`f32`)throw Error(`Input ${r} is not supported with reduction ${e}.`);let i=`{ + }`};return{name:`Range`,shaderCache:{hint:`${r}`},getShaderSource:c,getRunData:()=>({outputs:[{dims:a,dataType:r}],dispatchGroup:{x:Math.ceil(o/64)},programUniforms:s})}},Xl=e=>{let t=0,n=0,r=0;e.inputs[0].dataType===6?(t=e.inputs[0].getInt32Array()[0],n=e.inputs[1].getInt32Array()[0],r=e.inputs[2].getInt32Array()[0]):e.inputs[0].dataType===1&&(t=e.inputs[0].getFloat32Array()[0],n=e.inputs[1].getFloat32Array()[0],r=e.inputs[2].getFloat32Array()[0]),R.webgpu.validateInputContent&&Jl(t,n,r),e.compute(Yl(t,n,r,e.inputs[0].dataType),{inputs:[]})}}),Ql,$l,eu,tu,nu,ru,iu=M(()=>{"use strict";U(),G(),Yn(),X(),Ql=(e,t,n,r)=>{if(e!==`none`&&r!==`i32`&&r!==`u32`&&r!==`f32`)throw Error(`Input ${r} is not supported with reduction ${e}.`);let i=`{ var oldValue = 0; loop { let newValueF32 =`,a=`; @@ -2315,7 +2315,7 @@ fn calculateOutputIndex(index: u32) -> u32 { data_offset += u32((u32(index) * element_count_dim));`,eu=(e,t,n)=>`for (var i = 0u; i < uniforms.num_updates_elements; i++) { let value = updates[uniforms.num_updates_elements * ${n?`global_idx`:`idx`} + i]; ${Ql(e.reduction,`output[data_offset + i]`,`value`,t)} - }`,tu=(e,t)=>{let n=e[0].dims,r=e[1].dims,i=n,a=1,o=Math.ceil(U.size(r)/a),s=r[r.length-1],c=U.sizeFromDimension(n,s),l=U.sizeFromDimension(r,0)/s,u=[{type:12,data:o},{type:12,data:s},{type:12,data:c},...G(e[1].dims,e[2].dims,i)],d=r=>{let o=q(`indices`,e[1].dataType,e[1].dims.length),s=q(`updates`,e[2].dataType,e[2].dims.length,a),c=t.reduction!==`none`&&t.reduction!==``?or(`output`,e[0].dataType,i.length):J(`output`,e[0].dataType,i.length,a);return` + }`,tu=(e,t)=>{let n=e[0].dims,r=e[1].dims,i=n,a=1,o=Math.ceil(W.size(r)/a),s=r[r.length-1],c=W.sizeFromDimension(n,s),l=W.sizeFromDimension(r,0)/s,u=[{type:12,data:o},{type:12,data:s},{type:12,data:c},...K(e[1].dims,e[2].dims,i)],d=r=>{let o=J(`indices`,e[1].dataType,e[1].dims.length),s=J(`updates`,e[2].dataType,e[2].dims.length,a),c=t.reduction!==`none`&&t.reduction!==``?ar(`output`,e[0].dataType,i.length):Y(`output`,e[0].dataType,i.length,a);return` ${r.registerUniform(`output_size`,`u32`).registerUniform(`last_index_dimension`,`u32`).registerUniform(`num_updates_elements`,`u32`).declareVariables(o,s,c)} ${r.mainStart()} ${r.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} @@ -2360,7 +2360,7 @@ fn calculateOutputIndex(index: u32) -> u32 { ${$l(n.length,!0)} } ${eu(t,c.type.value,!0)} - }`};return{name:`ScatterND`,shaderCache:{hint:`${t.cacheKey}_${t.reduction}`,inputDependencies:[`rank`,`rank`]},getRunData:()=>({outputs:[{dims:i,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(o/64)},programUniforms:u}),getShaderSource:d}},nu=e=>Yn({reduction:e.reduction}),ru=(e,t)=>{e.compute(tu(e.inputs,t),{inputs:[e.inputs[1],e.inputs[2]],outputs:[]})}}),au,ou,su,cu,lu,uu,du,fu,pu,mu,hu,gu,_u,vu,yu,bu,xu,Su,Cu,wu,Tu=M(()=>{"use strict";V(),W(),Xn(),Y(),au=(e,t)=>{if(e.every(e=>e>0||(()=>{throw Error(`Resize requires scales input values to be positive`)})),e.length>0){if(t.mode===`linear`){if(!(e.length===2||e.length===3||e.length===4&&e[0]===1&&e[1]===1||e.length===4&&e[0]===1&&e[3]===1||e.length===5&&e[0]===1&&e[1]===1))throw Error(`For linear mode, Resize requires scales to be 2D, 3D, 4D with either two outermost or one innermost and + }`};return{name:`ScatterND`,shaderCache:{hint:`${t.cacheKey}_${t.reduction}`,inputDependencies:[`rank`,`rank`]},getRunData:()=>({outputs:[{dims:i,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(o/64)},programUniforms:u}),getShaderSource:d}},nu=e=>Jn({reduction:e.reduction}),ru=(e,t)=>{e.compute(tu(e.inputs,t),{inputs:[e.inputs[1],e.inputs[2]],outputs:[]})}}),au,ou,su,cu,lu,uu,du,fu,pu,mu,hu,gu,_u,vu,yu,bu,xu,Su,Cu,wu,Tu=M(()=>{"use strict";U(),G(),Yn(),X(),au=(e,t)=>{if(e.every(e=>e>0||(()=>{throw Error(`Resize requires scales input values to be positive`)})),e.length>0){if(t.mode===`linear`){if(!(e.length===2||e.length===3||e.length===4&&e[0]===1&&e[1]===1||e.length===4&&e[0]===1&&e[3]===1||e.length===5&&e[0]===1&&e[1]===1))throw Error(`For linear mode, Resize requires scales to be 2D, 3D, 4D with either two outermost or one innermost and one outermost scale values equal to 1, or 5D with two outermost scale values equal to 1`)}else if(t.mode===`cubic`&&!(e.length===2||e.length===4&&e[0]===1&&e[1]===1||e.length===4&&e[0]===1&&e[3]===1))throw Error(`Resize requires scales input size to be 2 or 4 for cubic mode`)}},ou=(e,t,n)=>{t.every(e=>e>=0&&e{throw Error(`Resize requires axes input values to be positive and less than rank`)}));let r=Array(n).fill(1);return t.forEach((t,n)=>r[t]=e[n]),r},su=(e,t,n,r,i,a)=>{let[o,s,c]=n>10?[1,2,3]:[-1,e.length>1?1:-1,-1],l=e[0].dims.length;if(o>0&&e.length>o&&e[o].dims.length>0)e[o].getFloat32Array().forEach(e=>a.push(e));else if(t.coordinateTransformMode===`tf_crop_and_resize`)throw Error(`Resize requires RoI input to be specified when coordinateTransformMode is tfCropAndResize`);if(s>0&&e.length>s&&e[s].dims.length===1&&e[s].dims[0]>0){if(e[s].getFloat32Array().forEach(e=>r.push(e)),r.length!==0&&r.length!==l&&n>=18&&r.length!==t.axes.length)throw Error(`Resize requires scales input size to be same as input rank or axes size for opset 18 and up`);au(r,t),t.axes.length>0&&ou(r,t.axes,l).forEach((e,t)=>r[t]=e)}if(c>0&&e.length>c&&e[c].dims.length===1&&e[c].dims[0]>0&&(e[c].getBigInt64Array().forEach(e=>i.push(Number(e))),i.length!==0&&i.length!==l&&n>=18&&i.length!==t.axes.length))throw Error(`Resize requires sizes input size to be same as input rank or axes size for opset 18 and up`);if(t.axes.length>0){if(r.length!==0&&r.length!==t.axes.length)throw Error(`Resize requires "scales" input size to be of axes rank when axes attributes is specified`);if(i.length!==0&&i.length!==t.axes.length)throw Error(`Resize requires "sizes" input size to be of rank axes rank when axes attributes is specified`)}if(typeof r<`u`&&typeof i<`u`&&r.length>0&&i.length>l)throw Error(`Resize requires only of scales or sizes to be specified`)},cu=(e,t,n,r)=>` // The whole part and the fractional part are calculated separately due to inaccuracy of floating // point division. As an example, f32(21) / f32(7) may evaluate to 2.99... instead of 3, causing an @@ -2399,14 +2399,14 @@ fn calculateOutputIndex(index: u32) -> u32 { var original_indices: array<${e.type.value}, ${n.length}>; for (var i:u32 = 0; i < ${n.length}; i++) { var output_index = ${e.indicesGet(`output_indices`,`i`)}; - var scale = ${K(`uniforms.scales`,`i`,r)}; - var roi_low = ${K(`uniforms.roi`,`i`,i)}; - var roi_hi = ${K(`uniforms.roi`,`i + ${t.length}`,i)}; + var scale = ${q(`uniforms.scales`,`i`,r)}; + var roi_low = ${q(`uniforms.roi`,`i`,i)}; + var roi_hi = ${q(`uniforms.roi`,`i + ${t.length}`,i)}; if (scale == 1.0) { original_indices[i] = ${e.type.value}(output_index); } else { - var input_shape_i = ${K(`uniforms.input_shape`,`i`,t.length)}; - var output_shape_i = ${K(`uniforms.output_shape`,`i`,n.length)}; + var input_shape_i = ${q(`uniforms.input_shape`,`i`,t.length)}; + var output_shape_i = ${q(`uniforms.output_shape`,`i`,n.length)}; original_indices[i] = getOriginalCoordinateFromResizedCoordinate(output_index, scale, output_shape_i, input_shape_i, roi_low, roi_hi); } @@ -2418,14 +2418,14 @@ fn calculateOutputIndex(index: u32) -> u32 { for (var i:u32 = 0; i < ${r.length}; i++) { var output_index = ${t.indicesGet(`output_indices`,`i`)}; var input_index: u32; - var scale = ${K(`uniforms.scales`,`i`,i)}; + var scale = ${q(`uniforms.scales`,`i`,i)}; if (scale == 1.0) { input_index = output_index; } else { - var roi_low = ${K(`uniforms.roi`,`i`,a)}; - var roi_hi = ${K(`uniforms.roi`,`i + ${n.length}`,a)}; - var input_shape_i = ${K(`uniforms.input_shape`,`i`,n.length)}; - var output_shape_i = ${K(`uniforms.output_shape`,`i`,r.length)}; + var roi_low = ${q(`uniforms.roi`,`i`,a)}; + var roi_hi = ${q(`uniforms.roi`,`i + ${n.length}`,a)}; + var input_shape_i = ${q(`uniforms.input_shape`,`i`,n.length)}; + var output_shape_i = ${q(`uniforms.output_shape`,`i`,r.length)}; var original_idx = getOriginalCoordinateFromResizedCoordinate(output_index, scale, output_shape_i, input_shape_i, roi_low, roi_hi); if (!${o} || (original_idx >= 0 && original_idx < ${t.type.value}(input_shape_i))) { @@ -2447,7 +2447,7 @@ fn calculateOutputIndex(index: u32) -> u32 { fn checkInputIndices(input_indices: ${e.type.indices}) -> bool { for (var i:u32 = 0; i < ${t.length}; i++) { var input_index = ${e.indicesGet(`input_indices`,`i`)}; - if (input_index < 0 || input_index >= ${K(`uniforms.input_shape`,`i`,t.length)}) { + if (input_index < 0 || input_index >= ${q(`uniforms.input_shape`,`i`,t.length)}) { return false; } } @@ -2603,7 +2603,7 @@ fn calculateOutputIndex(index: u32) -> u32 { } return (x111 * dx2 * dy2 * dz2 + x112 * dx2 * dy2 * dz1 + x121 * dx2 * dy1 *dz2 + x122 * dx2 * dy1 * dz1 + x211 * dx1 * dy2 * dz2 + x212 * dx1 * dy2 * dz1 + x221 * dx1 * dy1 *dz2 + x222 * dx1 * dy1 * dz1); - }`},xu=(e,t,n,r,i,a)=>{let o=e.dims,s=du(a,t.axes,o.length),c=fu(o,r,i,t.axes),l=r.slice();r.length===0&&(l=o.map((e,t)=>e===0?1:c[t]/e),t.keepAspectRatioPolicy!==`stretch`&&(c=pu(o,l,t)));let u=J(`output`,e.dataType,c.length),d=q(`input`,e.dataType,o.length),f=U.size(c),p=o.length===c.length&&o.every((e,t)=>e===c[t]),m=t.coordinateTransformMode===`tf_crop_and_resize`,h=t.extrapolationValue,g=d.type.value,_=e=>` + }`},xu=(e,t,n,r,i,a)=>{let o=e.dims,s=du(a,t.axes,o.length),c=fu(o,r,i,t.axes),l=r.slice();r.length===0&&(l=o.map((e,t)=>e===0?1:c[t]/e),t.keepAspectRatioPolicy!==`stretch`&&(c=pu(o,l,t)));let u=Y(`output`,e.dataType,c.length),d=J(`input`,e.dataType,o.length),f=W.size(c),p=o.length===c.length&&o.every((e,t)=>e===c[t]),m=t.coordinateTransformMode===`tf_crop_and_resize`,h=t.extrapolationValue,g=d.type.value,_=e=>` ${p?``:` ${lu(t.coordinateTransformMode,g)}; ${(()=>{switch(t.mode){case`nearest`:return` @@ -2630,7 +2630,7 @@ fn calculateOutputIndex(index: u32) -> u32 { output[global_idx] = ${t.extrapolationValue}; }`;case`linear`:return`output[global_idx] = ${o.length===2||o.length===4?`bilinearInterpolation`:`trilinearInterpolation`}(output_indices);`;case`cubic`:return`output[global_idx] = bicubicInterpolation(output_indices);`;default:throw Error(`Unsupported resize mode: ${t.mode}`)}})()}; `} - }`;return{name:`Resize`,shaderCache:{hint:`${t.cacheKey}|${n}|${l.length>0?t.mode===`cubic`?l:l.length:``}|${i.length>0?i:``}|${s.length>0?s:``}|${p}|${t.mode===`nearest`?o.length:o}`,inputDependencies:[`rank`]},getShaderSource:_,getRunData:()=>({outputs:[{dims:c,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(f/64)},programUniforms:[{type:12,data:f},{type:1,data:l},{type:1,data:s},...G(o,c)]})}},Su=e=>{let t=e.customDataBuffer;return new Uint32Array(t,t.byteOffset,1)[0]},Cu=(e,t)=>{let n=[],r=[],i=[],a=Su(e);if(t.antialias!==0)throw Error(`Only default value (0) for Antialias attribute is supported`);su(e.inputs,t,a,n,r,i),e.compute(xu(e.inputs[0],t,a,n,r,i),{inputs:[0]})},wu=e=>{let t=e.antialias,n=e.axes,r=e.coordinateTransformMode,i=e.cubicCoeffA,a=e.excludeOutside!==0,o=e.extrapolationValue,s=e.keepAspectRatioPolicy,c=e.mode,l=e.nearestMode===``?`simple`:e.nearestMode;return Yn({antialias:t,axes:n,coordinateTransformMode:r,cubicCoeffA:i,excludeOutside:a,extrapolationValue:o,keepAspectRatioPolicy:s,mode:c,nearestMode:l})}}),Eu,Du,Ou,ku=M(()=>{"use strict";V(),W(),Y(),Eu=e=>{if(!e||e.length<3)throw Error(`layerNorm requires at least 3 inputs.`);let t=e[0],n=e[1],r=e[2];if(t.dataType!==n.dataType||t.dataType!==r.dataType)throw Error(`All inputs must have the same data type`);if(t.dims.length!==3&&t.dims.length!==2)throw Error(`Input must be 2D or 3D`);if(n.dims.length!==3&&n.dims.length!==2)throw Error(`Skip must be 2D or 3D`);let i=t.dims[t.dims.length-1],a=t.dims[t.dims.length-2];if(n.dims[n.dims.length-1]!==i)throw Error(`Skip must have the same hidden size as input`);if(n.dims[n.dims.length-2]!==a)throw Error(`Skip must have the same sequence length as input`);if(r.dims.length!==1)throw Error(`Gamma must be 1D`);if(r.dims[r.dims.length-1]!==i)throw Error(`Gamma must have the same hidden size as input`);if(e.length>3){let t=e[3];if(t.dims.length!==1)throw Error(`Beta must be 1D`);if(t.dims[t.dims.length-1]!==i)throw Error(`Beta must have the same hidden size as input`)}if(e.length>4){let t=e[4];if(t.dims.length!==1)throw Error(`Bias must be 1D`);if(t.dims[t.dims.length-1]!==i)throw Error(`Bias must have the same hidden size as input`)}},Du=(e,t,n,r)=>{let i=t.simplified,a=e[0].dims,o=U.size(a),s=a,c=o,l=a.slice(-1)[0],u=r?a.slice(0,-1).concat(1):[],d=!i&&e.length>3,f=e.length>4,p=r&&n>1,m=r&&n>2,h=n>3,g=64,_=tr(l),v=[{type:12,data:c},{type:12,data:_},{type:12,data:l},{type:1,data:t.epsilon}],y=t=>{let n=[{name:`output_size`,type:`u32`},{name:`components`,type:`u32`},{name:`hidden_size`,type:`u32`},{name:`epsilon`,type:`f32`}],r=[q(`x`,e[0].dataType,e[0].dims,_),q(`skip`,e[1].dataType,e[1].dims,_),q(`gamma`,e[2].dataType,e[2].dims,_)];d&&r.push(q(`beta`,e[3].dataType,e[3].dims,_)),f&&r.push(q(`bias`,e[4].dataType,e[4].dims,_)),r.push(J(`output`,e[0].dataType,s,_)),p&&r.push(J(`mean_output`,1,u)),m&&r.push(J(`inv_std_output`,1,u)),h&&r.push(J(`input_skip_bias_sum`,e[0].dataType,s,_));let a=$n(e[0].dataType),o=$n(1,_);return` + }`;return{name:`Resize`,shaderCache:{hint:`${t.cacheKey}|${n}|${l.length>0?t.mode===`cubic`?l:l.length:``}|${i.length>0?i:``}|${s.length>0?s:``}|${p}|${t.mode===`nearest`?o.length:o}`,inputDependencies:[`rank`]},getShaderSource:_,getRunData:()=>({outputs:[{dims:c,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(f/64)},programUniforms:[{type:12,data:f},{type:1,data:l},{type:1,data:s},...K(o,c)]})}},Su=e=>{let t=e.customDataBuffer;return new Uint32Array(t,t.byteOffset,1)[0]},Cu=(e,t)=>{let n=[],r=[],i=[],a=Su(e);if(t.antialias!==0)throw Error(`Only default value (0) for Antialias attribute is supported`);su(e.inputs,t,a,n,r,i),e.compute(xu(e.inputs[0],t,a,n,r,i),{inputs:[0]})},wu=e=>{let t=e.antialias,n=e.axes,r=e.coordinateTransformMode,i=e.cubicCoeffA,a=e.excludeOutside!==0,o=e.extrapolationValue,s=e.keepAspectRatioPolicy,c=e.mode,l=e.nearestMode===``?`simple`:e.nearestMode;return Jn({antialias:t,axes:n,coordinateTransformMode:r,cubicCoeffA:i,excludeOutside:a,extrapolationValue:o,keepAspectRatioPolicy:s,mode:c,nearestMode:l})}}),Eu,Du,Ou,ku=M(()=>{"use strict";U(),G(),X(),Eu=e=>{if(!e||e.length<3)throw Error(`layerNorm requires at least 3 inputs.`);let t=e[0],n=e[1],r=e[2];if(t.dataType!==n.dataType||t.dataType!==r.dataType)throw Error(`All inputs must have the same data type`);if(t.dims.length!==3&&t.dims.length!==2)throw Error(`Input must be 2D or 3D`);if(n.dims.length!==3&&n.dims.length!==2)throw Error(`Skip must be 2D or 3D`);let i=t.dims[t.dims.length-1],a=t.dims[t.dims.length-2];if(n.dims[n.dims.length-1]!==i)throw Error(`Skip must have the same hidden size as input`);if(n.dims[n.dims.length-2]!==a)throw Error(`Skip must have the same sequence length as input`);if(r.dims.length!==1)throw Error(`Gamma must be 1D`);if(r.dims[r.dims.length-1]!==i)throw Error(`Gamma must have the same hidden size as input`);if(e.length>3){let t=e[3];if(t.dims.length!==1)throw Error(`Beta must be 1D`);if(t.dims[t.dims.length-1]!==i)throw Error(`Beta must have the same hidden size as input`)}if(e.length>4){let t=e[4];if(t.dims.length!==1)throw Error(`Bias must be 1D`);if(t.dims[t.dims.length-1]!==i)throw Error(`Bias must have the same hidden size as input`)}},Du=(e,t,n,r)=>{let i=t.simplified,a=e[0].dims,o=W.size(a),s=a,c=o,l=a.slice(-1)[0],u=r?a.slice(0,-1).concat(1):[],d=!i&&e.length>3,f=e.length>4,p=r&&n>1,m=r&&n>2,h=n>3,g=64,_=er(l),v=[{type:12,data:c},{type:12,data:_},{type:12,data:l},{type:1,data:t.epsilon}],y=t=>{let n=[{name:`output_size`,type:`u32`},{name:`components`,type:`u32`},{name:`hidden_size`,type:`u32`},{name:`epsilon`,type:`f32`}],r=[J(`x`,e[0].dataType,e[0].dims,_),J(`skip`,e[1].dataType,e[1].dims,_),J(`gamma`,e[2].dataType,e[2].dims,_)];d&&r.push(J(`beta`,e[3].dataType,e[3].dims,_)),f&&r.push(J(`bias`,e[4].dataType,e[4].dims,_)),r.push(Y(`output`,e[0].dataType,s,_)),p&&r.push(Y(`mean_output`,1,u)),m&&r.push(Y(`inv_std_output`,1,u)),h&&r.push(Y(`input_skip_bias_sum`,e[0].dataType,s,_));let a=Qn(e[0].dataType),o=Qn(1,_);return` ${t.registerUniforms(n).declareVariables(...r)} var sum_shared : array<${o}, ${g}>; @@ -2654,7 +2654,7 @@ fn calculateOutputIndex(index: u32) -> u32 { let value = input_value + skip_value + bias_value; ${h?`input_skip_bias_sum[offset + i] = value;`:``} output[offset + i] = value; - let f32_value = ${rr(a,_,`value`)}; + let f32_value = ${nr(a,_,`value`)}; sum_shared[ix] += f32_value; sum_squared_shared[ix] += f32_value * f32_value; } @@ -2672,8 +2672,8 @@ fn calculateOutputIndex(index: u32) -> u32 { let sum = sum_shared[0]; let square_sum = sum_squared_shared[0]; - let mean = ${ir(`sum`,_)} / f32(uniforms.hidden_size); - let inv_std_dev = inverseSqrt(${ir(`square_sum`,_)} / f32(uniforms.hidden_size) ${i?``:`- mean * mean`} + uniforms.epsilon); + let mean = ${rr(`sum`,_)} / f32(uniforms.hidden_size); + let inv_std_dev = inverseSqrt(${rr(`square_sum`,_)} / f32(uniforms.hidden_size) ${i?``:`- mean * mean`} + uniforms.epsilon); ${p?`mean_output[global_idx] = mean;`:``} ${m?`inv_std_output[global_idx] = inv_std_dev;`:``} @@ -2682,14 +2682,14 @@ fn calculateOutputIndex(index: u32) -> u32 { ${a}(inv_std_dev) * gamma[offset1d + i] ${d?`+ beta[offset1d + i]`:``}; } - }`},b=[{dims:s,dataType:e[0].dataType}];return n>1&&b.push({dims:u,dataType:1}),n>2&&b.push({dims:u,dataType:1}),n>3&&b.push({dims:a,dataType:e[0].dataType}),{name:`SkipLayerNormalization`,shaderCache:{hint:`${_};${p};${m};${h}`,inputDependencies:e.map((e,t)=>`type`)},getShaderSource:y,getRunData:()=>({outputs:b,dispatchGroup:{x:Math.ceil(c/l)},programUniforms:v})}},Ou=(e,t)=>{Eu(e.inputs);let n=[0];e.outputCount>1&&n.push(-3),e.outputCount>2&&n.push(-3),e.outputCount>3&&n.push(3),e.compute(Du(e.inputs,t,e.outputCount,!1),{outputs:n})}}),Au,ju,Mu,Nu,Pu,Fu,Iu,Lu,Ru=M(()=>{"use strict";V(),W(),Xn(),Y(),Au=(e,t)=>{if(!e||e.length<1)throw Error(`too few inputs`);if(t.axes.length!==0){if(t.axes.length!==t.starts.length||t.axes.length!==t.ends.length)throw Error(`axes, starts and ends must have the same length`)}else if(t.starts.length!==t.ends.length)throw Error(`starts and ends must have the same length`);e.slice(1).forEach((t,n)=>{if(e[n+1].dataType!==6&&e[n+1].dataType!==7)throw Error(`Input ${n} must be an array of int32 or int64`)})},ju=(e,t)=>{let n=[];if(e.length>t)if(e[t].dataType===7)e[t].getBigInt64Array().forEach(e=>n.push(Number(e)));else if(e[t].dataType===6)e[t].getInt32Array().forEach(e=>n.push(Number(e)));else throw Error(`Input ${t} must be an array of int32 or int64`);return n},Mu=(e,t)=>{if(e.length>1){let t=ju(e,1),n=ju(e,2),r=ju(e,3);return r.length===0&&(r=[...Array(e[0].dims.length).keys()]),Yn({starts:t,ends:n,axes:r})}else return t},Nu=(e,t,n,r,i)=>{let a=e;return e<0&&(a+=n[r[t]]),i[t]<0?Math.max(0,Math.min(a,n[r[t]]-1)):Math.max(0,Math.min(a,n[r[t]]))},Pu=(e,t,n)=>`fn calculateInputIndices(output_indices: ${t.type.indices}) -> ${e.type.indices} { + }`},b=[{dims:s,dataType:e[0].dataType}];return n>1&&b.push({dims:u,dataType:1}),n>2&&b.push({dims:u,dataType:1}),n>3&&b.push({dims:a,dataType:e[0].dataType}),{name:`SkipLayerNormalization`,shaderCache:{hint:`${_};${p};${m};${h}`,inputDependencies:e.map((e,t)=>`type`)},getShaderSource:y,getRunData:()=>({outputs:b,dispatchGroup:{x:Math.ceil(c/l)},programUniforms:v})}},Ou=(e,t)=>{Eu(e.inputs);let n=[0];e.outputCount>1&&n.push(-3),e.outputCount>2&&n.push(-3),e.outputCount>3&&n.push(3),e.compute(Du(e.inputs,t,e.outputCount,!1),{outputs:n})}}),Au,ju,Mu,Nu,Pu,Fu,Iu,Lu,Ru=M(()=>{"use strict";U(),G(),Yn(),X(),Au=(e,t)=>{if(!e||e.length<1)throw Error(`too few inputs`);if(t.axes.length!==0){if(t.axes.length!==t.starts.length||t.axes.length!==t.ends.length)throw Error(`axes, starts and ends must have the same length`)}else if(t.starts.length!==t.ends.length)throw Error(`starts and ends must have the same length`);e.slice(1).forEach((t,n)=>{if(e[n+1].dataType!==6&&e[n+1].dataType!==7)throw Error(`Input ${n} must be an array of int32 or int64`)})},ju=(e,t)=>{let n=[];if(e.length>t)if(e[t].dataType===7)e[t].getBigInt64Array().forEach(e=>n.push(Number(e)));else if(e[t].dataType===6)e[t].getInt32Array().forEach(e=>n.push(Number(e)));else throw Error(`Input ${t} must be an array of int32 or int64`);return n},Mu=(e,t)=>{if(e.length>1){let t=ju(e,1),n=ju(e,2),r=ju(e,3);return r.length===0&&(r=[...Array(e[0].dims.length).keys()]),Jn({starts:t,ends:n,axes:r})}else return t},Nu=(e,t,n,r,i)=>{let a=e;return e<0&&(a+=n[r[t]]),i[t]<0?Math.max(0,Math.min(a,n[r[t]]-1)):Math.max(0,Math.min(a,n[r[t]]))},Pu=(e,t,n)=>`fn calculateInputIndices(output_indices: ${t.type.indices}) -> ${e.type.indices} { var input_indices: ${e.type.indices}; var carry = 0u; for (var i = ${n.length}; i >= 0; i--) { - let input_shape_i = ${K(`uniforms.input_shape`,`i`,n.length)}; - let steps_i = ${K(`uniforms.steps`,`i`,n.length)}; - let signs_i = ${K(`uniforms.signs`,`i`,n.length)}; - let starts_i = ${K(`uniforms.starts`,`i`,n.length)}; + let input_shape_i = ${q(`uniforms.input_shape`,`i`,n.length)}; + let steps_i = ${q(`uniforms.steps`,`i`,n.length)}; + let signs_i = ${q(`uniforms.signs`,`i`,n.length)}; + let starts_i = ${q(`uniforms.starts`,`i`,n.length)}; var output_index = ${t.indicesGet(`output_indices`,`i`)}; var input_index = output_index * steps_i + starts_i + carry; carry = input_index / input_shape_i; @@ -2700,7 +2700,7 @@ fn calculateOutputIndex(index: u32) -> u32 { ${e.indicesSet(`input_indices`,`i`,`input_index`)}; } return input_indices; - }`,Fu=(e,t)=>{let n=e[0].dims,r=U.size(n),i=t.axes.length>0?U.normalizeAxes(t.axes,n.length):[...Array(n.length).keys()],a=ju(e,4);a.forEach(e=>e!==0||(()=>{throw Error(`step cannot be 0`)})),a.length===0&&(a=Array(i.length).fill(1));let o=t.starts.map((e,t)=>Nu(e,t,n,i,a)),s=t.ends.map((e,t)=>Nu(e,t,n,i,a));if(i.length!==o.length||i.length!==s.length)throw Error(`start, ends and axes should have the same number of elements`);if(i.length!==n.length)for(let e=0;eMath.sign(e));a.forEach((e,t,n)=>{if(e<0){let r=(s[t]-o[t])/e,i=o[t],c=i+r*a[t];o[t]=c,s[t]=i,n[t]=-e}});let l=n.slice(0);i.forEach((e,t)=>{l[e]=Math.ceil((s[e]-o[e])/a[e])});let u={dims:l,dataType:e[0].dataType},d=J(`output`,e[0].dataType,l.length),f=q(`input`,e[0].dataType,e[0].dims.length),p=U.size(l),m=[{name:`outputSize`,type:`u32`},{name:`starts`,type:`u32`,length:o.length},{name:`signs`,type:`i32`,length:c.length},{name:`steps`,type:`u32`,length:a.length}],h=[{type:12,data:p},{type:12,data:o},{type:6,data:c},{type:12,data:a},...G(e[0].dims,l)],g=e=>` + }`,Fu=(e,t)=>{let n=e[0].dims,r=W.size(n),i=t.axes.length>0?W.normalizeAxes(t.axes,n.length):[...Array(n.length).keys()],a=ju(e,4);a.forEach(e=>e!==0||(()=>{throw Error(`step cannot be 0`)})),a.length===0&&(a=Array(i.length).fill(1));let o=t.starts.map((e,t)=>Nu(e,t,n,i,a)),s=t.ends.map((e,t)=>Nu(e,t,n,i,a));if(i.length!==o.length||i.length!==s.length)throw Error(`start, ends and axes should have the same number of elements`);if(i.length!==n.length)for(let e=0;eMath.sign(e));a.forEach((e,t,n)=>{if(e<0){let r=(s[t]-o[t])/e,i=o[t],c=i+r*a[t];o[t]=c,s[t]=i,n[t]=-e}});let l=n.slice(0);i.forEach((e,t)=>{l[e]=Math.ceil((s[e]-o[e])/a[e])});let u={dims:l,dataType:e[0].dataType},d=Y(`output`,e[0].dataType,l.length),f=J(`input`,e[0].dataType,e[0].dims.length),p=W.size(l),m=[{name:`outputSize`,type:`u32`},{name:`starts`,type:`u32`,length:o.length},{name:`signs`,type:`i32`,length:c.length},{name:`steps`,type:`u32`,length:a.length}],h=[{type:12,data:p},{type:12,data:o},{type:6,data:c},{type:12,data:a},...K(e[0].dims,l)],g=e=>` ${e.registerUniforms(m).declareVariables(f,d)} ${Pu(f,d,n)} ${e.mainStart()} @@ -2708,7 +2708,7 @@ fn calculateOutputIndex(index: u32) -> u32 { let output_indices = ${d.offsetToIndices(`global_idx`)}; let input_indices = calculateInputIndices(output_indices); ${d.setByOffset(`global_idx`,f.getByIndices(`input_indices`))} - }`;return{name:`Slice`,shaderCache:{hint:`${c.length}_${o.length}_${a.length}`,inputDependencies:[`rank`]},getShaderSource:g,getRunData:()=>({outputs:[u],dispatchGroup:{x:Math.ceil(r/64)},programUniforms:h})}},Iu=(e,t)=>{Au(e.inputs,t);let n=Mu(e.inputs,t);e.compute(Fu(e.inputs,n),{inputs:[0]})},Lu=e=>{let t=e.starts,n=e.ends,r=e.axes;return Yn({starts:t,ends:n,axes:r})}}),zu,Bu,Q,Vu,Hu=M(()=>{"use strict";V(),W(),Xn(),vr(),Y(),zu=e=>{if(!e||e.length!==1)throw Error(`Softmax op requires 1 input.`)},Bu=(e,t)=>{let n=e.inputs[0],r=n.dims,i=U.size(r),a=r.length,o=U.normalizeAxis(t.axis,a),s=ot),l[o]=a-1,l[a-1]=o,c=e.compute(hr(n,l),{inputs:[n],outputs:[-1]})[0]):c=n;let u=c.dims,d=u[a-1],f=i/d,p=tr(d),m=d/p,h=64;f===1&&(h=256);let g=(e,t)=>t===4?`max(max(${e}.x, ${e}.y), max(${e}.z, ${e}.w))`:t===2?`max(${e}.x, ${e}.y)`:t===3?`max(max(${e}.x, ${e}.y), ${e}.z)`:e,_=q(`x`,c.dataType,c.dims,p),v=J(`result`,c.dataType,c.dims,p),y=_.type.value,b=$n(c.dataType)===`f32`?`var threadMax = ${y}(-3.402823e+38f);`:`var threadMax = ${y}(-65504.0h);`,x=e=>` + }`;return{name:`Slice`,shaderCache:{hint:`${c.length}_${o.length}_${a.length}`,inputDependencies:[`rank`]},getShaderSource:g,getRunData:()=>({outputs:[u],dispatchGroup:{x:Math.ceil(r/64)},programUniforms:h})}},Iu=(e,t)=>{Au(e.inputs,t);let n=Mu(e.inputs,t);e.compute(Fu(e.inputs,n),{inputs:[0]})},Lu=e=>{let t=e.starts,n=e.ends,r=e.axes;return Jn({starts:t,ends:n,axes:r})}}),zu,Bu,Vu,Hu,Uu=M(()=>{"use strict";U(),G(),Yn(),_r(),X(),zu=e=>{if(!e||e.length!==1)throw Error(`Softmax op requires 1 input.`)},Bu=(e,t)=>{let n=e.inputs[0],r=n.dims,i=W.size(r),a=r.length,o=W.normalizeAxis(t.axis,a),s=ot),l[o]=a-1,l[a-1]=o,c=e.compute(mr(n,l),{inputs:[n],outputs:[-1]})[0]):c=n;let u=c.dims,d=u[a-1],f=i/d,p=er(d),m=d/p,h=64;f===1&&(h=256);let g=(e,t)=>t===4?`max(max(${e}.x, ${e}.y), max(${e}.z, ${e}.w))`:t===2?`max(${e}.x, ${e}.y)`:t===3?`max(max(${e}.x, ${e}.y), ${e}.z)`:e,_=J(`x`,c.dataType,c.dims,p),v=Y(`result`,c.dataType,c.dims,p),y=_.type.value,b=Qn(c.dataType)===`f32`?`var threadMax = ${y}(-3.402823e+38f);`:`var threadMax = ${y}(-65504.0h);`,x=e=>` var rowMaxShared : ${y}; var rowSumShared : ${y}; var threadShared : array<${y}, ${h}>; @@ -2771,7 +2771,7 @@ fn calculateOutputIndex(index: u32) -> u32 { workgroupBarrier(); } if (lindex == 0) { - rowSumShared = ${y}(${ir(`threadShared[0]`,p)}); + rowSumShared = ${y}(${rr(`threadShared[0]`,p)}); } workgroupBarrier(); @@ -2780,7 +2780,7 @@ fn calculateOutputIndex(index: u32) -> u32 { let value = exp(getValue(row, col, row_stride) - rowMaxShared) / rowSumShared; setValue(row, col, row_stride, value); } - }`,S=e.compute({name:`Softmax`,shaderCache:{hint:`${p};${h}`,inputDependencies:[`type`]},getRunData:()=>({outputs:[{dims:u,dataType:c.dataType}],dispatchGroup:{x:f},programUniforms:[{type:6,data:m}]}),getShaderSource:x},{inputs:[c],outputs:[s?-1:0]})[0];s&&e.compute(hr(S,l),{inputs:[S]})},Q=(e,t)=>{zu(e.inputs),Bu(e,t)},Vu=e=>Yn({axis:e.axis})}),Uu,Wu,Gu,Ku,qu,Ju=M(()=>{"use strict";V(),W(),Y(),Uu=e=>Array.from(e.getBigInt64Array(),Number),Wu=e=>{if(!e||e.length!==2)throw Error(`Tile requires 2 inputs.`);if(e[0].dataType!==1&&e[0].dataType!==10&&e[0].dataType!==6&&e[0].dataType!==12)throw Error(`Tile only support float, float16, int32, and uint32 data types`);if(e[1].dataType!==7)throw Error("Tile `repeats` input should be of int64 data type");if(e[1].dims.length!==1)throw Error("Tile `repeats` input should be 1-D");if(Uu(e[1]).length!==e[0].dims.length)throw Error("Tile `repeats` input should have same number of elements as rank of input data tensor")},Gu=(e,t)=>{let n=[];for(let r=0;r{let n=e[0].dims,r=t??Uu(e[1]),i=Gu(n,r),a=U.size(i),o=e[0].dataType,s=q(`input`,o,n.length),c=J(`output`,o,i.length),l=e=>` + }`,S=e.compute({name:`Softmax`,shaderCache:{hint:`${p};${h}`,inputDependencies:[`type`]},getRunData:()=>({outputs:[{dims:u,dataType:c.dataType}],dispatchGroup:{x:f},programUniforms:[{type:6,data:m}]}),getShaderSource:x},{inputs:[c],outputs:[s?-1:0]})[0];s&&e.compute(mr(S,l),{inputs:[S]})},Vu=(e,t)=>{zu(e.inputs),Bu(e,t)},Hu=e=>Jn({axis:e.axis})}),Wu,Gu,Ku,Q,qu,Ju=M(()=>{"use strict";U(),G(),X(),Wu=e=>Array.from(e.getBigInt64Array(),Number),Gu=e=>{if(!e||e.length!==2)throw Error(`Tile requires 2 inputs.`);if(e[0].dataType!==1&&e[0].dataType!==10&&e[0].dataType!==6&&e[0].dataType!==12)throw Error(`Tile only support float, float16, int32, and uint32 data types`);if(e[1].dataType!==7)throw Error("Tile `repeats` input should be of int64 data type");if(e[1].dims.length!==1)throw Error("Tile `repeats` input should be 1-D");if(Wu(e[1]).length!==e[0].dims.length)throw Error("Tile `repeats` input should have same number of elements as rank of input data tensor")},Ku=(e,t)=>{let n=[];for(let r=0;r{let n=e[0].dims,r=t??Wu(e[1]),i=Ku(n,r),a=W.size(i),o=e[0].dataType,s=J(`input`,o,n.length),c=Y(`output`,o,i.length),l=e=>` const inputShape = ${s.indices(...n)}; ${e.registerUniform(`output_size`,`u32`).declareVariables(s,c)} ${e.mainStart()} @@ -2794,7 +2794,7 @@ fn calculateOutputIndex(index: u32) -> u32 { ${s.indicesSet(`input_indices`,`i`,`input_dim_value`)} } ${c.setByOffset(`global_idx`,s.getByIndices(`input_indices`))} - }`;return{name:`Tile`,shaderCache:{hint:`${r}`,inputDependencies:[`rank`]},getRunData:()=>({outputs:[{dims:i,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(a/64)},programUniforms:[{type:12,data:a},...G(e[0].dims,i)]}),getShaderSource:l}},qu=e=>{Wu(e.inputs),e.compute(Ku(e.inputs),{inputs:[0]})}}),Yu,Xu,Zu,Qu=M(()=>{"use strict";V(),W(),Y(),Yu=(e,t,n,r,i)=>{let a=J(`output_data`,i,n.length,4),o=q(`a_data`,t[1].dataType,t[1].dims.length,4),s=q(`b_data`,t[2].dataType,t[2].dims.length,4),c=q(`c_data`,t[0].dataType,t[0].dims.length,4),l,u=(e,t,n)=>`select(${t}, ${e}, ${n})`;if(!r)l=a.setByOffset(`global_idx`,u(o.getByOffset(`global_idx`),s.getByOffset(`global_idx`),c.getByOffset(`global_idx`)));else{let e=(e,t,n=``)=>{let r=`a_data[index_a${t}][component_a${t}]`,i=`b_data[index_b${t}][component_b${t}]`,l=`bool(c_data[index_c${t}] & (0xffu << (component_c${t} * 8)))`;return` + }`;return{name:`Tile`,shaderCache:{hint:`${r}`,inputDependencies:[`rank`]},getRunData:()=>({outputs:[{dims:i,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(a/64)},programUniforms:[{type:12,data:a},...K(e[0].dims,i)]}),getShaderSource:l}},qu=e=>{Gu(e.inputs),e.compute(Q(e.inputs),{inputs:[0]})}}),Yu,Xu,Zu,Qu=M(()=>{"use strict";U(),G(),X(),Yu=(e,t,n,r,i)=>{let a=Y(`output_data`,i,n.length,4),o=J(`a_data`,t[1].dataType,t[1].dims.length,4),s=J(`b_data`,t[2].dataType,t[2].dims.length,4),c=J(`c_data`,t[0].dataType,t[0].dims.length,4),l,u=(e,t,n)=>`select(${t}, ${e}, ${n})`;if(!r)l=a.setByOffset(`global_idx`,u(o.getByOffset(`global_idx`),s.getByOffset(`global_idx`),c.getByOffset(`global_idx`)));else{let e=(e,t,n=``)=>{let r=`a_data[index_a${t}][component_a${t}]`,i=`b_data[index_b${t}][component_b${t}]`,l=`bool(c_data[index_c${t}] & (0xffu << (component_c${t} * 8)))`;return` let output_indices${t} = ${a.offsetToIndices(`global_idx * 4u + ${t}u`)}; let offset_a${t} = ${o.broadcastedIndicesToOffset(`output_indices${t}`,a)}; let offset_b${t} = ${s.broadcastedIndicesToOffset(`output_indices${t}`,a)}; @@ -2822,10 +2822,10 @@ fn calculateOutputIndex(index: u32) -> u32 { ${e.mainStart()} ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.vec_size`)} ${l} - }`},Xu=e=>{let t=e[1].dims,n=e[2].dims,r=e[0].dims,i=e[1].dataType,a=!(U.areEqual(t,n)&&U.areEqual(n,r)),o=t,s=U.size(t);if(a){let e=hn.calcShape(hn.calcShape(t,n,!1),r,!1);if(!e)throw Error(`Can't perform where op on the given tensors`);o=e,s=U.size(o)}let c=Math.ceil(s/4);return{name:`Where`,shaderCache:{inputDependencies:[`rank`,`rank`,`rank`]},getShaderSource:t=>Yu(t,e,o,a,i),getRunData:()=>({outputs:[{dims:o,dataType:i}],dispatchGroup:{x:Math.ceil(s/64/4)},programUniforms:[{type:12,data:c},...G(r,t,n,o)]})}},Zu=e=>{e.compute(Xu(e.inputs))}}),$u,ed=M(()=>{"use strict";vi(),Di(),Mi(),Ii(),Ma(),Ka(),$a(),qo(),ss(),ds(),_s(),ks(),Fs(),Rs(),Us(),qs(),Qs(),rc(),cc(),Cc(),Yc(),el(),il(),sl(),pl(),jc(),Cl(),Hl(),ql(),Zl(),iu(),pi(),Tu(),Uc(),ku(),Ru(),Hu(),zc(),Ju(),vr(),Oa(),Qu(),$u=new Map([[`Abs`,[zi]],[`Acos`,[Bi]],[`Acosh`,[Vi]],[`Add`,[Ia]],[`ArgMax`,[gi,_i]],[`ArgMin`,[hi,_i]],[`Asin`,[Hi]],[`Asinh`,[Ui]],[`Atan`,[Wi]],[`Atanh`,[Gi]],[`Attention`,[Ei]],[`AveragePool`,[Nl,Ml]],[`BatchNormalization`,[ji]],[`BiasAdd`,[Fi]],[`BiasSplitGelu`,[ja]],[`Cast`,[qi,Ki]],[`Ceil`,[Xi]],[`Clip`,[Yi]],[`Concat`,[Za,Qa]],[`Conv`,[Ko,Ho]],[`ConvTranspose`,[os,es]],[`Cos`,[Zi]],[`Cosh`,[Qi]],[`CumSum`,[ls,us]],[`DepthToSpace`,[hs,gs]],[`DequantizeLinear`,[Gl,Kl]],[`Div`,[La]],[`Einsum`,[Ds,Os]],[`Elu`,[ea,$i]],[`Equal`,[Ra]],[`Erf`,[na]],[`Exp`,[ra]],[`Expand`,[Ps]],[`FastGelu`,[Ls]],[`Floor`,[ia]],[`FusedConv`,[Ko,Ho]],[`Gather`,[Hs,Vs]],[`GatherElements`,[nc,tc]],[`GatherBlockQuantized`,[Xs,Zs]],[`GatherND`,[Gs,Ks]],[`Gelu`,[aa]],[`Gemm`,[sc,oc]],[`GlobalAveragePool`,[Il,Fl]],[`GlobalMaxPool`,[Vl,Bl]],[`Greater`,[Ha]],[`GreaterOrEqual`,[Wa]],[`GridSample`,[xc,Sc]],[`GroupQueryAttention`,[Jc]],[`HardSigmoid`,[pa,fa]],[`InstanceNormalization`,[$c]],[`LayerNormalization`,[rl]],[`LeakyRelu`,[oa,$i]],[`Less`,[Ua]],[`LessOrEqual`,[Ga]],[`Log`,[wa]],[`MatMul`,[ol]],[`MatMulNBits`,[dl,fl]],[`MaxPool`,[Rl,zl]],[`Mul`,[za]],[`MultiHeadAttention`,[Ac,Ec]],[`Neg`,[ca]],[`Not`,[sa]],[`Pad`,[Sl]],[`Pow`,[Ba]],[`QuickGelu`,[Da,$i]],[`Range`,[Xl]],[`Reciprocal`,[la]],[`ReduceMin`,[ci]],[`ReduceMean`,[ri]],[`ReduceMax`,[si]],[`ReduceSum`,[ui]],[`ReduceProd`,[li]],[`ReduceL1`,[ii]],[`ReduceL2`,[ai]],[`ReduceLogSum`,[fi]],[`ReduceLogSumExp`,[oi]],[`ReduceSumSquare`,[di]],[`Relu`,[ua]],[`Resize`,[Cu,wu]],[`RotaryEmbedding`,[Hc]],[`ScatterND`,[ru,nu]],[`Sigmoid`,[da]],[`Sin`,[ma]],[`Sinh`,[ha]],[`Slice`,[Iu,Lu]],[`SkipLayerNormalization`,[Ou]],[`Split`,[Lc,Rc]],[`Sqrt`,[ga]],[`Softmax`,[Q,Vu]],[`Sub`,[Va]],[`Tan`,[_a]],[`Tanh`,[ya]],[`ThresholdedRelu`,[Ca,$i]],[`Tile`,[qu]],[`Transpose`,[gr,_r]],[`Where`,[Zu]]])}),td,nd=M(()=>{"use strict";$e(),pn(),Y(),td=class{constructor(e){this.backend=e,this.repo=new Map,this.attributesBound=!1}getArtifact(e){return this.repo.get(e)}setArtifact(e,t){this.repo.set(e,t)}run(e,t,n,r,i){He(e.programInfo.name);let a=this.backend.device,o=this.backend.getComputePassEncoder();this.backend.writeTimestamp(this.backend.pendingDispatchNumber*2);let s=[];for(let e of t)s.push({binding:s.length,resource:{buffer:e.buffer}});for(let e of n)s.push({binding:s.length,resource:{buffer:e.buffer}});i&&s.push({binding:s.length,resource:i});let c=a.createBindGroup({layout:e.computePipeline.getBindGroupLayout(0),entries:s,label:e.programInfo.name});if(this.backend.sessionStatus===`capturing`){let t={kernelId:this.backend.currentKernelId,computePipeline:e.computePipeline,bindGroup:c,dispatchGroup:r};this.backend.capturedCommandList.get(this.backend.currentSessionId).push(t)}o.setPipeline(e.computePipeline),o.setBindGroup(0,c),o.dispatchWorkgroups(...r),this.backend.writeTimestamp(this.backend.pendingDispatchNumber*2+1),this.backend.pendingDispatchNumber++,(this.backend.pendingDispatchNumber>=this.backend.maxDispatchNumber||this.backend.queryType===`at-passes`)&&this.backend.endComputePass(),this.backend.pendingDispatchNumber>=this.backend.maxDispatchNumber&&this.backend.flush(),B(e.programInfo.name)}dispose(){}build(e,t){He(e.name);let n=this.backend.device,r=[];[{feature:`shader-f16`,extension:`f16`},{feature:`subgroups`,extension:`subgroups`}].forEach(e=>{n.features.has(e.feature)&&r.push(`enable ${e.extension};`)});let i=lr(t,this.backend.device.limits),a=e.getShaderSource(i),o=`${r.join(` + }`},Xu=e=>{let t=e[1].dims,n=e[2].dims,r=e[0].dims,i=e[1].dataType,a=!(W.areEqual(t,n)&&W.areEqual(n,r)),o=t,s=W.size(t);if(a){let e=mn.calcShape(mn.calcShape(t,n,!1),r,!1);if(!e)throw Error(`Can't perform where op on the given tensors`);o=e,s=W.size(o)}let c=Math.ceil(s/4);return{name:`Where`,shaderCache:{inputDependencies:[`rank`,`rank`,`rank`]},getShaderSource:t=>Yu(t,e,o,a,i),getRunData:()=>({outputs:[{dims:o,dataType:i}],dispatchGroup:{x:Math.ceil(s/64/4)},programUniforms:[{type:12,data:c},...K(r,t,n,o)]})}},Zu=e=>{e.compute(Xu(e.inputs))}}),$u,ed=M(()=>{"use strict";_i(),Ei(),ji(),Fi(),ja(),Ga(),Qa(),Ko(),os(),us(),gs(),Os(),Ps(),Ls(),Hs(),Ks(),Zs(),nc(),sc(),Sc(),Jc(),$c(),rl(),ol(),fl(),Ac(),Sl(),Hl(),ql(),Zl(),iu(),fi(),Tu(),Hc(),ku(),Ru(),Uu(),Rc(),Ju(),_r(),Da(),Qu(),$u=new Map([[`Abs`,[Ri]],[`Acos`,[zi]],[`Acosh`,[Bi]],[`Add`,[Fa]],[`ArgMax`,[hi,gi]],[`ArgMin`,[mi,gi]],[`Asin`,[Vi]],[`Asinh`,[Hi]],[`Atan`,[Ui]],[`Atanh`,[Wi]],[`Attention`,[Ti]],[`AveragePool`,[Nl,Ml]],[`BatchNormalization`,[Ai]],[`BiasAdd`,[Pi]],[`BiasSplitGelu`,[Aa]],[`Cast`,[Ki,Gi]],[`Ceil`,[Yi]],[`Clip`,[Ji]],[`Concat`,[Xa,Za]],[`Conv`,[Go,Vo]],[`ConvTranspose`,[rs,$o]],[`Cos`,[Xi]],[`Cosh`,[Zi]],[`CumSum`,[cs,ls]],[`DepthToSpace`,[ms,hs]],[`DequantizeLinear`,[Gl,Kl]],[`Div`,[Ia]],[`Einsum`,[Es,Ds]],[`Elu`,[$i,Qi]],[`Equal`,[La]],[`Erf`,[ta]],[`Exp`,[na]],[`Expand`,[Ns]],[`FastGelu`,[Is]],[`Floor`,[ra]],[`FusedConv`,[Go,Vo]],[`Gather`,[Vs,Bs]],[`GatherElements`,[tc,ec]],[`GatherBlockQuantized`,[Ys,Xs]],[`GatherND`,[Ws,Gs]],[`Gelu`,[ia]],[`Gemm`,[oc,ac]],[`GlobalAveragePool`,[Il,Fl]],[`GlobalMaxPool`,[Vl,Bl]],[`Greater`,[Va]],[`GreaterOrEqual`,[Ua]],[`GridSample`,[bc,xc]],[`GroupQueryAttention`,[qc]],[`HardSigmoid`,[fa,da]],[`InstanceNormalization`,[Qc]],[`LayerNormalization`,[nl]],[`LeakyRelu`,[aa,Qi]],[`Less`,[Ha]],[`LessOrEqual`,[Wa]],[`Log`,[Ca]],[`MatMul`,[al]],[`MatMulNBits`,[ul,dl]],[`MaxPool`,[Rl,zl]],[`Mul`,[Ra]],[`MultiHeadAttention`,[kc,Tc]],[`Neg`,[sa]],[`Not`,[oa]],[`Pad`,[xl]],[`Pow`,[za]],[`QuickGelu`,[Ea,Qi]],[`Range`,[Xl]],[`Reciprocal`,[ca]],[`ReduceMin`,[si]],[`ReduceMean`,[ni]],[`ReduceMax`,[oi]],[`ReduceSum`,[li]],[`ReduceProd`,[ci]],[`ReduceL1`,[ri]],[`ReduceL2`,[ii]],[`ReduceLogSum`,[di]],[`ReduceLogSumExp`,[ai]],[`ReduceSumSquare`,[ui]],[`Relu`,[la]],[`Resize`,[Cu,wu]],[`RotaryEmbedding`,[Vc]],[`ScatterND`,[ru,nu]],[`Sigmoid`,[ua]],[`Sin`,[pa]],[`Sinh`,[ma]],[`Slice`,[Iu,Lu]],[`SkipLayerNormalization`,[Ou]],[`Split`,[Ic,Lc]],[`Sqrt`,[ha]],[`Softmax`,[Vu,Hu]],[`Sub`,[Ba]],[`Tan`,[ga]],[`Tanh`,[va]],[`ThresholdedRelu`,[Sa,Qi]],[`Tile`,[qu]],[`Transpose`,[hr,gr]],[`Where`,[Zu]]])}),td,nd=M(()=>{"use strict";Ze(),fn(),X(),td=class{constructor(e){this.backend=e,this.repo=new Map,this.attributesBound=!1}getArtifact(e){return this.repo.get(e)}setArtifact(e,t){this.repo.set(e,t)}run(e,t,n,r,i){Be(e.programInfo.name);let a=this.backend.device,o=this.backend.getComputePassEncoder();this.backend.writeTimestamp(this.backend.pendingDispatchNumber*2);let s=[];for(let e of t)s.push({binding:s.length,resource:{buffer:e.buffer}});for(let e of n)s.push({binding:s.length,resource:{buffer:e.buffer}});i&&s.push({binding:s.length,resource:i});let c=a.createBindGroup({layout:e.computePipeline.getBindGroupLayout(0),entries:s,label:e.programInfo.name});if(this.backend.sessionStatus===`capturing`){let t={kernelId:this.backend.currentKernelId,computePipeline:e.computePipeline,bindGroup:c,dispatchGroup:r};this.backend.capturedCommandList.get(this.backend.currentSessionId).push(t)}o.setPipeline(e.computePipeline),o.setBindGroup(0,c),o.dispatchWorkgroups(...r),this.backend.writeTimestamp(this.backend.pendingDispatchNumber*2+1),this.backend.pendingDispatchNumber++,(this.backend.pendingDispatchNumber>=this.backend.maxDispatchNumber||this.backend.queryType===`at-passes`)&&this.backend.endComputePass(),this.backend.pendingDispatchNumber>=this.backend.maxDispatchNumber&&this.backend.flush(),H(e.programInfo.name)}dispose(){}build(e,t){Be(e.name);let n=this.backend.device,r=[];[{feature:`shader-f16`,extension:`f16`},{feature:`subgroups`,extension:`subgroups`}].forEach(e=>{n.features.has(e.feature)&&r.push(`enable ${e.extension};`)});let i=cr(t,this.backend.device.limits),a=e.getShaderSource(i),o=`${r.join(` `)} ${i.additionalImplementations} -${a}`,s=n.createShaderModule({code:o,label:e.name});H(`verbose`,()=>`[WebGPU] ${e.name} shader code: ${o}`);let c=n.createComputePipeline({compute:{module:s,entryPoint:`main`},layout:`auto`,label:e.name});return B(e.name),{programInfo:e,computePipeline:c,uniformVariablesInfo:i.variablesInfo}}normalizeDispatchGroupSize(e){let t=typeof e==`number`?e:e.x,n=typeof e==`number`?1:e.y||1,r=typeof e==`number`?1:e.z||1,i=this.backend.device.limits.maxComputeWorkgroupsPerDimension;if(t<=i&&n<=i&&r<=i)return[t,n,r];let a=t*n*r,o=Math.ceil(Math.sqrt(a));if(o>i){if(o=Math.ceil(Math.cbrt(a)),o>i)throw Error(`Total dispatch size exceeds WebGPU maximum.`);return[o,o,o]}else return[o,o,1]}}}),rd={};N(rd,{WebGpuBackend:()=>sd});var id,ad,od,sd,cd=M(()=>{"use strict";$e(),V(),pn(),xn(),qn(),ed(),nd(),id=(e,t)=>{if(t.length!==e.length)throw Error(`inputDependencies length ${t.length} is not equal to inputTensors length ${e.length}.`);let n=[];for(let r=0;r{let r=e.name;return e.shaderCache?.hint&&(r+=`[`+e.shaderCache.hint+`]`),r+=`:`+n+`:${id(t,e.shaderCache?.inputDependencies??Array(t.length).fill(`dims`))}`,r},od=class{constructor(e){e&&(this.architecture=e.architecture,this.vendor=e.vendor)}isArchitecture(e){return this.architecture===e}isVendor(e){return this.vendor===e}},sd=class{constructor(){this.currentSessionId=null,this.currentKernelId=null,this.commandEncoder=null,this.computePassEncoder=null,this.maxDispatchNumber=16,this.pendingDispatchNumber=0,this.pendingKernels=[],this.pendingQueries=new Map,this.sessionStatus=`default`,this.capturedCommandList=new Map,this.capturedPendingKernels=new Map,this.sessionExternalDataMapping=new Map}get currentKernelCustomData(){if(this.currentKernelId===null)throw Error(`currentKernelCustomData(): currentKernelId is null. (should not happen)`);let e=this.kernelCustomData.get(this.currentKernelId);return e||(e={},this.kernelCustomData.set(this.currentKernelId,e)),e}async initialize(e,t){this.env=e;let n=[],r={requiredLimits:{maxComputeWorkgroupStorageSize:t.limits.maxComputeWorkgroupStorageSize,maxComputeWorkgroupsPerDimension:t.limits.maxComputeWorkgroupsPerDimension,maxStorageBufferBindingSize:t.limits.maxStorageBufferBindingSize,maxBufferSize:t.limits.maxBufferSize,maxComputeInvocationsPerWorkgroup:t.limits.maxComputeInvocationsPerWorkgroup,maxComputeWorkgroupSizeX:t.limits.maxComputeWorkgroupSizeX,maxComputeWorkgroupSizeY:t.limits.maxComputeWorkgroupSizeY,maxComputeWorkgroupSizeZ:t.limits.maxComputeWorkgroupSizeZ},requiredFeatures:n},i=e=>t.features.has(e)&&n.push(e)&&!0;i(`chromium-experimental-timestamp-query-inside-passes`)||i(`timestamp-query`),i(`shader-f16`),i(`subgroups`),this.device=await t.requestDevice(r),this.adapterInfo=new od(t.info||await t.requestAdapterInfo()),this.gpuDataManager=Kn(this),this.programManager=new td(this),this.kernels=new Map,this.kernelPersistentData=new Map,this.kernelCustomData=new Map,dn(e.logLevel,!!e.debug),this.device.onuncapturederror=e=>{e.error instanceof GPUValidationError&&console.error(`An uncaught WebGPU validation error was raised: ${e.error.message}`)},Object.defineProperty(this.env.webgpu,`device`,{value:this.device,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(this.env.webgpu,`adapter`,{value:t,writable:!1,enumerable:!0,configurable:!1}),this.setQueryType()}dispose(){typeof this.querySet<`u`&&this.querySet.destroy(),this.gpuDataManager.dispose()}getCommandEncoder(){return this.commandEncoder||=this.device.createCommandEncoder(),this.commandEncoder}getComputePassEncoder(){if(!this.computePassEncoder){let e=this.getCommandEncoder(),t={};this.queryType===`at-passes`&&(t.timestampWrites={querySet:this.querySet,beginningOfPassWriteIndex:this.pendingDispatchNumber*2,endOfPassWriteIndex:this.pendingDispatchNumber*2+1}),this.computePassEncoder=e.beginComputePass(t)}return this.computePassEncoder}endComputePass(){this.computePassEncoder&&(this.computePassEncoder.end(),this.computePassEncoder=null)}flush(){if(!this.commandEncoder)return;He(),this.endComputePass();let e;this.queryType!==`none`&&(this.commandEncoder.resolveQuerySet(this.querySet,0,this.pendingDispatchNumber*2,this.queryResolveBuffer,0),e=this.device.createBuffer({size:this.pendingDispatchNumber*2*8,usage:GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST}),this.pendingQueries.set(e,this.pendingKernels),this.pendingKernels=[],this.commandEncoder.copyBufferToBuffer(this.queryResolveBuffer,0,e,0,this.pendingDispatchNumber*2*8)),this.device.queue.submit([this.commandEncoder.finish()]),this.gpuDataManager.refreshPendingBuffers(),this.commandEncoder=null,this.pendingDispatchNumber=0,this.queryType!==`none`&&e.mapAsync(GPUMapMode.READ).then(()=>{let t=new BigUint64Array(e.getMappedRange()),n=this.pendingQueries.get(e);for(let e=0;e`u`&&(this.queryTimeBase=d);let p=Number(d-this.queryTimeBase),m=Number(f-this.queryTimeBase);if(!Number.isSafeInteger(p)||!Number.isSafeInteger(m))throw RangeError(`incorrect timestamp range`);if(this.env.webgpu.profiling?.ondata)this.env.webgpu.profiling.ondata({version:1,inputsMetadata:l.map(e=>({dims:e.dims,dataType:Zt(e.dataType)})),outputsMetadata:u.map(e=>({dims:e.dims,dataType:Zt(e.dataType)})),kernelId:i,kernelType:o,kernelName:s,programName:c,startTime:p,endTime:m});else{let e=``;l.forEach((t,n)=>{e+=`input[${n}]: [${t.dims}] | ${Zt(t.dataType)}, `});let t=``;u.forEach((e,n)=>{t+=`output[${n}]: [${e.dims}] | ${Zt(e.dataType)}, `}),console.log(`[profiling] kernel "${i}|${o}|${s}|${c}" ${e}${t}execution time: ${m-p} ns`)}z(`GPU`,`${c}::${d}::${f}`)}e.unmap(),this.pendingQueries.delete(e)}),B()}run(e,t,n,r,i,a){He(e.name);let o=[];for(let e=0;et):n;if(u.length!==s.length)throw Error(`Output size ${u.length} must be equal to ${s.length}.`);let d=[],f=[];for(let e=0;e=a)throw Error(`Invalid output index: ${u[e]}`);if(u[e]===-3)continue;let t=u[e]===-1,n=u[e]===-2,o=t||n?i(s[e].dataType,s[e].dims):r(u[e],s[e].dataType,s[e].dims);if(d.push(o),o.data===0)continue;let c=this.gpuDataManager.get(o.data);if(!c)throw Error(`no GPU data for output: ${o.data}`);if(t&&this.temporaryData.push(c),n){let e=this.kernelPersistentData.get(this.currentKernelId);e||(e=[],this.kernelPersistentData.set(this.currentKernelId,e)),e.push(c)}f.push(c)}if(o.length!==t.length||f.length!==d.length){if(f.length===0)return B(e.name),d;throw Error(`Program ${e.name} has zero-sized tensor(s) in inputs or outputs. This is not supported now.`)}let p;if(l){let e=0,t=[];l.forEach(n=>{let r=typeof n.data==`number`?[n.data]:n.data;if(r.length===0)return;let i=n.type===10?2:4,a,o;n.type===10?(o=r.length>4?16:r.length>2?8:r.length*i,a=r.length>4?16:i*r.length):(o=r.length<=2?r.length*i:16,a=16),e=Math.ceil(e/o)*o,t.push(e);let s=n.type===10?8:4;e+=r.length>4?Math.ceil(r.length/s)*a:r.length*i});let n=16;e=Math.ceil(e/n)*n;let r=new ArrayBuffer(e);l.forEach((e,n)=>{let i=t[n],a=typeof e.data==`number`?[e.data]:e.data;if(e.type===6)new Int32Array(r,i,a.length).set(a);else if(e.type===12)new Uint32Array(r,i,a.length).set(a);else if(e.type===10)new Uint16Array(r,i,a.length).set(a);else if(e.type===1)new Float32Array(r,i,a.length).set(a);else throw Error(`Unsupported uniform type: ${Zt(e.type)}`)});let i=this.gpuDataManager.create(e,GPUBufferUsage.COPY_DST|GPUBufferUsage.UNIFORM);this.device.queue.writeBuffer(i.buffer,0,r,0,e),this.gpuDataManager.release(i.id),p={offset:0,size:e,buffer:i.buffer}}let m=this.programManager.normalizeDispatchGroupSize(c),h=m[1]===1&&m[2]===1,g=ad(e,t,h),_=this.programManager.getArtifact(g);if(_||(_=this.programManager.build(e,m),this.programManager.setArtifact(g,_),H(`info`,()=>`[artifact] key: ${g}, programName: ${e.name}`)),l&&_.uniformVariablesInfo){if(l.length!==_.uniformVariablesInfo.length)throw Error(`Uniform variables count mismatch: expect ${_.uniformVariablesInfo.length}, got ${l.length} in program "${_.programInfo.name}".`);for(let e=0;e`[ProgramManager] run "${e.name}" (key=${g}) with ${m[0]}x${m[1]}x${m[2]}`),this.queryType!==`none`||this.sessionStatus===`capturing`){let e={kernelId:this.currentKernelId,programName:_.programInfo.name,inputTensorViews:t,outputTensorViews:d};this.pendingKernels.push(e),this.sessionStatus===`capturing`&&this.capturedPendingKernels.get(this.currentSessionId).push(e)}return this.programManager.run(_,o,f,m,p),B(e.name),d}upload(e,t){this.gpuDataManager.upload(e,t)}memcpy(e,t){this.gpuDataManager.memcpy(e,t)}async download(e,t){await this.gpuDataManager.download(e,t)}alloc(e){return this.gpuDataManager.create(e).id}free(e){return this.gpuDataManager.release(e)}createKernel(e,t,n,r){let i=$u.get(e);if(!i)throw Error(`kernel not implemented: ${e}`);let a={kernelType:e,kernelName:r,kernelEntry:i[0],attributes:[i[1],n]};this.kernels.set(t,a)}releaseKernel(e){let t=this.kernelPersistentData.get(e);if(t){for(let e of t)this.gpuDataManager.release(e.id);this.kernelPersistentData.delete(e)}this.kernelCustomData.delete(e),this.kernels.delete(e)}computeKernel(e,t,n){let r=this.kernels.get(e);if(!r)throw Error(`kernel not created: ${e}`);let i=r.kernelType,a=r.kernelName,o=r.kernelEntry,s=r.attributes;if(this.currentKernelId!==null)throw Error(`kernel "[${i}] ${a}" is not allowed to be called recursively`);this.currentKernelId=e,s[0]&&(s[1]=s[0](s[1]),s[0]=void 0),H(`info`,()=>`[WebGPU] Start to run kernel "[${i}] ${a}"...`);let c=this.env.debug;this.temporaryData=[];try{return c&&this.device.pushErrorScope(`validation`),o(t,s[1]),0}catch(e){return n.push(Promise.resolve(`[WebGPU] Kernel "[${i}] ${a}" failed. ${e}`)),1}finally{c&&n.push(this.device.popErrorScope().then(e=>e?`GPU validation error for kernel "[${i}] ${a}": ${e.message}`:null));for(let e of this.temporaryData)this.gpuDataManager.release(e.id);this.temporaryData=[],this.currentKernelId=null}}registerBuffer(e,t,n,r){let i=this.sessionExternalDataMapping.get(e);i||(i=new Map,this.sessionExternalDataMapping.set(e,i));let a=i.get(t),o=this.gpuDataManager.registerExternalBuffer(n,r,a);return i.set(t,[o,n]),o}unregisterBuffers(e){let t=this.sessionExternalDataMapping.get(e);t&&(t.forEach(e=>this.gpuDataManager.unregisterExternalBuffer(e[0])),this.sessionExternalDataMapping.delete(e))}getBuffer(e){let t=this.gpuDataManager.get(e);if(!t)throw Error(`no GPU data for buffer: ${e}`);return t.buffer}createDownloader(e,t,n){return async()=>{let r=await Wn(this,e,t);return bn(r.buffer,n)}}writeTimestamp(e){this.queryType===`inside-passes`&&this.computePassEncoder.writeTimestamp(this.querySet,e)}setQueryType(){this.queryType=`none`,(this.env.webgpu.profiling?.mode===`default`||(typeof this.env.trace>`u`?this.env.wasm.trace:this.env.trace))&&(this.device.features.has(`chromium-experimental-timestamp-query-inside-passes`)?this.queryType=`inside-passes`:this.device.features.has(`timestamp-query`)&&(this.queryType=`at-passes`),this.queryType!==`none`&&typeof this.querySet>`u`&&(this.querySet=this.device.createQuerySet({type:`timestamp`,count:this.maxDispatchNumber*2}),this.queryResolveBuffer=this.device.createBuffer({size:this.maxDispatchNumber*2*8,usage:GPUBufferUsage.COPY_SRC|GPUBufferUsage.QUERY_RESOLVE})))}captureBegin(){H(`info`,`captureBegin`),this.capturedCommandList.get(this.currentSessionId)||this.capturedCommandList.set(this.currentSessionId,[]),this.capturedPendingKernels.get(this.currentSessionId)||this.capturedPendingKernels.set(this.currentSessionId,[]),this.flush(),this.sessionStatus=`capturing`}captureEnd(){H(`info`,`captureEnd`),this.flush(),this.sessionStatus=`default`}replay(){H(`info`,`replay`),this.sessionStatus=`replaying`;let e=this.capturedCommandList.get(this.currentSessionId),t=this.capturedPendingKernels.get(this.currentSessionId),n=e.length;this.pendingKernels=[];for(let r=0;r=this.maxDispatchNumber||this.queryType===`at-passes`)&&this.endComputePass(),this.pendingDispatchNumber>=this.maxDispatchNumber&&this.flush()}this.flush(),this.sessionStatus=`default`}onCreateSession(){this.gpuDataManager.onCreateSession()}onReleaseSession(e){this.unregisterBuffers(e),this.capturedCommandList.has(e)&&this.capturedCommandList.delete(e),this.capturedPendingKernels.has(e)&&this.capturedPendingKernels.delete(e),this.gpuDataManager.onReleaseSession(e)}onRunStart(e){this.currentSessionId=e,this.setQueryType()}}}),ld={};N(ld,{init:()=>fd});var ud,dd,fd,pd=M(()=>{"use strict";V(),pn(),W(),In(),ud=class e{constructor(e,t,n,r){this.module=e,this.dataType=t,this.data=n,this.dims=r}getFloat32Array(){if(this.dataType!==1)throw Error(`Invalid data type`);let e=U.size(this.dims);return e===0?new Float32Array:new Float32Array(this.module.HEAP8.buffer,this.data,e)}getBigInt64Array(){if(this.dataType!==7)throw Error(`Invalid data type`);let e=U.size(this.dims);return e===0?new BigInt64Array:new BigInt64Array(this.module.HEAP8.buffer,this.data,e)}getInt32Array(){if(this.dataType!==6)throw Error(`Invalid data type`);let e=U.size(this.dims);return e===0?new Int32Array:new Int32Array(this.module.HEAP8.buffer,this.data,e)}getUint16Array(){if(this.dataType!==10&&this.dataType!==4)throw Error(`Invalid data type`);let e=U.size(this.dims);return e===0?new Uint16Array:new Uint16Array(this.module.HEAP8.buffer,this.data,e)}reshape(t){if(U.size(t)!==U.size(this.dims))throw Error(`Invalid new shape`);return new e(this.module,this.dataType,this.data,t)}},dd=class{constructor(e,t,n){this.module=e,this.backend=t,this.customDataOffset=0,this.customDataSize=0,this.adapterInfo=t.adapterInfo;let r=e.PTR_SIZE,i=n/e.PTR_SIZE,a=r===4?`i32`:`i64`;this.opKernelContext=Number(e.getValue(r*i++,a));let o=Number(e.getValue(r*i++,a));this.outputCount=Number(e.getValue(r*i++,a)),this.customDataOffset=Number(e.getValue(r*i++,`*`)),this.customDataSize=Number(e.getValue(r*i++,a));let s=[];for(let t=0;ttypeof e==`number`?this.inputs[e]:e)??this.inputs,r=t?.outputs??[],i=(e,t,n)=>new ud(this.module,t,this.output(e,n),n),a=(e,t)=>{let n=Qt(e,t);if(!n)throw Error(`Unsupported data type: ${e}`);let r=n>0?this.backend.gpuDataManager.create(n).id:0;return new ud(this.module,e,r,t)};return this.backend.run(e,n,r,i,a,this.outputCount)}output(e,t){let n=this.module.stackSave();try{let n=this.module.PTR_SIZE,r=n===4?`i32`:`i64`,i=this.module.stackAlloc((1+t.length)*n);this.module.setValue(i,t.length,r);for(let e=0;e{let i=t.jsepInit;if(!i)throw Error(`Failed to initialize JSEP. The WebAssembly module is not built with JSEP support.`);if(e===`webgpu`){let e=(cd(),le(rd)).WebGpuBackend,a=new e;await a.initialize(n,r),i(`webgpu`,[a,e=>a.alloc(Number(e)),e=>a.free(e),(e,n,r,i=!1)=>{if(i)H(`verbose`,()=>`[WebGPU] jsepCopyGpuToGpu: src=${Number(e)}, dst=${Number(n)}, size=${Number(r)}`),a.memcpy(Number(e),Number(n));else{H(`verbose`,()=>`[WebGPU] jsepCopyCpuToGpu: dataOffset=${Number(e)}, gpuDataId=${Number(n)}, size=${Number(r)}`);let i=t.HEAPU8.subarray(Number(e>>>0),Number(e>>>0)+Number(r));a.upload(Number(n),i)}},async(e,n,r)=>{H(`verbose`,()=>`[WebGPU] jsepCopyGpuToCpu: gpuDataId=${e}, dataOffset=${n}, size=${r}`),await a.download(Number(e),()=>t.HEAPU8.subarray(Number(n)>>>0,Number(n+r)>>>0))},(e,n,r)=>a.createKernel(e,Number(n),r,t.UTF8ToString(t._JsepGetNodeName(Number(n)))),e=>a.releaseKernel(e),(e,n,r,i)=>{H(`verbose`,()=>`[WebGPU] jsepRun: sessionHandle=${r}, kernel=${e}, contextDataOffset=${n}`);let o=new dd(t,a,Number(n));return a.computeKernel(Number(e),o,i)},()=>a.captureBegin(),()=>a.captureEnd(),()=>a.replay()])}else{let e=new Fn(n);i(`webnn`,[e,()=>e.reserveTensorId(),t=>e.releaseTensorId(t),async(t,n,r,i,a)=>e.ensureTensor(t,n,r,i,a),(t,n)=>{e.uploadTensor(t,n)},async(t,n)=>e.downloadTensor(t,n)])}}}),md,hd,gd,_d,vd,yd,bd,xd,Sd,Cd,wd,Td,Ed,Dd=M(()=>{"use strict";Ht(),Yt(),V(),It(),Bt(),on(),md=(e,t)=>{Ft()._OrtInit(e,t)!==0&&zt(`Can't initialize onnxruntime.`)},hd=async e=>{md(e.wasm.numThreads,en(e.logLevel))},gd=async(e,t)=>{Ft().asyncInit?.();{let n=(pd(),le(ld)).init;if(t===`webgpu`){if(typeof navigator>`u`||!navigator.gpu)throw Error(`WebGPU is not supported in current environment`);let t=e.webgpu.adapter;if(t){if(typeof t.limits!=`object`||typeof t.features!=`object`||typeof t.requestDevice!=`function`)throw Error("Invalid GPU adapter set in `env.webgpu.adapter`. It must be a GPUAdapter object.")}else{let n=e.webgpu.powerPreference;if(n!==void 0&&n!==`low-power`&&n!==`high-performance`)throw Error(`Invalid powerPreference setting: "${n}"`);let r=e.webgpu.forceFallbackAdapter;if(r!==void 0&&typeof r!=`boolean`)throw Error(`Invalid forceFallbackAdapter setting: "${r}"`);if(t=await navigator.gpu.requestAdapter({powerPreference:n,forceFallbackAdapter:r}),!t)throw Error(`Failed to get GPU adapter. You may need to enable flag "--enable-unsafe-webgpu" if you are using Chrome.`)}await n(`webgpu`,Ft(),e,t)}if(t===`webnn`){if(typeof navigator>`u`||!navigator.ml)throw Error(`WebNN is not supported in current environment`);await n(`webnn`,Ft(),e)}}},_d=new Map,vd=e=>{let t=Ft(),n=t.stackSave();try{let n=t.PTR_SIZE,r=t.stackAlloc(2*n);t._OrtGetInputOutputCount(e,r,r+n)!==0&&zt(`Can't get session input/output count.`);let i=n===4?`i32`:`i64`;return[Number(t.getValue(r,i)),Number(t.getValue(r+n,i))]}finally{t.stackRestore(n)}},yd=(e,t)=>{let n=Ft(),r=n.stackSave(),i=0;try{let r=n.PTR_SIZE,a=n.stackAlloc(2*r);n._OrtGetInputOutputMetadata(e,t,a,a+r)!==0&&zt(`Can't get session input/output metadata.`);let o=Number(n.getValue(a,`*`));i=Number(n.getValue(a+r,`*`));let s=n.HEAP32[i/4];if(s===0)return[o,0];let c=n.HEAPU32[i/4+1],l=[];for(let e=0;e{let t=Ft(),n=t._malloc(e.byteLength);if(n===0)throw Error(`Can't create a session. failed to allocate a buffer of size ${e.byteLength}.`);return t.HEAPU8.set(e,n),[n,e.byteLength]},xd=async(e,t)=>{let n,r,i=Ft();Array.isArray(e)?[n,r]=e:e.buffer===i.HEAPU8.buffer?[n,r]=[e.byteOffset,e.byteLength]:[n,r]=bd(e);let a=0,o=0,s=0,c=[],l=[],u=[];try{if([o,c]=await Jt(t),t?.externalData&&i.mountExternalData){let e=[];for(let n of t.externalData){let t=typeof n==`string`?n:n.path;e.push(an(typeof n==`string`?n:n.data).then(e=>{i.mountExternalData(t,e)}))}await Promise.all(e)}for(let e of t?.executionProviders??[])if((typeof e==`string`?e:e.name)===`webnn`){if(i.shouldTransferToMLTensor=!1,typeof e!=`string`){let t=e,n=t?.context,r=t?.gpuDevice,a=t?.deviceType,o=t?.powerPreference;n?i.currentContext=n:r?i.currentContext=await i.webnnCreateMLContext(r):i.currentContext=await i.webnnCreateMLContext({deviceType:a,powerPreference:o})}else i.currentContext=await i.webnnCreateMLContext();break}a=await i._OrtCreateSession(n,r,o),i.webgpuOnCreateSession?.(a),a===0&&zt(`Can't create a session.`),i.jsepOnCreateSession?.(),i.currentContext&&(i.webnnRegisterMLContext(a,i.currentContext),i.currentContext=void 0,i.shouldTransferToMLTensor=!0);let[e,d]=vd(a),f=!!t?.enableGraphCapture,p=[],m=[],h=[],g=[],_=[];for(let t=0;te===`gpu-buffer`||e===`ml-tensor`)&&(s=i._OrtCreateBinding(a),s===0&&zt(`Can't create IO binding.`),v={handle:s,outputPreferredLocations:_,outputPreferredLocationsEncoded:_.map(e=>rn(e))}),_d.set(a,[a,l,u,v,f,!1]),[a,p,m,h,g]}catch(e){throw l.forEach(e=>i._OrtFree(e)),u.forEach(e=>i._OrtFree(e)),s!==0&&i._OrtReleaseBinding(s)!==0&&zt(`Can't release IO binding.`),a!==0&&i._OrtReleaseSession(a)!==0&&zt(`Can't release session.`),e}finally{i._free(n),o!==0&&i._OrtReleaseSessionOptions(o)!==0&&zt(`Can't release session options.`),c.forEach(e=>i._free(e)),i.unmountExternalData?.()}},Sd=e=>{let t=Ft(),n=_d.get(e);if(!n)throw Error(`cannot release session. invalid session id: ${e}`);let[r,i,a,o,s]=n;o&&(s&&t._OrtClearBoundOutputs(o.handle)!==0&&zt(`Can't clear bound outputs.`),t._OrtReleaseBinding(o.handle)!==0&&zt(`Can't release IO binding.`)),t.jsepOnReleaseSession?.(e),t.webnnOnReleaseSession?.(e),t.webgpuOnReleaseSession?.(e),i.forEach(e=>t._OrtFree(e)),a.forEach(e=>t._OrtFree(e)),t._OrtReleaseSession(r)!==0&&zt(`Can't release session.`),_d.delete(e)},Cd=async(e,t,n,r,i,a,o=!1)=>{if(!e){t.push(0);return}let s=Ft(),c=s.PTR_SIZE,l=e[0],u=e[1],d=e[3],f=d,p,m;if(l===`string`&&(d===`gpu-buffer`||d===`ml-tensor`))throw Error(`String tensor is not supported on GPU.`);if(o&&d!==`gpu-buffer`)throw Error(`External buffer must be provided for input/output index ${a} when enableGraphCapture is true.`);if(d===`gpu-buffer`){let t=e[2].gpuBuffer;m=Qt(Xt(l),u);{let e=s.jsepRegisterBuffer;if(!e)throw Error(`Tensor location "gpu-buffer" is not supported without using WebGPU.`);p=e(r,a,t,m)}}else if(d===`ml-tensor`){let t=e[2].mlTensor;m=Qt(Xt(l),u);let n=s.webnnRegisterMLTensor;if(!n)throw Error(`Tensor location "ml-tensor" is not supported without using WebNN.`);p=n(r,t,Xt(l),u)}else{let t=e[2];if(Array.isArray(t)){m=c*t.length,p=s._malloc(m),n.push(p);for(let e=0;es.setValue(g+t*c,e,c===4?`i32`:`i64`));let e=s._OrtCreateTensor(Xt(l),p,m,g,u.length,rn(f));e===0&&zt(`Can't create tensor for input/output. session=${r}, index=${a}.`),t.push(e)}finally{s.stackRestore(h)}},wd=async(e,t,n,r,i,a)=>{let o=Ft(),s=o.PTR_SIZE,c=_d.get(e);if(!c)throw Error(`cannot run inference. invalid session id: ${e}`);let l=c[0],u=c[1],d=c[2],f=c[3],p=c[4],m=c[5],h=t.length,g=r.length,_=0,v=[],y=[],b=[],x=[],S=o.stackSave(),C=o.stackAlloc(h*s),w=o.stackAlloc(h*s),T=o.stackAlloc(g*s),E=o.stackAlloc(g*s);try{[_,v]=Vt(a);for(let r=0;re*t,1);d=Zt(a);let _=f?.outputPreferredLocations[r[t]];if(d===`string`){if(_===`gpu-buffer`||_===`ml-tensor`)throw Error(`String tensor is not supported on GPU.`);let e=[];for(let t=0;t0){let e=o.jsepGetBuffer;if(!e)throw Error(`preferredLocation "gpu-buffer" is not supported without using WebGPU.`);let t=e(p),r=Qt(a,g);if(r===void 0||!tn(d))throw Error(`Unsupported data type: ${d}`);u=!0,S.push([d,h,{gpuBuffer:t,download:o.jsepCreateDownloader(t,r,d),dispose:()=>{o._OrtReleaseTensor(n)!==0&&zt(`Can't release tensor.`)}},`gpu-buffer`])}else if(_===`ml-tensor`&&g>0){let t=o.webnnEnsureTensor,r=o.webnnIsInt64Supported;if(!t||!r)throw Error(`preferredLocation "ml-tensor" is not supported without using WebNN.`);if(Qt(a,g)===void 0||!nn(d))throw Error(`Unsupported data type: ${d}`);if(d===`int64`&&!r(e))throw Error(`preferredLocation "ml-tensor" for int64 output is not supported by current WebNN Context.`);let i=await t(e,p,a,h,!1);u=!0,S.push([d,h,{mlTensor:i,download:o.webnnCreateMLTensorDownloader(p,d),dispose:()=>{o.webnnReleaseTensorId(p),o._OrtReleaseTensor(n)}},`ml-tensor`])}else{let e=$t(d),t=new e(g);new Uint8Array(t.buffer,t.byteOffset,t.byteLength).set(o.HEAPU8.subarray(p,p+t.byteLength)),S.push([d,h,t,`cpu`])}}finally{o.stackRestore(a),d===`string`&&p&&o._free(p),u||o._OrtReleaseTensor(n),o.webnnOnRunEnd?.(l)}}return f&&!p&&(o._OrtClearBoundOutputs(f.handle)!==0&&zt(`Can't clear bound outputs.`),_d.set(e,[l,u,d,f,p,!1])),S}finally{o.stackRestore(S),y.forEach(e=>o._OrtReleaseTensor(e)),b.forEach(e=>o._OrtReleaseTensor(e)),x.forEach(e=>o._free(e)),_!==0&&o._OrtReleaseRunOptions(_),v.forEach(e=>o._free(e))}},Td=e=>{let t=Ft(),n=_d.get(e);if(!n)throw Error(`invalid session id`);let r=n[0],i=t._OrtEndProfiling(r);i===0&&zt(`Can't get an profile file name.`),t._OrtFree(i)},Ed=e=>{let t=[];for(let n of e){let e=n[2];!Array.isArray(e)&&`buffer`in e&&t.push(e.buffer)}return t}}),Od,kd,Ad,jd,Md,Nd,Pd,Fd,Id,Ld,Rd,zd,Bd,Vd,Hd,Ud,Wd,Gd,Kd=M(()=>{"use strict";$e(),Dd(),It(),Et(),Od=()=>!!L.wasm.proxy&&typeof document<`u`,Ad=!1,jd=!1,Md=!1,Fd=new Map,Id=(e,t)=>{let n=Fd.get(e);n?n.push(t):Fd.set(e,[t])},Ld=()=>{if(Ad||!jd||Md||!kd)throw Error(`worker not ready`)},Rd=e=>{switch(e.data.type){case`init-wasm`:Ad=!1,e.data.err?(Md=!0,Pd[1](e.data.err)):(jd=!0,Pd[0]()),Nd&&(URL.revokeObjectURL(Nd),Nd=void 0);break;case`init-ep`:case`copy-from`:case`create`:case`release`:case`run`:case`end-profiling`:{let t=Fd.get(e.data.type);e.data.err?t.shift()[1](e.data.err):t.shift()[0](e.data.out);break}default:}},zd=async()=>{if(!jd){if(Ad)throw Error(`multiple calls to 'initWasm()' detected.`);if(Md)throw Error(`previous call to 'initWasm()' failed.`);if(Ad=!0,Od())return new Promise((e,t)=>{kd?.terminate(),Ct().then(([n,r])=>{try{kd=r,kd.onerror=e=>t(e),kd.onmessage=Rd,Pd=[e,t];let i={type:`init-wasm`,in:L};!i.in.wasm.wasmPaths&&(n||pt)&&(i.in.wasm.wasmPaths={wasm:new URL(`/assets/ort-wasm-simd-threaded.jsep-B0T3yYHD.wasm`,``+self.location.href).href}),kd.postMessage(i),Nd=n}catch(e){t(e)}},t)});try{await Pt(L.wasm),await hd(L),jd=!0}catch(e){throw Md=!0,e}finally{Ad=!1}}},Bd=async e=>{if(Od())return Ld(),new Promise((t,n)=>{Id(`init-ep`,[t,n]);let r={type:`init-ep`,in:{epName:e,env:L}};kd.postMessage(r)});await gd(L,e)},Vd=async e=>Od()?(Ld(),new Promise((t,n)=>{Id(`copy-from`,[t,n]);let r={type:`copy-from`,in:{buffer:e}};kd.postMessage(r,[e.buffer])})):bd(e),Hd=async(e,t)=>{if(Od()){if(t?.preferredOutputLocation)throw Error(`session option "preferredOutputLocation" is not supported for proxy.`);return Ld(),new Promise((n,r)=>{Id(`create`,[n,r]);let i={type:`create`,in:{model:e,options:{...t}}},a=[];e instanceof Uint8Array&&a.push(e.buffer),kd.postMessage(i,a)})}else return xd(e,t)},Ud=async e=>{if(Od())return Ld(),new Promise((t,n)=>{Id(`release`,[t,n]);let r={type:`release`,in:e};kd.postMessage(r)});Sd(e)},Wd=async(e,t,n,r,i,a)=>{if(Od()){if(n.some(e=>e[3]!==`cpu`))throw Error(`input tensor on GPU is not supported for proxy.`);if(i.some(e=>e))throw Error(`pre-allocated output tensor is not supported for proxy.`);return Ld(),new Promise((i,o)=>{Id(`run`,[i,o]);let s=n,c={type:`run`,in:{sessionId:e,inputIndices:t,inputs:s,outputIndices:r,options:a}};kd.postMessage(c,Ed(s))})}else return wd(e,t,n,r,i,a)},Gd=async e=>{if(Od())return Ld(),new Promise((t,n)=>{Id(`end-profiling`,[t,n]);let r={type:`end-profiling`,in:e};kd.postMessage(r)});Td(e)}}),qd,Jd,Yd,Xd=M(()=>{"use strict";$e(),Kd(),V(),et(),on(),qd=(e,t)=>{switch(e.location){case`cpu`:return[e.type,e.dims,e.data,`cpu`];case`gpu-buffer`:return[e.type,e.dims,{gpuBuffer:e.gpuBuffer},`gpu-buffer`];case`ml-tensor`:return[e.type,e.dims,{mlTensor:e.mlTensor},`ml-tensor`];default:throw Error(`invalid data location: ${e.location} for ${t()}`)}},Jd=e=>{switch(e[3]){case`cpu`:return new ze(e[0],e[2],e[1]);case`gpu-buffer`:{let t=e[0];if(!tn(t))throw Error(`not supported data type: ${t} for deserializing GPU tensor`);let{gpuBuffer:n,download:r,dispose:i}=e[2];return ze.fromGpuBuffer(n,{dataType:t,dims:e[1],download:r,dispose:i})}case`ml-tensor`:{let t=e[0];if(!nn(t))throw Error(`not supported data type: ${t} for deserializing MLTensor tensor`);let{mlTensor:n,download:r,dispose:i}=e[2];return ze.fromMLTensor(n,{dataType:t,dims:e[1],download:r,dispose:i})}default:throw Error(`invalid data location: ${e[3]}`)}},Yd=class{async fetchModelAndCopyToWasmMemory(e){return Vd(await an(e))}async loadModel(e,t){He();let n;n=typeof e==`string`?await this.fetchModelAndCopyToWasmMemory(e):e,[this.sessionId,this.inputNames,this.outputNames,this.inputMetadata,this.outputMetadata]=await Hd(n,t),B()}async dispose(){return Ud(this.sessionId)}async run(e,t,n){He();let r=[],i=[];Object.entries(e).forEach(e=>{let t=e[0],n=e[1],a=this.inputNames.indexOf(t);if(a===-1)throw Error(`invalid input '${t}'`);r.push(n),i.push(a)});let a=[],o=[];Object.entries(t).forEach(e=>{let t=e[0],n=e[1],r=this.outputNames.indexOf(t);if(r===-1)throw Error(`invalid output '${t}'`);a.push(n),o.push(r)});let s=r.map((e,t)=>qd(e,()=>`input "${this.inputNames[i[t]]}"`)),c=a.map((e,t)=>e?qd(e,()=>`output "${this.outputNames[o[t]]}"`):null),l=await Wd(this.sessionId,i,s,o,c,n),u={};for(let e=0;e$d,initializeFlags:()=>Qd,wasmBackend:()=>ef});var Qd,$d,ef,tf=M(()=>{"use strict";$e(),Kd(),Xd(),Qd=()=>{(typeof L.wasm.initTimeout!=`number`||L.wasm.initTimeout<0)&&(L.wasm.initTimeout=0);let e=L.wasm.simd;if(typeof e!=`boolean`&&e!==void 0&&e!==`fixed`&&e!==`relaxed`&&(console.warn(`Property "env.wasm.simd" is set to unknown value "${e}". Reset it to \`false\` and ignore SIMD feature checking.`),L.wasm.simd=!1),typeof L.wasm.proxy!=`boolean`&&(L.wasm.proxy=!1),typeof L.wasm.trace!=`boolean`&&(L.wasm.trace=!1),typeof L.wasm.numThreads!=`number`||!Number.isInteger(L.wasm.numThreads)||L.wasm.numThreads<=0)if(typeof self<`u`&&!self.crossOriginIsolated)L.wasm.numThreads=1;else{let e=typeof navigator>`u`?se(`node:os`).cpus().length:navigator.hardwareConcurrency;L.wasm.numThreads=Math.min(4,Math.ceil((e||1)/2))}},$d=class{async init(e){Qd(),await zd(),await Bd(e)}async createInferenceSessionHandler(e,t){let n=new Yd;return await n.loadModel(e,t),n}},ef=new $d});$e(),$e(),$e();var nf=`1.22.0-dev.20250409-89f8206ba4`,rf=Qe;{let e=(tf(),le(Zd)).wasmBackend;P(`webgpu`,e,5),P(`webnn`,e,5),P(`cpu`,e,10),P(`wasm`,e,10)}Object.defineProperty(L.versions,`web`,{value:nf,enumerable:!0}); +${a}`,s=n.createShaderModule({code:o,label:e.name});dn(`verbose`,()=>`[WebGPU] ${e.name} shader code: ${o}`);let c=n.createComputePipeline({compute:{module:s,entryPoint:`main`},layout:`auto`,label:e.name});return H(e.name),{programInfo:e,computePipeline:c,uniformVariablesInfo:i.variablesInfo}}normalizeDispatchGroupSize(e){let t=typeof e==`number`?e:e.x,n=typeof e==`number`?1:e.y||1,r=typeof e==`number`?1:e.z||1,i=this.backend.device.limits.maxComputeWorkgroupsPerDimension;if(t<=i&&n<=i&&r<=i)return[t,n,r];let a=t*n*r,o=Math.ceil(Math.sqrt(a));if(o>i){if(o=Math.ceil(Math.cbrt(a)),o>i)throw Error(`Total dispatch size exceeds WebGPU maximum.`);return[o,o,o]}else return[o,o,1]}}}),rd={};N(rd,{WebGpuBackend:()=>sd});var id,ad,od,sd,cd=M(()=>{"use strict";Ze(),U(),fn(),bn(),Kn(),ed(),nd(),id=(e,t)=>{if(t.length!==e.length)throw Error(`inputDependencies length ${t.length} is not equal to inputTensors length ${e.length}.`);let n=[];for(let r=0;r{let r=e.name;return e.shaderCache?.hint&&(r+=`[`+e.shaderCache.hint+`]`),r+=`:`+n+`:${id(t,e.shaderCache?.inputDependencies??Array(t.length).fill(`dims`))}`,r},od=class{constructor(e){e&&(this.architecture=e.architecture,this.vendor=e.vendor)}isArchitecture(e){return this.architecture===e}isVendor(e){return this.vendor===e}},sd=class{constructor(){this.currentSessionId=null,this.currentKernelId=null,this.commandEncoder=null,this.computePassEncoder=null,this.maxDispatchNumber=16,this.pendingDispatchNumber=0,this.pendingKernels=[],this.pendingQueries=new Map,this.sessionStatus=`default`,this.capturedCommandList=new Map,this.capturedPendingKernels=new Map,this.sessionExternalDataMapping=new Map}get currentKernelCustomData(){if(this.currentKernelId===null)throw Error(`currentKernelCustomData(): currentKernelId is null. (should not happen)`);let e=this.kernelCustomData.get(this.currentKernelId);return e||(e={},this.kernelCustomData.set(this.currentKernelId,e)),e}async initialize(e,t){this.env=e;let n=[],r={requiredLimits:{maxComputeWorkgroupStorageSize:t.limits.maxComputeWorkgroupStorageSize,maxComputeWorkgroupsPerDimension:t.limits.maxComputeWorkgroupsPerDimension,maxStorageBufferBindingSize:t.limits.maxStorageBufferBindingSize,maxBufferSize:t.limits.maxBufferSize,maxComputeInvocationsPerWorkgroup:t.limits.maxComputeInvocationsPerWorkgroup,maxComputeWorkgroupSizeX:t.limits.maxComputeWorkgroupSizeX,maxComputeWorkgroupSizeY:t.limits.maxComputeWorkgroupSizeY,maxComputeWorkgroupSizeZ:t.limits.maxComputeWorkgroupSizeZ},requiredFeatures:n},i=e=>t.features.has(e)&&n.push(e)&&!0;i(`chromium-experimental-timestamp-query-inside-passes`)||i(`timestamp-query`),i(`shader-f16`),i(`subgroups`),this.device=await t.requestDevice(r),this.adapterInfo=new od(t.info||await t.requestAdapterInfo()),this.gpuDataManager=Gn(this),this.programManager=new td(this),this.kernels=new Map,this.kernelPersistentData=new Map,this.kernelCustomData=new Map,ln(e.logLevel,!!e.debug),this.device.onuncapturederror=e=>{e.error instanceof GPUValidationError&&console.error(`An uncaught WebGPU validation error was raised: ${e.error.message}`)},Object.defineProperty(this.env.webgpu,`device`,{value:this.device,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(this.env.webgpu,`adapter`,{value:t,writable:!1,enumerable:!0,configurable:!1}),this.setQueryType()}dispose(){typeof this.querySet<`u`&&this.querySet.destroy(),this.gpuDataManager.dispose()}getCommandEncoder(){return this.commandEncoder||=this.device.createCommandEncoder(),this.commandEncoder}getComputePassEncoder(){if(!this.computePassEncoder){let e=this.getCommandEncoder(),t={};this.queryType===`at-passes`&&(t.timestampWrites={querySet:this.querySet,beginningOfPassWriteIndex:this.pendingDispatchNumber*2,endOfPassWriteIndex:this.pendingDispatchNumber*2+1}),this.computePassEncoder=e.beginComputePass(t)}return this.computePassEncoder}endComputePass(){this.computePassEncoder&&(this.computePassEncoder.end(),this.computePassEncoder=null)}flush(){if(!this.commandEncoder)return;Be(),this.endComputePass();let e;this.queryType!==`none`&&(this.commandEncoder.resolveQuerySet(this.querySet,0,this.pendingDispatchNumber*2,this.queryResolveBuffer,0),e=this.device.createBuffer({size:this.pendingDispatchNumber*2*8,usage:GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST}),this.pendingQueries.set(e,this.pendingKernels),this.pendingKernels=[],this.commandEncoder.copyBufferToBuffer(this.queryResolveBuffer,0,e,0,this.pendingDispatchNumber*2*8)),this.device.queue.submit([this.commandEncoder.finish()]),this.gpuDataManager.refreshPendingBuffers(),this.commandEncoder=null,this.pendingDispatchNumber=0,this.queryType!==`none`&&e.mapAsync(GPUMapMode.READ).then(()=>{let t=new BigUint64Array(e.getMappedRange()),n=this.pendingQueries.get(e);for(let e=0;e`u`&&(this.queryTimeBase=d);let p=Number(d-this.queryTimeBase),m=Number(f-this.queryTimeBase);if(!Number.isSafeInteger(p)||!Number.isSafeInteger(m))throw RangeError(`incorrect timestamp range`);if(this.env.webgpu.profiling?.ondata)this.env.webgpu.profiling.ondata({version:1,inputsMetadata:l.map(e=>({dims:e.dims,dataType:Yt(e.dataType)})),outputsMetadata:u.map(e=>({dims:e.dims,dataType:Yt(e.dataType)})),kernelId:i,kernelType:o,kernelName:s,programName:c,startTime:p,endTime:m});else{let e=``;l.forEach((t,n)=>{e+=`input[${n}]: [${t.dims}] | ${Yt(t.dataType)}, `});let t=``;u.forEach((e,n)=>{t+=`output[${n}]: [${e.dims}] | ${Yt(e.dataType)}, `}),console.log(`[profiling] kernel "${i}|${o}|${s}|${c}" ${e}${t}execution time: ${m-p} ns`)}V(`GPU`,`${c}::${d}::${f}`)}e.unmap(),this.pendingQueries.delete(e)}),H()}run(e,t,n,r,i,a){Be(e.name);let o=[];for(let e=0;et):n;if(u.length!==s.length)throw Error(`Output size ${u.length} must be equal to ${s.length}.`);let d=[],f=[];for(let e=0;e=a)throw Error(`Invalid output index: ${u[e]}`);if(u[e]===-3)continue;let t=u[e]===-1,n=u[e]===-2,o=t||n?i(s[e].dataType,s[e].dims):r(u[e],s[e].dataType,s[e].dims);if(d.push(o),o.data===0)continue;let c=this.gpuDataManager.get(o.data);if(!c)throw Error(`no GPU data for output: ${o.data}`);if(t&&this.temporaryData.push(c),n){let e=this.kernelPersistentData.get(this.currentKernelId);e||(e=[],this.kernelPersistentData.set(this.currentKernelId,e)),e.push(c)}f.push(c)}if(o.length!==t.length||f.length!==d.length){if(f.length===0)return H(e.name),d;throw Error(`Program ${e.name} has zero-sized tensor(s) in inputs or outputs. This is not supported now.`)}let p;if(l){let e=0,t=[];l.forEach(n=>{let r=typeof n.data==`number`?[n.data]:n.data;if(r.length===0)return;let i=n.type===10?2:4,a,o;n.type===10?(o=r.length>4?16:r.length>2?8:r.length*i,a=r.length>4?16:i*r.length):(o=r.length<=2?r.length*i:16,a=16),e=Math.ceil(e/o)*o,t.push(e);let s=n.type===10?8:4;e+=r.length>4?Math.ceil(r.length/s)*a:r.length*i});let n=16;e=Math.ceil(e/n)*n;let r=new ArrayBuffer(e);l.forEach((e,n)=>{let i=t[n],a=typeof e.data==`number`?[e.data]:e.data;if(e.type===6)new Int32Array(r,i,a.length).set(a);else if(e.type===12)new Uint32Array(r,i,a.length).set(a);else if(e.type===10)new Uint16Array(r,i,a.length).set(a);else if(e.type===1)new Float32Array(r,i,a.length).set(a);else throw Error(`Unsupported uniform type: ${Yt(e.type)}`)});let i=this.gpuDataManager.create(e,GPUBufferUsage.COPY_DST|GPUBufferUsage.UNIFORM);this.device.queue.writeBuffer(i.buffer,0,r,0,e),this.gpuDataManager.release(i.id),p={offset:0,size:e,buffer:i.buffer}}let m=this.programManager.normalizeDispatchGroupSize(c),h=m[1]===1&&m[2]===1,g=ad(e,t,h),_=this.programManager.getArtifact(g);if(_||(_=this.programManager.build(e,m),this.programManager.setArtifact(g,_),dn(`info`,()=>`[artifact] key: ${g}, programName: ${e.name}`)),l&&_.uniformVariablesInfo){if(l.length!==_.uniformVariablesInfo.length)throw Error(`Uniform variables count mismatch: expect ${_.uniformVariablesInfo.length}, got ${l.length} in program "${_.programInfo.name}".`);for(let e=0;e`[ProgramManager] run "${e.name}" (key=${g}) with ${m[0]}x${m[1]}x${m[2]}`),this.queryType!==`none`||this.sessionStatus===`capturing`){let e={kernelId:this.currentKernelId,programName:_.programInfo.name,inputTensorViews:t,outputTensorViews:d};this.pendingKernels.push(e),this.sessionStatus===`capturing`&&this.capturedPendingKernels.get(this.currentSessionId).push(e)}return this.programManager.run(_,o,f,m,p),H(e.name),d}upload(e,t){this.gpuDataManager.upload(e,t)}memcpy(e,t){this.gpuDataManager.memcpy(e,t)}async download(e,t){await this.gpuDataManager.download(e,t)}alloc(e){return this.gpuDataManager.create(e).id}free(e){return this.gpuDataManager.release(e)}createKernel(e,t,n,r){let i=$u.get(e);if(!i)throw Error(`kernel not implemented: ${e}`);let a={kernelType:e,kernelName:r,kernelEntry:i[0],attributes:[i[1],n]};this.kernels.set(t,a)}releaseKernel(e){let t=this.kernelPersistentData.get(e);if(t){for(let e of t)this.gpuDataManager.release(e.id);this.kernelPersistentData.delete(e)}this.kernelCustomData.delete(e),this.kernels.delete(e)}computeKernel(e,t,n){let r=this.kernels.get(e);if(!r)throw Error(`kernel not created: ${e}`);let i=r.kernelType,a=r.kernelName,o=r.kernelEntry,s=r.attributes;if(this.currentKernelId!==null)throw Error(`kernel "[${i}] ${a}" is not allowed to be called recursively`);this.currentKernelId=e,s[0]&&(s[1]=s[0](s[1]),s[0]=void 0),dn(`info`,()=>`[WebGPU] Start to run kernel "[${i}] ${a}"...`);let c=this.env.debug;this.temporaryData=[];try{return c&&this.device.pushErrorScope(`validation`),o(t,s[1]),0}catch(e){return n.push(Promise.resolve(`[WebGPU] Kernel "[${i}] ${a}" failed. ${e}`)),1}finally{c&&n.push(this.device.popErrorScope().then(e=>e?`GPU validation error for kernel "[${i}] ${a}": ${e.message}`:null));for(let e of this.temporaryData)this.gpuDataManager.release(e.id);this.temporaryData=[],this.currentKernelId=null}}registerBuffer(e,t,n,r){let i=this.sessionExternalDataMapping.get(e);i||(i=new Map,this.sessionExternalDataMapping.set(e,i));let a=i.get(t),o=this.gpuDataManager.registerExternalBuffer(n,r,a);return i.set(t,[o,n]),o}unregisterBuffers(e){let t=this.sessionExternalDataMapping.get(e);t&&(t.forEach(e=>this.gpuDataManager.unregisterExternalBuffer(e[0])),this.sessionExternalDataMapping.delete(e))}getBuffer(e){let t=this.gpuDataManager.get(e);if(!t)throw Error(`no GPU data for buffer: ${e}`);return t.buffer}createDownloader(e,t,n){return async()=>{let r=await Un(this,e,t);return yn(r.buffer,n)}}writeTimestamp(e){this.queryType===`inside-passes`&&this.computePassEncoder.writeTimestamp(this.querySet,e)}setQueryType(){this.queryType=`none`,(this.env.webgpu.profiling?.mode===`default`||(typeof this.env.trace>`u`?this.env.wasm.trace:this.env.trace))&&(this.device.features.has(`chromium-experimental-timestamp-query-inside-passes`)?this.queryType=`inside-passes`:this.device.features.has(`timestamp-query`)&&(this.queryType=`at-passes`),this.queryType!==`none`&&typeof this.querySet>`u`&&(this.querySet=this.device.createQuerySet({type:`timestamp`,count:this.maxDispatchNumber*2}),this.queryResolveBuffer=this.device.createBuffer({size:this.maxDispatchNumber*2*8,usage:GPUBufferUsage.COPY_SRC|GPUBufferUsage.QUERY_RESOLVE})))}captureBegin(){dn(`info`,`captureBegin`),this.capturedCommandList.get(this.currentSessionId)||this.capturedCommandList.set(this.currentSessionId,[]),this.capturedPendingKernels.get(this.currentSessionId)||this.capturedPendingKernels.set(this.currentSessionId,[]),this.flush(),this.sessionStatus=`capturing`}captureEnd(){dn(`info`,`captureEnd`),this.flush(),this.sessionStatus=`default`}replay(){dn(`info`,`replay`),this.sessionStatus=`replaying`;let e=this.capturedCommandList.get(this.currentSessionId),t=this.capturedPendingKernels.get(this.currentSessionId),n=e.length;this.pendingKernels=[];for(let r=0;r=this.maxDispatchNumber||this.queryType===`at-passes`)&&this.endComputePass(),this.pendingDispatchNumber>=this.maxDispatchNumber&&this.flush()}this.flush(),this.sessionStatus=`default`}onCreateSession(){this.gpuDataManager.onCreateSession()}onReleaseSession(e){this.unregisterBuffers(e),this.capturedCommandList.has(e)&&this.capturedCommandList.delete(e),this.capturedPendingKernels.has(e)&&this.capturedPendingKernels.delete(e),this.gpuDataManager.onReleaseSession(e)}onRunStart(e){this.currentSessionId=e,this.setQueryType()}}}),ld={};N(ld,{init:()=>fd});var ud,dd,fd,pd=M(()=>{"use strict";U(),fn(),G(),Fn(),ud=class e{constructor(e,t,n,r){this.module=e,this.dataType=t,this.data=n,this.dims=r}getFloat32Array(){if(this.dataType!==1)throw Error(`Invalid data type`);let e=W.size(this.dims);return e===0?new Float32Array:new Float32Array(this.module.HEAP8.buffer,this.data,e)}getBigInt64Array(){if(this.dataType!==7)throw Error(`Invalid data type`);let e=W.size(this.dims);return e===0?new BigInt64Array:new BigInt64Array(this.module.HEAP8.buffer,this.data,e)}getInt32Array(){if(this.dataType!==6)throw Error(`Invalid data type`);let e=W.size(this.dims);return e===0?new Int32Array:new Int32Array(this.module.HEAP8.buffer,this.data,e)}getUint16Array(){if(this.dataType!==10&&this.dataType!==4)throw Error(`Invalid data type`);let e=W.size(this.dims);return e===0?new Uint16Array:new Uint16Array(this.module.HEAP8.buffer,this.data,e)}reshape(t){if(W.size(t)!==W.size(this.dims))throw Error(`Invalid new shape`);return new e(this.module,this.dataType,this.data,t)}},dd=class{constructor(e,t,n){this.module=e,this.backend=t,this.customDataOffset=0,this.customDataSize=0,this.adapterInfo=t.adapterInfo;let r=e.PTR_SIZE,i=n/e.PTR_SIZE,a=r===4?`i32`:`i64`;this.opKernelContext=Number(e.getValue(r*i++,a));let o=Number(e.getValue(r*i++,a));this.outputCount=Number(e.getValue(r*i++,a)),this.customDataOffset=Number(e.getValue(r*i++,`*`)),this.customDataSize=Number(e.getValue(r*i++,a));let s=[];for(let t=0;ttypeof e==`number`?this.inputs[e]:e)??this.inputs,r=t?.outputs??[],i=(e,t,n)=>new ud(this.module,t,this.output(e,n),n),a=(e,t)=>{let n=Xt(e,t);if(!n)throw Error(`Unsupported data type: ${e}`);let r=n>0?this.backend.gpuDataManager.create(n).id:0;return new ud(this.module,e,r,t)};return this.backend.run(e,n,r,i,a,this.outputCount)}output(e,t){let n=this.module.stackSave();try{let n=this.module.PTR_SIZE,r=n===4?`i32`:`i64`,i=this.module.stackAlloc((1+t.length)*n);this.module.setValue(i,t.length,r);for(let e=0;e{let i=t.jsepInit;if(!i)throw Error(`Failed to initialize JSEP. The WebAssembly module is not built with JSEP support.`);if(e===`webgpu`){let e=(cd(),le(rd)).WebGpuBackend,a=new e;await a.initialize(n,r),i(`webgpu`,[a,e=>a.alloc(Number(e)),e=>a.free(e),(e,n,r,i=!1)=>{if(i)dn(`verbose`,()=>`[WebGPU] jsepCopyGpuToGpu: src=${Number(e)}, dst=${Number(n)}, size=${Number(r)}`),a.memcpy(Number(e),Number(n));else{dn(`verbose`,()=>`[WebGPU] jsepCopyCpuToGpu: dataOffset=${Number(e)}, gpuDataId=${Number(n)}, size=${Number(r)}`);let i=t.HEAPU8.subarray(Number(e>>>0),Number(e>>>0)+Number(r));a.upload(Number(n),i)}},async(e,n,r)=>{dn(`verbose`,()=>`[WebGPU] jsepCopyGpuToCpu: gpuDataId=${e}, dataOffset=${n}, size=${r}`),await a.download(Number(e),()=>t.HEAPU8.subarray(Number(n)>>>0,Number(n+r)>>>0))},(e,n,r)=>a.createKernel(e,Number(n),r,t.UTF8ToString(t._JsepGetNodeName(Number(n)))),e=>a.releaseKernel(e),(e,n,r,i)=>{dn(`verbose`,()=>`[WebGPU] jsepRun: sessionHandle=${r}, kernel=${e}, contextDataOffset=${n}`);let o=new dd(t,a,Number(n));return a.computeKernel(Number(e),o,i)},()=>a.captureBegin(),()=>a.captureEnd(),()=>a.replay()])}else{let e=new Pn(n);i(`webnn`,[e,()=>e.reserveTensorId(),t=>e.releaseTensorId(t),async(t,n,r,i,a)=>e.ensureTensor(t,n,r,i,a),(t,n)=>{e.uploadTensor(t,n)},async(t,n)=>e.downloadTensor(t,n)])}}}),md,hd,gd,_d,vd,yd,bd,xd,Sd,Cd,wd,Td,Ed,Dd=M(()=>{"use strict";Bt(),qt(),U(),Pt(),Rt(),rn(),md=(e,t)=>{Nt()._OrtInit(e,t)!==0&&Lt(`Can't initialize onnxruntime.`)},hd=async e=>{md(e.wasm.numThreads,Qt(e.logLevel))},gd=async(e,t)=>{Nt().asyncInit?.();{let n=(pd(),le(ld)).init;if(t===`webgpu`){if(typeof navigator>`u`||!navigator.gpu)throw Error(`WebGPU is not supported in current environment`);let t=e.webgpu.adapter;if(t){if(typeof t.limits!=`object`||typeof t.features!=`object`||typeof t.requestDevice!=`function`)throw Error("Invalid GPU adapter set in `env.webgpu.adapter`. It must be a GPUAdapter object.")}else{let n=e.webgpu.powerPreference;if(n!==void 0&&n!==`low-power`&&n!==`high-performance`)throw Error(`Invalid powerPreference setting: "${n}"`);let r=e.webgpu.forceFallbackAdapter;if(r!==void 0&&typeof r!=`boolean`)throw Error(`Invalid forceFallbackAdapter setting: "${r}"`);if(t=await navigator.gpu.requestAdapter({powerPreference:n,forceFallbackAdapter:r}),!t)throw Error(`Failed to get GPU adapter. You may need to enable flag "--enable-unsafe-webgpu" if you are using Chrome.`)}await n(`webgpu`,Nt(),e,t)}if(t===`webnn`){if(typeof navigator>`u`||!navigator.ml)throw Error(`WebNN is not supported in current environment`);await n(`webnn`,Nt(),e)}}},_d=new Map,vd=e=>{let t=Nt(),n=t.stackSave();try{let n=t.PTR_SIZE,r=t.stackAlloc(2*n);t._OrtGetInputOutputCount(e,r,r+n)!==0&&Lt(`Can't get session input/output count.`);let i=n===4?`i32`:`i64`;return[Number(t.getValue(r,i)),Number(t.getValue(r+n,i))]}finally{t.stackRestore(n)}},yd=(e,t)=>{let n=Nt(),r=n.stackSave(),i=0;try{let r=n.PTR_SIZE,a=n.stackAlloc(2*r);n._OrtGetInputOutputMetadata(e,t,a,a+r)!==0&&Lt(`Can't get session input/output metadata.`);let o=Number(n.getValue(a,`*`));i=Number(n.getValue(a+r,`*`));let s=n.HEAP32[i/4];if(s===0)return[o,0];let c=n.HEAPU32[i/4+1],l=[];for(let e=0;e{let t=Nt(),n=t._malloc(e.byteLength);if(n===0)throw Error(`Can't create a session. failed to allocate a buffer of size ${e.byteLength}.`);return t.HEAPU8.set(e,n),[n,e.byteLength]},xd=async(e,t)=>{let n,r,i=Nt();Array.isArray(e)?[n,r]=e:e.buffer===i.HEAPU8.buffer?[n,r]=[e.byteOffset,e.byteLength]:[n,r]=bd(e);let a=0,o=0,s=0,c=[],l=[],u=[];try{if([o,c]=await Kt(t),t?.externalData&&i.mountExternalData){let e=[];for(let n of t.externalData){let t=typeof n==`string`?n:n.path;e.push(nn(typeof n==`string`?n:n.data).then(e=>{i.mountExternalData(t,e)}))}await Promise.all(e)}for(let e of t?.executionProviders??[])if((typeof e==`string`?e:e.name)===`webnn`){if(i.shouldTransferToMLTensor=!1,typeof e!=`string`){let t=e,n=t?.context,r=t?.gpuDevice,a=t?.deviceType,o=t?.powerPreference;n?i.currentContext=n:r?i.currentContext=await i.webnnCreateMLContext(r):i.currentContext=await i.webnnCreateMLContext({deviceType:a,powerPreference:o})}else i.currentContext=await i.webnnCreateMLContext();break}a=await i._OrtCreateSession(n,r,o),i.webgpuOnCreateSession?.(a),a===0&&Lt(`Can't create a session.`),i.jsepOnCreateSession?.(),i.currentContext&&(i.webnnRegisterMLContext(a,i.currentContext),i.currentContext=void 0,i.shouldTransferToMLTensor=!0);let[e,d]=vd(a),f=!!t?.enableGraphCapture,p=[],m=[],h=[],g=[],_=[];for(let t=0;te===`gpu-buffer`||e===`ml-tensor`)&&(s=i._OrtCreateBinding(a),s===0&&Lt(`Can't create IO binding.`),v={handle:s,outputPreferredLocations:_,outputPreferredLocationsEncoded:_.map(e=>tn(e))}),_d.set(a,[a,l,u,v,f,!1]),[a,p,m,h,g]}catch(e){throw l.forEach(e=>i._OrtFree(e)),u.forEach(e=>i._OrtFree(e)),s!==0&&i._OrtReleaseBinding(s)!==0&&Lt(`Can't release IO binding.`),a!==0&&i._OrtReleaseSession(a)!==0&&Lt(`Can't release session.`),e}finally{i._free(n),o!==0&&i._OrtReleaseSessionOptions(o)!==0&&Lt(`Can't release session options.`),c.forEach(e=>i._free(e)),i.unmountExternalData?.()}},Sd=e=>{let t=Nt(),n=_d.get(e);if(!n)throw Error(`cannot release session. invalid session id: ${e}`);let[r,i,a,o,s]=n;o&&(s&&t._OrtClearBoundOutputs(o.handle)!==0&&Lt(`Can't clear bound outputs.`),t._OrtReleaseBinding(o.handle)!==0&&Lt(`Can't release IO binding.`)),t.jsepOnReleaseSession?.(e),t.webnnOnReleaseSession?.(e),t.webgpuOnReleaseSession?.(e),i.forEach(e=>t._OrtFree(e)),a.forEach(e=>t._OrtFree(e)),t._OrtReleaseSession(r)!==0&&Lt(`Can't release session.`),_d.delete(e)},Cd=async(e,t,n,r,i,a,o=!1)=>{if(!e){t.push(0);return}let s=Nt(),c=s.PTR_SIZE,l=e[0],u=e[1],d=e[3],f=d,p,m;if(l===`string`&&(d===`gpu-buffer`||d===`ml-tensor`))throw Error(`String tensor is not supported on GPU.`);if(o&&d!==`gpu-buffer`)throw Error(`External buffer must be provided for input/output index ${a} when enableGraphCapture is true.`);if(d===`gpu-buffer`){let t=e[2].gpuBuffer;m=Xt(Jt(l),u);{let e=s.jsepRegisterBuffer;if(!e)throw Error(`Tensor location "gpu-buffer" is not supported without using WebGPU.`);p=e(r,a,t,m)}}else if(d===`ml-tensor`){let t=e[2].mlTensor;m=Xt(Jt(l),u);let n=s.webnnRegisterMLTensor;if(!n)throw Error(`Tensor location "ml-tensor" is not supported without using WebNN.`);p=n(r,t,Jt(l),u)}else{let t=e[2];if(Array.isArray(t)){m=c*t.length,p=s._malloc(m),n.push(p);for(let e=0;es.setValue(g+t*c,e,c===4?`i32`:`i64`));let e=s._OrtCreateTensor(Jt(l),p,m,g,u.length,tn(f));e===0&&Lt(`Can't create tensor for input/output. session=${r}, index=${a}.`),t.push(e)}finally{s.stackRestore(h)}},wd=async(e,t,n,r,i,a)=>{let o=Nt(),s=o.PTR_SIZE,c=_d.get(e);if(!c)throw Error(`cannot run inference. invalid session id: ${e}`);let l=c[0],u=c[1],d=c[2],f=c[3],p=c[4],m=c[5],h=t.length,g=r.length,_=0,v=[],y=[],b=[],x=[],S=o.stackSave(),C=o.stackAlloc(h*s),w=o.stackAlloc(h*s),T=o.stackAlloc(g*s),E=o.stackAlloc(g*s);try{[_,v]=zt(a);for(let r=0;re*t,1);d=Yt(a);let _=f?.outputPreferredLocations[r[t]];if(d===`string`){if(_===`gpu-buffer`||_===`ml-tensor`)throw Error(`String tensor is not supported on GPU.`);let e=[];for(let t=0;t0){let e=o.jsepGetBuffer;if(!e)throw Error(`preferredLocation "gpu-buffer" is not supported without using WebGPU.`);let t=e(p),r=Xt(a,g);if(r===void 0||!$t(d))throw Error(`Unsupported data type: ${d}`);u=!0,S.push([d,h,{gpuBuffer:t,download:o.jsepCreateDownloader(t,r,d),dispose:()=>{o._OrtReleaseTensor(n)!==0&&Lt(`Can't release tensor.`)}},`gpu-buffer`])}else if(_===`ml-tensor`&&g>0){let t=o.webnnEnsureTensor,r=o.webnnIsInt64Supported;if(!t||!r)throw Error(`preferredLocation "ml-tensor" is not supported without using WebNN.`);if(Xt(a,g)===void 0||!en(d))throw Error(`Unsupported data type: ${d}`);if(d===`int64`&&!r(e))throw Error(`preferredLocation "ml-tensor" for int64 output is not supported by current WebNN Context.`);let i=await t(e,p,a,h,!1);u=!0,S.push([d,h,{mlTensor:i,download:o.webnnCreateMLTensorDownloader(p,d),dispose:()=>{o.webnnReleaseTensorId(p),o._OrtReleaseTensor(n)}},`ml-tensor`])}else{let e=Zt(d),t=new e(g);new Uint8Array(t.buffer,t.byteOffset,t.byteLength).set(o.HEAPU8.subarray(p,p+t.byteLength)),S.push([d,h,t,`cpu`])}}finally{o.stackRestore(a),d===`string`&&p&&o._free(p),u||o._OrtReleaseTensor(n),o.webnnOnRunEnd?.(l)}}return f&&!p&&(o._OrtClearBoundOutputs(f.handle)!==0&&Lt(`Can't clear bound outputs.`),_d.set(e,[l,u,d,f,p,!1])),S}finally{o.stackRestore(S),y.forEach(e=>o._OrtReleaseTensor(e)),b.forEach(e=>o._OrtReleaseTensor(e)),x.forEach(e=>o._free(e)),_!==0&&o._OrtReleaseRunOptions(_),v.forEach(e=>o._free(e))}},Td=e=>{let t=Nt(),n=_d.get(e);if(!n)throw Error(`invalid session id`);let r=n[0],i=t._OrtEndProfiling(r);i===0&&Lt(`Can't get an profile file name.`),t._OrtFree(i)},Ed=e=>{let t=[];for(let n of e){let e=n[2];!Array.isArray(e)&&`buffer`in e&&t.push(e.buffer)}return t}}),Od,kd,Ad,jd,Md,Nd,Pd,Fd,Id,Ld,Rd,zd,Bd,Vd,Hd,Ud,Wd,Gd,Kd=M(()=>{"use strict";Ze(),Dd(),Pt(),wt(),Od=()=>!!R.wasm.proxy&&typeof document<`u`,Ad=!1,jd=!1,Md=!1,Fd=new Map,Id=(e,t)=>{let n=Fd.get(e);n?n.push(t):Fd.set(e,[t])},Ld=()=>{if(Ad||!jd||Md||!kd)throw Error(`worker not ready`)},Rd=e=>{switch(e.data.type){case`init-wasm`:Ad=!1,e.data.err?(Md=!0,Pd[1](e.data.err)):(jd=!0,Pd[0]()),Nd&&(URL.revokeObjectURL(Nd),Nd=void 0);break;case`init-ep`:case`copy-from`:case`create`:case`release`:case`run`:case`end-profiling`:{let t=Fd.get(e.data.type);e.data.err?t.shift()[1](e.data.err):t.shift()[0](e.data.out);break}default:}},zd=async()=>{if(!jd){if(Ad)throw Error(`multiple calls to 'initWasm()' detected.`);if(Md)throw Error(`previous call to 'initWasm()' failed.`);if(Ad=!0,Od())return new Promise((e,t)=>{kd?.terminate(),xt().then(([n,r])=>{try{kd=r,kd.onerror=e=>t(e),kd.onmessage=Rd,Pd=[e,t];let i={type:`init-wasm`,in:R};!i.in.wasm.wasmPaths&&(n||dt)&&(i.in.wasm.wasmPaths={wasm:new URL(`/assets/ort-wasm-simd-threaded.jsep-B0T3yYHD.wasm`,``+self.location.href).href}),kd.postMessage(i),Nd=n}catch(e){t(e)}},t)});try{await Mt(R.wasm),await hd(R),jd=!0}catch(e){throw Md=!0,e}finally{Ad=!1}}},Bd=async e=>{if(Od())return Ld(),new Promise((t,n)=>{Id(`init-ep`,[t,n]);let r={type:`init-ep`,in:{epName:e,env:R}};kd.postMessage(r)});await gd(R,e)},Vd=async e=>Od()?(Ld(),new Promise((t,n)=>{Id(`copy-from`,[t,n]);let r={type:`copy-from`,in:{buffer:e}};kd.postMessage(r,[e.buffer])})):bd(e),Hd=async(e,t)=>{if(Od()){if(t?.preferredOutputLocation)throw Error(`session option "preferredOutputLocation" is not supported for proxy.`);return Ld(),new Promise((n,r)=>{Id(`create`,[n,r]);let i={type:`create`,in:{model:e,options:{...t}}},a=[];e instanceof Uint8Array&&a.push(e.buffer),kd.postMessage(i,a)})}else return xd(e,t)},Ud=async e=>{if(Od())return Ld(),new Promise((t,n)=>{Id(`release`,[t,n]);let r={type:`release`,in:e};kd.postMessage(r)});Sd(e)},Wd=async(e,t,n,r,i,a)=>{if(Od()){if(n.some(e=>e[3]!==`cpu`))throw Error(`input tensor on GPU is not supported for proxy.`);if(i.some(e=>e))throw Error(`pre-allocated output tensor is not supported for proxy.`);return Ld(),new Promise((i,o)=>{Id(`run`,[i,o]);let s=n,c={type:`run`,in:{sessionId:e,inputIndices:t,inputs:s,outputIndices:r,options:a}};kd.postMessage(c,Ed(s))})}else return wd(e,t,n,r,i,a)},Gd=async e=>{if(Od())return Ld(),new Promise((t,n)=>{Id(`end-profiling`,[t,n]);let r={type:`end-profiling`,in:e};kd.postMessage(r)});Td(e)}}),qd,Jd,Yd,Xd=M(()=>{"use strict";Ze(),Kd(),U(),Qe(),rn(),qd=(e,t)=>{switch(e.location){case`cpu`:return[e.type,e.dims,e.data,`cpu`];case`gpu-buffer`:return[e.type,e.dims,{gpuBuffer:e.gpuBuffer},`gpu-buffer`];case`ml-tensor`:return[e.type,e.dims,{mlTensor:e.mlTensor},`ml-tensor`];default:throw Error(`invalid data location: ${e.location} for ${t()}`)}},Jd=e=>{switch(e[3]){case`cpu`:return new Le(e[0],e[2],e[1]);case`gpu-buffer`:{let t=e[0];if(!$t(t))throw Error(`not supported data type: ${t} for deserializing GPU tensor`);let{gpuBuffer:n,download:r,dispose:i}=e[2];return Le.fromGpuBuffer(n,{dataType:t,dims:e[1],download:r,dispose:i})}case`ml-tensor`:{let t=e[0];if(!en(t))throw Error(`not supported data type: ${t} for deserializing MLTensor tensor`);let{mlTensor:n,download:r,dispose:i}=e[2];return Le.fromMLTensor(n,{dataType:t,dims:e[1],download:r,dispose:i})}default:throw Error(`invalid data location: ${e[3]}`)}},Yd=class{async fetchModelAndCopyToWasmMemory(e){return Vd(await nn(e))}async loadModel(e,t){Be();let n;n=typeof e==`string`?await this.fetchModelAndCopyToWasmMemory(e):e,[this.sessionId,this.inputNames,this.outputNames,this.inputMetadata,this.outputMetadata]=await Hd(n,t),H()}async dispose(){return Ud(this.sessionId)}async run(e,t,n){Be();let r=[],i=[];Object.entries(e).forEach(e=>{let t=e[0],n=e[1],a=this.inputNames.indexOf(t);if(a===-1)throw Error(`invalid input '${t}'`);r.push(n),i.push(a)});let a=[],o=[];Object.entries(t).forEach(e=>{let t=e[0],n=e[1],r=this.outputNames.indexOf(t);if(r===-1)throw Error(`invalid output '${t}'`);a.push(n),o.push(r)});let s=r.map((e,t)=>qd(e,()=>`input "${this.inputNames[i[t]]}"`)),c=a.map((e,t)=>e?qd(e,()=>`output "${this.outputNames[o[t]]}"`):null),l=await Wd(this.sessionId,i,s,o,c,n),u={};for(let e=0;e$d,initializeFlags:()=>Qd,wasmBackend:()=>ef});var Qd,$d,ef,tf=M(()=>{"use strict";Ze(),Kd(),Xd(),Qd=()=>{(typeof R.wasm.initTimeout!=`number`||R.wasm.initTimeout<0)&&(R.wasm.initTimeout=0);let e=R.wasm.simd;if(typeof e!=`boolean`&&e!==void 0&&e!==`fixed`&&e!==`relaxed`&&(console.warn(`Property "env.wasm.simd" is set to unknown value "${e}". Reset it to \`false\` and ignore SIMD feature checking.`),R.wasm.simd=!1),typeof R.wasm.proxy!=`boolean`&&(R.wasm.proxy=!1),typeof R.wasm.trace!=`boolean`&&(R.wasm.trace=!1),typeof R.wasm.numThreads!=`number`||!Number.isInteger(R.wasm.numThreads)||R.wasm.numThreads<=0)if(typeof self<`u`&&!self.crossOriginIsolated)R.wasm.numThreads=1;else{let e=typeof navigator>`u`?se(`node:os`).cpus().length:navigator.hardwareConcurrency;R.wasm.numThreads=Math.min(4,Math.ceil((e||1)/2))}},$d=class{async init(e){Qd(),await zd(),await Bd(e)}async createInferenceSessionHandler(e,t){let n=new Yd;return await n.loadModel(e,t),n}},ef=new $d});Ze(),Ze(),Ze();var nf=`1.22.0-dev.20250409-89f8206ba4`,rf=Xe;{let e=(tf(),le(Zd)).wasmBackend;fe(`webgpu`,e,5),fe(`webnn`,e,5),fe(`cpu`,e,10),fe(`wasm`,e,10)}Object.defineProperty(R.versions,`web`,{value:nf,enumerable:!0}); /** * @license * Copyright 2021 Google LLC. All Rights Reserved. @@ -2874,15 +2874,15 @@ ${a}`,s=n.createShaderModule({code:o,label:e.name});H(`verbose`,()=>`[WebGPU] ${ * limitations under the License. * ============================================================================= */ -let af={url:self.location.href};var sf={"onnxruntime-common":e=>{e.exports=ne},"onnxruntime-web":e=>{e.exports=j},"?2ce3":()=>{},"?7992":()=>{},"?5af5":()=>{},"?2b25":()=>{},"?db59":()=>{},"?383f":()=>{},"?fa4b":()=>{},"./node_modules/@huggingface/jinja/dist/index.js":(e,t,n)=>{n.r(t),n.d(t,{Environment:()=>L,Interpreter:()=>ye,Template:()=>Pe,parse:()=>se,tokenize:()=>d});var r=Object.freeze({Text:`Text`,NumericLiteral:`NumericLiteral`,BooleanLiteral:`BooleanLiteral`,NullLiteral:`NullLiteral`,StringLiteral:`StringLiteral`,Identifier:`Identifier`,Equals:`Equals`,OpenParen:`OpenParen`,CloseParen:`CloseParen`,OpenStatement:`OpenStatement`,CloseStatement:`CloseStatement`,OpenExpression:`OpenExpression`,CloseExpression:`CloseExpression`,OpenSquareBracket:`OpenSquareBracket`,CloseSquareBracket:`CloseSquareBracket`,OpenCurlyBracket:`OpenCurlyBracket`,CloseCurlyBracket:`CloseCurlyBracket`,Comma:`Comma`,Dot:`Dot`,Colon:`Colon`,Pipe:`Pipe`,CallOperator:`CallOperator`,AdditiveBinaryOperator:`AdditiveBinaryOperator`,MultiplicativeBinaryOperator:`MultiplicativeBinaryOperator`,ComparisonBinaryOperator:`ComparisonBinaryOperator`,UnaryOperator:`UnaryOperator`,Set:`Set`,If:`If`,For:`For`,In:`In`,Is:`Is`,NotIn:`NotIn`,Else:`Else`,EndSet:`EndSet`,EndIf:`EndIf`,ElseIf:`ElseIf`,EndFor:`EndFor`,And:`And`,Or:`Or`,Not:`UnaryOperator`,Macro:`Macro`,EndMacro:`EndMacro`,Break:`Break`,Continue:`Continue`}),i=Object.freeze({set:r.Set,for:r.For,in:r.In,is:r.Is,if:r.If,else:r.Else,endset:r.EndSet,endif:r.EndIf,elif:r.ElseIf,endfor:r.EndFor,and:r.And,or:r.Or,not:r.Not,"not in":r.NotIn,macro:r.Macro,endmacro:r.EndMacro,break:r.Break,continue:r.Continue,true:r.BooleanLiteral,false:r.BooleanLiteral,none:r.NullLiteral,True:r.BooleanLiteral,False:r.BooleanLiteral,None:r.NullLiteral}),a=class{constructor(e,t){this.value=e,this.type=t}};function o(e){return/\w/.test(e)}function s(e){return/[0-9]/.test(e)}var c=[[`{%`,r.OpenStatement],[`%}`,r.CloseStatement],[`{{`,r.OpenExpression],[`}}`,r.CloseExpression],[`(`,r.OpenParen],[`)`,r.CloseParen],[`{`,r.OpenCurlyBracket],[`}`,r.CloseCurlyBracket],[`[`,r.OpenSquareBracket],[`]`,r.CloseSquareBracket],[`,`,r.Comma],[`.`,r.Dot],[`:`,r.Colon],[`|`,r.Pipe],[`<=`,r.ComparisonBinaryOperator],[`>=`,r.ComparisonBinaryOperator],[`==`,r.ComparisonBinaryOperator],[`!=`,r.ComparisonBinaryOperator],[`<`,r.ComparisonBinaryOperator],[`>`,r.ComparisonBinaryOperator],[`+`,r.AdditiveBinaryOperator],[`-`,r.AdditiveBinaryOperator],[`*`,r.MultiplicativeBinaryOperator],[`/`,r.MultiplicativeBinaryOperator],[`%`,r.MultiplicativeBinaryOperator],[`=`,r.Equals]],l=new Map([[`n`,` -`],[`t`,` `],[`r`,`\r`],[`b`,`\b`],[`f`,`\f`],[`v`,`\v`],[`'`,`'`],[`"`,`"`],[`\\`,`\\`]]);function u(e,t={}){return e.endsWith(` -`)&&(e=e.slice(0,-1)),e=e.replace(/{#.*?#}/gs,`{##}`),t.lstrip_blocks&&(e=e.replace(/^[ \t]*({[#%])/gm,`$1`)),t.trim_blocks&&(e=e.replace(/([#%]})\n/g,`$1`)),e.replace(/{##}/g,``).replace(/-%}\s*/g,`%}`).replace(/\s*{%-/g,`{%`).replace(/-}}\s*/g,`}}`).replace(/\s*{{-/g,`{{`)}function d(e,t={}){let n=[],d=u(e,t),f=0,p=e=>{let t=``;for(;e(d[f]);){if(d[f]===`\\`){if(++f,f>=d.length)throw SyntaxError(`Unexpected end of input`);let e=d[f++],n=l.get(e);if(n===void 0)throw SyntaxError(`Unexpected escaped character: ${e}`);t+=n;continue}if(t+=d[f++],f>=d.length)throw SyntaxError(`Unexpected end of input`)}return t};main:for(;f0){n.push(new a(e,r.Text));continue}}p(e=>/\s/.test(e));let t=d[f];if(t===`-`||t===`+`){let e=n.at(-1)?.type;if(e===r.Text||e===void 0)throw SyntaxError(`Unexpected character: ${t}`);switch(e){case r.Identifier:case r.NumericLiteral:case r.BooleanLiteral:case r.NullLiteral:case r.StringLiteral:case r.CloseParen:case r.CloseSquareBracket:break;default:{++f;let e=p(s);n.push(new a(`${t}${e}`,e.length>0?r.NumericLiteral:r.UnaryOperator));continue}}}for(let[e,t]of c){let r=d.slice(f,f+e.length);if(r===e){n.push(new a(e,t)),f+=e.length;continue main}}if(t===`'`||t===`"`){++f;let e=p(e=>e!==t);n.push(new a(e,r.StringLiteral)),++f;continue}if(s(t)){let e=p(s);n.push(new a(e,r.NumericLiteral));continue}if(o(t)){let e=p(o),t=Object.hasOwn(i,e)?i[e]:r.Identifier;t===r.In&&n.at(-1)?.type===r.Not?(n.pop(),n.push(new a(`not in`,r.NotIn))):n.push(new a(e,t));continue}throw SyntaxError(`Unexpected character: ${t}`)}return n}var f=class{type=`Statement`},p=class extends f{constructor(e){super(),this.body=e}type=`Program`},m=class extends f{constructor(e,t,n){super(),this.test=e,this.body=t,this.alternate=n}type=`If`},h=class extends f{constructor(e,t,n,r){super(),this.loopvar=e,this.iterable=t,this.body=n,this.defaultBlock=r}type=`For`},g=class extends f{type=`Break`},_=class extends f{type=`Continue`},v=class extends f{constructor(e,t,n){super(),this.assignee=e,this.value=t,this.body=n}type=`Set`},y=class extends f{constructor(e,t,n){super(),this.name=e,this.args=t,this.body=n}type=`Macro`},b=class extends f{type=`Expression`},x=class extends b{constructor(e,t,n){super(),this.object=e,this.property=t,this.computed=n}type=`MemberExpression`},S=class extends b{constructor(e,t){super(),this.callee=e,this.args=t}type=`CallExpression`},C=class extends b{constructor(e){super(),this.value=e}type=`Identifier`},w=class extends b{constructor(e){super(),this.value=e}type=`Literal`},T=class extends w{type=`NumericLiteral`},E=class extends w{type=`StringLiteral`},D=class extends w{type=`BooleanLiteral`},O=class extends w{type=`NullLiteral`},k=class extends w{type=`ArrayLiteral`},A=class extends w{type=`TupleLiteral`},ee=class extends w{type=`ObjectLiteral`},te=class extends b{constructor(e,t,n){super(),this.operator=e,this.left=t,this.right=n}type=`BinaryExpression`},ne=class extends b{constructor(e,t){super(),this.operand=e,this.filter=t}type=`FilterExpression`},j=class extends b{constructor(e,t){super(),this.iterable=e,this.test=t}type=`SelectExpression`},re=class extends b{constructor(e,t,n){super(),this.operand=e,this.negate=t,this.test=n}type=`TestExpression`},ie=class extends b{constructor(e,t){super(),this.operator=e,this.argument=t}type=`UnaryExpression`},ae=class extends b{constructor(e=void 0,t=void 0,n=void 0){super(),this.start=e,this.stop=t,this.step=n}type=`SliceExpression`},oe=class extends b{constructor(e,t){super(),this.key=e,this.value=t}type=`KeywordArgumentExpression`};function se(e){let t=new p([]),n=0;function i(t,r){let i=e[n++];if(!i||i.type!==t)throw Error(`Parser Error: ${r}. ${i.type} !== ${t}.`);return i}function a(){switch(e[n].type){case r.Text:return c();case r.OpenStatement:return l();case r.OpenExpression:return u();default:throw SyntaxError(`Unexpected token type: ${e[n].type}`)}}function o(...t){return n+t.length<=e.length&&t.some((t,r)=>t!==e[n+r].type)}function s(...t){return n+t.length<=e.length&&t.every((t,r)=>t===e[n+r].type)}function c(){return new E(i(r.Text,`Expected text token`).value)}function l(){i(r.OpenStatement,`Expected opening statement token`);let t;switch(e[n].type){case r.Set:++n,t=d(),i(r.CloseStatement,`Expected closing statement token`);break;case r.If:++n,t=f(),i(r.OpenStatement,`Expected {% token`),i(r.EndIf,`Expected endif token`),i(r.CloseStatement,`Expected %} token`);break;case r.Macro:++n,t=b(),i(r.OpenStatement,`Expected {% token`),i(r.EndMacro,`Expected endmacro token`),i(r.CloseStatement,`Expected %} token`);break;case r.For:++n,t=se(),i(r.OpenStatement,`Expected {% token`),i(r.EndFor,`Expected endfor token`),i(r.CloseStatement,`Expected %} token`);break;case r.Break:++n,i(r.CloseStatement,`Expected closing statement token`),t=new g;break;case r.Continue:++n,i(r.CloseStatement,`Expected closing statement token`),t=new _;break;default:throw SyntaxError(`Unknown statement type: ${e[n].type}`)}return t}function u(){i(r.OpenExpression,`Expected opening expression token`);let e=M();return i(r.CloseExpression,`Expected closing expression token`),e}function d(){let t=M();if(s(r.Equals)){++n;let e=M();return new v(t,e,[])}else{let o=[];for(i(r.CloseStatement,`Expected %} token`);!(e[n]?.type===r.OpenStatement&&e[n+1]?.type===r.EndSet);){let e=a();o.push(e)}return i(r.OpenStatement,`Expected {% token`),i(r.EndSet,`Expected endset token`),new v(t,null,o)}}function f(){let t=M();i(r.CloseStatement,`Expected closing statement token`);let o=[],c=[];for(;!(e[n]?.type===r.OpenStatement&&(e[n+1]?.type===r.ElseIf||e[n+1]?.type===r.Else||e[n+1]?.type===r.EndIf));)o.push(a());if(e[n]?.type===r.OpenStatement&&e[n+1]?.type!==r.EndIf)if(++n,s(r.ElseIf))i(r.ElseIf,`Expected elseif token`),c.push(f());else for(i(r.Else,`Expected else token`),i(r.CloseStatement,`Expected closing statement token`);!(e[n]?.type===r.OpenStatement&&e[n+1]?.type===r.EndIf);)c.push(a());return new m(t,o,c)}function b(){let e=L();if(e.type!==`Identifier`)throw SyntaxError(`Expected identifier following macro statement`);let t=I();i(r.CloseStatement,`Expected closing statement token`);let n=[];for(;o(r.OpenStatement,r.EndMacro);)n.push(a());return new y(e,t,n)}function w(e=!1){let t=e?L:M,i=[t()],a=s(r.Comma);for(;a&&(++n,i.push(t()),s(r.Comma)););return a?new A(i):i[0]}function se(){let e=w(!0);if(!(e instanceof C||e instanceof A))throw SyntaxError(`Expected identifier/tuple for the loop variable, got ${e.type} instead`);i(r.In,"Expected `in` keyword following loop variable");let t=M();i(r.CloseStatement,`Expected closing statement token`);let c=[];for(;o(r.OpenStatement,r.EndFor)&&o(r.OpenStatement,r.Else);)c.push(a());let l=[];if(s(r.OpenStatement,r.Else))for(++n,++n,i(r.CloseStatement,`Expected closing statement token`);o(r.OpenStatement,r.EndFor);)l.push(a());return new h(e,t,c,l)}function M(){return N()}function N(){let e=ce();if(s(r.If)){++n;let t=ce();if(s(r.Else)){++n;let r=ce();return new m(t,[e],[r])}else return new j(e,t)}return e}function ce(){let t=le();for(;s(r.Or);){let r=e[n];++n;let i=le();t=new te(r,t,i)}return t}function le(){let t=ue();for(;s(r.And);){let r=e[n];++n;let i=ue();t=new te(r,t,i)}return t}function ue(){let t;for(;s(r.Not);){let r=e[n];++n;let i=ue();t=new ie(r,i)}return t??de()}function de(){let t=P();for(;s(r.ComparisonBinaryOperator)||s(r.In)||s(r.NotIn);){let r=e[n];++n;let i=P();t=new te(r,t,i)}return t}function P(){let t=ge();for(;s(r.AdditiveBinaryOperator);){let r=e[n];++n;let i=ge();t=new te(r,t,i)}return t}function F(){let e=he(L());return s(r.OpenParen)?fe(e):e}function fe(e){let t=new S(e,I());return t=he(t),s(r.OpenParen)&&(t=fe(t)),t}function I(){i(r.OpenParen,`Expected opening parenthesis for arguments list`);let e=pe();return i(r.CloseParen,`Expected closing parenthesis for arguments list`),e}function pe(){let e=[];for(;!s(r.CloseParen);){let t=M();if(s(r.Equals)){if(++n,!(t instanceof C))throw SyntaxError(`Expected identifier for keyword argument`);let e=M();t=new oe(t,e)}e.push(t),s(r.Comma)&&++n}return e}function me(){let e=[],t=!1;for(;!s(r.CloseSquareBracket);)s(r.Colon)?(e.push(void 0),++n,t=!0):(e.push(M()),s(r.Colon)&&(++n,t=!0));if(e.length===0)throw SyntaxError(`Expected at least one argument for member/slice expression`);if(t){if(e.length>3)throw SyntaxError(`Expected 0-3 arguments for slice expression`);return new ae(...e)}return e[0]}function he(t){for(;s(r.Dot)||s(r.OpenSquareBracket);){let a=e[n];++n;let o,s=a.type!==r.Dot;if(s)o=me(),i(r.CloseSquareBracket,`Expected closing square bracket`);else if(o=L(),o.type!==`Identifier`)throw SyntaxError(`Expected identifier following dot operator`);t=new x(t,o,s)}return t}function ge(){let t=_e();for(;s(r.MultiplicativeBinaryOperator);){let r=e[n];++n;let i=_e();t=new te(r,t,i)}return t}function _e(){let e=ve();for(;s(r.Is);){++n;let t=s(r.Not);t&&++n;let i=L();if(i instanceof D?i=new C(i.value.toString()):i instanceof O&&(i=new C(`none`)),!(i instanceof C))throw SyntaxError(`Expected identifier for the test`);e=new re(e,t,i)}return e}function ve(){let e=F();for(;s(r.Pipe);){++n;let t=L();if(!(t instanceof C))throw SyntaxError(`Expected identifier for the filter`);s(r.OpenParen)&&(t=fe(t)),e=new ne(e,t)}return e}function L(){let t=e[n];switch(t.type){case r.NumericLiteral:return++n,new T(Number(t.value));case r.StringLiteral:return++n,new E(t.value);case r.BooleanLiteral:return++n,new D(t.value.toLowerCase()===`true`);case r.NullLiteral:return++n,new O(null);case r.Identifier:return++n,new C(t.value);case r.OpenParen:{++n;let t=w();if(e[n].type!==r.CloseParen)throw SyntaxError(`Expected closing parenthesis, got ${e[n].type} instead`);return++n,t}case r.OpenSquareBracket:{++n;let e=[];for(;!s(r.CloseSquareBracket);)e.push(M()),s(r.Comma)&&++n;return++n,new k(e)}case r.OpenCurlyBracket:{++n;let e=new Map;for(;!s(r.CloseCurlyBracket);){let t=M();i(r.Colon,`Expected colon between key and value in object literal`);let a=M();e.set(t,a),s(r.Comma)&&++n}return++n,new ee(e)}default:throw SyntaxError(`Unexpected token: ${t.type}`)}}for(;n=0?(t=(t??=0)<0?Math.max(e.length+t,0):Math.min(t,e.length),n=(n??=e.length)<0?Math.max(e.length+n,0):Math.min(n,e.length)):(t=(t??=e.length-1)<0?Math.max(e.length+t,-1):Math.min(t,e.length-1),n=(n??=-1)<-1?Math.max(e.length+n,-1):Math.min(n,e.length-1));let a=[];for(let o=t;i*oe.toUpperCase())}var le=class extends Error{},ue=class extends Error{},de=class{type=`RuntimeValue`;value;builtins=new Map;constructor(e=void 0){this.value=e}__bool__(){return new fe(!!this.value)}},P=class extends de{type=`NumericValue`},F=class extends de{type=`StringValue`;builtins=new Map([[`upper`,new ge(()=>new F(this.value.toUpperCase()))],[`lower`,new ge(()=>new F(this.value.toLowerCase()))],[`strip`,new ge(()=>new F(this.value.trim()))],[`title`,new ge(()=>new F(ce(this.value)))],[`length`,new P(this.value.length)],[`rstrip`,new ge(()=>new F(this.value.trimEnd()))],[`lstrip`,new ge(()=>new F(this.value.trimStart()))],[`startswith`,new ge(e=>{if(e.length===0)throw Error(`startswith() requires at least one argument`);let t=e[0];if(!(t instanceof F))throw Error(`startswith() argument must be a string`);return new fe(this.value.startsWith(t.value))})],[`endswith`,new ge(e=>{if(e.length===0)throw Error(`endswith() requires at least one argument`);let t=e[0];if(!(t instanceof F))throw Error(`endswith() argument must be a string`);return new fe(this.value.endsWith(t.value))})],[`split`,new ge(e=>{let t=e[0]??new _e;if(!(t instanceof F||t instanceof _e))throw Error(`sep argument must be a string or null`);let n=e[1]??new P(-1);if(!(n instanceof P))throw Error(`maxsplit argument must be a number`);let r=[];if(t instanceof _e){let e=this.value.trimStart();for(let{0:t,index:i}of e.matchAll(/\S+/g)){if(n.value!==-1&&r.length>=n.value&&i!==void 0){r.push(t+e.slice(i+t.length));break}r.push(t)}}else{if(t.value===``)throw Error(`empty separator`);r=this.value.split(t.value),n.value!==-1&&r.length>n.value&&r.push(r.splice(n.value).join(t.value))}return new me(r.map(e=>new F(e)))})]])},fe=class extends de{type=`BooleanValue`},I=class extends de{type=`ObjectValue`;__bool__(){return new fe(this.value.size>0)}builtins=new Map([[`get`,new ge(([e,t])=>{if(!(e instanceof F))throw Error(`Object key must be a string: got ${e.type}`);return this.value.get(e.value)??t??new _e})],[`items`,new ge(()=>new me(Array.from(this.value.entries()).map(([e,t])=>new me([new F(e),t]))))]])},pe=class extends I{type=`KeywordArgumentsValue`},me=class extends de{type=`ArrayValue`;builtins=new Map([[`length`,new P(this.value.length)]]);__bool__(){return new fe(this.value.length>0)}},he=class extends me{type=`TupleValue`},ge=class extends de{type=`FunctionValue`},_e=class extends de{type=`NullValue`},ve=class extends de{type=`UndefinedValue`},L=class{constructor(e){this.parent=e}variables=new Map([[`namespace`,new ge(e=>{if(e.length===0)return new I(new Map);if(e.length!==1||!(e[0]instanceof I))throw Error("`namespace` expects either zero arguments or a single object argument");return e[0]})]]);tests=new Map([[`boolean`,e=>e.type===`BooleanValue`],[`callable`,e=>e instanceof ge],[`odd`,e=>{if(e.type!==`NumericValue`)throw Error(`Cannot apply test "odd" to type: ${e.type}`);return e.value%2!=0}],[`even`,e=>{if(e.type!==`NumericValue`)throw Error(`Cannot apply test "even" to type: ${e.type}`);return e.value%2==0}],[`false`,e=>e.type===`BooleanValue`&&!e.value],[`true`,e=>e.type===`BooleanValue`&&e.value],[`none`,e=>e.type===`NullValue`],[`string`,e=>e.type===`StringValue`],[`number`,e=>e.type===`NumericValue`],[`integer`,e=>e.type===`NumericValue`&&Number.isInteger(e.value)],[`iterable`,e=>e.type===`ArrayValue`||e.type===`StringValue`],[`mapping`,e=>e.type===`ObjectValue`],[`lower`,e=>{let t=e.value;return e.type===`StringValue`&&t===t.toLowerCase()}],[`upper`,e=>{let t=e.value;return e.type===`StringValue`&&t===t.toUpperCase()}],[`none`,e=>e.type===`NullValue`],[`defined`,e=>e.type!==`UndefinedValue`],[`undefined`,e=>e.type===`UndefinedValue`],[`equalto`,(e,t)=>e.value===t.value],[`eq`,(e,t)=>e.value===t.value]]);set(e,t){return this.declareVariable(e,be(t))}declareVariable(e,t){if(this.variables.has(e))throw SyntaxError(`Variable already declared: ${e}`);return this.variables.set(e,t),t}setVariable(e,t){return this.variables.set(e,t),t}resolve(e){if(this.variables.has(e))return this;if(this.parent)return this.parent.resolve(e);throw Error(`Unknown variable: ${e}`)}lookupVariable(e){try{return this.resolve(e).variables.get(e)??new ve}catch{return new ve}}},ye=class{global;constructor(e){this.global=e??new L}run(e){return this.evaluate(e,this.global)}evaluateBinaryExpression(e,t){let n=this.evaluate(e.left,t);switch(e.operator.value){case`and`:return n.__bool__().value?this.evaluate(e.right,t):n;case`or`:return n.__bool__().value?n:this.evaluate(e.right,t)}let r=this.evaluate(e.right,t);switch(e.operator.value){case`==`:return new fe(n.value==r.value);case`!=`:return new fe(n.value!=r.value)}if(n instanceof ve||r instanceof ve)throw Error(`Cannot perform operation on undefined values`);if(n instanceof _e||r instanceof _e)throw Error(`Cannot perform operation on null values`);if(n instanceof P&&r instanceof P)switch(e.operator.value){case`+`:return new P(n.value+r.value);case`-`:return new P(n.value-r.value);case`*`:return new P(n.value*r.value);case`/`:return new P(n.value/r.value);case`%`:return new P(n.value%r.value);case`<`:return new fe(n.value`:return new fe(n.value>r.value);case`>=`:return new fe(n.value>=r.value);case`<=`:return new fe(n.value<=r.value)}else if(n instanceof me&&r instanceof me)switch(e.operator.value){case`+`:return new me(n.value.concat(r.value))}else if(r instanceof me){let t=r.value.find(e=>e.value===n.value)!==void 0;switch(e.operator.value){case`in`:return new fe(t);case`not in`:return new fe(!t)}}if(n instanceof F||r instanceof F)switch(e.operator.value){case`+`:return new F(n.value.toString()+r.value.toString())}if(n instanceof F&&r instanceof F)switch(e.operator.value){case`in`:return new fe(r.value.includes(n.value));case`not in`:return new fe(!r.value.includes(n.value))}if(n instanceof F&&r instanceof I)switch(e.operator.value){case`in`:return new fe(r.value.has(n.value));case`not in`:return new fe(!r.value.has(n.value))}throw SyntaxError(`Unknown operator "${e.operator.value}" between ${n.type} and ${r.type}`)}evaluateArguments(e,t){let n=[],r=new Map;for(let i of e)if(i.type===`KeywordArgumentExpression`){let e=i;r.set(e.key.value,this.evaluate(e.value,t))}else{if(r.size>0)throw Error(`Positional arguments must come before keyword arguments`);n.push(this.evaluate(i,t))}return[n,r]}evaluateFilterExpression(e,t){let n=this.evaluate(e.operand,t);if(e.filter.type===`Identifier`){let t=e.filter;if(t.value===`tojson`)return new F(xe(n));if(n instanceof me)switch(t.value){case`list`:return n;case`first`:return n.value[0];case`last`:return n.value[n.value.length-1];case`length`:return new P(n.value.length);case`reverse`:return new me(n.value.reverse());case`sort`:return new me(n.value.sort((e,t)=>{if(e.type!==t.type)throw Error(`Cannot compare different types: ${e.type} and ${t.type}`);switch(e.type){case`NumericValue`:return e.value-t.value;case`StringValue`:return e.value.localeCompare(t.value);default:throw Error(`Cannot compare type: ${e.type}`)}}));case`join`:return new F(n.value.map(e=>e.value).join(``));case`string`:return new F(xe(n));default:throw Error(`Unknown ArrayValue filter: ${t.value}`)}else if(n instanceof F)switch(t.value){case`length`:return new P(n.value.length);case`upper`:return new F(n.value.toUpperCase());case`lower`:return new F(n.value.toLowerCase());case`title`:return new F(ce(n.value));case`capitalize`:return new F(n.value.charAt(0).toUpperCase()+n.value.slice(1));case`trim`:return new F(n.value.trim());case`indent`:return new F(n.value.split(` +let af={url:self.location.href};var sf={"onnxruntime-common":e=>{e.exports=ne},"onnxruntime-web":e=>{e.exports=j},"?2ce3":()=>{},"?7992":()=>{},"?5af5":()=>{},"?2b25":()=>{},"?db59":()=>{},"?383f":()=>{},"?fa4b":()=>{},"./node_modules/@huggingface/jinja/dist/index.js":(e,t,n)=>{n.r(t),n.d(t,{Environment:()=>Ce,Interpreter:()=>Te,Template:()=>Ve,parse:()=>ce,tokenize:()=>u});var r=Object.freeze({Text:`Text`,NumericLiteral:`NumericLiteral`,StringLiteral:`StringLiteral`,Identifier:`Identifier`,Equals:`Equals`,OpenParen:`OpenParen`,CloseParen:`CloseParen`,OpenStatement:`OpenStatement`,CloseStatement:`CloseStatement`,OpenExpression:`OpenExpression`,CloseExpression:`CloseExpression`,OpenSquareBracket:`OpenSquareBracket`,CloseSquareBracket:`CloseSquareBracket`,OpenCurlyBracket:`OpenCurlyBracket`,CloseCurlyBracket:`CloseCurlyBracket`,Comma:`Comma`,Dot:`Dot`,Colon:`Colon`,Pipe:`Pipe`,CallOperator:`CallOperator`,AdditiveBinaryOperator:`AdditiveBinaryOperator`,MultiplicativeBinaryOperator:`MultiplicativeBinaryOperator`,ComparisonBinaryOperator:`ComparisonBinaryOperator`,UnaryOperator:`UnaryOperator`,Comment:`Comment`}),i=class{constructor(e,t){this.value=e,this.type=t}};function a(e){return/\w/.test(e)}function o(e){return/[0-9]/.test(e)}var s=[[`{%`,r.OpenStatement],[`%}`,r.CloseStatement],[`{{`,r.OpenExpression],[`}}`,r.CloseExpression],[`(`,r.OpenParen],[`)`,r.CloseParen],[`{`,r.OpenCurlyBracket],[`}`,r.CloseCurlyBracket],[`[`,r.OpenSquareBracket],[`]`,r.CloseSquareBracket],[`,`,r.Comma],[`.`,r.Dot],[`:`,r.Colon],[`|`,r.Pipe],[`<=`,r.ComparisonBinaryOperator],[`>=`,r.ComparisonBinaryOperator],[`==`,r.ComparisonBinaryOperator],[`!=`,r.ComparisonBinaryOperator],[`<`,r.ComparisonBinaryOperator],[`>`,r.ComparisonBinaryOperator],[`+`,r.AdditiveBinaryOperator],[`-`,r.AdditiveBinaryOperator],[`~`,r.AdditiveBinaryOperator],[`*`,r.MultiplicativeBinaryOperator],[`/`,r.MultiplicativeBinaryOperator],[`%`,r.MultiplicativeBinaryOperator],[`=`,r.Equals]],c=new Map([[`n`,` +`],[`t`,` `],[`r`,`\r`],[`b`,`\b`],[`f`,`\f`],[`v`,`\v`],[`'`,`'`],[`"`,`"`],[`\\`,`\\`]]);function l(e,t={}){return e.endsWith(` +`)&&(e=e.slice(0,-1)),t.lstrip_blocks&&(e=e.replace(/^[ \t]*({[#%-])/gm,`$1`)),t.trim_blocks&&(e=e.replace(/([#%-]})\n/g,`$1`)),e.replace(/-%}\s*/g,`%}`).replace(/\s*{%-/g,`{%`).replace(/-}}\s*/g,`}}`).replace(/\s*{{-/g,`{{`).replace(/-#}\s*/g,`#}`).replace(/\s*{#-/g,`{#`).replace(/{%\s*(end)?generation\s*%}/gs,``)}function u(e,t={}){let n=[],u=l(e,t),d=0,f=0,p=e=>{let t=``;for(;e(u[d]);){if(u[d]===`\\`){if(++d,d>=u.length)throw SyntaxError(`Unexpected end of input`);let e=u[d++],n=c.get(e);if(n===void 0)throw SyntaxError(`Unexpected escaped character: ${e}`);t+=n;continue}if(t+=u[d++],d>=u.length)throw SyntaxError(`Unexpected end of input`)}return t};main:for(;d0){n.push(new i(e,r.Text));continue}}if(u[d]===`{`&&u[d+1]===`#`){d+=2;let e=``;for(;u[d]!==`#`||u[d+1]!==`}`;){if(d+2>=u.length)throw SyntaxError(`Missing end of comment tag`);e+=u[d++]}n.push(new i(e,r.Comment)),d+=2;continue}p(e=>/\s/.test(e));let t=u[d];if(t===`-`||t===`+`){let e=n.at(-1)?.type;if(e===r.Text||e===void 0)throw SyntaxError(`Unexpected character: ${t}`);switch(e){case r.Identifier:case r.NumericLiteral:case r.StringLiteral:case r.CloseParen:case r.CloseSquareBracket:break;default:{++d;let e=p(o);n.push(new i(`${t}${e}`,e.length>0?r.NumericLiteral:r.UnaryOperator));continue}}}for(let[e,t]of s){if(e===`}}`&&f>0)continue;let a=u.slice(d,d+e.length);if(a===e){n.push(new i(e,t)),t===r.OpenExpression?f=0:t===r.OpenCurlyBracket?++f:t===r.CloseCurlyBracket&&--f,d+=e.length;continue main}}if(t===`'`||t===`"`){++d;let e=p(e=>e!==t);n.push(new i(e,r.StringLiteral)),++d;continue}if(o(t)){let e=p(o);if(u[d]===`.`&&o(u[d+1])){++d;let t=p(o);e=`${e}.${t}`}n.push(new i(e,r.NumericLiteral));continue}if(a(t)){let e=p(a);n.push(new i(e,r.Identifier));continue}throw SyntaxError(`Unexpected character: ${t}`)}return n}var d=class{type=`Statement`},f=class extends d{constructor(e){super(),this.body=e}type=`Program`},p=class extends d{constructor(e,t,n){super(),this.test=e,this.body=t,this.alternate=n}type=`If`},m=class extends d{constructor(e,t,n,r){super(),this.loopvar=e,this.iterable=t,this.body=n,this.defaultBlock=r}type=`For`},h=class extends d{type=`Break`},g=class extends d{type=`Continue`},_=class extends d{constructor(e,t,n){super(),this.assignee=e,this.value=t,this.body=n}type=`Set`},v=class extends d{constructor(e,t,n){super(),this.name=e,this.args=t,this.body=n}type=`Macro`},y=class extends d{constructor(e){super(),this.value=e}type=`Comment`},b=class extends d{type=`Expression`},x=class extends b{constructor(e,t,n){super(),this.object=e,this.property=t,this.computed=n}type=`MemberExpression`},S=class extends b{constructor(e,t){super(),this.callee=e,this.args=t}type=`CallExpression`},C=class extends b{constructor(e){super(),this.value=e}type=`Identifier`},w=class extends b{constructor(e){super(),this.value=e}type=`Literal`},T=class extends w{type=`IntegerLiteral`},E=class extends w{type=`FloatLiteral`},D=class extends w{type=`StringLiteral`},O=class extends w{type=`ArrayLiteral`},k=class extends w{type=`TupleLiteral`},A=class extends w{type=`ObjectLiteral`},ee=class extends b{constructor(e,t,n){super(),this.operator=e,this.left=t,this.right=n}type=`BinaryExpression`},te=class extends b{constructor(e,t){super(),this.operand=e,this.filter=t}type=`FilterExpression`},ne=class extends d{constructor(e,t){super(),this.filter=e,this.body=t}type=`FilterStatement`},j=class extends b{constructor(e,t){super(),this.lhs=e,this.test=t}type=`SelectExpression`},re=class extends b{constructor(e,t,n){super(),this.operand=e,this.negate=t,this.test=n}type=`TestExpression`},ie=class extends b{constructor(e,t){super(),this.operator=e,this.argument=t}type=`UnaryExpression`},ae=class extends b{constructor(e=void 0,t=void 0,n=void 0){super(),this.start=e,this.stop=t,this.step=n}type=`SliceExpression`},oe=class extends b{constructor(e,t){super(),this.key=e,this.value=t}type=`KeywordArgumentExpression`},se=class extends b{constructor(e){super(),this.argument=e}type=`SpreadExpression`},M=class extends d{constructor(e,t,n){super(),this.call=e,this.callerArgs=t,this.body=n}type=`CallStatement`},N=class extends b{constructor(e,t,n){super(),this.condition=e,this.trueExpr=t,this.falseExpr=n}type=`Ternary`};function ce(e){let t=new f([]),n=0;function a(t,r){let i=e[n++];if(!i||i.type!==t)throw Error(`Parser Error: ${r}. ${i.type} !== ${t}.`);return i}function o(e){if(!u(e))throw SyntaxError(`Expected ${e}`);++n}function s(){switch(e[n].type){case r.Comment:return new y(e[n++].value);case r.Text:return d();case r.OpenStatement:return b();case r.OpenExpression:return w();default:throw SyntaxError(`Unexpected token type: ${e[n].type}`)}}function c(...t){return n+t.length<=e.length&&t.every((t,r)=>t===e[n+r].type)}function l(...t){return e[n]?.type===r.OpenStatement&&e[n+1]?.type===r.Identifier&&t.includes(e[n+1]?.value)}function u(...t){return n+t.length<=e.length&&t.every((t,r)=>e[n+r].type===`Identifier`&&t===e[n+r].value)}function d(){return new D(a(r.Text,`Expected text token`).value)}function b(){if(a(r.OpenStatement,`Expected opening statement token`),e[n].type!==r.Identifier)throw SyntaxError(`Unknown statement, got ${e[n].type}`);let t=e[n].value,i;switch(t){case`set`:++n,i=ce();break;case`if`:++n,i=le(),a(r.OpenStatement,`Expected {% token`),o(`endif`),a(r.CloseStatement,`Expected %} token`);break;case`macro`:++n,i=ue(),a(r.OpenStatement,`Expected {% token`),o(`endmacro`),a(r.CloseStatement,`Expected %} token`);break;case`for`:++n,i=fe(),a(r.OpenStatement,`Expected {% token`),o(`endfor`),a(r.CloseStatement,`Expected %} token`);break;case`call`:{++n;let e=null;c(r.OpenParen)&&(e=R());let t=B();if(t.type!==`Identifier`)throw SyntaxError(`Expected identifier following call statement`);let u=R();a(r.CloseStatement,`Expected closing statement token`);let d=[];for(;!l(`endcall`);)d.push(s());a(r.OpenStatement,`Expected '{%'`),o(`endcall`),a(r.CloseStatement,`Expected closing statement token`);let f=new S(t,u);i=new M(f,e,d);break}case`break`:++n,a(r.CloseStatement,`Expected closing statement token`),i=new h;break;case`continue`:++n,a(r.CloseStatement,`Expected closing statement token`),i=new g;break;case`filter`:{++n;let e=B();e instanceof C&&c(r.OpenParen)&&(e=L(e)),a(r.CloseStatement,`Expected closing statement token`);let t=[];for(;!l(`endfilter`);)t.push(s());a(r.OpenStatement,`Expected '{%'`),o(`endfilter`),a(r.CloseStatement,`Expected '%}'`),i=new ne(e,t);break}default:throw SyntaxError(`Unknown statement type: ${t}`)}return i}function w(){a(r.OpenExpression,`Expected opening expression token`);let e=P();return a(r.CloseExpression,`Expected closing expression token`),e}function ce(){let e=de(),t=null,i=[];if(c(r.Equals))++n,t=de();else{for(a(r.CloseStatement,`Expected %} token`);!l(`endset`);)i.push(s());a(r.OpenStatement,`Expected {% token`),o(`endset`)}return a(r.CloseStatement,`Expected closing statement token`),new _(e,t,i)}function le(){let e=P();a(r.CloseStatement,`Expected closing statement token`);let t=[],i=[];for(;!l(`elif`,`else`,`endif`);)t.push(s());if(l(`elif`)){++n,++n;let e=le();i.push(e)}else if(l(`else`))for(++n,++n,a(r.CloseStatement,`Expected closing statement token`);!l(`endif`);)i.push(s());return new p(e,t,i)}function ue(){let e=B();if(e.type!==`Identifier`)throw SyntaxError(`Expected identifier following macro statement`);let t=R();a(r.CloseStatement,`Expected closing statement token`);let n=[];for(;!l(`endmacro`);)n.push(s());return new v(e,t,n)}function de(e=!1){let t=e?B:P,i=[t()],a=c(r.Comma);for(;a&&(++n,i.push(t()),c(r.Comma)););return a?new k(i):i[0]}function fe(){let e=de(!0);if(!(e instanceof C||e instanceof k))throw SyntaxError(`Expected identifier/tuple for the loop variable, got ${e.type} instead`);if(!u(`in`))throw SyntaxError("Expected `in` keyword following loop variable");++n;let t=P();a(r.CloseStatement,`Expected closing statement token`);let i=[];for(;!l(`endfor`,`else`);)i.push(s());let o=[];if(l(`else`))for(++n,++n,a(r.CloseStatement,`Expected closing statement token`);!l(`endfor`);)o.push(s());return new m(e,t,i,o)}function P(){return pe()}function pe(){let e=F();if(u(`if`)){++n;let t=F();if(u(`else`)){++n;let r=pe();return new N(t,e,r)}else return new j(e,t)}return e}function F(){let t=me();for(;u(`or`);){let r=e[n];++n;let i=me();t=new ee(r,t,i)}return t}function me(){let t=he();for(;u(`and`);){let r=e[n];++n;let i=he();t=new ee(r,t,i)}return t}function he(){let t;for(;u(`not`);){let r=e[n];++n;let i=he();t=new ie(r,i)}return t??ge()}function ge(){let t=I();for(;;){let a;if(u(`not`,`in`))a=new i(`not in`,r.Identifier),n+=2;else if(u(`in`))a=e[n++];else if(c(r.ComparisonBinaryOperator))a=e[n++];else break;let o=I();t=new ee(a,t,o)}return t}function I(){let t=be();for(;c(r.AdditiveBinaryOperator);){let r=e[n];++n;let i=be();t=new ee(r,t,i)}return t}function _e(){let e=z(B());return c(r.OpenParen)?L(e):e}function L(e){let t=new S(e,R());return t=z(t),c(r.OpenParen)&&(t=L(t)),t}function R(){a(r.OpenParen,`Expected opening parenthesis for arguments list`);let e=ve();return a(r.CloseParen,`Expected closing parenthesis for arguments list`),e}function ve(){let t=[];for(;!c(r.CloseParen);){let i;if(e[n].type===r.MultiplicativeBinaryOperator&&e[n].value===`*`){++n;let e=P();i=new se(e)}else if(i=P(),c(r.Equals)){if(++n,!(i instanceof C))throw SyntaxError(`Expected identifier for keyword argument`);let e=P();i=new oe(i,e)}t.push(i),c(r.Comma)&&++n}return t}function ye(){let e=[],t=!1;for(;!c(r.CloseSquareBracket);)c(r.Colon)?(e.push(void 0),++n,t=!0):(e.push(P()),c(r.Colon)&&(++n,t=!0));if(e.length===0)throw SyntaxError(`Expected at least one argument for member/slice expression`);if(t){if(e.length>3)throw SyntaxError(`Expected 0-3 arguments for slice expression`);return new ae(...e)}return e[0]}function z(t){for(;c(r.Dot)||c(r.OpenSquareBracket);){let i=e[n];++n;let o,s=i.type===r.OpenSquareBracket;if(s)o=ye(),a(r.CloseSquareBracket,`Expected closing square bracket`);else if(o=B(),o.type!==`Identifier`)throw SyntaxError(`Expected identifier following dot operator`);t=new x(t,o,s)}return t}function be(){let t=xe();for(;c(r.MultiplicativeBinaryOperator);){let r=e[n++],i=xe();t=new ee(r,t,i)}return t}function xe(){let e=Se();for(;u(`is`);){++n;let t=u(`not`);t&&++n;let r=B();if(!(r instanceof C))throw SyntaxError(`Expected identifier for the test`);e=new re(e,t,r)}return e}function Se(){let e=_e();for(;c(r.Pipe);){++n;let t=B();if(!(t instanceof C))throw SyntaxError(`Expected identifier for the filter`);c(r.OpenParen)&&(t=L(t)),e=new te(e,t)}return e}function B(){let t=e[n++];switch(t.type){case r.NumericLiteral:{let e=t.value;return e.includes(`.`)?new E(Number(e)):new T(Number(e))}case r.StringLiteral:{let i=t.value;for(;c(r.StringLiteral);)i+=e[n++].value;return new D(i)}case r.Identifier:return new C(t.value);case r.OpenParen:{let e=de();return a(r.CloseParen,"Expected closing parenthesis, got ${tokens[current].type} instead."),e}case r.OpenSquareBracket:{let e=[];for(;!c(r.CloseSquareBracket);)e.push(P()),c(r.Comma)&&++n;return++n,new O(e)}case r.OpenCurlyBracket:{let e=new Map;for(;!c(r.CloseCurlyBracket);){let t=P();a(r.Colon,`Expected colon between key and value in object literal`);let i=P();e.set(t,i),c(r.Comma)&&++n}return++n,new A(e)}default:throw SyntaxError(`Unexpected token: ${t.type}`)}}for(;n=0?(t=(t??=0)<0?Math.max(e.length+t,0):Math.min(t,e.length),n=(n??=e.length)<0?Math.max(e.length+n,0):Math.min(n,e.length)):(t=(t??=e.length-1)<0?Math.max(e.length+t,-1):Math.min(t,e.length-1),n=(n??=-1)<-1?Math.max(e.length+n,-1):Math.min(n,e.length-1));let a=[];for(let o=t;i*oe.toUpperCase())}function fe(e){return P(new Date,e)}function P(e,t){let n=new Intl.DateTimeFormat(void 0,{month:`long`}),r=new Intl.DateTimeFormat(void 0,{month:`short`}),i=e=>e<10?`0`+e:e.toString();return t.replace(/%[YmdbBHM%]/g,t=>{switch(t){case`%Y`:return e.getFullYear().toString();case`%m`:return i(e.getMonth()+1);case`%d`:return i(e.getDate());case`%b`:return r.format(e);case`%B`:return n.format(e);case`%H`:return i(e.getHours());case`%M`:return i(e.getMinutes());case`%%`:return`%`;default:return t}})}function pe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function F(e,t,n,r){if(r===0)return e;let i=r==null||r<0?1/0:r,a=t.length===0?RegExp(`(?=)`,`gu`):new RegExp(pe(t),`gu`);return e.replaceAll(a,e=>i>0?(--i,n):e)}var me=class extends Error{},he=class extends Error{},ge=class{type=`RuntimeValue`;value;builtins=new Map;constructor(e=void 0){this.value=e}__bool__(){return new R(!!this.value)}toString(){return String(this.value)}},I=class extends ge{type=`IntegerValue`},_e=class extends ge{type=`FloatValue`;toString(){return this.value%1==0?this.value.toFixed(1):this.value.toString()}},L=class extends ge{type=`StringValue`;builtins=new Map([[`upper`,new xe(()=>new L(this.value.toUpperCase()))],[`lower`,new xe(()=>new L(this.value.toLowerCase()))],[`strip`,new xe(()=>new L(this.value.trim()))],[`title`,new xe(()=>new L(de(this.value)))],[`capitalize`,new xe(()=>new L(this.value.charAt(0).toUpperCase()+this.value.slice(1)))],[`length`,new I(this.value.length)],[`rstrip`,new xe(()=>new L(this.value.trimEnd()))],[`lstrip`,new xe(()=>new L(this.value.trimStart()))],[`startswith`,new xe(e=>{if(e.length===0)throw Error(`startswith() requires at least one argument`);let t=e[0];if(t instanceof L)return new R(this.value.startsWith(t.value));if(t instanceof z){for(let e of t.value){if(!(e instanceof L))throw Error(`startswith() tuple elements must be strings`);if(this.value.startsWith(e.value))return new R(!0)}return new R(!1)}throw Error(`startswith() argument must be a string or tuple of strings`)})],[`endswith`,new xe(e=>{if(e.length===0)throw Error(`endswith() requires at least one argument`);let t=e[0];if(t instanceof L)return new R(this.value.endsWith(t.value));if(t instanceof z){for(let e of t.value){if(!(e instanceof L))throw Error(`endswith() tuple elements must be strings`);if(this.value.endsWith(e.value))return new R(!0)}return new R(!1)}throw Error(`endswith() argument must be a string or tuple of strings`)})],[`split`,new xe(e=>{let t=e[0]??new Se;if(!(t instanceof L||t instanceof Se))throw Error(`sep argument must be a string or null`);let n=e[1]??new I(-1);if(!(n instanceof I))throw Error(`maxsplit argument must be a number`);let r=[];if(t instanceof Se){let e=this.value.trimStart();for(let{0:t,index:i}of e.matchAll(/\S+/g)){if(n.value!==-1&&r.length>=n.value&&i!==void 0){r.push(t+e.slice(i+t.length));break}r.push(t)}}else{if(t.value===``)throw Error(`empty separator`);r=this.value.split(t.value),n.value!==-1&&r.length>n.value&&r.push(r.splice(n.value).join(t.value))}return new z(r.map(e=>new L(e)))})],[`replace`,new xe(e=>{if(e.length<2)throw Error(`replace() requires at least two arguments`);let t=e[0],n=e[1];if(!(t instanceof L&&n instanceof L))throw Error(`replace() arguments must be strings`);let r;if(r=e.length>2?e[2].type===`KeywordArgumentsValue`?e[2].value.get(`count`)??new Se:e[2]:new Se,!(r instanceof I||r instanceof Se))throw Error(`replace() count argument must be a number or null`);return new L(F(this.value,t.value,n.value,r.value))})]])},R=class extends ge{type=`BooleanValue`},ve=class extends ge{type=`ObjectValue`;__bool__(){return new R(this.value.size>0)}builtins=new Map([[`get`,new xe(([e,t])=>{if(!(e instanceof L))throw Error(`Object key must be a string: got ${e.type}`);return this.value.get(e.value)??t??new Se})],[`items`,new xe(()=>this.items())],[`keys`,new xe(()=>this.keys())],[`values`,new xe(()=>this.values())]]);items(){return new z(Array.from(this.value.entries()).map(([e,t])=>new z([new L(e),t])))}keys(){return new z(Array.from(this.value.keys()).map(e=>new L(e)))}values(){return new z(Array.from(this.value.values()))}},ye=class extends ve{type=`KeywordArgumentsValue`},z=class extends ge{type=`ArrayValue`;builtins=new Map([[`length`,new I(this.value.length)]]);__bool__(){return new R(this.value.length>0)}},be=class extends z{type=`TupleValue`},xe=class extends ge{type=`FunctionValue`},Se=class extends ge{type=`NullValue`},B=class extends ge{type=`UndefinedValue`},Ce=class{constructor(e){this.parent=e}variables=new Map([[`namespace`,new xe(e=>{if(e.length===0)return new ve(new Map);if(e.length!==1||!(e[0]instanceof ve))throw Error("`namespace` expects either zero arguments or a single object argument");return e[0]})]]);tests=new Map([[`boolean`,e=>e.type===`BooleanValue`],[`callable`,e=>e instanceof xe],[`odd`,e=>{if(!(e instanceof I))throw Error(`cannot odd on ${e.type}`);return e.value%2!=0}],[`even`,e=>{if(!(e instanceof I))throw Error(`cannot even on ${e.type}`);return e.value%2==0}],[`false`,e=>e.type===`BooleanValue`&&!e.value],[`true`,e=>e.type===`BooleanValue`&&e.value],[`none`,e=>e.type===`NullValue`],[`string`,e=>e.type===`StringValue`],[`number`,e=>e instanceof I||e instanceof _e],[`integer`,e=>e instanceof I],[`iterable`,e=>e.type===`ArrayValue`||e.type===`StringValue`],[`mapping`,e=>e.type===`ObjectValue`],[`lower`,e=>{let t=e.value;return e.type===`StringValue`&&t===t.toLowerCase()}],[`upper`,e=>{let t=e.value;return e.type===`StringValue`&&t===t.toUpperCase()}],[`none`,e=>e.type===`NullValue`],[`defined`,e=>e.type!==`UndefinedValue`],[`undefined`,e=>e.type===`UndefinedValue`],[`equalto`,(e,t)=>e.value===t.value],[`eq`,(e,t)=>e.value===t.value]]);set(e,t){return this.declareVariable(e,Ee(t))}declareVariable(e,t){if(this.variables.has(e))throw SyntaxError(`Variable already declared: ${e}`);return this.variables.set(e,t),t}setVariable(e,t){return this.variables.set(e,t),t}resolve(e){if(this.variables.has(e))return this;if(this.parent)return this.parent.resolve(e);throw Error(`Unknown variable: ${e}`)}lookupVariable(e){try{return this.resolve(e).variables.get(e)??new B}catch{return new B}}};function we(e){e.set(`false`,!1),e.set(`true`,!0),e.set(`none`,null),e.set(`raise_exception`,e=>{throw Error(e)}),e.set(`range`,le),e.set(`strftime_now`,fe),e.set(`True`,!0),e.set(`False`,!1),e.set(`None`,null)}var Te=class{global;constructor(e){this.global=e??new Ce}run(e){return this.evaluate(e,this.global)}evaluateBinaryExpression(e,t){let n=this.evaluate(e.left,t);switch(e.operator.value){case`and`:return n.__bool__().value?this.evaluate(e.right,t):n;case`or`:return n.__bool__().value?n:this.evaluate(e.right,t)}let r=this.evaluate(e.right,t);switch(e.operator.value){case`==`:return new R(n.value==r.value);case`!=`:return new R(n.value!=r.value)}if(n instanceof B||r instanceof B){if(r instanceof B&&[`in`,`not in`].includes(e.operator.value))return new R(e.operator.value===`not in`);throw Error(`Cannot perform operation ${e.operator.value} on undefined values`)}else if(n instanceof Se||r instanceof Se)throw Error(`Cannot perform operation on null values`);else if(e.operator.value===`~`)return new L(n.value.toString()+r.value.toString());else if((n instanceof I||n instanceof _e)&&(r instanceof I||r instanceof _e)){let t=n.value,i=r.value;switch(e.operator.value){case`+`:case`-`:case`*`:{let a=e.operator.value===`+`?t+i:e.operator.value===`-`?t-i:t*i,o=n instanceof _e||r instanceof _e;return o?new _e(a):new I(a)}case`/`:return new _e(t/i);case`%`:{let e=t%i,a=n instanceof _e||r instanceof _e;return a?new _e(e):new I(e)}case`<`:return new R(t`:return new R(t>i);case`>=`:return new R(t>=i);case`<=`:return new R(t<=i)}}else if(n instanceof z&&r instanceof z)switch(e.operator.value){case`+`:return new z(n.value.concat(r.value))}else if(r instanceof z){let t=r.value.find(e=>e.value===n.value)!==void 0;switch(e.operator.value){case`in`:return new R(t);case`not in`:return new R(!t)}}if(n instanceof L||r instanceof L)switch(e.operator.value){case`+`:return new L(n.value.toString()+r.value.toString())}if(n instanceof L&&r instanceof L)switch(e.operator.value){case`in`:return new R(r.value.includes(n.value));case`not in`:return new R(!r.value.includes(n.value))}if(n instanceof L&&r instanceof ve)switch(e.operator.value){case`in`:return new R(r.value.has(n.value));case`not in`:return new R(!r.value.has(n.value))}throw SyntaxError(`Unknown operator "${e.operator.value}" between ${n.type} and ${r.type}`)}evaluateArguments(e,t){let n=[],r=new Map;for(let i of e)if(i.type===`SpreadExpression`){let e=i,r=this.evaluate(e.argument,t);if(!(r instanceof z))throw Error(`Cannot unpack non-iterable type: ${r.type}`);for(let e of r.value)n.push(e)}else if(i.type===`KeywordArgumentExpression`){let e=i;r.set(e.key.value,this.evaluate(e.value,t))}else{if(r.size>0)throw Error(`Positional arguments must come before keyword arguments`);n.push(this.evaluate(i,t))}return[n,r]}applyFilter(e,t,n){if(t.type===`Identifier`){let r=t;if(r.value===`tojson`)return new L(De(e));if(e instanceof z)switch(r.value){case`list`:return e;case`first`:return e.value[0];case`last`:return e.value[e.value.length-1];case`length`:return new I(e.value.length);case`reverse`:return new z(e.value.reverse());case`sort`:return new z(e.value.sort((e,t)=>{if(e.type!==t.type)throw Error(`Cannot compare different types: ${e.type} and ${t.type}`);switch(e.type){case`IntegerValue`:case`FloatValue`:return e.value-t.value;case`StringValue`:return e.value.localeCompare(t.value);default:throw Error(`Cannot compare type: ${e.type}`)}}));case`join`:return new L(e.value.map(e=>e.value).join(``));case`string`:return new L(De(e));case`unique`:{let t=new Set,n=[];for(let r of e.value)t.has(r.value)||(t.add(r.value),n.push(r));return new z(n)}default:throw Error(`Unknown ArrayValue filter: ${r.value}`)}else if(e instanceof L)switch(r.value){case`length`:case`upper`:case`lower`:case`title`:case`capitalize`:{let t=e.builtins.get(r.value);if(t instanceof xe)return t.value([],n);if(t instanceof I)return t;throw Error(`Unknown StringValue filter: ${r.value}`)}case`trim`:return new L(e.value.trim());case`indent`:return new L(e.value.split(` `).map((e,t)=>t===0||e.length===0?e:` `+e).join(` -`));case`join`:case`string`:return n;default:throw Error(`Unknown StringValue filter: ${t.value}`)}else if(n instanceof P)switch(t.value){case`abs`:return new P(Math.abs(n.value));default:throw Error(`Unknown NumericValue filter: ${t.value}`)}else if(n instanceof I)switch(t.value){case`items`:return new me(Array.from(n.value.entries()).map(([e,t])=>new me([new F(e),t])));case`length`:return new P(n.value.size);default:throw Error(`Unknown ObjectValue filter: ${t.value}`)}throw Error(`Cannot apply filter "${t.value}" to type: ${n.type}`)}else if(e.filter.type===`CallExpression`){let r=e.filter;if(r.callee.type!==`Identifier`)throw Error(`Unknown filter: ${r.callee.type}`);let i=r.callee.value;if(i===`tojson`){let[,e]=this.evaluateArguments(r.args,t),i=e.get(`indent`)??new _e;if(!(i instanceof P||i instanceof _e))throw Error(`If set, indent must be a number`);return new F(xe(n,i.value))}else if(i===`join`){let e;if(n instanceof F)e=Array.from(n.value);else if(n instanceof me)e=n.value.map(e=>e.value);else throw Error(`Cannot apply filter "${i}" to type: ${n.type}`);let[a,o]=this.evaluateArguments(r.args,t),s=a.at(0)??o.get(`separator`)??new F(``);if(!(s instanceof F))throw Error(`separator must be a string`);return new F(e.join(s.value))}if(n instanceof me){switch(i){case`selectattr`:case`rejectattr`:{let e=i===`selectattr`;if(n.value.some(e=>!(e instanceof I)))throw Error(`\`${i}\` can only be applied to array of objects`);if(r.args.some(e=>e.type!==`StringLiteral`))throw Error(`arguments of \`${i}\` must be strings`);let[a,o,s]=r.args.map(e=>this.evaluate(e,t)),c;if(o){let e=t.tests.get(o.value);if(!e)throw Error(`Unknown test: ${o.value}`);c=e}else c=(...e)=>e[0].__bool__().value;let l=n.value.filter(t=>{let n=t.value.get(a.value),r=n?c(n,s):!1;return e?r:!r});return new me(l)}case`map`:{let[,e]=this.evaluateArguments(r.args,t);if(e.has(`attribute`)){let t=e.get(`attribute`);if(!(t instanceof F))throw Error(`attribute must be a string`);let r=e.get(`default`),i=n.value.map(e=>{if(!(e instanceof I))throw Error(`items in map must be an object`);return e.value.get(t.value)??r??new ve});return new me(i)}else throw Error("`map` expressions without `attribute` set are not currently supported.")}}throw Error(`Unknown ArrayValue filter: ${i}`)}else if(n instanceof F){switch(i){case`indent`:{let[e,i]=this.evaluateArguments(r.args,t),a=e.at(0)??i.get(`width`)??new P(4);if(!(a instanceof P))throw Error(`width must be a number`);let o=e.at(1)??i.get(`first`)??new fe(!1),s=e.at(2)??i.get(`blank`)??new fe(!1),c=n.value.split(` -`),l=` `.repeat(a.value),u=c.map((e,t)=>!o.value&&t===0||!s.value&&e.length===0?e:l+e);return new F(u.join(` -`))}}throw Error(`Unknown StringValue filter: ${i}`)}else throw Error(`Cannot apply filter "${i}" to type: ${n.type}`)}throw Error(`Unknown filter: ${e.filter.type}`)}evaluateTestExpression(e,t){let n=this.evaluate(e.operand,t),r=t.tests.get(e.test.value);if(!r)throw Error(`Unknown test: ${e.test.value}`);let i=r(n);return new fe(e.negate?!i:i)}evaluateUnaryExpression(e,t){let n=this.evaluate(e.argument,t);switch(e.operator.value){case`not`:return new fe(!n.value);default:throw SyntaxError(`Unknown operator: ${e.operator.value}`)}}evalProgram(e,t){return this.evaluateBlock(e.body,t)}evaluateBlock(e,t){let n=``;for(let r of e){let e=this.evaluate(r,t);e.type!==`NullValue`&&e.type!==`UndefinedValue`&&(n+=e.value)}return new F(n)}evaluateIdentifier(e,t){return t.lookupVariable(e.value)}evaluateCallExpression(e,t){let[n,r]=this.evaluateArguments(e.args,t);r.size>0&&n.push(new pe(r));let i=this.evaluate(e.callee,t);if(i.type!==`FunctionValue`)throw Error(`Cannot call something that is not a function: got ${i.type}`);return i.value(n,t)}evaluateSliceExpression(e,t,n){if(!(e instanceof me||e instanceof F))throw Error(`Slice object must be an array or string`);let r=this.evaluate(t.start,n),i=this.evaluate(t.stop,n),a=this.evaluate(t.step,n);if(!(r instanceof P||r instanceof ve))throw Error(`Slice start must be numeric or undefined`);if(!(i instanceof P||i instanceof ve))throw Error(`Slice stop must be numeric or undefined`);if(!(a instanceof P||a instanceof ve))throw Error(`Slice step must be numeric or undefined`);return e instanceof me?new me(N(e.value,r.value,i.value,a.value)):new F(N(Array.from(e.value),r.value,i.value,a.value).join(``))}evaluateMemberExpression(e,t){let n=this.evaluate(e.object,t),r;if(e.computed){if(e.property.type===`SliceExpression`)return this.evaluateSliceExpression(n,e.property,t);r=this.evaluate(e.property,t)}else r=new F(e.property.value);let i;if(n instanceof I){if(!(r instanceof F))throw Error(`Cannot access property with non-string: got ${r.type}`);i=n.value.get(r.value)??n.builtins.get(r.value)}else if(n instanceof me||n instanceof F)if(r instanceof P)i=n.value.at(r.value),n instanceof F&&(i=new F(n.value.at(r.value)));else if(r instanceof F)i=n.builtins.get(r.value);else throw Error(`Cannot access property with non-string/non-number: got ${r.type}`);else{if(!(r instanceof F))throw Error(`Cannot access property with non-string: got ${r.type}`);i=n.builtins.get(r.value)}return i instanceof de?i:new ve}evaluateSet(e,t){let n=e.value?this.evaluate(e.value,t):this.evaluateBlock(e.body,t);if(e.assignee.type===`Identifier`){let r=e.assignee.value;t.setVariable(r,n)}else if(e.assignee.type===`MemberExpression`){let r=e.assignee,i=this.evaluate(r.object,t);if(!(i instanceof I))throw Error(`Cannot assign to member of non-object`);if(r.property.type!==`Identifier`)throw Error(`Cannot assign to member with non-identifier property`);i.value.set(r.property.value,n)}else throw Error(`Invalid LHS inside assignment expression: ${JSON.stringify(e.assignee)}`);return new _e}evaluateIf(e,t){let n=this.evaluate(e.test,t);return this.evaluateBlock(n.__bool__().value?e.body:e.alternate,t)}evaluateFor(e,t){let n=new L(t),r,i;if(e.iterable.type===`SelectExpression`){let t=e.iterable;i=this.evaluate(t.iterable,n),r=t.test}else i=this.evaluate(e.iterable,n);if(!(i instanceof me))throw Error(`Expected iterable type in for loop: got ${i.type}`);let a=[],o=[];for(let t=0;tt.setVariable(e.loopvar.value,c);else if(e.loopvar.type===`TupleLiteral`){let t=e.loopvar;if(c.type!==`ArrayValue`)throw Error(`Cannot unpack non-iterable type: ${c.type}`);let n=c;if(t.value.length!==n.value.length)throw Error(`Too ${t.value.length>n.value.length?`few`:`many`} items to unpack`);l=e=>{for(let r=0;r0?a[t-1]:new ve],[`nextitem`,t{let r=new L(n);t=t.slice();let i;t.at(-1)?.type===`KeywordArgumentsValue`&&(i=t.pop());for(let n=0;nthis.evaluate(e,t)));case`TupleLiteral`:return new he(e.value.map(e=>this.evaluate(e,t)));case`ObjectLiteral`:{let n=new Map;for(let[r,i]of e.value){let e=this.evaluate(r,t);if(!(e instanceof F))throw Error(`Object keys must be strings: got ${e.type}`);n.set(e.value,this.evaluate(i,t))}return new I(n)}case`Identifier`:return this.evaluateIdentifier(e,t);case`CallExpression`:return this.evaluateCallExpression(e,t);case`MemberExpression`:return this.evaluateMemberExpression(e,t);case`UnaryExpression`:return this.evaluateUnaryExpression(e,t);case`BinaryExpression`:return this.evaluateBinaryExpression(e,t);case`FilterExpression`:return this.evaluateFilterExpression(e,t);case`TestExpression`:return this.evaluateTestExpression(e,t);default:throw SyntaxError(`Unknown node type: ${e.type}`)}}};function be(e){switch(typeof e){case`number`:return new P(e);case`string`:return new F(e);case`boolean`:return new fe(e);case`undefined`:return new ve;case`object`:return e===null?new _e:Array.isArray(e)?new me(e.map(be)):new I(new Map(Object.entries(e).map(([e,t])=>[e,be(t)])));case`function`:return new ge((t,n)=>{let r=e(...t.map(e=>e.value))??null;return be(r)});default:throw Error(`Cannot convert to runtime value: ${e}`)}}function xe(e,t,n){let r=n??0;switch(e.type){case`NullValue`:case`UndefinedValue`:return`null`;case`NumericValue`:case`StringValue`:case`BooleanValue`:return JSON.stringify(e.value);case`ArrayValue`:case`ObjectValue`:{let n=t?` `.repeat(t):``,i=` -`+n.repeat(r),a=i+n;if(e.type===`ArrayValue`){let n=e.value.map(e=>xe(e,t,r+1));return t?`[${a}${n.join(`,${a}`)}${i}]`:`[${n.join(`, `)}]`}else{let n=Array.from(e.value.entries()).map(([e,n])=>{let i=`"${e}": ${xe(n,t,r+1)}`;return t?`${a}${i}`:i});return t?`{${n.join(`,`)}${i}}`:`{${n.join(`, `)}}`}}default:throw Error(`Cannot convert to JSON: ${e.type}`)}}var Se=` -`,Ce=`{%- `,we=` -%}`,Te={MultiplicativeBinaryOperator:2,AdditiveBinaryOperator:1,ComparisonBinaryOperator:0};function Ee(e,t=` `){let n=typeof t==`number`?` `.repeat(t):t,r=Oe(e.body,0,n);return r.replace(/\n$/,``)}function De(...e){return Ce+e.join(` `)+we}function Oe(e,t,n){return e.map(e=>ke(e,t,n)).join(Se)}function ke(e,t,n){let r=n.repeat(t);switch(e.type){case`Program`:return Oe(e.body,t,n);case`If`:return Ae(e,t,n);case`For`:return je(e,t,n);case`Set`:return Me(e,t,n);case`Macro`:return Ne(e,t,n);case`Break`:return r+De(`break`);case`Continue`:return r+De(`continue`);default:return r+`{{- `+R(e)+` -}}`}}function Ae(e,t,n){let r=n.repeat(t),i=[],a=e;for(;a&&(i.push({test:a.test,body:a.body}),a.alternate.length===1&&a.alternate[0].type===`If`);)a=a.alternate[0];let o=r+De(`if`,R(i[0].test))+Se+Oe(i[0].body,t+1,n);for(let e=1;e0&&(o+=Se+r+De(`else`)+Se+Oe(a.alternate,t+1,n)),o+=Se+r+De(`endif`),o}function je(e,t,n){let r=n.repeat(t),i=``;if(e.iterable.type===`SelectExpression`){let t=e.iterable;i=`${R(t.iterable)} if ${R(t.test)}`}else i=R(e.iterable);let a=r+De(`for`,R(e.loopvar),`in`,i)+Se+Oe(e.body,t+1,n);return e.defaultBlock.length>0&&(a+=Se+r+De(`else`)+Se+Oe(e.defaultBlock,t+1,n)),a+=Se+r+De(`endfor`),a}function Me(e,t,n){let r=n.repeat(t),i=R(e.assignee),a=e.value?R(e.value):``,o=r+De(`set`,`${i}${e.value?` = `+a:``}`);return e.body.length===0?o:o+Se+Oe(e.body,t+1,n)+Se+r+De(`endset`)}function Ne(e,t,n){let r=n.repeat(t),i=e.args.map(R).join(`, `);return r+De(`macro`,`${e.name.value}(${i})`)+Se+Oe(e.body,t+1,n)+Se+r+De(`endmacro`)}function R(e,t=-1){switch(e.type){case`Identifier`:return e.value;case`NullLiteral`:return`none`;case`NumericLiteral`:case`BooleanLiteral`:return`${e.value}`;case`StringLiteral`:return JSON.stringify(e.value);case`BinaryExpression`:{let n=e,r=Te[n.operator.type]??0,i=R(n.left,r),a=R(n.right,r+1),o=`${i} ${n.operator.value} ${a}`;return rR(e,-1)).join(`, `);return`${R(t.callee,-1)}(${n})`}case`MemberExpression`:{let t=e,n=R(t.object,-1);t.object.type!==`Identifier`&&(n=`(${n})`);let r=R(t.property,-1);return!t.computed&&t.property.type!==`Identifier`&&(r=`(${r})`),t.computed?`${n}[${r}]`:`${n}.${r}`}case`FilterExpression`:{let t=e,n=R(t.operand,1/0);return t.filter.type===`CallExpression`?`${n} | ${R(t.filter,-1)}`:`${n} | ${t.filter.value}`}case`SelectExpression`:{let t=e;return`${R(t.iterable,-1)} | select(${R(t.test,-1)})`}case`TestExpression`:{let t=e;return`${R(t.operand,-1)} is${t.negate?` not`:``} ${t.test.value}`}case`ArrayLiteral`:case`TupleLiteral`:{let t=e.value.map(e=>R(e,-1)),n=e.type===`ArrayLiteral`?`[]`:`()`;return`${n[0]}${t.join(`, `)}${n[1]}`}case`ObjectLiteral`:{let t=Array.from(e.value.entries()).map(([e,t])=>`${R(e,-1)}: ${R(t,-1)}`);return`{ ${t.join(`, `)} }`}case`SliceExpression`:{let t=e,n=t.start?R(t.start,-1):``,r=t.stop?R(t.stop,-1):``,i=t.step?`:${R(t.step,-1)}`:``;return`${n}:${r}${i}`}case`KeywordArgumentExpression`:{let t=e;return`${t.key.value}=${R(t.value,-1)}`}case`If`:{let t=e,n=R(t.test,-1),r=R(t.body[0],0),i=R(t.alternate[0],-1);return`${r} if ${n} else ${i}`}default:throw Error(`Unknown expression type: ${e.type}`)}}var Pe=class{parsed;constructor(e){let t=d(e,{lstrip_blocks:!0,trim_blocks:!0});this.parsed=se(t)}render(e){let t=new L;if(t.set(`false`,!1),t.set(`true`,!0),t.set(`raise_exception`,e=>{throw Error(e)}),t.set(`range`,M),e)for(let[n,r]of Object.entries(e))t.set(n,r);let n=new ye(t),r=n.run(this.parsed);return r.value}format(e){return Ee(this.parsed,e?.indent||` `)}}},"./src/backends/onnx.js":(e,t,n)=>{var r;n.r(t),n.d(t,{Tensor:()=>s.Tensor,createInferenceSession:()=>g,deviceToExecutionProviders:()=>m,isONNXProxy:()=>y,isONNXTensor:()=>_});var i=n( +`));case`join`:case`string`:return e;case`int`:{let t=parseInt(e.value,10);return new I(isNaN(t)?0:t)}case`float`:{let t=parseFloat(e.value);return new _e(isNaN(t)?0:t)}default:throw Error(`Unknown StringValue filter: ${r.value}`)}else if(e instanceof I||e instanceof _e)switch(r.value){case`abs`:return e instanceof I?new I(Math.abs(e.value)):new _e(Math.abs(e.value));case`int`:return new I(Math.floor(e.value));case`float`:return new _e(e.value);default:throw Error(`Unknown NumericValue filter: ${r.value}`)}else if(e instanceof ve)switch(r.value){case`items`:return new z(Array.from(e.value.entries()).map(([e,t])=>new z([new L(e),t])));case`length`:return new I(e.value.size);default:throw Error(`Unknown ObjectValue filter: ${r.value}`)}else if(e instanceof R)switch(r.value){case`bool`:return new R(e.value);case`int`:return new I(e.value?1:0);case`float`:return new _e(e.value?1:0);case`string`:return new L(e.value?`true`:`false`);default:throw Error(`Unknown BooleanValue filter: ${r.value}`)}throw Error(`Cannot apply filter "${r.value}" to type: ${e.type}`)}else if(t.type===`CallExpression`){let r=t;if(r.callee.type!==`Identifier`)throw Error(`Unknown filter: ${r.callee.type}`);let i=r.callee.value;if(i===`tojson`){let[,t]=this.evaluateArguments(r.args,n),i=t.get(`indent`)??new Se;if(!(i instanceof I||i instanceof Se))throw Error(`If set, indent must be a number`);return new L(De(e,i.value))}else if(i===`join`){let t;if(e instanceof L)t=Array.from(e.value);else if(e instanceof z)t=e.value.map(e=>e.value);else throw Error(`Cannot apply filter "${i}" to type: ${e.type}`);let[a,o]=this.evaluateArguments(r.args,n),s=a.at(0)??o.get(`separator`)??new L(``);if(!(s instanceof L))throw Error(`separator must be a string`);return new L(t.join(s.value))}else if(i===`int`||i===`float`){let[t,a]=this.evaluateArguments(r.args,n),o=t.at(0)??a.get(`default`)??(i===`int`?new I(0):new _e(0));if(e instanceof L){let t=i===`int`?parseInt(e.value,10):parseFloat(e.value);return isNaN(t)?o:i===`int`?new I(t):new _e(t)}else if(e instanceof I||e instanceof _e)return e;else if(e instanceof R)return i===`int`?new I(e.value?1:0):new _e(e.value?1:0);else throw Error(`Cannot apply filter "${i}" to type: ${e.type}`)}else if(i===`default`){let[t,i]=this.evaluateArguments(r.args,n),a=t[0]??new L(``),o=t[1]??i.get(`boolean`)??new R(!1);if(!(o instanceof R))throw Error("`default` filter flag must be a boolean");return e instanceof B||o.value&&!e.__bool__().value?a:e}if(e instanceof z){switch(i){case`selectattr`:case`rejectattr`:{let t=i===`selectattr`;if(e.value.some(e=>!(e instanceof ve)))throw Error(`\`${i}\` can only be applied to array of objects`);if(r.args.some(e=>e.type!==`StringLiteral`))throw Error(`arguments of \`${i}\` must be strings`);let[a,o,s]=r.args.map(e=>this.evaluate(e,n)),c;if(o){let e=n.tests.get(o.value);if(!e)throw Error(`Unknown test: ${o.value}`);c=e}else c=(...e)=>e[0].__bool__().value;let l=e.value.filter(e=>{let n=e.value.get(a.value),r=n?c(n,s):!1;return t?r:!r});return new z(l)}case`map`:{let[,t]=this.evaluateArguments(r.args,n);if(t.has(`attribute`)){let n=t.get(`attribute`);if(!(n instanceof L))throw Error(`attribute must be a string`);let r=t.get(`default`),i=e.value.map(e=>{if(!(e instanceof ve))throw Error(`items in map must be an object`);return e.value.get(n.value)??r??new B});return new z(i)}else throw Error("`map` expressions without `attribute` set are not currently supported.")}}throw Error(`Unknown ArrayValue filter: ${i}`)}else if(e instanceof L){switch(i){case`indent`:{let[t,i]=this.evaluateArguments(r.args,n),a=t.at(0)??i.get(`width`)??new I(4);if(!(a instanceof I))throw Error(`width must be a number`);let o=t.at(1)??i.get(`first`)??new R(!1),s=t.at(2)??i.get(`blank`)??new R(!1),c=e.value.split(` +`),l=` `.repeat(a.value),u=c.map((e,t)=>!o.value&&t===0||!s.value&&e.length===0?e:l+e);return new L(u.join(` +`))}case`replace`:{let t=e.builtins.get(`replace`);if(!(t instanceof xe))throw Error(`replace filter not available`);let[i,a]=this.evaluateArguments(r.args,n);return t.value([...i,new ye(a)],n)}}throw Error(`Unknown StringValue filter: ${i}`)}else throw Error(`Cannot apply filter "${i}" to type: ${e.type}`)}throw Error(`Unknown filter: ${t.type}`)}evaluateFilterExpression(e,t){let n=this.evaluate(e.operand,t);return this.applyFilter(n,e.filter,t)}evaluateTestExpression(e,t){let n=this.evaluate(e.operand,t),r=t.tests.get(e.test.value);if(!r)throw Error(`Unknown test: ${e.test.value}`);let i=r(n);return new R(e.negate?!i:i)}evaluateSelectExpression(e,t){let n=this.evaluate(e.test,t);return n.__bool__().value?this.evaluate(e.lhs,t):new B}evaluateUnaryExpression(e,t){let n=this.evaluate(e.argument,t);switch(e.operator.value){case`not`:return new R(!n.value);default:throw SyntaxError(`Unknown operator: ${e.operator.value}`)}}evaluateTernaryExpression(e,t){let n=this.evaluate(e.condition,t);return n.__bool__().value?this.evaluate(e.trueExpr,t):this.evaluate(e.falseExpr,t)}evalProgram(e,t){return this.evaluateBlock(e.body,t)}evaluateBlock(e,t){let n=``;for(let r of e){let e=this.evaluate(r,t);e.type!==`NullValue`&&e.type!==`UndefinedValue`&&(n+=e.toString())}return new L(n)}evaluateIdentifier(e,t){return t.lookupVariable(e.value)}evaluateCallExpression(e,t){let[n,r]=this.evaluateArguments(e.args,t);r.size>0&&n.push(new ye(r));let i=this.evaluate(e.callee,t);if(i.type!==`FunctionValue`)throw Error(`Cannot call something that is not a function: got ${i.type}`);return i.value(n,t)}evaluateSliceExpression(e,t,n){if(!(e instanceof z||e instanceof L))throw Error(`Slice object must be an array or string`);let r=this.evaluate(t.start,n),i=this.evaluate(t.stop,n),a=this.evaluate(t.step,n);if(!(r instanceof I||r instanceof B))throw Error(`Slice start must be numeric or undefined`);if(!(i instanceof I||i instanceof B))throw Error(`Slice stop must be numeric or undefined`);if(!(a instanceof I||a instanceof B))throw Error(`Slice step must be numeric or undefined`);return e instanceof z?new z(ue(e.value,r.value,i.value,a.value)):new L(ue(Array.from(e.value),r.value,i.value,a.value).join(``))}evaluateMemberExpression(e,t){let n=this.evaluate(e.object,t),r;if(e.computed){if(e.property.type===`SliceExpression`)return this.evaluateSliceExpression(n,e.property,t);r=this.evaluate(e.property,t)}else r=new L(e.property.value);let i;if(n instanceof ve){if(!(r instanceof L))throw Error(`Cannot access property with non-string: got ${r.type}`);i=n.value.get(r.value)??n.builtins.get(r.value)}else if(n instanceof z||n instanceof L)if(r instanceof I)i=n.value.at(r.value),n instanceof L&&(i=new L(n.value.at(r.value)));else if(r instanceof L)i=n.builtins.get(r.value);else throw Error(`Cannot access property with non-string/non-number: got ${r.type}`);else{if(!(r instanceof L))throw Error(`Cannot access property with non-string: got ${r.type}`);i=n.builtins.get(r.value)}return i instanceof ge?i:new B}evaluateSet(e,t){let n=e.value?this.evaluate(e.value,t):this.evaluateBlock(e.body,t);if(e.assignee.type===`Identifier`){let r=e.assignee.value;t.setVariable(r,n)}else if(e.assignee.type===`TupleLiteral`){let r=e.assignee;if(!(n instanceof z))throw Error(`Cannot unpack non-iterable type in set: ${n.type}`);let i=n.value;if(i.length!==r.value.length)throw Error(`Too ${r.value.length>i.length?`few`:`many`} items to unpack in set`);for(let e=0;et.setVariable(e.loopvar.value,c);else if(e.loopvar.type===`TupleLiteral`){let t=e.loopvar;if(c.type!==`ArrayValue`)throw Error(`Cannot unpack non-iterable type: ${c.type}`);let n=c;if(t.value.length!==n.value.length)throw Error(`Too ${t.value.length>n.value.length?`few`:`many`} items to unpack`);l=e=>{for(let r=0;r0?a[t-1]:new B],[`nextitem`,t{let r=new Ce(n);t=t.slice();let i;t.at(-1)?.type===`KeywordArgumentsValue`&&(i=t.pop());for(let n=0;n{let r=new Ce(n);if(e.callerArgs)for(let n=0;nthis.evaluate(e,t)));case`TupleLiteral`:return new be(e.value.map(e=>this.evaluate(e,t)));case`ObjectLiteral`:{let n=new Map;for(let[r,i]of e.value){let e=this.evaluate(r,t);if(!(e instanceof L))throw Error(`Object keys must be strings: got ${e.type}`);n.set(e.value,this.evaluate(i,t))}return new ve(n)}case`Identifier`:return this.evaluateIdentifier(e,t);case`CallExpression`:return this.evaluateCallExpression(e,t);case`MemberExpression`:return this.evaluateMemberExpression(e,t);case`UnaryExpression`:return this.evaluateUnaryExpression(e,t);case`BinaryExpression`:return this.evaluateBinaryExpression(e,t);case`FilterExpression`:return this.evaluateFilterExpression(e,t);case`FilterStatement`:return this.evaluateFilterStatement(e,t);case`TestExpression`:return this.evaluateTestExpression(e,t);case`SelectExpression`:return this.evaluateSelectExpression(e,t);case`Ternary`:return this.evaluateTernaryExpression(e,t);case`Comment`:return new Se;default:throw SyntaxError(`Unknown node type: ${e.type}`)}}};function Ee(e){switch(typeof e){case`number`:return Number.isInteger(e)?new I(e):new _e(e);case`string`:return new L(e);case`boolean`:return new R(e);case`undefined`:return new B;case`object`:return e===null?new Se:Array.isArray(e)?new z(e.map(Ee)):new ve(new Map(Object.entries(e).map(([e,t])=>[e,Ee(t)])));case`function`:return new xe((t,n)=>{let r=e(...t.map(e=>e.value))??null;return Ee(r)});default:throw Error(`Cannot convert to runtime value: ${e}`)}}function De(e,t,n){let r=n??0;switch(e.type){case`NullValue`:case`UndefinedValue`:return`null`;case`IntegerValue`:case`FloatValue`:case`StringValue`:case`BooleanValue`:return JSON.stringify(e.value);case`ArrayValue`:case`ObjectValue`:{let n=t?` `.repeat(t):``,i=` +`+n.repeat(r),a=i+n;if(e.type===`ArrayValue`){let n=e.value.map(e=>De(e,t,r+1));return t?`[${a}${n.join(`,${a}`)}${i}]`:`[${n.join(`, `)}]`}else{let n=Array.from(e.value.entries()).map(([e,n])=>{let i=`"${e}": ${De(n,t,r+1)}`;return t?`${a}${i}`:i});return t?`{${n.join(`,`)}${i}}`:`{${n.join(`, `)}}`}}default:throw Error(`Cannot convert to JSON: ${e.type}`)}}var Oe=` +`,ke=`{%- `,Ae=` -%}`;function je(e){switch(e.operator.type){case`MultiplicativeBinaryOperator`:return 4;case`AdditiveBinaryOperator`:return 3;case`ComparisonBinaryOperator`:return 2;case`Identifier`:return e.operator.value===`and`?1:e.operator.value===`in`||e.operator.value===`not in`?2:0}return 0}function Me(e,t=` `){let n=typeof t==`number`?` `.repeat(t):t,r=Pe(e.body,0,n);return r.replace(/\n$/,``)}function Ne(...e){return ke+e.join(` `)+Ae}function Pe(e,t,n){return e.map(e=>Fe(e,t,n)).join(Oe)}function Fe(e,t,n){let r=n.repeat(t);switch(e.type){case`Program`:return Pe(e.body,t,n);case`If`:return Ie(e,t,n);case`For`:return Le(e,t,n);case`Set`:return Re(e,t,n);case`Macro`:return V(e,t,n);case`Break`:return r+Ne(`break`);case`Continue`:return r+Ne(`continue`);case`CallStatement`:return ze(e,t,n);case`FilterStatement`:return Be(e,t,n);case`Comment`:return r+`{# `+e.value+` #}`;default:return r+`{{- `+H(e)+` -}}`}}function Ie(e,t,n){let r=n.repeat(t),i=[],a=e;for(;a&&(i.push({test:a.test,body:a.body}),a.alternate.length===1&&a.alternate[0].type===`If`);)a=a.alternate[0];let o=r+Ne(`if`,H(i[0].test))+Oe+Pe(i[0].body,t+1,n);for(let e=1;e0&&(o+=Oe+r+Ne(`else`)+Oe+Pe(a.alternate,t+1,n)),o+=Oe+r+Ne(`endif`),o}function Le(e,t,n){let r=n.repeat(t),i=``;if(e.iterable.type===`SelectExpression`){let t=e.iterable;i=`${H(t.lhs)} if ${H(t.test)}`}else i=H(e.iterable);let a=r+Ne(`for`,H(e.loopvar),`in`,i)+Oe+Pe(e.body,t+1,n);return e.defaultBlock.length>0&&(a+=Oe+r+Ne(`else`)+Oe+Pe(e.defaultBlock,t+1,n)),a+=Oe+r+Ne(`endfor`),a}function Re(e,t,n){let r=n.repeat(t),i=H(e.assignee),a=e.value?H(e.value):``,o=r+Ne(`set`,`${i}${e.value?` = `+a:``}`);return e.body.length===0?o:o+Oe+Pe(e.body,t+1,n)+Oe+r+Ne(`endset`)}function V(e,t,n){let r=n.repeat(t),i=e.args.map(H).join(`, `);return r+Ne(`macro`,`${e.name.value}(${i})`)+Oe+Pe(e.body,t+1,n)+Oe+r+Ne(`endmacro`)}function ze(e,t,n){let r=n.repeat(t),i=e.callerArgs&&e.callerArgs.length>0?`(${e.callerArgs.map(H).join(`, `)})`:``,a=H(e.call),o=r+Ne(`call${i}`,a)+Oe;return o+=Pe(e.body,t+1,n)+Oe,o+=r+Ne(`endcall`),o}function Be(e,t,n){let r=n.repeat(t),i=e.filter.type===`Identifier`?e.filter.value:H(e.filter),a=r+Ne(`filter`,i)+Oe;return a+=Pe(e.body,t+1,n)+Oe,a+=r+Ne(`endfilter`),a}function H(e,t=-1){switch(e.type){case`SpreadExpression`:{let t=e;return`*${H(t.argument)}`}case`Identifier`:return e.value;case`IntegerLiteral`:return`${e.value}`;case`FloatLiteral`:return`${e.value}`;case`StringLiteral`:return JSON.stringify(e.value);case`BinaryExpression`:{let n=e,r=je(n),i=H(n.left,r),a=H(n.right,r+1),o=`${i} ${n.operator.value} ${a}`;return r`${H(e)}: ${H(t)}`);return`{${t.join(`, `)}}`}case`SliceExpression`:{let t=e,n=t.start?H(t.start):``,r=t.stop?H(t.stop):``,i=t.step?`:${H(t.step)}`:``;return`${n}:${r}${i}`}case`KeywordArgumentExpression`:{let t=e;return`${t.key.value}=${H(t.value)}`}case`Ternary`:{let n=e,r=`${H(n.trueExpr)} if ${H(n.condition,0)} else ${H(n.falseExpr)}`;return t>-1?`(${r})`:r}default:throw Error(`Unknown expression type: ${e.type}`)}}var Ve=class{parsed;constructor(e){let t=u(e,{lstrip_blocks:!0,trim_blocks:!0});this.parsed=ce(t)}render(e){let t=new Ce;if(we(t),e)for(let[n,r]of Object.entries(e))t.set(n,r);let n=new Te(t),r=n.run(this.parsed);return r.value}format(e){return Me(this.parsed,e?.indent||` `)}}},"./src/backends/onnx.js":(e,t,n)=>{var r;n.r(t),n.d(t,{Tensor:()=>s.Tensor,createInferenceSession:()=>g,deviceToExecutionProviders:()=>m,isONNXProxy:()=>y,isONNXTensor:()=>_});var i=n( /*! ../env.js */ `./src/env.js`),a=n( /*! onnxruntime-node */ @@ -2920,13 +2920,13 @@ let af={url:self.location.href};var sf={"onnxruntime-common":e=>{e.exports=ne}," /*! ./utils/core.js */ `./src/utils/core.js`),i=n( /*! ./utils/hub.js */ -`./src/utils/hub.js`);async function a(e,t){return await(0,i.getModelJSON)(e,`config.json`,!0,t)}function o(e){let t={},n={};switch(e.model_type){case`llava`:case`paligemma`:case`gemma3`:case`florence2`:case`llava_onevision`:case`idefics3`:case`ultravox`:case`smolvlm`:case`gemma3n`:n=o(e.text_config);break;case`moondream1`:n=o(e.phi_config);break;case`musicgen`:n=o(e.decoder);break;case`multi_modality`:n=o(e.language_config);break;case`gpt2`:case`gptj`:case`jais`:case`codegen`:case`gpt_bigcode`:t.num_heads=`n_head`,t.num_layers=`n_layer`,t.hidden_size=`n_embd`;break;case`gpt_neox`:case`stablelm`:case`opt`:case`falcon`:t.num_heads=`num_attention_heads`,t.num_layers=`num_hidden_layers`,t.hidden_size=`hidden_size`;break;case`llama`:case`olmo`:case`olmo2`:case`mobilellm`:case`granite`:case`cohere`:case`mistral`:case`starcoder2`:case`qwen2`:case`qwen2_vl`:case`phi`:case`phi3`:case`phi3_v`:case`llava_qwen2`:t.num_heads=`num_key_value_heads`,t.num_layers=`num_hidden_layers`,t.hidden_size=`hidden_size`,t.num_attention_heads=`num_attention_heads`;break;case`qwen3`:case`gemma`:case`gemma2`:case`gemma3_text`:case`gemma3n_text`:case`glm`:case`helium`:t.num_heads=`num_key_value_heads`,t.num_layers=`num_hidden_layers`,t.dim_kv=`head_dim`;break;case`openelm`:t.num_heads=`num_kv_heads`,t.num_layers=`num_transformer_layers`,t.dim_kv=`head_dim`;break;case`gpt_neo`:case`donut-swin`:t.num_heads=`num_heads`,t.num_layers=`num_layers`,t.hidden_size=`hidden_size`;break;case`bloom`:t.num_heads=`n_head`,t.num_layers=`n_layer`,t.hidden_size=`hidden_size`;break;case`mpt`:t.num_heads=`n_heads`,t.num_layers=`n_layers`,t.hidden_size=`d_model`;break;case`exaone`:t.num_heads=`num_key_value_heads`,t.num_layers=`num_layers`,t.dim_kv=`head_dim`,t.num_attention_heads=`num_attention_heads`;break;case`t5`:case`mt5`:case`longt5`:t.num_decoder_layers=`num_decoder_layers`,t.num_decoder_heads=`num_heads`,t.decoder_dim_kv=`d_kv`,t.num_encoder_layers=`num_layers`,t.num_encoder_heads=`num_heads`,t.encoder_dim_kv=`d_kv`;break;case`bart`:case`mbart`:case`marian`:case`whisper`:case`lite-whisper`:case`m2m_100`:case`blenderbot`:case`blenderbot-small`:case`florence2_language`:t.num_decoder_layers=`decoder_layers`,t.num_decoder_heads=`decoder_attention_heads`,t.decoder_hidden_size=`d_model`,t.num_encoder_layers=`encoder_layers`,t.num_encoder_heads=`encoder_attention_heads`,t.encoder_hidden_size=`d_model`;break;case`speecht5`:t.num_decoder_layers=`decoder_layers`,t.num_decoder_heads=`decoder_attention_heads`,t.decoder_hidden_size=`hidden_size`,t.num_encoder_layers=`encoder_layers`,t.num_encoder_heads=`encoder_attention_heads`,t.encoder_hidden_size=`hidden_size`;break;case`trocr`:t.num_encoder_layers=t.num_decoder_layers=`decoder_layers`,t.num_encoder_heads=t.num_decoder_heads=`decoder_attention_heads`,t.encoder_hidden_size=t.decoder_hidden_size=`d_model`;break;case`musicgen_decoder`:t.num_encoder_layers=t.num_decoder_layers=`num_hidden_layers`,t.num_encoder_heads=t.num_decoder_heads=`num_attention_heads`,t.encoder_hidden_size=t.decoder_hidden_size=`hidden_size`;break;case`moonshine`:t.num_decoder_layers=`decoder_num_hidden_layers`,t.num_decoder_heads=`decoder_num_key_value_heads`,t.num_encoder_layers=`encoder_num_hidden_layers`,t.num_encoder_heads=`encoder_num_key_value_heads`,t.encoder_hidden_size=t.decoder_hidden_size=`hidden_size`;break;case`vision-encoder-decoder`:let i=o(e.decoder),a=`num_decoder_layers`in i,s=(0,r.pick)(e,[`model_type`,`is_encoder_decoder`]);return a?(s.num_decoder_layers=i.num_decoder_layers,s.num_decoder_heads=i.num_decoder_heads,s.decoder_hidden_size=i.decoder_hidden_size,s.num_encoder_layers=i.num_encoder_layers,s.num_encoder_heads=i.num_encoder_heads,s.encoder_hidden_size=i.encoder_hidden_size):(s.num_layers=i.num_layers,s.num_heads=i.num_heads,s.hidden_size=i.hidden_size),s}let i={...n,...(0,r.pick)(e,[`model_type`,`multi_query`,`is_encoder_decoder`])};for(let n in t)i[n]=e[t[n]];return i}function s(e,{prefix:t=`past_key_values`,batch_size:n=1}={}){let r={},i=e.normalized_config;if(i.is_encoder_decoder&&`num_encoder_heads`in i&&`num_decoder_heads`in i){let e=i.encoder_dim_kv??i.encoder_hidden_size/i.num_encoder_heads,a=i.decoder_dim_kv??i.decoder_hidden_size/i.num_decoder_heads,o=[n,i.num_encoder_heads,0,e],s=[n,i.num_decoder_heads,0,a];for(let e=0;e{n.r(t),n.d(t,{apis:()=>v,env:()=>w});var r=n( +`./src/utils/hub.js`);async function a(e,t){return await(0,i.getModelJSON)(e,`config.json`,!0,t)}function o(e){let t={},n={};switch(e.model_type){case`llava`:case`paligemma`:case`gemma3`:case`florence2`:case`llava_onevision`:case`idefics3`:case`ultravox`:case`smolvlm`:case`gemma3n`:n=o(e.text_config);break;case`moondream1`:n=o(e.phi_config);break;case`musicgen`:n=o(e.decoder);break;case`multi_modality`:n=o(e.language_config);break;case`gpt2`:case`gptj`:case`jais`:case`codegen`:case`gpt_bigcode`:t.num_heads=`n_head`,t.num_layers=`n_layer`,t.hidden_size=`n_embd`;break;case`gpt_neox`:case`stablelm`:case`opt`:case`falcon`:t.num_heads=`num_attention_heads`,t.num_layers=`num_hidden_layers`,t.hidden_size=`hidden_size`;break;case`llama`:case`smollm3`:case`olmo`:case`olmo2`:case`mobilellm`:case`granite`:case`cohere`:case`mistral`:case`starcoder2`:case`qwen2`:case`qwen2_vl`:case`phi`:case`phi3`:case`phi3_v`:case`llava_qwen2`:t.num_heads=`num_key_value_heads`,t.num_layers=`num_hidden_layers`,t.hidden_size=`hidden_size`,t.num_attention_heads=`num_attention_heads`;break;case`qwen3`:case`gemma`:case`gemma2`:case`gemma3_text`:case`gemma3n_text`:case`glm`:case`helium`:case`ernie4_5`:t.num_heads=`num_key_value_heads`,t.num_layers=`num_hidden_layers`,t.dim_kv=`head_dim`;break;case`openelm`:t.num_heads=`num_kv_heads`,t.num_layers=`num_transformer_layers`,t.dim_kv=`head_dim`;break;case`gpt_neo`:case`donut-swin`:t.num_heads=`num_heads`,t.num_layers=`num_layers`,t.hidden_size=`hidden_size`;break;case`bloom`:t.num_heads=`n_head`,t.num_layers=`n_layer`,t.hidden_size=`hidden_size`;break;case`mpt`:t.num_heads=`n_heads`,t.num_layers=`n_layers`,t.hidden_size=`d_model`;break;case`exaone`:t.num_heads=`num_key_value_heads`,t.num_layers=`num_layers`,t.dim_kv=`head_dim`,t.num_attention_heads=`num_attention_heads`;break;case`t5`:case`mt5`:case`longt5`:t.num_decoder_layers=`num_decoder_layers`,t.num_decoder_heads=`num_heads`,t.decoder_dim_kv=`d_kv`,t.num_encoder_layers=`num_layers`,t.num_encoder_heads=`num_heads`,t.encoder_dim_kv=`d_kv`;break;case`bart`:case`mbart`:case`marian`:case`whisper`:case`lite-whisper`:case`m2m_100`:case`blenderbot`:case`blenderbot-small`:case`florence2_language`:t.num_decoder_layers=`decoder_layers`,t.num_decoder_heads=`decoder_attention_heads`,t.decoder_hidden_size=`d_model`,t.num_encoder_layers=`encoder_layers`,t.num_encoder_heads=`encoder_attention_heads`,t.encoder_hidden_size=`d_model`;break;case`speecht5`:t.num_decoder_layers=`decoder_layers`,t.num_decoder_heads=`decoder_attention_heads`,t.decoder_hidden_size=`hidden_size`,t.num_encoder_layers=`encoder_layers`,t.num_encoder_heads=`encoder_attention_heads`,t.encoder_hidden_size=`hidden_size`;break;case`trocr`:t.num_encoder_layers=t.num_decoder_layers=`decoder_layers`,t.num_encoder_heads=t.num_decoder_heads=`decoder_attention_heads`,t.encoder_hidden_size=t.decoder_hidden_size=`d_model`;break;case`musicgen_decoder`:t.num_encoder_layers=t.num_decoder_layers=`num_hidden_layers`,t.num_encoder_heads=t.num_decoder_heads=`num_attention_heads`,t.encoder_hidden_size=t.decoder_hidden_size=`hidden_size`;break;case`moonshine`:t.num_decoder_layers=`decoder_num_hidden_layers`,t.num_decoder_heads=`decoder_num_key_value_heads`,t.num_encoder_layers=`encoder_num_hidden_layers`,t.num_encoder_heads=`encoder_num_key_value_heads`,t.encoder_hidden_size=t.decoder_hidden_size=`hidden_size`;break;case`vision-encoder-decoder`:let i=o(e.decoder),a=`num_decoder_layers`in i,s=(0,r.pick)(e,[`model_type`,`is_encoder_decoder`]);return a?(s.num_decoder_layers=i.num_decoder_layers,s.num_decoder_heads=i.num_decoder_heads,s.decoder_hidden_size=i.decoder_hidden_size,s.num_encoder_layers=i.num_encoder_layers,s.num_encoder_heads=i.num_encoder_heads,s.encoder_hidden_size=i.encoder_hidden_size):(s.num_layers=i.num_layers,s.num_heads=i.num_heads,s.hidden_size=i.hidden_size),s}let i={...n,...(0,r.pick)(e,[`model_type`,`multi_query`,`is_encoder_decoder`])};for(let n in t)i[n]=e[t[n]];return i}function s(e,{prefix:t=`past_key_values`,batch_size:n=1}={}){let r={},i=e.normalized_config;if(i.is_encoder_decoder&&`num_encoder_heads`in i&&`num_decoder_heads`in i){let e=i.encoder_dim_kv??i.encoder_hidden_size/i.num_encoder_heads,a=i.decoder_dim_kv??i.decoder_hidden_size/i.num_decoder_heads,o=[n,i.num_encoder_heads,0,e],s=[n,i.num_decoder_heads,0,a];for(let e=0;e{n.r(t),n.d(t,{apis:()=>v,env:()=>w});var r=n( /*! node:fs */ `?db59`),i=n( /*! node:path */ `?383f`),a=n( /*! node:url */ -`?fa4b`);let o=`3.6.1`,s=typeof window<`u`&&window.document!==void 0,c=typeof self<`u`&&[`DedicatedWorkerGlobalScope`,`ServiceWorkerGlobalScope`,`SharedWorkerGlobalScope`].includes(self.constructor?.name),l=typeof self<`u`&&`caches`in self,u=typeof navigator<`u`&&`gpu`in navigator,d=typeof navigator<`u`&&`ml`in navigator,f=typeof process<`u`,p=f&&process?.release?.name===`node`,m=!T(r),h=!T(i),g=globalThis.Deno!==void 0,_=globalThis.Bun!==void 0,v=Object.freeze({IS_BROWSER_ENV:s,IS_WEBWORKER_ENV:c,IS_WEB_CACHE_AVAILABLE:l,IS_WEBGPU_AVAILABLE:u,IS_WEBNN_AVAILABLE:d,IS_PROCESS_AVAILABLE:f,IS_NODE_ENV:p,IS_FS_AVAILABLE:m,IS_PATH_AVAILABLE:h}),y=m&&h,b=`./`;if(y){let e=Object(af).url;e?b=i.dirname(i.dirname(a.fileURLToPath(e))):typeof __dirname<`u`&&(b=i.dirname(__dirname))}let x=y?i.join(b,`/.cache/`):null,S=`/models/`,C=y?i.join(b,S):S,w={version:o,backends:{onnx:{}},allowRemoteModels:!0,remoteHost:`https://huggingface.co/`,remotePathTemplate:`{model}/resolve/{revision}/`,allowLocalModels:!(s||c),localModelPath:C,useFS:m,useBrowserCache:l&&!g,useFSCache:m,cacheDir:x,useCustomCache:!1,customCache:null};function T(e){return Object.keys(e).length===0}},"./src/generation/configuration_utils.js":(e,t,n)=>{n.r(t),n.d(t,{GenerationConfig:()=>i});var r=n( +`?fa4b`);let o=`3.6.3`,s=typeof window<`u`&&window.document!==void 0,c=typeof self<`u`&&[`DedicatedWorkerGlobalScope`,`ServiceWorkerGlobalScope`,`SharedWorkerGlobalScope`].includes(self.constructor?.name),l=typeof self<`u`&&`caches`in self,u=typeof navigator<`u`&&`gpu`in navigator,d=typeof navigator<`u`&&`ml`in navigator,f=typeof process<`u`,p=f&&process?.release?.name===`node`,m=!T(r),h=!T(i),g=globalThis.Deno!==void 0,_=globalThis.Bun!==void 0,v=Object.freeze({IS_BROWSER_ENV:s,IS_WEBWORKER_ENV:c,IS_WEB_CACHE_AVAILABLE:l,IS_WEBGPU_AVAILABLE:u,IS_WEBNN_AVAILABLE:d,IS_PROCESS_AVAILABLE:f,IS_NODE_ENV:p,IS_FS_AVAILABLE:m,IS_PATH_AVAILABLE:h}),y=m&&h,b=`./`;if(y){let e=Object(af).url;e?b=i.dirname(i.dirname(a.fileURLToPath(e))):typeof __dirname<`u`&&(b=i.dirname(__dirname))}let x=y?i.join(b,`/.cache/`):null,S=`/models/`,C=y?i.join(b,S):S,w={version:o,backends:{onnx:{}},allowRemoteModels:!0,remoteHost:`https://huggingface.co/`,remotePathTemplate:`{model}/resolve/{revision}/`,allowLocalModels:!(s||c),localModelPath:C,useFS:m,useBrowserCache:l&&!g,useFSCache:m,cacheDir:x,useCustomCache:!1,customCache:null};function T(e){return Object.keys(e).length===0}},"./src/generation/configuration_utils.js":(e,t,n)=>{n.r(t),n.d(t,{GenerationConfig:()=>i});var r=n( /*! ../utils/core.js */ `./src/utils/core.js`);class i{max_length=20;max_new_tokens=null;min_length=0;min_new_tokens=null;early_stopping=!1;max_time=null;do_sample=!1;num_beams=1;num_beam_groups=1;penalty_alpha=null;use_cache=!0;temperature=1;top_k=50;top_p=1;typical_p=1;epsilon_cutoff=0;eta_cutoff=0;diversity_penalty=0;repetition_penalty=1;encoder_repetition_penalty=1;length_penalty=1;no_repeat_ngram_size=0;bad_words_ids=null;force_words_ids=null;renormalize_logits=!1;constraints=null;forced_bos_token_id=null;forced_eos_token_id=null;remove_invalid_values=!1;exponential_decay_length_penalty=null;suppress_tokens=null;streamer=null;begin_suppress_tokens=null;forced_decoder_ids=null;guidance_scale=null;num_return_sequences=1;output_attentions=!1;output_hidden_states=!1;output_scores=!1;return_dict_in_generate=!1;pad_token_id=null;bos_token_id=null;eos_token_id=null;encoder_no_repeat_ngram_size=0;decoder_start_token_id=null;generation_kwargs={};constructor(e){Object.assign(this,(0,r.pick)(e,Object.getOwnPropertyNames(this)))}}},"./src/generation/logits_process.js":(e,t,n)=>{n.r(t),n.d(t,{ClassifierFreeGuidanceLogitsProcessor:()=>v,ForcedBOSTokenLogitsProcessor:()=>l,ForcedEOSTokenLogitsProcessor:()=>u,LogitsProcessor:()=>o,LogitsProcessorList:()=>c,LogitsWarper:()=>s,MinLengthLogitsProcessor:()=>h,MinNewTokensLengthLogitsProcessor:()=>g,NoBadWordsLogitsProcessor:()=>_,NoRepeatNGramLogitsProcessor:()=>p,RepetitionPenaltyLogitsProcessor:()=>m,SuppressTokensAtBeginLogitsProcessor:()=>d,TemperatureLogitsWarper:()=>y,TopKLogitsWarper:()=>x,TopPLogitsWarper:()=>b,WhisperTimeStampLogitsProcessor:()=>f});var r=n( /*! ../utils/generic.js */ @@ -2952,7 +2952,7 @@ let af={url:self.location.href};var sf={"onnxruntime-common":e=>{e.exports=ne}," /*! ../env.js */ `./src/env.js`);class o{put(e){throw Error(`Not implemented`)}end(){throw Error(`Not implemented`)}}let s=a.apis.IS_PROCESS_AVAILABLE?e=>process.stdout.write(e):e=>console.log(e);class c extends o{constructor(e,{skip_prompt:t=!1,callback_function:n=null,token_callback_function:r=null,skip_special_tokens:i=!0,decode_kwargs:a={},...o}={}){super(),this.tokenizer=e,this.skip_prompt=t,this.callback_function=n??s,this.token_callback_function=r,this.decode_kwargs={skip_special_tokens:i,...a,...o},this.token_cache=[],this.print_len=0,this.next_tokens_are_prompt=!0}put(e){if(e.length>1)throw Error(`TextStreamer only supports batch size of 1`);let t=this.next_tokens_are_prompt;if(t&&(this.next_tokens_are_prompt=!1,this.skip_prompt))return;let n=e[0];this.token_callback_function?.(n),this.token_cache=(0,r.mergeArrays)(this.token_cache,n);let a=this.tokenizer.decode(this.token_cache,this.decode_kwargs),o;t||a.endsWith(` `)?(o=a.slice(this.print_len),this.token_cache=[],this.print_len=0):a.length>0&&(0,i.is_chinese_char)(a.charCodeAt(a.length-1))?(o=a.slice(this.print_len),this.print_len+=o.length):(o=a.slice(this.print_len,a.lastIndexOf(` `)+1),this.print_len+=o.length),this.on_finalized_text(o,!1)}end(){let e;if(this.token_cache.length>0){let t=this.tokenizer.decode(this.token_cache,this.decode_kwargs);e=t.slice(this.print_len),this.token_cache=[],this.print_len=0}else e=``;this.next_tokens_are_prompt=!0,this.on_finalized_text(e,!0)}on_finalized_text(e,t){e.length>0&&this.callback_function?.(e),t&&this.callback_function===s&&a.apis.IS_PROCESS_AVAILABLE&&this.callback_function?.(` -`)}}class l extends c{constructor(e,{skip_prompt:t=!1,callback_function:n=null,token_callback_function:r=null,on_chunk_start:i=null,on_chunk_end:a=null,on_finalize:o=null,time_precision:s=.02,skip_special_tokens:c=!0,decode_kwargs:l={}}={}){super(e,{skip_prompt:t,skip_special_tokens:c,callback_function:n,token_callback_function:r,decode_kwargs:l}),this.timestamp_begin=e.timestamp_begin,this.on_chunk_start=i,this.on_chunk_end=a,this.on_finalize=o,this.time_precision=s,this.waiting_for_timestamp=!1}put(e){if(e.length>1)throw Error(`WhisperTextStreamer only supports batch size of 1`);let t=e[0];if(t.length===1){let e=Number(t[0])-this.timestamp_begin;if(e>=0){let n=e*this.time_precision;this.waiting_for_timestamp?this.on_chunk_end?.(n):this.on_chunk_start?.(n),this.waiting_for_timestamp=!this.waiting_for_timestamp,this.token_callback_function?.(t);return}}return super.put(e)}end(){super.end(),this.on_finalize?.()}}},"./src/models.js":(e,t,n)=>{n.r(t),n.d(t,{ASTForAudioClassification:()=>jn,ASTModel:()=>An,ASTPreTrainedModel:()=>kn,AlbertForMaskedLM:()=>Ut,AlbertForQuestionAnswering:()=>Ht,AlbertForSequenceClassification:()=>Vt,AlbertModel:()=>Bt,AlbertPreTrainedModel:()=>zt,AutoModel:()=>lu,AutoModelForAudioClassification:()=>Ou,AutoModelForAudioFrameClassification:()=>Au,AutoModelForAudioTextToText:()=>zu,AutoModelForCTC:()=>Du,AutoModelForCausalLM:()=>gu,AutoModelForDepthEstimation:()=>Pu,AutoModelForDocumentQuestionAnswering:()=>ju,AutoModelForImageClassification:()=>bu,AutoModelForImageFeatureExtraction:()=>Lu,AutoModelForImageMatting:()=>Mu,AutoModelForImageSegmentation:()=>xu,AutoModelForImageTextToText:()=>Ru,AutoModelForImageToImage:()=>Nu,AutoModelForMaskGeneration:()=>Eu,AutoModelForMaskedLM:()=>_u,AutoModelForNormalEstimation:()=>Fu,AutoModelForObjectDetection:()=>wu,AutoModelForPoseEstimation:()=>Iu,AutoModelForQuestionAnswering:()=>vu,AutoModelForSemanticSegmentation:()=>Su,AutoModelForSeq2SeqLM:()=>fu,AutoModelForSequenceClassification:()=>uu,AutoModelForSpeechSeq2Seq:()=>pu,AutoModelForTextToSpectrogram:()=>mu,AutoModelForTextToWaveform:()=>hu,AutoModelForTokenClassification:()=>du,AutoModelForUniversalSegmentation:()=>Cu,AutoModelForVision2Seq:()=>yu,AutoModelForXVector:()=>ku,AutoModelForZeroShotObjectDetection:()=>Tu,BartForConditionalGeneration:()=>tn,BartForSequenceClassification:()=>nn,BartModel:()=>en,BartPretrainedModel:()=>$t,BaseModelOutput:()=>me,BeitForImageClassification:()=>Da,BeitModel:()=>Ea,BeitPreTrainedModel:()=>Ta,BertForMaskedLM:()=>_e,BertForQuestionAnswering:()=>ye,BertForSequenceClassification:()=>ve,BertForTokenClassification:()=>L,BertModel:()=>ge,BertPreTrainedModel:()=>he,BlenderbotForConditionalGeneration:()=>un,BlenderbotModel:()=>ln,BlenderbotPreTrainedModel:()=>cn,BlenderbotSmallForConditionalGeneration:()=>H,BlenderbotSmallModel:()=>fn,BlenderbotSmallPreTrainedModel:()=>dn,BloomForCausalLM:()=>Li,BloomModel:()=>Ii,BloomPreTrainedModel:()=>Fi,CLIPModel:()=>nr,CLIPPreTrainedModel:()=>tr,CLIPSegForImageSegmentation:()=>mr,CLIPSegModel:()=>pr,CLIPSegPreTrainedModel:()=>X,CLIPTextModel:()=>rr,CLIPTextModelWithProjection:()=>ir,CLIPVisionModel:()=>K,CLIPVisionModelWithProjection:()=>ar,CamembertForMaskedLM:()=>Xe,CamembertForQuestionAnswering:()=>$e,CamembertForSequenceClassification:()=>Ze,CamembertForTokenClassification:()=>Qe,CamembertModel:()=>Ye,CamembertPreTrainedModel:()=>Je,CausalLMOutput:()=>Gu,CausalLMOutputWithPast:()=>Ku,ChineseCLIPModel:()=>lr,ChineseCLIPPreTrainedModel:()=>cr,ClapAudioModelWithProjection:()=>mc,ClapModel:()=>fc,ClapPreTrainedModel:()=>dc,ClapTextModelWithProjection:()=>pc,CodeGenForCausalLM:()=>Fr,CodeGenModel:()=>Pr,CodeGenPreTrainedModel:()=>Nr,CohereForCausalLM:()=>ci,CohereModel:()=>si,CoherePreTrainedModel:()=>oi,ConvBertForMaskedLM:()=>Be,ConvBertForQuestionAnswering:()=>He,ConvBertForSequenceClassification:()=>z,ConvBertForTokenClassification:()=>Ve,ConvBertModel:()=>ze,ConvBertPreTrainedModel:()=>Re,ConvNextForImageClassification:()=>Vo,ConvNextModel:()=>Bo,ConvNextPreTrainedModel:()=>zo,ConvNextV2ForImageClassification:()=>Wo,ConvNextV2Model:()=>Uo,ConvNextV2PreTrainedModel:()=>Ho,DFineForObjectDetection:()=>Ja,DFineModel:()=>qa,DFinePreTrainedModel:()=>Ka,DPTForDepthEstimation:()=>vo,DPTModel:()=>_o,DPTPreTrainedModel:()=>go,DacDecoderModel:()=>yl,DacDecoderOutput:()=>gl,DacEncoderModel:()=>vl,DacEncoderOutput:()=>hl,DacModel:()=>_l,DacPreTrainedModel:()=>ml,DebertaForMaskedLM:()=>nt,DebertaForQuestionAnswering:()=>at,DebertaForSequenceClassification:()=>rt,DebertaForTokenClassification:()=>it,DebertaModel:()=>tt,DebertaPreTrainedModel:()=>et,DebertaV2ForMaskedLM:()=>ct,DebertaV2ForQuestionAnswering:()=>dt,DebertaV2ForSequenceClassification:()=>lt,DebertaV2ForTokenClassification:()=>ut,DebertaV2Model:()=>st,DebertaV2PreTrainedModel:()=>ot,DecisionTransformerModel:()=>Jc,DecisionTransformerPreTrainedModel:()=>qc,DeiTForImageClassification:()=>to,DeiTModel:()=>eo,DeiTPreTrainedModel:()=>$a,DepthAnythingForDepthEstimation:()=>bo,DepthAnythingPreTrainedModel:()=>yo,DepthProForDepthEstimation:()=>Eo,DepthProPreTrainedModel:()=>To,DetrForObjectDetection:()=>Aa,DetrForSegmentation:()=>ja,DetrModel:()=>ka,DetrObjectDetectionOutput:()=>Ma,DetrPreTrainedModel:()=>Oa,DetrSegmentationOutput:()=>Na,Dinov2ForImageClassification:()=>qo,Dinov2Model:()=>Ko,Dinov2PreTrainedModel:()=>Go,Dinov2WithRegistersForImageClassification:()=>Xo,Dinov2WithRegistersModel:()=>Yo,Dinov2WithRegistersPreTrainedModel:()=>Jo,DistilBertForMaskedLM:()=>_t,DistilBertForQuestionAnswering:()=>gt,DistilBertForSequenceClassification:()=>mt,DistilBertForTokenClassification:()=>ht,DistilBertModel:()=>pt,DistilBertPreTrainedModel:()=>ft,DonutSwinModel:()=>Ro,DonutSwinPreTrainedModel:()=>Lo,EfficientNetForImageClassification:()=>Ec,EfficientNetModel:()=>Tc,EfficientNetPreTrainedModel:()=>wc,ElectraForMaskedLM:()=>We,ElectraForQuestionAnswering:()=>qe,ElectraForSequenceClassification:()=>Ge,ElectraForTokenClassification:()=>Ke,ElectraModel:()=>Ue,ElectraPreTrainedModel:()=>B,EsmForMaskedLM:()=>bt,EsmForSequenceClassification:()=>xt,EsmForTokenClassification:()=>St,EsmModel:()=>yt,EsmPreTrainedModel:()=>vt,ExaoneForCausalLM:()=>qr,ExaoneModel:()=>Kr,ExaonePreTrainedModel:()=>Gr,FalconForCausalLM:()=>uc,FalconModel:()=>lc,FalconPreTrainedModel:()=>cc,FastViTForImageClassification:()=>ua,FastViTModel:()=>la,FastViTPreTrainedModel:()=>ca,Florence2ForConditionalGeneration:()=>Gn,Florence2PreTrainedModel:()=>Wn,GLPNForDepthEstimation:()=>Io,GLPNModel:()=>Fo,GLPNPreTrainedModel:()=>Po,GPT2LMHeadModel:()=>_r,GPT2Model:()=>gr,GPT2PreTrainedModel:()=>hr,GPTBigCodeForCausalLM:()=>Mr,GPTBigCodeModel:()=>jr,GPTBigCodePreTrainedModel:()=>Ar,GPTJForCausalLM:()=>kr,GPTJModel:()=>Or,GPTJPreTrainedModel:()=>Dr,GPTNeoForCausalLM:()=>Cr,GPTNeoModel:()=>Sr,GPTNeoPreTrainedModel:()=>xr,GPTNeoXForCausalLM:()=>Er,GPTNeoXModel:()=>Tr,GPTNeoXPreTrainedModel:()=>wr,Gemma2ForCausalLM:()=>mi,Gemma2Model:()=>pi,Gemma2PreTrainedModel:()=>fi,Gemma3ForCausalLM:()=>_i,Gemma3Model:()=>gi,Gemma3PreTrainedModel:()=>hi,Gemma3nForConditionalGeneration:()=>Xn,Gemma3nPreTrainedModel:()=>Yn,GemmaForCausalLM:()=>di,GemmaModel:()=>ui,GemmaPreTrainedModel:()=>li,GlmForCausalLM:()=>Wr,GlmModel:()=>Ur,GlmPreTrainedModel:()=>Hr,GraniteForCausalLM:()=>ai,GraniteModel:()=>ii,GranitePreTrainedModel:()=>ri,GroundingDinoForObjectDetection:()=>Qo,GroundingDinoPreTrainedModel:()=>Zo,GroupViTModel:()=>sa,GroupViTPreTrainedModel:()=>oa,HeliumForCausalLM:()=>Vr,HeliumModel:()=>Br,HeliumPreTrainedModel:()=>zr,HieraForImageClassification:()=>io,HieraModel:()=>ro,HieraPreTrainedModel:()=>no,HubertForCTC:()=>zs,HubertForSequenceClassification:()=>Bs,HubertModel:()=>Rs,HubertPreTrainedModel:()=>Ls,IJepaForImageClassification:()=>Yi,IJepaModel:()=>Ji,IJepaPreTrainedModel:()=>qi,Idefics3ForConditionalGeneration:()=>Qn,Idefics3PreTrainedModel:()=>Zn,ImageMattingOutput:()=>qu,JAISLMHeadModel:()=>br,JAISModel:()=>yr,JAISPreTrainedModel:()=>vr,JinaCLIPModel:()=>ur,JinaCLIPPreTrainedModel:()=>Y,JinaCLIPTextModel:()=>dr,JinaCLIPVisionModel:()=>fr,LiteWhisperForConditionalGeneration:()=>Fn,LlamaForCausalLM:()=>Rr,LlamaModel:()=>Lr,LlamaPreTrainedModel:()=>Ir,LlavaForConditionalGeneration:()=>Vn,LlavaOnevisionForConditionalGeneration:()=>Hn,LlavaPreTrainedModel:()=>Bn,LlavaQwen2ForCausalLM:()=>Jn,LongT5ForConditionalGeneration:()=>Yt,LongT5Model:()=>Jt,LongT5PreTrainedModel:()=>qt,M2M100ForConditionalGeneration:()=>ps,M2M100Model:()=>fs,M2M100PreTrainedModel:()=>ds,MBartForCausalLM:()=>sn,MBartForConditionalGeneration:()=>an,MBartForSequenceClassification:()=>on,MBartModel:()=>V,MBartPreTrainedModel:()=>rn,MPNetForMaskedLM:()=>At,MPNetForQuestionAnswering:()=>Nt,MPNetForSequenceClassification:()=>jt,MPNetForTokenClassification:()=>Mt,MPNetModel:()=>kt,MPNetPreTrainedModel:()=>Ot,MT5ForConditionalGeneration:()=>Qt,MT5Model:()=>Zt,MT5PreTrainedModel:()=>Xt,MarianMTModel:()=>us,MarianModel:()=>ls,MarianPreTrainedModel:()=>cs,MaskFormerForInstanceSegmentation:()=>No,MaskFormerModel:()=>Mo,MaskFormerPreTrainedModel:()=>jo,MaskedLMOutput:()=>Uu,Metric3DForDepthEstimation:()=>Oo,Metric3DPreTrainedModel:()=>Do,Metric3Dv2ForDepthEstimation:()=>Ao,Metric3Dv2PreTrainedModel:()=>ko,MgpstrForSceneTextRecognition:()=>$c,MgpstrModelOutput:()=>Zc,MgpstrPreTrainedModel:()=>Qc,MimiDecoderModel:()=>pl,MimiDecoderOutput:()=>ul,MimiEncoderModel:()=>fl,MimiEncoderOutput:()=>ll,MimiModel:()=>dl,MimiPreTrainedModel:()=>cl,MistralForCausalLM:()=>ic,MistralModel:()=>rc,MistralPreTrainedModel:()=>nc,MobileBertForMaskedLM:()=>Tt,MobileBertForQuestionAnswering:()=>Dt,MobileBertForSequenceClassification:()=>Et,MobileBertModel:()=>wt,MobileBertPreTrainedModel:()=>Ct,MobileLLMForCausalLM:()=>Xr,MobileLLMModel:()=>Yr,MobileLLMPreTrainedModel:()=>Jr,MobileNetV1ForImageClassification:()=>Nc,MobileNetV1ForSemanticSegmentation:()=>Pc,MobileNetV1Model:()=>Mc,MobileNetV1PreTrainedModel:()=>jc,MobileNetV2ForImageClassification:()=>Lc,MobileNetV2ForSemanticSegmentation:()=>Rc,MobileNetV2Model:()=>Ic,MobileNetV2PreTrainedModel:()=>Fc,MobileNetV3ForImageClassification:()=>Vc,MobileNetV3ForSemanticSegmentation:()=>Hc,MobileNetV3Model:()=>Bc,MobileNetV3PreTrainedModel:()=>zc,MobileNetV4ForImageClassification:()=>Gc,MobileNetV4ForSemanticSegmentation:()=>Kc,MobileNetV4Model:()=>Wc,MobileNetV4PreTrainedModel:()=>Uc,MobileViTForImageClassification:()=>ha,MobileViTModel:()=>ma,MobileViTPreTrainedModel:()=>pa,MobileViTV2ForImageClassification:()=>va,MobileViTV2Model:()=>_a,MobileViTV2PreTrainedModel:()=>ga,ModelOutput:()=>pe,ModernBertForMaskedLM:()=>Oe,ModernBertForSequenceClassification:()=>ke,ModernBertForTokenClassification:()=>Ae,ModernBertModel:()=>De,ModernBertPreTrainedModel:()=>Ee,Moondream1ForConditionalGeneration:()=>Un,MoonshineForConditionalGeneration:()=>Rn,MoonshineModel:()=>Ln,MoonshinePreTrainedModel:()=>In,MptForCausalLM:()=>Bi,MptModel:()=>zi,MptPreTrainedModel:()=>Ri,MultiModalityCausalLM:()=>Xc,MultiModalityPreTrainedModel:()=>Yc,MusicgenForCausalLM:()=>kc,MusicgenForConditionalGeneration:()=>Ac,MusicgenModel:()=>Oc,MusicgenPreTrainedModel:()=>Dc,NeoBertForMaskedLM:()=>Se,NeoBertForQuestionAnswering:()=>Te,NeoBertForSequenceClassification:()=>Ce,NeoBertForTokenClassification:()=>we,NeoBertModel:()=>xe,NeoBertPreTrainedModel:()=>be,NomicBertModel:()=>Me,NomicBertPreTrainedModel:()=>je,OPTForCausalLM:()=>Ui,OPTModel:()=>Hi,OPTPreTrainedModel:()=>Vi,Olmo2ForCausalLM:()=>ni,Olmo2Model:()=>ti,Olmo2PreTrainedModel:()=>ei,OlmoForCausalLM:()=>$r,OlmoModel:()=>Qr,OlmoPreTrainedModel:()=>Zr,OpenELMForCausalLM:()=>bi,OpenELMModel:()=>yi,OpenELMPreTrainedModel:()=>vi,OwlViTForObjectDetection:()=>xa,OwlViTModel:()=>ba,OwlViTPreTrainedModel:()=>ya,Owlv2ForObjectDetection:()=>wa,Owlv2Model:()=>Ca,Owlv2PreTrainedModel:()=>Sa,PaliGemmaForConditionalGeneration:()=>qn,PaliGemmaPreTrainedModel:()=>Kn,PatchTSMixerForPrediction:()=>al,PatchTSMixerModel:()=>il,PatchTSMixerPreTrainedModel:()=>rl,PatchTSTForPrediction:()=>nl,PatchTSTModel:()=>tl,PatchTSTPreTrainedModel:()=>el,Phi3ForCausalLM:()=>Pi,Phi3Model:()=>Ni,Phi3PreTrainedModel:()=>Mi,Phi3VForCausalLM:()=>G,Phi3VPreTrainedModel:()=>er,PhiForCausalLM:()=>ji,PhiModel:()=>Ai,PhiPreTrainedModel:()=>ki,PreTrainedModel:()=>I,PretrainedMixin:()=>Z,PvtForImageClassification:()=>ea,PvtModel:()=>$i,PvtPreTrainedModel:()=>Qi,PyAnnoteForAudioFrameClassification:()=>xs,PyAnnoteModel:()=>bs,PyAnnotePreTrainedModel:()=>ys,QuestionAnsweringModelOutput:()=>Wu,Qwen2ForCausalLM:()=>Ci,Qwen2Model:()=>Si,Qwen2PreTrainedModel:()=>xi,Qwen2VLForConditionalGeneration:()=>Oi,Qwen2VLPreTrainedModel:()=>Di,Qwen3ForCausalLM:()=>Ei,Qwen3Model:()=>Ti,Qwen3PreTrainedModel:()=>wi,RFDetrForObjectDetection:()=>Wa,RFDetrModel:()=>Ua,RFDetrObjectDetectionOutput:()=>Ga,RFDetrPreTrainedModel:()=>Ha,RTDetrForObjectDetection:()=>Ia,RTDetrModel:()=>Fa,RTDetrObjectDetectionOutput:()=>La,RTDetrPreTrainedModel:()=>Pa,RTDetrV2ForObjectDetection:()=>Ba,RTDetrV2Model:()=>za,RTDetrV2ObjectDetectionOutput:()=>Va,RTDetrV2PreTrainedModel:()=>Ra,ResNetForImageClassification:()=>so,ResNetModel:()=>oo,ResNetPreTrainedModel:()=>ao,RoFormerForMaskedLM:()=>Pe,RoFormerForQuestionAnswering:()=>Le,RoFormerForSequenceClassification:()=>Fe,RoFormerForTokenClassification:()=>Ie,RoFormerModel:()=>R,RoFormerPreTrainedModel:()=>Ne,RobertaForMaskedLM:()=>hn,RobertaForQuestionAnswering:()=>_n,RobertaForSequenceClassification:()=>U,RobertaForTokenClassification:()=>gn,RobertaModel:()=>mn,RobertaPreTrainedModel:()=>pn,SamImageSegmentationOutput:()=>ss,SamModel:()=>os,SamPreTrainedModel:()=>rs,SapiensForDepthEstimation:()=>Co,SapiensForNormalEstimation:()=>wo,SapiensForSemanticSegmentation:()=>So,SapiensPreTrainedModel:()=>xo,SegformerForImageClassification:()=>yc,SegformerForSemanticSegmentation:()=>bc,SegformerModel:()=>vc,SegformerPreTrainedModel:()=>_c,Seq2SeqLMOutput:()=>Bu,SequenceClassifierOutput:()=>Q,SiglipModel:()=>J,SiglipPreTrainedModel:()=>q,SiglipTextModel:()=>or,SiglipVisionModel:()=>sr,SmolVLMForConditionalGeneration:()=>$n,SnacDecoderModel:()=>Cl,SnacEncoderModel:()=>Sl,SnacModel:()=>xl,SnacPreTrainedModel:()=>bl,SpeechT5ForSpeechToText:()=>Zs,SpeechT5ForTextToSpeech:()=>Qs,SpeechT5HifiGan:()=>$s,SpeechT5Model:()=>Xs,SpeechT5PreTrainedModel:()=>Ys,SqueezeBertForMaskedLM:()=>It,SqueezeBertForQuestionAnswering:()=>Rt,SqueezeBertForSequenceClassification:()=>Lt,SqueezeBertModel:()=>Ft,SqueezeBertPreTrainedModel:()=>Pt,StableLmForCausalLM:()=>Cc,StableLmModel:()=>Sc,StableLmPreTrainedModel:()=>xc,Starcoder2ForCausalLM:()=>sc,Starcoder2Model:()=>oc,Starcoder2PreTrainedModel:()=>ac,StyleTextToSpeech2Model:()=>Js,StyleTextToSpeech2PreTrainedModel:()=>qs,Swin2SRForImageSuperResolution:()=>ho,Swin2SRModel:()=>mo,Swin2SRPreTrainedModel:()=>po,SwinForImageClassification:()=>uo,SwinForSemanticSegmentation:()=>fo,SwinModel:()=>lo,SwinPreTrainedModel:()=>co,T5ForConditionalGeneration:()=>Kt,T5Model:()=>Gt,T5PreTrainedModel:()=>Wt,TableTransformerForObjectDetection:()=>Za,TableTransformerModel:()=>Xa,TableTransformerObjectDetectionOutput:()=>Qa,TableTransformerPreTrainedModel:()=>Ya,TokenClassifierOutput:()=>Hu,TrOCRForCausalLM:()=>tc,TrOCRPreTrainedModel:()=>ec,UltravoxModel:()=>sl,UltravoxPreTrainedModel:()=>ol,UniSpeechForCTC:()=>Es,UniSpeechForSequenceClassification:()=>Ds,UniSpeechModel:()=>Ts,UniSpeechPreTrainedModel:()=>ws,UniSpeechSatForAudioFrameClassification:()=>Ms,UniSpeechSatForCTC:()=>As,UniSpeechSatForSequenceClassification:()=>js,UniSpeechSatModel:()=>ks,UniSpeechSatPreTrainedModel:()=>Os,ViTForImageClassification:()=>Ki,ViTMAEModel:()=>na,ViTMAEPreTrainedModel:()=>ta,ViTMSNForImageClassification:()=>aa,ViTMSNModel:()=>ia,ViTMSNPreTrainedModel:()=>ra,ViTModel:()=>Gi,ViTPreTrainedModel:()=>Wi,VisionEncoderDecoderModel:()=>zn,VitMatteForImageMatting:()=>fa,VitMattePreTrainedModel:()=>da,VitPoseForPoseEstimation:()=>Zi,VitPosePreTrainedModel:()=>Xi,VitsModel:()=>gc,VitsModelOutput:()=>Ju,VitsPreTrainedModel:()=>hc,Wav2Vec2BertForCTC:()=>Fs,Wav2Vec2BertForSequenceClassification:()=>Is,Wav2Vec2BertModel:()=>Ps,Wav2Vec2BertPreTrainedModel:()=>Ns,Wav2Vec2ForAudioFrameClassification:()=>vs,Wav2Vec2ForCTC:()=>gs,Wav2Vec2ForSequenceClassification:()=>_s,Wav2Vec2Model:()=>hs,Wav2Vec2PreTrainedModel:()=>ms,WavLMForAudioFrameClassification:()=>Ks,WavLMForCTC:()=>Us,WavLMForSequenceClassification:()=>Ws,WavLMForXVector:()=>Gs,WavLMModel:()=>Hs,WavLMPreTrainedModel:()=>Vs,WeSpeakerResNetModel:()=>Cs,WeSpeakerResNetPreTrainedModel:()=>Ss,WhisperForConditionalGeneration:()=>Pn,WhisperModel:()=>Nn,WhisperPreTrainedModel:()=>Mn,XLMForQuestionAnswering:()=>Sn,XLMForSequenceClassification:()=>bn,XLMForTokenClassification:()=>xn,XLMModel:()=>yn,XLMPreTrainedModel:()=>vn,XLMRobertaForMaskedLM:()=>Tn,XLMRobertaForQuestionAnswering:()=>On,XLMRobertaForSequenceClassification:()=>En,XLMRobertaForTokenClassification:()=>Dn,XLMRobertaModel:()=>wn,XLMRobertaPreTrainedModel:()=>Cn,XLMWithLMHeadModel:()=>W,XVectorOutput:()=>Vu,YolosForObjectDetection:()=>ts,YolosModel:()=>es,YolosObjectDetectionOutput:()=>ns,YolosPreTrainedModel:()=>$o});var r=n( +`)}}class l extends c{constructor(e,{skip_prompt:t=!1,callback_function:n=null,token_callback_function:r=null,on_chunk_start:i=null,on_chunk_end:a=null,on_finalize:o=null,time_precision:s=.02,skip_special_tokens:c=!0,decode_kwargs:l={}}={}){super(e,{skip_prompt:t,skip_special_tokens:c,callback_function:n,token_callback_function:r,decode_kwargs:l}),this.timestamp_begin=e.timestamp_begin,this.on_chunk_start=i,this.on_chunk_end=a,this.on_finalize=o,this.time_precision=s,this.waiting_for_timestamp=!1}put(e){if(e.length>1)throw Error(`WhisperTextStreamer only supports batch size of 1`);let t=e[0];if(t.length===1){let e=Number(t[0])-this.timestamp_begin;if(e>=0){let n=e*this.time_precision;this.waiting_for_timestamp?this.on_chunk_end?.(n):this.on_chunk_start?.(n),this.waiting_for_timestamp=!this.waiting_for_timestamp,this.token_callback_function?.(t);return}}return super.put(e)}end(){super.end(),this.on_finalize?.()}}},"./src/models.js":(e,t,n)=>{n.r(t),n.d(t,{ASTForAudioClassification:()=>An,ASTModel:()=>kn,ASTPreTrainedModel:()=>On,AlbertForMaskedLM:()=>Vt,AlbertForQuestionAnswering:()=>Bt,AlbertForSequenceClassification:()=>zt,AlbertModel:()=>Rt,AlbertPreTrainedModel:()=>Lt,AutoModel:()=>hu,AutoModelForAudioClassification:()=>Pu,AutoModelForAudioFrameClassification:()=>Iu,AutoModelForAudioTextToText:()=>Gu,AutoModelForCTC:()=>Nu,AutoModelForCausalLM:()=>Su,AutoModelForDepthEstimation:()=>Bu,AutoModelForDocumentQuestionAnswering:()=>Lu,AutoModelForImageClassification:()=>Eu,AutoModelForImageFeatureExtraction:()=>Uu,AutoModelForImageMatting:()=>Ru,AutoModelForImageSegmentation:()=>Du,AutoModelForImageTextToText:()=>Wu,AutoModelForImageToImage:()=>zu,AutoModelForMaskGeneration:()=>Mu,AutoModelForMaskedLM:()=>Cu,AutoModelForNormalEstimation:()=>Vu,AutoModelForObjectDetection:()=>Au,AutoModelForPoseEstimation:()=>Hu,AutoModelForQuestionAnswering:()=>wu,AutoModelForSemanticSegmentation:()=>Ou,AutoModelForSeq2SeqLM:()=>vu,AutoModelForSequenceClassification:()=>gu,AutoModelForSpeechSeq2Seq:()=>yu,AutoModelForTextToSpectrogram:()=>bu,AutoModelForTextToWaveform:()=>xu,AutoModelForTokenClassification:()=>_u,AutoModelForUniversalSegmentation:()=>ku,AutoModelForVision2Seq:()=>Tu,AutoModelForXVector:()=>Fu,AutoModelForZeroShotObjectDetection:()=>ju,BartForConditionalGeneration:()=>$t,BartForSequenceClassification:()=>en,BartModel:()=>Qt,BartPretrainedModel:()=>Zt,BaseModelOutput:()=>he,BeitForImageClassification:()=>ka,BeitModel:()=>Oa,BeitPreTrainedModel:()=>Da,BertForMaskedLM:()=>_e,BertForQuestionAnswering:()=>ve,BertForSequenceClassification:()=>L,BertForTokenClassification:()=>R,BertModel:()=>I,BertPreTrainedModel:()=>ge,BlenderbotForConditionalGeneration:()=>cn,BlenderbotModel:()=>sn,BlenderbotPreTrainedModel:()=>on,BlenderbotSmallForConditionalGeneration:()=>dn,BlenderbotSmallModel:()=>un,BlenderbotSmallPreTrainedModel:()=>ln,BloomForCausalLM:()=>zi,BloomModel:()=>Ri,BloomPreTrainedModel:()=>Li,CLIPModel:()=>tr,CLIPPreTrainedModel:()=>er,CLIPSegForImageSegmentation:()=>pr,CLIPSegModel:()=>fr,CLIPSegPreTrainedModel:()=>Z,CLIPTextModel:()=>nr,CLIPTextModelWithProjection:()=>rr,CLIPVisionModel:()=>q,CLIPVisionModelWithProjection:()=>ir,CamembertForMaskedLM:()=>Je,CamembertForQuestionAnswering:()=>Ze,CamembertForSequenceClassification:()=>Ye,CamembertForTokenClassification:()=>Xe,CamembertModel:()=>qe,CamembertPreTrainedModel:()=>Ke,CausalLMOutput:()=>Zu,CausalLMOutputWithPast:()=>Qu,ChineseCLIPModel:()=>cr,ChineseCLIPPreTrainedModel:()=>sr,ClapAudioModelWithProjection:()=>yc,ClapModel:()=>_c,ClapPreTrainedModel:()=>gc,ClapTextModelWithProjection:()=>vc,CodeGenForCausalLM:()=>Pr,CodeGenModel:()=>Nr,CodeGenPreTrainedModel:()=>Mr,CohereForCausalLM:()=>ui,CohereModel:()=>li,CoherePreTrainedModel:()=>ci,ConvBertForMaskedLM:()=>Re,ConvBertForQuestionAnswering:()=>Be,ConvBertForSequenceClassification:()=>V,ConvBertForTokenClassification:()=>ze,ConvBertModel:()=>Le,ConvBertPreTrainedModel:()=>Ie,ConvNextForImageClassification:()=>Uo,ConvNextModel:()=>Ho,ConvNextPreTrainedModel:()=>Vo,ConvNextV2ForImageClassification:()=>Ko,ConvNextV2Model:()=>Go,ConvNextV2PreTrainedModel:()=>Wo,DFineForObjectDetection:()=>Xa,DFineModel:()=>Ya,DFinePreTrainedModel:()=>Ja,DPTForDepthEstimation:()=>bo,DPTModel:()=>yo,DPTPreTrainedModel:()=>vo,DacDecoderModel:()=>wl,DacDecoderOutput:()=>xl,DacEncoderModel:()=>Cl,DacEncoderOutput:()=>bl,DacModel:()=>Sl,DacPreTrainedModel:()=>yl,DebertaForMaskedLM:()=>et,DebertaForQuestionAnswering:()=>rt,DebertaForSequenceClassification:()=>tt,DebertaForTokenClassification:()=>nt,DebertaModel:()=>$e,DebertaPreTrainedModel:()=>Qe,DebertaV2ForMaskedLM:()=>ot,DebertaV2ForQuestionAnswering:()=>lt,DebertaV2ForSequenceClassification:()=>st,DebertaV2ForTokenClassification:()=>ct,DebertaV2Model:()=>at,DebertaV2PreTrainedModel:()=>it,DecisionTransformerModel:()=>$c,DecisionTransformerPreTrainedModel:()=>Qc,DeiTForImageClassification:()=>ro,DeiTModel:()=>no,DeiTPreTrainedModel:()=>to,DepthAnythingForDepthEstimation:()=>So,DepthAnythingPreTrainedModel:()=>xo,DepthProForDepthEstimation:()=>Oo,DepthProPreTrainedModel:()=>Do,DetrForObjectDetection:()=>Ma,DetrForSegmentation:()=>Na,DetrModel:()=>ja,DetrObjectDetectionOutput:()=>Pa,DetrPreTrainedModel:()=>Aa,DetrSegmentationOutput:()=>Fa,Dinov2ForImageClassification:()=>Yo,Dinov2Model:()=>Jo,Dinov2PreTrainedModel:()=>qo,Dinov2WithRegistersForImageClassification:()=>Qo,Dinov2WithRegistersModel:()=>Zo,Dinov2WithRegistersPreTrainedModel:()=>Xo,DistilBertForMaskedLM:()=>ht,DistilBertForQuestionAnswering:()=>mt,DistilBertForSequenceClassification:()=>ft,DistilBertForTokenClassification:()=>pt,DistilBertModel:()=>dt,DistilBertPreTrainedModel:()=>ut,DonutSwinModel:()=>Bo,DonutSwinPreTrainedModel:()=>zo,EfficientNetForImageClassification:()=>jc,EfficientNetModel:()=>Ac,EfficientNetPreTrainedModel:()=>kc,ElectraForMaskedLM:()=>He,ElectraForQuestionAnswering:()=>Ge,ElectraForSequenceClassification:()=>Ue,ElectraForTokenClassification:()=>We,ElectraModel:()=>Ve,ElectraPreTrainedModel:()=>H,Ernie4_5_ForCausalLM:()=>lc,Ernie4_5_Model:()=>cc,Ernie4_5_PretrainedModel:()=>sc,EsmForMaskedLM:()=>vt,EsmForSequenceClassification:()=>yt,EsmForTokenClassification:()=>bt,EsmModel:()=>_t,EsmPreTrainedModel:()=>gt,ExaoneForCausalLM:()=>Yr,ExaoneModel:()=>Jr,ExaonePreTrainedModel:()=>qr,FalconForCausalLM:()=>hc,FalconModel:()=>mc,FalconPreTrainedModel:()=>pc,FastViTForImageClassification:()=>fa,FastViTModel:()=>da,FastViTPreTrainedModel:()=>ua,Florence2ForConditionalGeneration:()=>Wn,Florence2PreTrainedModel:()=>Un,GLPNForDepthEstimation:()=>Ro,GLPNModel:()=>Lo,GLPNPreTrainedModel:()=>Io,GPT2LMHeadModel:()=>gr,GPT2Model:()=>hr,GPT2PreTrainedModel:()=>mr,GPTBigCodeForCausalLM:()=>jr,GPTBigCodeModel:()=>Ar,GPTBigCodePreTrainedModel:()=>kr,GPTJForCausalLM:()=>Or,GPTJModel:()=>Dr,GPTJPreTrainedModel:()=>Er,GPTNeoForCausalLM:()=>Sr,GPTNeoModel:()=>xr,GPTNeoPreTrainedModel:()=>br,GPTNeoXForCausalLM:()=>Tr,GPTNeoXModel:()=>wr,GPTNeoXPreTrainedModel:()=>Cr,Gemma2ForCausalLM:()=>gi,Gemma2Model:()=>hi,Gemma2PreTrainedModel:()=>mi,Gemma3ForCausalLM:()=>yi,Gemma3Model:()=>vi,Gemma3PreTrainedModel:()=>_i,Gemma3nForConditionalGeneration:()=>Yn,Gemma3nPreTrainedModel:()=>Jn,GemmaForCausalLM:()=>pi,GemmaModel:()=>fi,GemmaPreTrainedModel:()=>di,GlmForCausalLM:()=>Kr,GlmModel:()=>Gr,GlmPreTrainedModel:()=>Wr,GraniteForCausalLM:()=>si,GraniteModel:()=>oi,GranitePreTrainedModel:()=>ai,GroundingDinoForObjectDetection:()=>es,GroundingDinoPreTrainedModel:()=>$o,GroupViTModel:()=>la,GroupViTPreTrainedModel:()=>ca,HeliumForCausalLM:()=>Ur,HeliumModel:()=>Hr,HeliumPreTrainedModel:()=>Vr,HieraForImageClassification:()=>oo,HieraModel:()=>ao,HieraPreTrainedModel:()=>io,HubertForCTC:()=>Vs,HubertForSequenceClassification:()=>Hs,HubertModel:()=>Bs,HubertPreTrainedModel:()=>zs,IJepaForImageClassification:()=>Zi,IJepaModel:()=>Xi,IJepaPreTrainedModel:()=>Yi,Idefics3ForConditionalGeneration:()=>Zn,Idefics3PreTrainedModel:()=>Xn,ImageMattingOutput:()=>$u,JAISLMHeadModel:()=>yr,JAISModel:()=>vr,JAISPreTrainedModel:()=>_r,JinaCLIPModel:()=>lr,JinaCLIPPreTrainedModel:()=>X,JinaCLIPTextModel:()=>ur,JinaCLIPVisionModel:()=>dr,LiteWhisperForConditionalGeneration:()=>Pn,LlamaForCausalLM:()=>Lr,LlamaModel:()=>Ir,LlamaPreTrainedModel:()=>Fr,LlavaForConditionalGeneration:()=>Bn,LlavaOnevisionForConditionalGeneration:()=>Vn,LlavaPreTrainedModel:()=>zn,LlavaQwen2ForCausalLM:()=>qn,LongT5ForConditionalGeneration:()=>qt,LongT5Model:()=>Kt,LongT5PreTrainedModel:()=>Gt,M2M100ForConditionalGeneration:()=>hs,M2M100Model:()=>ms,M2M100PreTrainedModel:()=>ps,MBartForCausalLM:()=>an,MBartForConditionalGeneration:()=>nn,MBartForSequenceClassification:()=>rn,MBartModel:()=>U,MBartPreTrainedModel:()=>tn,MPNetForMaskedLM:()=>Ot,MPNetForQuestionAnswering:()=>jt,MPNetForSequenceClassification:()=>kt,MPNetForTokenClassification:()=>At,MPNetModel:()=>Dt,MPNetPreTrainedModel:()=>Et,MT5ForConditionalGeneration:()=>Xt,MT5Model:()=>Yt,MT5PreTrainedModel:()=>Jt,MarianMTModel:()=>fs,MarianModel:()=>ds,MarianPreTrainedModel:()=>us,MaskFormerForInstanceSegmentation:()=>Fo,MaskFormerModel:()=>Po,MaskFormerPreTrainedModel:()=>No,MaskedLMOutput:()=>Yu,Metric3DForDepthEstimation:()=>Ao,Metric3DPreTrainedModel:()=>ko,Metric3Dv2ForDepthEstimation:()=>Mo,Metric3Dv2PreTrainedModel:()=>jo,MgpstrForSceneTextRecognition:()=>il,MgpstrModelOutput:()=>nl,MgpstrPreTrainedModel:()=>rl,MimiDecoderModel:()=>vl,MimiDecoderOutput:()=>hl,MimiEncoderModel:()=>_l,MimiEncoderOutput:()=>ml,MimiModel:()=>gl,MimiPreTrainedModel:()=>pl,MistralForCausalLM:()=>oc,MistralModel:()=>ac,MistralPreTrainedModel:()=>ic,MobileBertForMaskedLM:()=>Ct,MobileBertForQuestionAnswering:()=>Tt,MobileBertForSequenceClassification:()=>wt,MobileBertModel:()=>St,MobileBertPreTrainedModel:()=>xt,MobileLLMForCausalLM:()=>Qr,MobileLLMModel:()=>Zr,MobileLLMPreTrainedModel:()=>Xr,MobileNetV1ForImageClassification:()=>Rc,MobileNetV1ForSemanticSegmentation:()=>zc,MobileNetV1Model:()=>Lc,MobileNetV1PreTrainedModel:()=>Ic,MobileNetV2ForImageClassification:()=>Hc,MobileNetV2ForSemanticSegmentation:()=>Uc,MobileNetV2Model:()=>Vc,MobileNetV2PreTrainedModel:()=>Bc,MobileNetV3ForImageClassification:()=>Kc,MobileNetV3ForSemanticSegmentation:()=>qc,MobileNetV3Model:()=>Gc,MobileNetV3PreTrainedModel:()=>Wc,MobileNetV4ForImageClassification:()=>Xc,MobileNetV4ForSemanticSegmentation:()=>Zc,MobileNetV4Model:()=>Yc,MobileNetV4PreTrainedModel:()=>Jc,MobileViTForImageClassification:()=>_a,MobileViTModel:()=>ga,MobileViTPreTrainedModel:()=>ha,MobileViTV2ForImageClassification:()=>ba,MobileViTV2Model:()=>ya,MobileViTV2PreTrainedModel:()=>va,ModelOutput:()=>me,ModernBertForMaskedLM:()=>Te,ModernBertForSequenceClassification:()=>Ee,ModernBertForTokenClassification:()=>De,ModernBertModel:()=>we,ModernBertPreTrainedModel:()=>Ce,Moondream1ForConditionalGeneration:()=>Hn,MoonshineForConditionalGeneration:()=>Ln,MoonshineModel:()=>In,MoonshinePreTrainedModel:()=>Fn,MptForCausalLM:()=>Hi,MptModel:()=>Vi,MptPreTrainedModel:()=>Bi,MultiModalityCausalLM:()=>tl,MultiModalityPreTrainedModel:()=>el,MusicgenForCausalLM:()=>Pc,MusicgenForConditionalGeneration:()=>Fc,MusicgenModel:()=>Nc,MusicgenPreTrainedModel:()=>Mc,NeoBertForMaskedLM:()=>be,NeoBertForQuestionAnswering:()=>B,NeoBertForSequenceClassification:()=>xe,NeoBertForTokenClassification:()=>Se,NeoBertModel:()=>z,NeoBertPreTrainedModel:()=>ye,NomicBertModel:()=>ke,NomicBertPreTrainedModel:()=>Oe,OPTForCausalLM:()=>Gi,OPTModel:()=>Wi,OPTPreTrainedModel:()=>Ui,Olmo2ForCausalLM:()=>ii,Olmo2Model:()=>ri,Olmo2PreTrainedModel:()=>ni,OlmoForCausalLM:()=>ti,OlmoModel:()=>ei,OlmoPreTrainedModel:()=>$r,OpenELMForCausalLM:()=>Si,OpenELMModel:()=>xi,OpenELMPreTrainedModel:()=>bi,OwlViTForObjectDetection:()=>Ca,OwlViTModel:()=>Sa,OwlViTPreTrainedModel:()=>xa,Owlv2ForObjectDetection:()=>Ea,Owlv2Model:()=>Ta,Owlv2PreTrainedModel:()=>wa,PaliGemmaForConditionalGeneration:()=>Kn,PaliGemmaPreTrainedModel:()=>Gn,PatchTSMixerForPrediction:()=>ul,PatchTSMixerModel:()=>ll,PatchTSMixerPreTrainedModel:()=>cl,PatchTSTForPrediction:()=>sl,PatchTSTModel:()=>ol,PatchTSTPreTrainedModel:()=>al,Phi3ForCausalLM:()=>Ii,Phi3Model:()=>Fi,Phi3PreTrainedModel:()=>Pi,Phi3VForCausalLM:()=>K,Phi3VPreTrainedModel:()=>$n,PhiForCausalLM:()=>Ni,PhiModel:()=>Mi,PhiPreTrainedModel:()=>ji,PreTrainedModel:()=>F,PretrainedMixin:()=>kl,PvtForImageClassification:()=>na,PvtModel:()=>ta,PvtPreTrainedModel:()=>ea,PyAnnoteForAudioFrameClassification:()=>Cs,PyAnnoteModel:()=>Ss,PyAnnotePreTrainedModel:()=>xs,QuestionAnsweringModelOutput:()=>Xu,Qwen2ForCausalLM:()=>Ti,Qwen2Model:()=>wi,Qwen2PreTrainedModel:()=>Ci,Qwen2VLForConditionalGeneration:()=>Ai,Qwen2VLPreTrainedModel:()=>ki,Qwen3ForCausalLM:()=>Oi,Qwen3Model:()=>Di,Qwen3PreTrainedModel:()=>Ei,RFDetrForObjectDetection:()=>Ka,RFDetrModel:()=>Ga,RFDetrObjectDetectionOutput:()=>qa,RFDetrPreTrainedModel:()=>Wa,RTDetrForObjectDetection:()=>Ra,RTDetrModel:()=>La,RTDetrObjectDetectionOutput:()=>za,RTDetrPreTrainedModel:()=>Ia,RTDetrV2ForObjectDetection:()=>Ha,RTDetrV2Model:()=>Va,RTDetrV2ObjectDetectionOutput:()=>Ua,RTDetrV2PreTrainedModel:()=>Ba,ResNetForImageClassification:()=>lo,ResNetModel:()=>co,ResNetPreTrainedModel:()=>so,RoFormerForMaskedLM:()=>Me,RoFormerForQuestionAnswering:()=>Fe,RoFormerForSequenceClassification:()=>Ne,RoFormerForTokenClassification:()=>Pe,RoFormerModel:()=>je,RoFormerPreTrainedModel:()=>Ae,RobertaForMaskedLM:()=>mn,RobertaForQuestionAnswering:()=>gn,RobertaForSequenceClassification:()=>W,RobertaForTokenClassification:()=>hn,RobertaModel:()=>pn,RobertaPreTrainedModel:()=>fn,SamImageSegmentationOutput:()=>ls,SamModel:()=>cs,SamPreTrainedModel:()=>ss,SapiensForDepthEstimation:()=>To,SapiensForNormalEstimation:()=>Eo,SapiensForSemanticSegmentation:()=>wo,SapiensPreTrainedModel:()=>Co,SegformerForImageClassification:()=>wc,SegformerForSemanticSegmentation:()=>Tc,SegformerModel:()=>Cc,SegformerPreTrainedModel:()=>Sc,Seq2SeqLMOutput:()=>Ku,SequenceClassifierOutput:()=>Q,SiglipModel:()=>Y,SiglipPreTrainedModel:()=>J,SiglipTextModel:()=>ar,SiglipVisionModel:()=>or,SmolLM3ForCausalLM:()=>Br,SmolLM3Model:()=>zr,SmolLM3PreTrainedModel:()=>Rr,SmolVLMForConditionalGeneration:()=>Qn,SnacDecoderModel:()=>Ol,SnacEncoderModel:()=>Dl,SnacModel:()=>El,SnacPreTrainedModel:()=>Tl,SpeechT5ForSpeechToText:()=>$s,SpeechT5ForTextToSpeech:()=>ec,SpeechT5HifiGan:()=>tc,SpeechT5Model:()=>Qs,SpeechT5PreTrainedModel:()=>Zs,SqueezeBertForMaskedLM:()=>Pt,SqueezeBertForQuestionAnswering:()=>It,SqueezeBertForSequenceClassification:()=>Ft,SqueezeBertModel:()=>Nt,SqueezeBertPreTrainedModel:()=>Mt,StableLmForCausalLM:()=>Oc,StableLmModel:()=>Dc,StableLmPreTrainedModel:()=>Ec,Starcoder2ForCausalLM:()=>fc,Starcoder2Model:()=>dc,Starcoder2PreTrainedModel:()=>uc,StyleTextToSpeech2Model:()=>Xs,StyleTextToSpeech2PreTrainedModel:()=>Ys,Swin2SRForImageSuperResolution:()=>_o,Swin2SRModel:()=>go,Swin2SRPreTrainedModel:()=>ho,SwinForImageClassification:()=>po,SwinForSemanticSegmentation:()=>mo,SwinModel:()=>fo,SwinPreTrainedModel:()=>uo,T5ForConditionalGeneration:()=>Wt,T5Model:()=>Ut,T5PreTrainedModel:()=>Ht,TableTransformerForObjectDetection:()=>$a,TableTransformerModel:()=>Qa,TableTransformerObjectDetectionOutput:()=>eo,TableTransformerPreTrainedModel:()=>Za,TokenClassifierOutput:()=>Ju,TrOCRForCausalLM:()=>rc,TrOCRPreTrainedModel:()=>nc,UltravoxModel:()=>fl,UltravoxPreTrainedModel:()=>dl,UniSpeechForCTC:()=>Os,UniSpeechForSequenceClassification:()=>ks,UniSpeechModel:()=>Ds,UniSpeechPreTrainedModel:()=>Es,UniSpeechSatForAudioFrameClassification:()=>Ps,UniSpeechSatForCTC:()=>Ms,UniSpeechSatForSequenceClassification:()=>Ns,UniSpeechSatModel:()=>js,UniSpeechSatPreTrainedModel:()=>As,ViTForImageClassification:()=>Ji,ViTMAEModel:()=>ia,ViTMAEPreTrainedModel:()=>ra,ViTMSNForImageClassification:()=>sa,ViTMSNModel:()=>oa,ViTMSNPreTrainedModel:()=>aa,ViTModel:()=>qi,ViTPreTrainedModel:()=>Ki,VisionEncoderDecoderModel:()=>Rn,VitMatteForImageMatting:()=>ma,VitMattePreTrainedModel:()=>pa,VitPoseForPoseEstimation:()=>$i,VitPosePreTrainedModel:()=>Qi,VitsModel:()=>xc,VitsModelOutput:()=>ed,VitsPreTrainedModel:()=>bc,Wav2Vec2BertForCTC:()=>Ls,Wav2Vec2BertForSequenceClassification:()=>Rs,Wav2Vec2BertModel:()=>Is,Wav2Vec2BertPreTrainedModel:()=>Fs,Wav2Vec2ForAudioFrameClassification:()=>bs,Wav2Vec2ForCTC:()=>vs,Wav2Vec2ForSequenceClassification:()=>ys,Wav2Vec2Model:()=>_s,Wav2Vec2PreTrainedModel:()=>gs,WavLMForAudioFrameClassification:()=>Js,WavLMForCTC:()=>Gs,WavLMForSequenceClassification:()=>Ks,WavLMForXVector:()=>qs,WavLMModel:()=>Ws,WavLMPreTrainedModel:()=>Us,WeSpeakerResNetModel:()=>Ts,WeSpeakerResNetPreTrainedModel:()=>ws,WhisperForConditionalGeneration:()=>Nn,WhisperModel:()=>Mn,WhisperPreTrainedModel:()=>jn,XLMForQuestionAnswering:()=>xn,XLMForSequenceClassification:()=>yn,XLMForTokenClassification:()=>bn,XLMModel:()=>vn,XLMPreTrainedModel:()=>_n,XLMRobertaForMaskedLM:()=>wn,XLMRobertaForQuestionAnswering:()=>Dn,XLMRobertaForSequenceClassification:()=>Tn,XLMRobertaForTokenClassification:()=>En,XLMRobertaModel:()=>Cn,XLMRobertaPreTrainedModel:()=>Sn,XLMWithLMHeadModel:()=>G,XVectorOutput:()=>qu,YolosForObjectDetection:()=>rs,YolosModel:()=>ns,YolosObjectDetectionOutput:()=>os,YolosPreTrainedModel:()=>ts});var r=n( /*! ./configs.js */ `./src/configs.js`),i=n( /*! ./backends/onnx.js */ @@ -2986,7 +2986,7 @@ let af={url:self.location.href};var sf={"onnxruntime-common":e=>{e.exports=ne}," /*! ./models/whisper/generation_whisper.js */ `./src/models/whisper/generation_whisper.js`),y=n( /*! ./models/whisper/common_whisper.js */ -`./src/models/whisper/common_whisper.js`);let b={EncoderOnly:0,EncoderDecoder:1,Seq2Seq:2,Vision2Seq:3,DecoderOnly:4,MaskGeneration:5,ImageTextToText:6,Musicgen:7,MultiModality:8,Phi3V:9,AudioTextToText:10,AutoEncoder:11,ImageAudioTextToText:12},x=new Map,S=new Map,C=new Map;async function w(e,t,n){let o=n.config?.[`transformers.js_config`]??{},s=n.device??o.device;s&&typeof s!=`string`&&(s.hasOwnProperty(t)?s=s[t]:(console.warn(`device not specified for "${t}". Using the default device.`),s=null));let l=s??(_.apis.IS_NODE_ENV?`cpu`:`wasm`),u=(0,i.deviceToExecutionProviders)(l),d=o.device_config??{};d.hasOwnProperty(l)&&(o={...o,...d[l]});let f=n.dtype??o.dtype;if(typeof f!=`string`&&(f&&f.hasOwnProperty(t)?f=f[t]:(f=a.DEFAULT_DEVICE_DTYPE_MAPPING[l]??a.DATA_TYPES.fp32,console.warn(`dtype not specified for "${t}". Using the default dtype (${f}) for this device (${l}).`))),f===a.DATA_TYPES.auto){let e=o.dtype;typeof e!=`string`&&(e=e?.[t]),f=e&&e!==a.DATA_TYPES.auto&&a.DATA_TYPES.hasOwnProperty(e)?e:a.DEFAULT_DEVICE_DTYPE_MAPPING[l]??a.DATA_TYPES.fp32}let p=f;if(a.DEFAULT_DTYPE_SUFFIX_MAPPING.hasOwnProperty(p)){if(p===a.DATA_TYPES.fp16&&l===`webgpu`&&!await(0,a.isWebGpuFp16Supported)())throw Error(`The device (${l}) does not support fp16.`)}else throw Error(`Invalid dtype: ${p}. Should be one of: ${Object.keys(a.DATA_TYPES).join(`, `)}`);let m=o.kv_cache_dtype,h=m?typeof m==`string`?m:m[p]??`float32`:void 0;if(h&&![`float32`,`float16`].includes(h))throw Error(`Invalid kv_cache_dtype: ${h}. Should be one of: float32, float16`);let g={dtype:p,kv_cache_dtype:h,device:l},v=a.DEFAULT_DTYPE_SUFFIX_MAPPING[p],y=`${t}${v}.onnx`,b=`${n.subfolder??``}/${y}`,x={...n.session_options};x.executionProviders??=u;let S=o.free_dimension_overrides;S?x.freeDimensionOverrides??=S:l.startsWith(`webnn`)&&!x.freeDimensionOverrides&&console.warn(`WebNN does not currently support dynamic shapes and requires 'free_dimension_overrides' to be set in config.json, preferably as a field within config["transformers.js_config"]["device_config"]["${l}"]. When 'free_dimension_overrides' is not set, you may experience significant performance degradation.`);let C=_.apis.IS_NODE_ENV&&_.env.useFSCache,w=(0,c.getModelFile)(e,b,!0,n,C),T=n.use_external_data_format??o.use_external_data_format,E=[];if(T){let r;r=typeof T==`object`?T.hasOwnProperty(y)?T[y]:T.hasOwnProperty(t)?T[t]:!1:T;let i=+r;if(i>c.MAX_EXTERNAL_DATA_CHUNKS)throw Error(`The number of external data chunks (${i}) exceeds the maximum allowed value (${c.MAX_EXTERNAL_DATA_CHUNKS}).`);for(let t=0;t{let o=await(0,c.getModelFile)(e,i,!0,n,C);t(o instanceof Uint8Array?{path:r,data:o}:r)}))}}else x.externalData!==void 0&&(E=x.externalData.map(async t=>{if(typeof t.data==`string`){let r=await(0,c.getModelFile)(e,t.data,!0,n);return{...t,data:r}}return t}));if(E.length>0){let e=await Promise.all(E);_.apis.IS_NODE_ENV||(x.externalData=e)}if(l===`webgpu`){let e=(0,r.getKeyValueShapes)(n.config,{prefix:`present`});if(Object.keys(e).length>0&&!(0,i.isONNXProxy)()){let t={};for(let n in e)t[n]=`gpu-buffer`;x.preferredOutputLocation=t}}let D=await w;return{buffer_or_path:D,session_options:x,session_config:g}}async function T(e,t,n){return Object.fromEntries(await Promise.all(Object.keys(t).map(async r=>{let{buffer_or_path:a,session_options:o,session_config:s}=await w(e,t[r],n),c=await(0,i.createInferenceSession)(a,o,s);return[r,c]})))}async function E(e,t,n){return Object.fromEntries(await Promise.all(Object.keys(t).map(async r=>{let i=await(0,c.getModelJSON)(e,t[r],!1,n);return[r,i]})))}function D(e,t){let n=Object.create(null),r=[];for(let a of e.inputNames){let e=t[a];if(!(e instanceof f.Tensor)){r.push(a);continue}n[a]=(0,i.isONNXProxy)()?e.clone():e}if(r.length>0)throw Error(`An error occurred during model execution: "Missing the following inputs: ${r.join(`, `)}.`);let a=Object.keys(t).length,o=e.inputNames.length;if(a>o){let n=Object.keys(t).filter(t=>!e.inputNames.includes(t));console.warn(`WARNING: Too many inputs were provided (${a} > ${o}). The following inputs will be ignored: "${n.join(`, `)}".`)}return n}let O=Promise.resolve();async function k(e,t){let n=D(e,t);try{let t=Object.fromEntries(Object.entries(n).map(([e,t])=>[e,t.ort_tensor])),r=()=>e.run(t),i=await(_.apis.IS_BROWSER_ENV||_.apis.IS_WEBWORKER_ENV?O=O.then(r):r());return A(i)}catch(e){let t=Object.fromEntries(Object.entries(n).map(([e,t])=>{let n={type:t.type,dims:t.dims,location:t.location};return n.location!==`gpu-buffer`&&(n.data=t.data),[e,n]}));throw console.error(`An error occurred during model execution: "${e}".`),console.error(`Inputs given to model:`,t),e}}function A(e){for(let t in e)(0,i.isONNXTensor)(e[t])?e[t]=new f.Tensor(e[t]):typeof e[t]==`object`&&A(e[t]);return e}function ee(e){if(e instanceof f.Tensor)return e;if(e.length===0)throw Error(`items must be non-empty`);if(Array.isArray(e[0])){if(e.some(t=>t.length!==e[0].length))throw Error(`Unable to create tensor, you should probably activate truncation and/or padding with 'padding=True' and/or 'truncation=True' to have batched tensors with the same length.`);return new f.Tensor(`int64`,BigInt64Array.from(e.flat().map(e=>BigInt(e))),[e.length,e[0].length])}else return new f.Tensor(`int64`,BigInt64Array.from(e.map(e=>BigInt(e))),[1,e.length])}function te(e){return new f.Tensor(`bool`,[e],[1])}async function ne(e,t){let{encoder_outputs:n,input_ids:r,decoder_input_ids:i,...a}=t;if(!n){let r=(0,s.pick)(t,e.sessions.model.inputNames);n=(await j(e,r)).last_hidden_state}a.input_ids=i,a.encoder_hidden_states=n,e.sessions.decoder_model_merged.inputNames.includes(`encoder_attention_mask`)&&(a.encoder_attention_mask=t.attention_mask);let o=await ie(e,a,!0);return o}async function j(e,t){let n=e.sessions.model,r=(0,s.pick)(t,n.inputNames);if(n.inputNames.includes(`inputs_embeds`)&&!r.inputs_embeds){if(!t.input_ids)throw Error("Both `input_ids` and `inputs_embeds` are missing in the model inputs.");r.inputs_embeds=await e.encode_text({input_ids:t.input_ids})}if(n.inputNames.includes(`token_type_ids`)&&!r.token_type_ids){if(!r.input_ids)throw Error("Both `input_ids` and `token_type_ids` are missing in the model inputs.");r.token_type_ids=(0,f.zeros_like)(r.input_ids)}if(n.inputNames.includes(`pixel_mask`)&&!r.pixel_mask){if(!r.pixel_values)throw Error("Both `pixel_values` and `pixel_mask` are missing in the model inputs.");let e=r.pixel_values.dims;r.pixel_mask=(0,f.ones)([e[0],e[2],e[3]])}return await k(n,r)}async function re(e,t){let n=await e.encode(t),r=await e.decode(n);return r}async function ie(e,t,n=!1){let r=e.sessions[n?`decoder_model_merged`:`model`],{past_key_values:i,...a}=t;if(r.inputNames.includes(`use_cache_branch`)&&(a.use_cache_branch=te(!!i)),r.inputNames.includes(`position_ids`)&&a.attention_mask&&!a.position_ids){let t=[`paligemma`,`gemma3_text`,`gemma3`].includes(e.config.model_type)?1:0;a.position_ids=ue(a,i,t)}e.addPastKeyValues(a,i);let o=(0,s.pick)(a,r.inputNames);return await k(r,o)}function ae({modality_token_id:e,inputs_embeds:t,modality_features:n,input_ids:r,attention_mask:i}){let a=r.tolist().map(t=>t.reduce((t,n,r)=>(n==e&&t.push(r),t),[])),o=a.reduce((e,t)=>e+t.length,0),s=n.dims[0];if(o!==s)throw Error(`Number of tokens and features do not match: tokens: ${o}, features ${s}`);let c=0;for(let e=0;ee.dims[1]||i[e.at(-1)])),{...n,decoder_input_ids:ee(t)}}function F(e,...t){return e.config.is_encoder_decoder?P(e,...t):de(e,...t)}function fe(e,t,n,r){let i=!!n.past_key_values;if(r.guidance_scale!==null&&r.guidance_scale>1&&(i?n.input_ids=(0,f.cat)([n.input_ids,n.input_ids],0):(n.input_ids=(0,f.cat)([n.input_ids,(0,f.full_like)(n.input_ids,BigInt(r.pad_token_id))],0),n.attention_mask=(0,f.cat)([n.attention_mask,(0,f.full_like)(n.attention_mask,0n)],0))),(i||!n.pixel_values)&&(n.pixel_values=(0,f.full)([0,0,3,384,384],1)),i){let e=0,t=1,r=e>0?1:0,i=1;n.images_seq_mask=new f.Tensor(`bool`,Array(e+t).fill(!0).fill(!1,0,t),[i,e+t]),n.images_emb_mask=new f.Tensor(`bool`,Array(e).fill(!!r),[i,1,e])}return n}class I extends o.Callable{main_input_name=`input_ids`;forward_params=[`input_ids`,`attention_mask`];constructor(e,t,n){super(),this.config=e,this.sessions=t,this.configs=n;let r=C.get(this.constructor),i=x.get(r);switch(this.can_generate=!1,this._forward=null,this._prepare_inputs_for_generation=null,i){case b.DecoderOnly:this.can_generate=!0,this._forward=ie,this._prepare_inputs_for_generation=de;break;case b.Seq2Seq:case b.Vision2Seq:case b.Musicgen:this.can_generate=!0,this._forward=ne,this._prepare_inputs_for_generation=P;break;case b.EncoderDecoder:this._forward=ne;break;case b.ImageTextToText:this.can_generate=!0,this._forward=ce,this._prepare_inputs_for_generation=F;break;case b.AudioTextToText:this.can_generate=!0,this._forward=N,this._prepare_inputs_for_generation=F;break;case b.Phi3V:case b.ImageAudioTextToText:this.can_generate=!0,this._prepare_inputs_for_generation=F;break;case b.MultiModality:this.can_generate=!0,this._prepare_inputs_for_generation=fe;break;case b.AutoEncoder:this._forward=re;break;default:this._forward=j;break}this.can_generate&&this.forward_params.push(`past_key_values`),this.custom_config=this.config[`transformers.js_config`]??{}}async dispose(){let e=[];for(let t of Object.values(this.sessions))t?.handler?.dispose&&e.push(t.handler.dispose());return await Promise.all(e)}static async from_pretrained(e,{progress_callback:t=null,config:n=null,cache_dir:i=null,local_files_only:a=!1,revision:o=`main`,model_file_name:s=null,subfolder:c=`onnx`,device:u=null,dtype:d=null,use_external_data_format:f=null,session_options:p={}}={}){let m={progress_callback:t,config:n,cache_dir:i,local_files_only:a,revision:o,model_file_name:s,subfolder:c,device:u,dtype:d,use_external_data_format:f,session_options:p},h=C.get(this),g=x.get(h);n=m.config=await r.AutoConfig.from_pretrained(e,m);let _;if(g===b.DecoderOnly)_=await Promise.all([T(e,{model:m.model_file_name??`model`},m),E(e,{generation_config:`generation_config.json`},m)]);else if(g===b.Seq2Seq||g===b.Vision2Seq)_=await Promise.all([T(e,{model:`encoder_model`,decoder_model_merged:`decoder_model_merged`},m),E(e,{generation_config:`generation_config.json`},m)]);else if(g===b.MaskGeneration)_=await Promise.all([T(e,{model:`vision_encoder`,prompt_encoder_mask_decoder:`prompt_encoder_mask_decoder`},m)]);else if(g===b.EncoderDecoder)_=await Promise.all([T(e,{model:`encoder_model`,decoder_model_merged:`decoder_model_merged`},m)]);else if(g===b.ImageTextToText){let t={embed_tokens:`embed_tokens`,vision_encoder:`vision_encoder`,decoder_model_merged:`decoder_model_merged`};n.is_encoder_decoder&&(t.model=`encoder_model`),_=await Promise.all([T(e,t,m),E(e,{generation_config:`generation_config.json`},m)])}else if(g===b.AudioTextToText){let t={embed_tokens:`embed_tokens`,audio_encoder:`audio_encoder`,decoder_model_merged:`decoder_model_merged`};_=await Promise.all([T(e,t,m),E(e,{generation_config:`generation_config.json`},m)])}else if(g===b.ImageAudioTextToText){let t={embed_tokens:`embed_tokens`,audio_encoder:`audio_encoder`,vision_encoder:`vision_encoder`,decoder_model_merged:`decoder_model_merged`};_=await Promise.all([T(e,t,m),E(e,{generation_config:`generation_config.json`},m)])}else if(g===b.Musicgen)_=await Promise.all([T(e,{model:`text_encoder`,decoder_model_merged:`decoder_model_merged`,encodec_decode:`encodec_decode`},m),E(e,{generation_config:`generation_config.json`},m)]);else if(g===b.MultiModality)_=await Promise.all([T(e,{prepare_inputs_embeds:`prepare_inputs_embeds`,model:`language_model`,lm_head:`lm_head`,gen_head:`gen_head`,gen_img_embeds:`gen_img_embeds`,image_decode:`image_decode`},m),E(e,{generation_config:`generation_config.json`},m)]);else if(g===b.Phi3V)_=await Promise.all([T(e,{prepare_inputs_embeds:`prepare_inputs_embeds`,model:`model`,vision_encoder:`vision_encoder`},m),E(e,{generation_config:`generation_config.json`},m)]);else if(g===b.AutoEncoder)_=await Promise.all([T(e,{encoder_model:`encoder_model`,decoder_model:`decoder_model`},m)]);else{if(g!==b.EncoderOnly){let e=h??n?.model_type;e!==`custom`&&console.warn(`Model type for '${e}' not found, assuming encoder-only architecture. Please report this at ${l.GITHUB_ISSUE_URL}.`)}_=await Promise.all([T(e,{model:m.model_file_name??`model`},m)])}return new this(n,..._)}async _call(e){return await this.forward(e)}async forward(e){return await this._forward(this,e)}get generation_config(){return this.configs?.generation_config??null}_get_logits_warper(e){let t=new u.LogitsProcessorList;return e.temperature!==null&&e.temperature!==1&&t.push(new u.TemperatureLogitsWarper(e.temperature)),e.top_k!==null&&e.top_k!==0&&t.push(new u.TopKLogitsWarper(e.top_k)),e.top_p!==null&&e.top_p<1&&t.push(new u.TopPLogitsWarper(e.top_p)),t}_get_logits_processor(e,t,n=null){let r=new u.LogitsProcessorList;if(e.repetition_penalty!==null&&e.repetition_penalty!==1&&r.push(new u.RepetitionPenaltyLogitsProcessor(e.repetition_penalty)),e.no_repeat_ngram_size!==null&&e.no_repeat_ngram_size>0&&r.push(new u.NoRepeatNGramLogitsProcessor(e.no_repeat_ngram_size)),e.bad_words_ids!==null&&r.push(new u.NoBadWordsLogitsProcessor(e.bad_words_ids,e.eos_token_id)),e.min_length!==null&&e.eos_token_id!==null&&e.min_length>0&&r.push(new u.MinLengthLogitsProcessor(e.min_length,e.eos_token_id)),e.min_new_tokens!==null&&e.eos_token_id!==null&&e.min_new_tokens>0&&r.push(new u.MinNewTokensLengthLogitsProcessor(t,e.min_new_tokens,e.eos_token_id)),e.forced_bos_token_id!==null&&r.push(new u.ForcedBOSTokenLogitsProcessor(e.forced_bos_token_id)),e.forced_eos_token_id!==null&&r.push(new u.ForcedEOSTokenLogitsProcessor(e.max_length,e.forced_eos_token_id)),e.begin_suppress_tokens!==null){let n=t>1||e.forced_bos_token_id===null?t:t+1;r.push(new u.SuppressTokensAtBeginLogitsProcessor(e.begin_suppress_tokens,n))}return e.guidance_scale!==null&&e.guidance_scale>1&&r.push(new u.ClassifierFreeGuidanceLogitsProcessor(e.guidance_scale)),n!==null&&r.extend(n),r}_prepare_generation_config(e,t,n=d.GenerationConfig){let r={...this.config};for(let e of[`decoder`,`generator`,`text_config`])e in r&&Object.assign(r,r[e]);let i=new n(r);return Object.assign(i,this.generation_config??{}),e&&Object.assign(i,e),t&&Object.assign(i,(0,s.pick)(t,Object.getOwnPropertyNames(i))),i}_get_stopping_criteria(e,t=null){let n=new h.StoppingCriteriaList;return e.max_length!==null&&n.push(new h.MaxLengthCriteria(e.max_length,this.config.max_position_embeddings??null)),e.eos_token_id!==null&&n.push(new h.EosTokenCriteria(e.eos_token_id)),t&&n.extend(t),n}_validate_model_class(){if(!this.can_generate){let e=[Pl,Rl,Nl,Ol],t=C.get(this.constructor),n=new Set,r=this.config.model_type;for(let t of e){let e=t.get(r);e&&n.add(e[0])}let i=`The current model class (${t}) is not compatible with \`.generate()\`, as it doesn't have a language model head.`;throw n.size>0&&(i+=` Please use the following class instead: ${[...n].join(`, `)}`),Error(i)}}prepare_inputs_for_generation(...e){return this._prepare_inputs_for_generation(this,...e)}_update_model_kwargs_for_generation({generated_input_ids:e,outputs:t,model_inputs:n,is_encoder_decoder:r}){return n.past_key_values=this.getPastKeyValues(t,n.past_key_values),n.input_ids=new f.Tensor(`int64`,e.flat(),[e.length,1]),r?`decoder_attention_mask`in n:n.attention_mask=(0,f.cat)([n.attention_mask,(0,f.ones)([n.attention_mask.dims[0],1])],1),n.position_ids=null,n}_prepare_model_inputs({inputs:e,bos_token_id:t,model_kwargs:n}){let r=(0,s.pick)(n,this.forward_params),i=this.main_input_name;if(i in r){if(e)throw Error("`inputs`: {inputs}` were passed alongside {input_name} which is not allowed. Make sure to either pass {inputs} or {input_name}=...")}else r[i]=e;let a=r[i];return{inputs_tensor:a,model_inputs:r,model_input_name:i}}async _prepare_encoder_decoder_kwargs_for_generation({inputs_tensor:e,model_inputs:t,model_input_name:n,generation_config:r}){if(this.sessions.model.inputNames.includes(`inputs_embeds`)&&!t.inputs_embeds&&`_prepare_inputs_embeds`in this){let{input_ids:e,pixel_values:n,attention_mask:r,...i}=t,a=await this._prepare_inputs_embeds(t);t={...i,...(0,s.pick)(a,[`inputs_embeds`,`attention_mask`])}}let{last_hidden_state:i}=await j(this,t);if(r.guidance_scale!==null&&r.guidance_scale>1)i=(0,f.cat)([i,(0,f.full_like)(i,0)],0),`attention_mask`in t&&(t.attention_mask=(0,f.cat)([t.attention_mask,(0,f.zeros_like)(t.attention_mask)],0));else if(t.decoder_input_ids){let e=ee(t.decoder_input_ids).dims[0];if(e!==i.dims[0]){if(i.dims[0]!==1)throw Error(`The encoder outputs have a different batch size (${i.dims[0]}) than the decoder inputs (${e}).`);i=(0,f.cat)(Array.from({length:e},()=>i),0)}}return t.encoder_outputs=i,t}_prepare_decoder_input_ids_for_generation({batch_size:e,model_input_name:t,model_kwargs:n,decoder_start_token_id:r,bos_token_id:i,generation_config:a}){let{decoder_input_ids:o,...s}=n;if(!(o instanceof f.Tensor)){if(o)Array.isArray(o[0])||(o=Array.from({length:e},()=>o));else if(r??=i,this.config.model_type===`musicgen`)o=Array.from({length:e*this.config.decoder.num_codebooks},()=>[r]);else if(Array.isArray(r)){if(r.length!==e)throw Error(`\`decoder_start_token_id\` expcted to have length ${e} but got ${r.length}`);o=r}else o=Array.from({length:e},()=>[r]);o=ee(o)}return n.decoder_attention_mask=(0,f.ones_like)(o),{input_ids:o,model_inputs:s}}async generate({inputs:e=null,generation_config:t=null,logits_processor:n=null,stopping_criteria:r=null,streamer:i=null,...a}){this._validate_model_class(),t=this._prepare_generation_config(t,a);let{inputs_tensor:o,model_inputs:s,model_input_name:c}=this._prepare_model_inputs({inputs:e,model_kwargs:a}),l=this.config.is_encoder_decoder;l&&(`encoder_outputs`in s||(s=await this._prepare_encoder_decoder_kwargs_for_generation({inputs_tensor:o,model_inputs:s,model_input_name:c,generation_config:t})));let u;l?{input_ids:u,model_inputs:s}=this._prepare_decoder_input_ids_for_generation({batch_size:s[c].dims.at(0),model_input_name:c,model_kwargs:s,decoder_start_token_id:t.decoder_start_token_id,bos_token_id:t.bos_token_id,generation_config:t}):u=s[c];let d=u.dims.at(-1);t.max_new_tokens!==null&&(t.max_length=d+t.max_new_tokens);let p=this._get_logits_processor(t,d,n),m=this._get_stopping_criteria(t,r),h=s[c].dims.at(0),_=g.LogitsSampler.getSampler(t),v=Array(h).fill(0),y=u.tolist();i&&i.put(y);let b,x={};for(;;){if(s=this.prepare_inputs_for_generation(y,s,t),b=await this.forward(s),t.output_attentions&&t.return_dict_in_generate){let e=this.getAttentions(b);for(let t in e)t in x||(x[t]=[]),x[t].push(e[t])}let e=b.logits.slice(null,-1,null),n=p(y,e),r=[];for(let e=0;ee))break;s=this._update_model_kwargs_for_generation({generated_input_ids:r,outputs:b,model_inputs:s,is_encoder_decoder:l})}i&&i.end();let S=this.getPastKeyValues(b,s.past_key_values,!0),C=new f.Tensor(`int64`,y.flat(),[y.length,y[0].length]);if(t.return_dict_in_generate)return{sequences:C,past_key_values:S,...x};for(let e of Object.values(b))e.location===`gpu-buffer`&&e.dispose();return C}getPastKeyValues(e,t,n=!1){let r=Object.create(null);for(let i in e)if(i.startsWith(`present`)){let a=i.replace(`present`,`past_key_values`),o=i.includes(`encoder`);if(o&&t?r[a]=t[a]:r[a]=e[i],t&&(!o||n)){let e=t[a];e.location===`gpu-buffer`&&e.dispose()}}return r}getAttentions(e){let t={};for(let n of[`cross_attentions`,`encoder_attentions`,`decoder_attentions`])for(let r in e)r.startsWith(n)&&(n in t||(t[n]=[]),t[n].push(e[r]));return t}addPastKeyValues(e,t){if(t)Object.assign(e,t);else{let t=this.sessions.decoder_model_merged??this.sessions.model,n=t?.config?.kv_cache_dtype??`float32`,i=n===`float16`?new f.DataTypeMap.float16:[],a=(e[this.main_input_name]??e.attention_mask)?.dims?.[0]??1,o=(0,r.getKeyValueShapes)(this.config,{batch_size:a});for(let t in o)e[t]=new f.Tensor(n,i,o[t])}}async encode_image({pixel_values:e}){return(await k(this.sessions.vision_encoder,{pixel_values:e})).image_features}async encode_text({input_ids:e}){return(await k(this.sessions.embed_tokens,{input_ids:e})).inputs_embeds}async encode_audio({audio_values:e}){return(await k(this.sessions.audio_encoder,{audio_values:e})).audio_features}}class pe{}class me extends pe{constructor({last_hidden_state:e,hidden_states:t=null,attentions:n=null}){super(),this.last_hidden_state=e,this.hidden_states=t,this.attentions=n}}class he extends I{}class ge extends he{}class _e extends he{async _call(e){return new Uu(await super._call(e))}}class ve extends he{async _call(e){return new Q(await super._call(e))}}class L extends he{async _call(e){return new Hu(await super._call(e))}}class ye extends he{async _call(e){return new Wu(await super._call(e))}}class be extends I{}class xe extends be{}class Se extends be{async _call(e){return new Uu(await super._call(e))}}class Ce extends be{async _call(e){return new Q(await super._call(e))}}class we extends be{async _call(e){return new Hu(await super._call(e))}}class Te extends be{async _call(e){return new Wu(await super._call(e))}}class Ee extends I{}class De extends Ee{}class Oe extends Ee{async _call(e){return new Uu(await super._call(e))}}class ke extends Ee{async _call(e){return new Q(await super._call(e))}}class Ae extends Ee{async _call(e){return new Hu(await super._call(e))}}class je extends I{}class Me extends je{}class Ne extends I{}class R extends Ne{}class Pe extends Ne{async _call(e){return new Uu(await super._call(e))}}class Fe extends Ne{async _call(e){return new Q(await super._call(e))}}class Ie extends Ne{async _call(e){return new Hu(await super._call(e))}}class Le extends Ne{async _call(e){return new Wu(await super._call(e))}}class Re extends I{}class ze extends Re{}class Be extends Re{async _call(e){return new Uu(await super._call(e))}}class z extends Re{async _call(e){return new Q(await super._call(e))}}class Ve extends Re{async _call(e){return new Hu(await super._call(e))}}class He extends Re{async _call(e){return new Wu(await super._call(e))}}class B extends I{}class Ue extends B{}class We extends B{async _call(e){return new Uu(await super._call(e))}}class Ge extends B{async _call(e){return new Q(await super._call(e))}}class Ke extends B{async _call(e){return new Hu(await super._call(e))}}class qe extends B{async _call(e){return new Wu(await super._call(e))}}class Je extends I{}class Ye extends Je{}class Xe extends Je{async _call(e){return new Uu(await super._call(e))}}class Ze extends Je{async _call(e){return new Q(await super._call(e))}}class Qe extends Je{async _call(e){return new Hu(await super._call(e))}}class $e extends Je{async _call(e){return new Wu(await super._call(e))}}class et extends I{}class tt extends et{}class nt extends et{async _call(e){return new Uu(await super._call(e))}}class rt extends et{async _call(e){return new Q(await super._call(e))}}class it extends et{async _call(e){return new Hu(await super._call(e))}}class at extends et{async _call(e){return new Wu(await super._call(e))}}class ot extends I{}class st extends ot{}class ct extends ot{async _call(e){return new Uu(await super._call(e))}}class lt extends ot{async _call(e){return new Q(await super._call(e))}}class ut extends ot{async _call(e){return new Hu(await super._call(e))}}class dt extends ot{async _call(e){return new Wu(await super._call(e))}}class ft extends I{}class pt extends ft{}class mt extends ft{async _call(e){return new Q(await super._call(e))}}class ht extends ft{async _call(e){return new Hu(await super._call(e))}}class gt extends ft{async _call(e){return new Wu(await super._call(e))}}class _t extends ft{async _call(e){return new Uu(await super._call(e))}}class vt extends I{}class yt extends vt{}class bt extends vt{async _call(e){return new Uu(await super._call(e))}}class xt extends vt{async _call(e){return new Q(await super._call(e))}}class St extends vt{async _call(e){return new Hu(await super._call(e))}}class Ct extends I{}class wt extends Ct{}class Tt extends Ct{async _call(e){return new Uu(await super._call(e))}}class Et extends Ct{async _call(e){return new Q(await super._call(e))}}class Dt extends Ct{async _call(e){return new Wu(await super._call(e))}}class Ot extends I{}class kt extends Ot{}class At extends Ot{async _call(e){return new Uu(await super._call(e))}}class jt extends Ot{async _call(e){return new Q(await super._call(e))}}class Mt extends Ot{async _call(e){return new Hu(await super._call(e))}}class Nt extends Ot{async _call(e){return new Wu(await super._call(e))}}class Pt extends I{}class Ft extends Pt{}class It extends Pt{async _call(e){return new Uu(await super._call(e))}}class Lt extends Pt{async _call(e){return new Q(await super._call(e))}}class Rt extends Pt{async _call(e){return new Wu(await super._call(e))}}class zt extends I{}class Bt extends zt{}class Vt extends zt{async _call(e){return new Q(await super._call(e))}}class Ht extends zt{async _call(e){return new Wu(await super._call(e))}}class Ut extends zt{async _call(e){return new Uu(await super._call(e))}}class Wt extends I{forward_params=[`input_ids`,`attention_mask`,`encoder_outputs`,`decoder_input_ids`,`decoder_attention_mask`,`past_key_values`]}class Gt extends Wt{}class Kt extends Wt{}class qt extends I{}class Jt extends qt{}class Yt extends qt{}class Xt extends I{}class Zt extends Xt{}class Qt extends Xt{}class $t extends I{}class en extends $t{}class tn extends $t{}class nn extends $t{async _call(e){return new Q(await super._call(e))}}class rn extends I{}class V extends rn{}class an extends rn{}class on extends rn{async _call(e){return new Q(await super._call(e))}}class sn extends rn{}class cn extends I{}class ln extends cn{}class un extends cn{}class dn extends I{}class fn extends dn{}class H extends dn{}class pn extends I{}class mn extends pn{}class hn extends pn{async _call(e){return new Uu(await super._call(e))}}class U extends pn{async _call(e){return new Q(await super._call(e))}}class gn extends pn{async _call(e){return new Hu(await super._call(e))}}class _n extends pn{async _call(e){return new Wu(await super._call(e))}}class vn extends I{}class yn extends vn{}class W extends vn{async _call(e){return new Uu(await super._call(e))}}class bn extends vn{async _call(e){return new Q(await super._call(e))}}class xn extends vn{async _call(e){return new Hu(await super._call(e))}}class Sn extends vn{async _call(e){return new Wu(await super._call(e))}}class Cn extends I{}class wn extends Cn{}class Tn extends Cn{async _call(e){return new Uu(await super._call(e))}}class En extends Cn{async _call(e){return new Q(await super._call(e))}}class Dn extends Cn{async _call(e){return new Hu(await super._call(e))}}class On extends Cn{async _call(e){return new Wu(await super._call(e))}}class kn extends I{}class An extends kn{}class jn extends kn{}class Mn extends I{requires_attention_mask=!1;main_input_name=`input_features`;forward_params=[`input_features`,`attention_mask`,`decoder_input_ids`,`decoder_attention_mask`,`past_key_values`]}class Nn extends Mn{}class Pn extends Mn{_prepare_generation_config(e,t){return super._prepare_generation_config(e,t,v.WhisperGenerationConfig)}_retrieve_init_tokens(e){let t=[e.decoder_start_token_id],n=e.language,r=e.task;if(e.is_multilingual){n||(console.warn(`No language specified - defaulting to English (en).`),n=`en`);let i=(0,y.whisper_language_to_code)(n),a=`<|${i}|>`;t.push(e.lang_to_id[a]),t.push(e.task_to_id[r??`transcribe`])}else if(n||r)throw Error("Cannot specify `task` or `language` for an English-only model. If the model is intended to be multilingual, pass `is_multilingual=true` to generate, or update the generation config.");return!e.return_timestamps&&e.no_timestamps_token_id&&t.at(-1)!==e.no_timestamps_token_id?t.push(e.no_timestamps_token_id):e.return_timestamps&&t.at(-1)===e.no_timestamps_token_id&&(console.warn("<|notimestamps|> prompt token is removed from generation_config since `return_timestamps` is set to `true`."),t.pop()),t.filter(e=>e!=null)}async generate({inputs:e=null,generation_config:t=null,logits_processor:n=null,stopping_criteria:r=null,...i}){t=this._prepare_generation_config(t,i);let a=i.decoder_input_ids??this._retrieve_init_tokens(t);if(t.return_timestamps&&(n??=new u.LogitsProcessorList,n.push(new u.WhisperTimeStampLogitsProcessor(t,a))),t.begin_suppress_tokens&&(n??=new u.LogitsProcessorList,n.push(new u.SuppressTokensAtBeginLogitsProcessor(t.begin_suppress_tokens,a.length))),t.return_token_timestamps){if(!t.alignment_heads)throw Error("Model generation config has no `alignment_heads`, token-level timestamps not available. See https://gist.github.com/hollance/42e32852f24243b748ae6bc1f985b13a on how to add this property to the generation config.");t.task===`translate`&&console.warn(`Token-level timestamps may not be reliable for task 'translate'.`),t.output_attentions=!0,t.return_dict_in_generate=!0}let o=await super.generate({inputs:e,generation_config:t,logits_processor:n,decoder_input_ids:a,...i});return t.return_token_timestamps&&(o.token_timestamps=this._extract_token_timestamps(o,t.alignment_heads,t.num_frames)),o}_extract_token_timestamps(e,t,n=null,r=.02){if(!e.cross_attentions)throw Error("Model outputs must contain cross attentions to extract timestamps. This is most likely because the model was not exported with `output_attentions=True`.");n??console.warn("`num_frames` has not been set, meaning the entire audio will be analyzed. This may lead to inaccurate token-level timestamps for short audios (< 30 seconds).");let i=this.config.median_filter_width;i===void 0&&(console.warn("Model config has no `median_filter_width`, using default value of 7."),i=7);let a=e.cross_attentions,o=Array.from({length:this.config.decoder_layers},(e,t)=>(0,f.cat)(a.map(e=>e[t]),2)),c=(0,f.stack)(t.map(([e,t])=>{if(e>=o.length)throw Error(`Layer index ${e} is out of bounds for cross attentions (length ${o.length}).`);return n?o[e].slice(null,t,null,[0,n]):o[e].slice(null,t)})).transpose(1,0,2,3),[l,u]=(0,f.std_mean)(c,-2,0,!0),d=c.clone();for(let e=0;en[t+1]-n[t]),o=(0,s.mergeArrays)([1],a).map(e=>!!e),c=[];for(let e=0;eArray.from({length:e.dims[0]},t=>Array.from({length:e.dims[1]},e=>1))),p=t?t.tolist():[],h=n?n.tolist():[],g=0,_=0;for(let e=0;eu[e][n]==1),n=t.reduce((e,t,n)=>(t==s&&e.push(n),e),[]),r=n.map(e=>t[e+1]),f=r.filter(e=>e==a).length,v=r.filter(e=>e==o).length,y=[],b=0,x=f,S=v;for(let e=0;et>b&&e==a),n=t.findIndex((e,t)=>t>b&&e==o),r=x>0&&e!==-1?e:t.length+1,i=S>0&&n!==-1?n:t.length+1,s,l,u,d;r0?(0,m.max)(y.at(-1))[0]+1:0;y.push(Array.from({length:3*w},(e,t)=>T+t%w));let E=w+T,D=f*v*C,O=Array.from({length:D},(e,t)=>E+Math.floor(t/(v*C))),k=Array.from({length:D},(e,t)=>E+Math.floor(t/C)%v),A=Array.from({length:D},(e,t)=>E+t%C);y.push([O,k,A].flat()),b=s+D}if(b0?(0,m.max)(y.at(-1))[0]+1:0,n=t.length-b;y.push(Array.from({length:3*n},(t,r)=>e+r%n))}let C=y.reduce((e,t)=>e+t.length,0),w=Array(C),T=0;for(let e=0;e<3;++e)for(let t=0;te[n%e.length]),i=Array.from({length:t[0]},(n,r)=>(0,m.max)(e.subarray(t[1]*r,t[1]*(r+1)))[0]+1n+BigInt(t[1]));return[new f.Tensor(`int64`,n,[3,...t]),new f.Tensor(`int64`,i,[i.length,1])]}else{let[t,n]=e.dims,r=BigInt64Array.from({length:3*t*n},(e,r)=>BigInt(Math.floor(r%n/t)));return[new f.Tensor(`int64`,r,[3,...e.dims]),(0,f.zeros)([t,1])]}}async encode_image({pixel_values:e,image_grid_thw:t}){let n=(await k(this.sessions.vision_encoder,{pixel_values:e,grid_thw:t})).image_features;return n}_merge_input_ids_with_image_features(e){return oe({image_token_id:this.config.image_token_id,...e})}prepare_inputs_for_generation(e,t,n){if(t.attention_mask&&!t.position_ids)if(!t.past_key_values)[t.position_ids,t.rope_deltas]=this.get_rope_index(t.input_ids,t.image_grid_thw,t.video_grid_thw,t.attention_mask);else{t.pixel_values=null;let e=BigInt(Object.values(t.past_key_values)[0].dims.at(-2)),n=t.rope_deltas.map(t=>e+t);t.position_ids=(0,f.stack)([n,n,n],0)}return t}}class ki extends I{}class Ai extends ki{}class ji extends ki{}class Mi extends I{}class Ni extends Mi{}class Pi extends Mi{}class Fi extends I{}class Ii extends Fi{}class Li extends Fi{}class Ri extends I{}class zi extends Ri{}class Bi extends Ri{}class Vi extends I{}class Hi extends Vi{}class Ui extends Vi{}class Wi extends I{}class Gi extends Wi{}class Ki extends Wi{async _call(e){return new Q(await super._call(e))}}class qi extends I{}class Ji extends qi{}class Yi extends qi{async _call(e){return new Q(await super._call(e))}}class Xi extends I{}class Zi extends Xi{}class Qi extends I{}class $i extends Qi{}class ea extends Qi{async _call(e){return new Q(await super._call(e))}}class ta extends I{}class na extends ta{}class ra extends I{}class ia extends ra{}class aa extends ra{async _call(e){return new Q(await super._call(e))}}class oa extends I{}class sa extends oa{}class ca extends I{}class la extends ca{}class ua extends ca{async _call(e){return new Q(await super._call(e))}}class da extends I{}class fa extends da{async _call(e){return new qu(await super._call(e))}}class pa extends I{}class ma extends pa{}class ha extends pa{async _call(e){return new Q(await super._call(e))}}class ga extends I{}class _a extends ga{}class va extends ga{async _call(e){return new Q(await super._call(e))}}class ya extends I{}class ba extends ya{}class xa extends ya{}class Sa extends I{}class Ca extends Sa{}class wa extends Sa{}class Ta extends I{}class Ea extends Ta{}class Da extends Ta{async _call(e){return new Q(await super._call(e))}}class Oa extends I{}class ka extends Oa{}class Aa extends Oa{async _call(e){return new Ma(await super._call(e))}}class ja extends Oa{async _call(e){return new Na(await super._call(e))}}class Ma extends pe{constructor({logits:e,pred_boxes:t}){super(),this.logits=e,this.pred_boxes=t}}class Na extends pe{constructor({logits:e,pred_boxes:t,pred_masks:n}){super(),this.logits=e,this.pred_boxes=t,this.pred_masks=n}}class Pa extends I{}class Fa extends Pa{}class Ia extends Pa{async _call(e){return new La(await super._call(e))}}class La extends pe{constructor({logits:e,pred_boxes:t}){super(),this.logits=e,this.pred_boxes=t}}class Ra extends I{}class za extends Ra{}class Ba extends Ra{async _call(e){return new Va(await super._call(e))}}class Va extends La{}class Ha extends I{}class Ua extends Ha{}class Wa extends Ha{async _call(e){return new Ga(await super._call(e))}}class Ga extends La{}class Ka extends I{}class qa extends Ka{}class Ja extends Ka{async _call(e){return new La(await super._call(e))}}class Ya extends I{}class Xa extends Ya{}class Za extends Ya{async _call(e){return new Qa(await super._call(e))}}class Qa extends Ma{}class $a extends I{}class eo extends $a{}class to extends $a{async _call(e){return new Q(await super._call(e))}}class no extends I{}class ro extends no{}class io extends no{async _call(e){return new Q(await super._call(e))}}class ao extends I{}class oo extends ao{}class so extends ao{async _call(e){return new Q(await super._call(e))}}class co extends I{}class lo extends co{}class uo extends co{async _call(e){return new Q(await super._call(e))}}class fo extends co{}class po extends I{}class mo extends po{}class ho extends po{}class go extends I{}class _o extends go{}class vo extends go{}class yo extends I{}class bo extends yo{}class xo extends I{}class So extends xo{}class Co extends xo{}class wo extends xo{}class To extends I{}class Eo extends To{}class Do extends I{}class Oo extends Do{}class ko extends I{}class Ao extends ko{}class jo extends I{}class Mo extends jo{}class No extends jo{}class Po extends I{}class Fo extends Po{}class Io extends Po{}class Lo extends I{}class Ro extends Lo{}class zo extends I{}class Bo extends zo{}class Vo extends zo{async _call(e){return new Q(await super._call(e))}}class Ho extends I{}class Uo extends Ho{}class Wo extends Ho{async _call(e){return new Q(await super._call(e))}}class Go extends I{}class Ko extends Go{}class qo extends Go{async _call(e){return new Q(await super._call(e))}}class Jo extends I{}class Yo extends Jo{}class Xo extends Jo{async _call(e){return new Q(await super._call(e))}}class Zo extends I{}class Qo extends Zo{}class $o extends I{}class es extends $o{}class ts extends $o{async _call(e){return new ns(await super._call(e))}}class ns extends pe{constructor({logits:e,pred_boxes:t}){super(),this.logits=e,this.pred_boxes=t}}class rs extends I{}class os extends rs{async get_image_embeddings({pixel_values:e}){return await j(this,{pixel_values:e})}async forward(e){if((!e.image_embeddings||!e.image_positional_embeddings)&&(e={...e,...await this.get_image_embeddings(e)}),!e.input_labels&&e.input_points){let t=e.input_points.dims.slice(0,-1),n=t.reduce((e,t)=>e*t,1);e.input_labels=new f.Tensor(`int64`,new BigInt64Array(n).fill(1n),t)}let t={image_embeddings:e.image_embeddings,image_positional_embeddings:e.image_positional_embeddings};return e.input_points&&(t.input_points=e.input_points),e.input_labels&&(t.input_labels=e.input_labels),e.input_boxes&&(t.input_boxes=e.input_boxes),await k(this.sessions.prompt_encoder_mask_decoder,t)}async _call(e){return new ss(await super._call(e))}}class ss extends pe{constructor({iou_scores:e,pred_masks:t}){super(),this.iou_scores=e,this.pred_masks=t}}class cs extends I{}class ls extends cs{}class us extends cs{}class ds extends I{}class fs extends ds{}class ps extends ds{}class ms extends I{}class hs extends ms{}class gs extends ms{async _call(e){return new Gu(await super._call(e))}}class _s extends ms{async _call(e){return new Q(await super._call(e))}}class vs extends ms{async _call(e){return new Hu(await super._call(e))}}class ys extends I{}class bs extends ys{}class xs extends ys{async _call(e){return new Hu(await super._call(e))}}class Ss extends I{}class Cs extends Ss{}class ws extends I{}class Ts extends ws{}class Es extends ws{async _call(e){return new Gu(await super._call(e))}}class Ds extends ws{async _call(e){return new Q(await super._call(e))}}class Os extends I{}class ks extends Os{}class As extends Os{async _call(e){return new Gu(await super._call(e))}}class js extends Os{async _call(e){return new Q(await super._call(e))}}class Ms extends Os{async _call(e){return new Hu(await super._call(e))}}class Ns extends I{}class Ps extends Ns{}class Fs extends Ns{async _call(e){return new Gu(await super._call(e))}}class Is extends Ns{async _call(e){return new Q(await super._call(e))}}class Ls extends I{}class Rs extends ms{}class zs extends ms{async _call(e){return new Gu(await super._call(e))}}class Bs extends ms{async _call(e){return new Q(await super._call(e))}}class Vs extends I{}class Hs extends Vs{}class Us extends Vs{async _call(e){return new Gu(await super._call(e))}}class Ws extends Vs{async _call(e){return new Q(await super._call(e))}}class Gs extends Vs{async _call(e){return new Vu(await super._call(e))}}class Ks extends Vs{async _call(e){return new Hu(await super._call(e))}}class qs extends I{}class Js extends qs{}class Ys extends I{}class Xs extends Ys{}class Zs extends Ys{}class Qs extends Ys{async generate_speech(e,t,{threshold:n=.5,minlenratio:r=0,maxlenratio:i=20,vocoder:a=null}={}){let o={input_ids:e},{encoder_outputs:s,encoder_attention_mask:c}=await j(this,o),l=s.dims[1]/this.config.reduction_factor,u=Math.floor(l*i),d=Math.floor(l*r),p=this.config.num_mel_bins,m=[],h=null,g=null,_=0;for(;;){++_;let e=te(!!g),r;r=g?g.output_sequence_out:new f.Tensor(`float32`,new Float32Array(p),[1,1,p]);let i={use_cache_branch:e,output_sequence:r,encoder_attention_mask:c,speaker_embeddings:t,encoder_hidden_states:s};this.addPastKeyValues(i,h),g=await k(this.sessions.decoder_model_merged,i),h=this.getPastKeyValues(g,h);let{prob:a,spectrum:o}=g;if(m.push(o),_>=d&&(Array.from(a.data).filter(e=>e>=n).length>0||_>=u))break}let v=(0,f.cat)(m),{waveform:y}=await k(a.sessions.model,{spectrogram:v});return{spectrogram:v,waveform:y}}}class $s extends I{main_input_name=`spectrogram`}class ec extends I{}class tc extends ec{}class nc extends I{}class rc extends nc{}class ic extends nc{}class ac extends I{}class oc extends ac{}class sc extends ac{}class cc extends I{}class lc extends cc{}class uc extends cc{}class dc extends I{}class fc extends dc{}class pc extends dc{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`text_model`})}}class mc extends dc{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`audio_model`})}}class hc extends I{}class gc extends hc{async _call(e){return new Ju(await super._call(e))}}class _c extends I{}class vc extends _c{}class yc extends _c{}class bc extends _c{}class xc extends I{}class Sc extends xc{}class Cc extends xc{}class wc extends I{}class Tc extends wc{}class Ec extends wc{async _call(e){return new Q(await super._call(e))}}class Dc extends I{}class Oc extends Dc{}class kc extends Dc{}class Ac extends I{forward_params=[`input_ids`,`attention_mask`,`encoder_outputs`,`decoder_input_ids`,`decoder_attention_mask`,`past_key_values`];_apply_and_filter_by_delay_pattern_mask(e){let[t,n]=e.dims,r=this.config.decoder.num_codebooks,i=n-r,a=0;for(let t=0;t0&&c<=i&&(e.data[a++]=e.data[t])}let o=Math.floor(t/r),s=a/(o*r);return new f.Tensor(e.type,e.data.slice(0,a),[o,r,s])}prepare_inputs_for_generation(e,t,n){let r=structuredClone(e);for(let e=0;e=t&&(r[e][t]=BigInt(this.config.decoder.pad_token_id));n.guidance_scale!==null&&n.guidance_scale>1&&(r=r.concat(r));let i=super.prepare_inputs_for_generation(r,t,n);return i}async generate(e){let t=await super.generate(e),n=this._apply_and_filter_by_delay_pattern_mask(t).unsqueeze_(0),{audio_values:r}=await k(this.sessions.encodec_decode,{audio_codes:n});return r}}class jc extends I{}class Mc extends jc{}class Nc extends jc{async _call(e){return new Q(await super._call(e))}}class Pc extends jc{}class Fc extends I{}class Ic extends Fc{}class Lc extends Fc{async _call(e){return new Q(await super._call(e))}}class Rc extends Fc{}class zc extends I{}class Bc extends zc{}class Vc extends zc{async _call(e){return new Q(await super._call(e))}}class Hc extends zc{}class Uc extends I{}class Wc extends Uc{}class Gc extends Uc{async _call(e){return new Q(await super._call(e))}}class Kc extends Uc{}class qc extends I{}class Jc extends qc{}class Yc extends I{}class Xc extends Yc{forward_params=[`input_ids`,`pixel_values`,`images_seq_mask`,`images_emb_mask`,`attention_mask`,`position_ids`,`past_key_values`];constructor(...e){super(...e),this._generation_mode=`text`}async forward(e){let t=this._generation_mode??`text`,n;if(t===`text`||!e.past_key_values){let t=this.sessions.prepare_inputs_embeds,r=(0,s.pick)(e,t.inputNames);n=await k(t,r)}else{let t=this.sessions.gen_img_embeds,r=(0,s.pick)({image_ids:e.input_ids},t.inputNames);n=await k(t,r)}let r={...e,...n},i=await ie(this,r),a=this.sessions[t===`text`?`lm_head`:`gen_head`];if(!a)throw Error(`Unable to find "${a}" generation head`);let o=await k(a,(0,s.pick)(i,a.inputNames));return{...n,...i,...o}}async generate(e){return this._generation_mode=`text`,super.generate(e)}async generate_images(e){this._generation_mode=`image`;let t=(e.inputs??e[this.main_input_name]).dims[1],n=await super.generate(e),r=n.slice(null,[t,null]),i=this.sessions.image_decode,{decoded_image:a}=await k(i,{generated_tokens:r}),o=a.add_(1).mul_(255/2).clamp_(0,255).to(`uint8`),s=[];for(let e of o){let t=p.RawImage.fromTensor(e);s.push(t)}return s}}class Zc extends pe{constructor({char_logits:e,bpe_logits:t,wp_logits:n}){super(),this.char_logits=e,this.bpe_logits=t,this.wp_logits=n}get logits(){return[this.char_logits,this.bpe_logits,this.wp_logits]}}class Qc extends I{}class $c extends Qc{async _call(e){return new Zc(await super._call(e))}}class el extends I{}class tl extends el{}class nl extends el{}class rl extends I{}class il extends rl{}class al extends rl{}class ol extends I{forward_params=[`input_ids`,`attention_mask`,`position_ids`,`audio_values`,`past_key_values`]}class sl extends ol{_merge_input_ids_with_audio_features(e){let t=e.audio_features.dims.at(-1),n=e.audio_features.view(-1,t);return se({audio_token_id:this.config.ignore_index,...e,audio_features:n})}}class cl extends I{main_input_name=`input_values`;forward_params=[`input_values`]}class ll extends pe{constructor({audio_codes:e}){super(),this.audio_codes=e}}class ul extends pe{constructor({audio_values:e}){super(),this.audio_values=e}}class dl extends cl{async encode(e){return new ll(await k(this.sessions.encoder_model,e))}async decode(e){return new ul(await k(this.sessions.decoder_model,e))}}class fl extends cl{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`encoder_model`})}}class pl extends cl{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`decoder_model`})}}class ml extends I{main_input_name=`input_values`;forward_params=[`input_values`]}class hl extends pe{constructor({audio_codes:e}){super(),this.audio_codes=e}}class gl extends pe{constructor({audio_values:e}){super(),this.audio_values=e}}class _l extends ml{async encode(e){return new hl(await k(this.sessions.encoder_model,e))}async decode(e){return new gl(await k(this.sessions.decoder_model,e))}}class vl extends ml{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`encoder_model`})}}class yl extends ml{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`decoder_model`})}}class bl extends I{main_input_name=`input_values`;forward_params=[`input_values`]}class xl extends bl{async encode(e){return await k(this.sessions.encoder_model,e)}async decode(e){return await k(this.sessions.decoder_model,e)}}class Sl extends bl{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`encoder_model`})}}class Cl extends bl{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`decoder_model`})}}class Z{static MODEL_CLASS_MAPPINGS=null;static BASE_IF_FAIL=!1;static async from_pretrained(e,{progress_callback:t=null,config:n=null,cache_dir:i=null,local_files_only:a=!1,revision:o=`main`,model_file_name:s=null,subfolder:c=`onnx`,device:l=null,dtype:u=null,use_external_data_format:d=null,session_options:f={}}={}){let p={progress_callback:t,config:n,cache_dir:i,local_files_only:a,revision:o,model_file_name:s,subfolder:c,device:l,dtype:u,use_external_data_format:d,session_options:f};if(p.config=await r.AutoConfig.from_pretrained(e,p),!this.MODEL_CLASS_MAPPINGS)throw Error("`MODEL_CLASS_MAPPINGS` not implemented for this type of `AutoClass`: "+this.name);let m=p.config.model_type;for(let t of this.MODEL_CLASS_MAPPINGS){let n=t.get(m);if(!n){for(let e of t.values())if(e[0]===m){n=e;break}if(!n)continue}return await n[1].from_pretrained(e,p)}if(this.BASE_IF_FAIL)return cu.has(m)||console.warn(`Unknown model class "${m}", attempting to construct from base class.`),await I.from_pretrained(e,p);throw Error(`Unsupported model type: ${m}`)}}let wl=new Map([[`bert`,[`BertModel`,ge]],[`neobert`,[`NeoBertModel`,xe]],[`modernbert`,[`ModernBertModel`,De]],[`nomic_bert`,[`NomicBertModel`,Me]],[`roformer`,[`RoFormerModel`,R]],[`electra`,[`ElectraModel`,Ue]],[`esm`,[`EsmModel`,yt]],[`convbert`,[`ConvBertModel`,ze]],[`camembert`,[`CamembertModel`,Ye]],[`deberta`,[`DebertaModel`,tt]],[`deberta-v2`,[`DebertaV2Model`,st]],[`mpnet`,[`MPNetModel`,kt]],[`albert`,[`AlbertModel`,Bt]],[`distilbert`,[`DistilBertModel`,pt]],[`roberta`,[`RobertaModel`,mn]],[`xlm`,[`XLMModel`,yn]],[`xlm-roberta`,[`XLMRobertaModel`,wn]],[`clap`,[`ClapModel`,fc]],[`clip`,[`CLIPModel`,nr]],[`clipseg`,[`CLIPSegModel`,pr]],[`chinese_clip`,[`ChineseCLIPModel`,lr]],[`siglip`,[`SiglipModel`,J]],[`jina_clip`,[`JinaCLIPModel`,ur]],[`mobilebert`,[`MobileBertModel`,wt]],[`squeezebert`,[`SqueezeBertModel`,Ft]],[`wav2vec2`,[`Wav2Vec2Model`,hs]],[`wav2vec2-bert`,[`Wav2Vec2BertModel`,Ps]],[`unispeech`,[`UniSpeechModel`,Ts]],[`unispeech-sat`,[`UniSpeechSatModel`,ks]],[`hubert`,[`HubertModel`,Rs]],[`wavlm`,[`WavLMModel`,Hs]],[`audio-spectrogram-transformer`,[`ASTModel`,An]],[`vits`,[`VitsModel`,gc]],[`pyannote`,[`PyAnnoteModel`,bs]],[`wespeaker-resnet`,[`WeSpeakerResNetModel`,Cs]],[`detr`,[`DetrModel`,ka]],[`rt_detr`,[`RTDetrModel`,Fa]],[`rt_detr_v2`,[`RTDetrV2Model`,za]],[`rf_detr`,[`RFDetrModel`,Ua]],[`d_fine`,[`DFineModel`,qa]],[`table-transformer`,[`TableTransformerModel`,Xa]],[`vit`,[`ViTModel`,Gi]],[`ijepa`,[`IJepaModel`,Ji]],[`pvt`,[`PvtModel`,$i]],[`vit_msn`,[`ViTMSNModel`,ia]],[`vit_mae`,[`ViTMAEModel`,na]],[`groupvit`,[`GroupViTModel`,sa]],[`fastvit`,[`FastViTModel`,la]],[`mobilevit`,[`MobileViTModel`,ma]],[`mobilevitv2`,[`MobileViTV2Model`,_a]],[`owlvit`,[`OwlViTModel`,ba]],[`owlv2`,[`Owlv2Model`,Ca]],[`beit`,[`BeitModel`,Ea]],[`deit`,[`DeiTModel`,eo]],[`hiera`,[`HieraModel`,ro]],[`convnext`,[`ConvNextModel`,Bo]],[`convnextv2`,[`ConvNextV2Model`,Uo]],[`dinov2`,[`Dinov2Model`,Ko]],[`dinov2_with_registers`,[`Dinov2WithRegistersModel`,Yo]],[`resnet`,[`ResNetModel`,oo]],[`swin`,[`SwinModel`,lo]],[`swin2sr`,[`Swin2SRModel`,mo]],[`donut-swin`,[`DonutSwinModel`,Ro]],[`yolos`,[`YolosModel`,es]],[`dpt`,[`DPTModel`,_o]],[`glpn`,[`GLPNModel`,Fo]],[`hifigan`,[`SpeechT5HifiGan`,$s]],[`efficientnet`,[`EfficientNetModel`,Tc]],[`decision_transformer`,[`DecisionTransformerModel`,Jc]],[`patchtst`,[`PatchTSTForPrediction`,tl]],[`patchtsmixer`,[`PatchTSMixerForPrediction`,il]],[`mobilenet_v1`,[`MobileNetV1Model`,Mc]],[`mobilenet_v2`,[`MobileNetV2Model`,Ic]],[`mobilenet_v3`,[`MobileNetV3Model`,Bc]],[`mobilenet_v4`,[`MobileNetV4Model`,Wc]],[`maskformer`,[`MaskFormerModel`,Mo]],[`mgp-str`,[`MgpstrForSceneTextRecognition`,$c]],[`style_text_to_speech_2`,[`StyleTextToSpeech2Model`,Js]]]),Tl=new Map([[`t5`,[`T5Model`,Gt]],[`longt5`,[`LongT5Model`,Jt]],[`mt5`,[`MT5Model`,Zt]],[`bart`,[`BartModel`,en]],[`mbart`,[`MBartModel`,V]],[`marian`,[`MarianModel`,ls]],[`whisper`,[`WhisperModel`,Nn]],[`m2m_100`,[`M2M100Model`,fs]],[`blenderbot`,[`BlenderbotModel`,ln]],[`blenderbot-small`,[`BlenderbotSmallModel`,fn]]]),El=new Map([[`mimi`,[`MimiModel`,dl]],[`dac`,[`DacModel`,_l]],[`snac`,[`SnacModel`,xl]]]),Dl=new Map([[`bloom`,[`BloomModel`,Ii]],[`jais`,[`JAISModel`,yr]],[`gpt2`,[`GPT2Model`,gr]],[`gptj`,[`GPTJModel`,Or]],[`gpt_bigcode`,[`GPTBigCodeModel`,jr]],[`gpt_neo`,[`GPTNeoModel`,Sr]],[`gpt_neox`,[`GPTNeoXModel`,Tr]],[`codegen`,[`CodeGenModel`,Pr]],[`llama`,[`LlamaModel`,Lr]],[`exaone`,[`ExaoneModel`,Kr]],[`olmo`,[`OlmoModel`,Qr]],[`olmo2`,[`Olmo2Model`,ti]],[`mobilellm`,[`MobileLLMModel`,Yr]],[`granite`,[`GraniteModel`,ii]],[`cohere`,[`CohereModel`,si]],[`gemma`,[`GemmaModel`,ui]],[`gemma2`,[`Gemma2Model`,pi]],[`gemma3_text`,[`Gemma3Model`,gi]],[`helium`,[`HeliumModel`,Br]],[`glm`,[`GlmModel`,Ur]],[`openelm`,[`OpenELMModel`,yi]],[`qwen2`,[`Qwen2Model`,Si]],[`qwen3`,[`Qwen3Model`,Ti]],[`phi`,[`PhiModel`,Ai]],[`phi3`,[`Phi3Model`,Ni]],[`mpt`,[`MptModel`,zi]],[`opt`,[`OPTModel`,Hi]],[`mistral`,[`MistralModel`,rc]],[`starcoder2`,[`Starcoder2Model`,oc]],[`falcon`,[`FalconModel`,lc]],[`stablelm`,[`StableLmModel`,Sc]]]),Ol=new Map([[`speecht5`,[`SpeechT5ForSpeechToText`,Zs]],[`whisper`,[`WhisperForConditionalGeneration`,Pn]],[`lite-whisper`,[`LiteWhisperForConditionalGeneration`,Fn]],[`moonshine`,[`MoonshineForConditionalGeneration`,Rn]]]),kl=new Map([[`speecht5`,[`SpeechT5ForTextToSpeech`,Qs]]]),Al=new Map([[`vits`,[`VitsModel`,gc]],[`musicgen`,[`MusicgenForConditionalGeneration`,Ac]]]),jl=new Map([[`bert`,[`BertForSequenceClassification`,ve]],[`neobert`,[`NeoBertForSequenceClassification`,Ce]],[`modernbert`,[`ModernBertForSequenceClassification`,ke]],[`roformer`,[`RoFormerForSequenceClassification`,Fe]],[`electra`,[`ElectraForSequenceClassification`,Ge]],[`esm`,[`EsmForSequenceClassification`,xt]],[`convbert`,[`ConvBertForSequenceClassification`,z]],[`camembert`,[`CamembertForSequenceClassification`,Ze]],[`deberta`,[`DebertaForSequenceClassification`,rt]],[`deberta-v2`,[`DebertaV2ForSequenceClassification`,lt]],[`mpnet`,[`MPNetForSequenceClassification`,jt]],[`albert`,[`AlbertForSequenceClassification`,Vt]],[`distilbert`,[`DistilBertForSequenceClassification`,mt]],[`roberta`,[`RobertaForSequenceClassification`,U]],[`xlm`,[`XLMForSequenceClassification`,bn]],[`xlm-roberta`,[`XLMRobertaForSequenceClassification`,En]],[`bart`,[`BartForSequenceClassification`,nn]],[`mbart`,[`MBartForSequenceClassification`,on]],[`mobilebert`,[`MobileBertForSequenceClassification`,Et]],[`squeezebert`,[`SqueezeBertForSequenceClassification`,Lt]]]),Ml=new Map([[`bert`,[`BertForTokenClassification`,L]],[`neobert`,[`NeoBertForTokenClassification`,we]],[`modernbert`,[`ModernBertForTokenClassification`,Ae]],[`roformer`,[`RoFormerForTokenClassification`,Ie]],[`electra`,[`ElectraForTokenClassification`,Ke]],[`esm`,[`EsmForTokenClassification`,St]],[`convbert`,[`ConvBertForTokenClassification`,Ve]],[`camembert`,[`CamembertForTokenClassification`,Qe]],[`deberta`,[`DebertaForTokenClassification`,it]],[`deberta-v2`,[`DebertaV2ForTokenClassification`,ut]],[`mpnet`,[`MPNetForTokenClassification`,Mt]],[`distilbert`,[`DistilBertForTokenClassification`,ht]],[`roberta`,[`RobertaForTokenClassification`,gn]],[`xlm`,[`XLMForTokenClassification`,xn]],[`xlm-roberta`,[`XLMRobertaForTokenClassification`,Dn]]]),Nl=new Map([[`t5`,[`T5ForConditionalGeneration`,Kt]],[`longt5`,[`LongT5ForConditionalGeneration`,Yt]],[`mt5`,[`MT5ForConditionalGeneration`,Qt]],[`bart`,[`BartForConditionalGeneration`,tn]],[`mbart`,[`MBartForConditionalGeneration`,an]],[`marian`,[`MarianMTModel`,us]],[`m2m_100`,[`M2M100ForConditionalGeneration`,ps]],[`blenderbot`,[`BlenderbotForConditionalGeneration`,un]],[`blenderbot-small`,[`BlenderbotSmallForConditionalGeneration`,H]]]),Pl=new Map([[`bloom`,[`BloomForCausalLM`,Li]],[`gpt2`,[`GPT2LMHeadModel`,_r]],[`jais`,[`JAISLMHeadModel`,br]],[`gptj`,[`GPTJForCausalLM`,kr]],[`gpt_bigcode`,[`GPTBigCodeForCausalLM`,Mr]],[`gpt_neo`,[`GPTNeoForCausalLM`,Cr]],[`gpt_neox`,[`GPTNeoXForCausalLM`,Er]],[`codegen`,[`CodeGenForCausalLM`,Fr]],[`llama`,[`LlamaForCausalLM`,Rr]],[`exaone`,[`ExaoneForCausalLM`,qr]],[`olmo`,[`OlmoForCausalLM`,$r]],[`olmo2`,[`Olmo2ForCausalLM`,ni]],[`mobilellm`,[`MobileLLMForCausalLM`,Xr]],[`granite`,[`GraniteForCausalLM`,ai]],[`cohere`,[`CohereForCausalLM`,ci]],[`gemma`,[`GemmaForCausalLM`,di]],[`gemma2`,[`Gemma2ForCausalLM`,mi]],[`gemma3_text`,[`Gemma3ForCausalLM`,_i]],[`helium`,[`HeliumForCausalLM`,Vr]],[`glm`,[`GlmForCausalLM`,Wr]],[`openelm`,[`OpenELMForCausalLM`,bi]],[`qwen2`,[`Qwen2ForCausalLM`,Ci]],[`qwen3`,[`Qwen3ForCausalLM`,Ei]],[`phi`,[`PhiForCausalLM`,ji]],[`phi3`,[`Phi3ForCausalLM`,Pi]],[`mpt`,[`MptForCausalLM`,Bi]],[`opt`,[`OPTForCausalLM`,Ui]],[`mbart`,[`MBartForCausalLM`,sn]],[`mistral`,[`MistralForCausalLM`,ic]],[`starcoder2`,[`Starcoder2ForCausalLM`,sc]],[`falcon`,[`FalconForCausalLM`,uc]],[`trocr`,[`TrOCRForCausalLM`,tc]],[`stablelm`,[`StableLmForCausalLM`,Cc]],[`phi3_v`,[`Phi3VForCausalLM`,G]]]),Fl=new Map([[`multi_modality`,[`MultiModalityCausalLM`,Xc]]]),Il=new Map([[`bert`,[`BertForMaskedLM`,_e]],[`neobert`,[`NeoBertForMaskedLM`,Se]],[`modernbert`,[`ModernBertForMaskedLM`,Oe]],[`roformer`,[`RoFormerForMaskedLM`,Pe]],[`electra`,[`ElectraForMaskedLM`,We]],[`esm`,[`EsmForMaskedLM`,bt]],[`convbert`,[`ConvBertForMaskedLM`,Be]],[`camembert`,[`CamembertForMaskedLM`,Xe]],[`deberta`,[`DebertaForMaskedLM`,nt]],[`deberta-v2`,[`DebertaV2ForMaskedLM`,ct]],[`mpnet`,[`MPNetForMaskedLM`,At]],[`albert`,[`AlbertForMaskedLM`,Ut]],[`distilbert`,[`DistilBertForMaskedLM`,_t]],[`roberta`,[`RobertaForMaskedLM`,hn]],[`xlm`,[`XLMWithLMHeadModel`,W]],[`xlm-roberta`,[`XLMRobertaForMaskedLM`,Tn]],[`mobilebert`,[`MobileBertForMaskedLM`,Tt]],[`squeezebert`,[`SqueezeBertForMaskedLM`,It]]]),Ll=new Map([[`bert`,[`BertForQuestionAnswering`,ye]],[`neobert`,[`NeoBertForQuestionAnswering`,Te]],[`roformer`,[`RoFormerForQuestionAnswering`,Le]],[`electra`,[`ElectraForQuestionAnswering`,qe]],[`convbert`,[`ConvBertForQuestionAnswering`,He]],[`camembert`,[`CamembertForQuestionAnswering`,$e]],[`deberta`,[`DebertaForQuestionAnswering`,at]],[`deberta-v2`,[`DebertaV2ForQuestionAnswering`,dt]],[`mpnet`,[`MPNetForQuestionAnswering`,Nt]],[`albert`,[`AlbertForQuestionAnswering`,Ht]],[`distilbert`,[`DistilBertForQuestionAnswering`,gt]],[`roberta`,[`RobertaForQuestionAnswering`,_n]],[`xlm`,[`XLMForQuestionAnswering`,Sn]],[`xlm-roberta`,[`XLMRobertaForQuestionAnswering`,On]],[`mobilebert`,[`MobileBertForQuestionAnswering`,Dt]],[`squeezebert`,[`SqueezeBertForQuestionAnswering`,Rt]]]),Rl=new Map([[`vision-encoder-decoder`,[`VisionEncoderDecoderModel`,zn]],[`idefics3`,[`Idefics3ForConditionalGeneration`,Qn]],[`smolvlm`,[`SmolVLMForConditionalGeneration`,$n]]]),zl=new Map([[`llava`,[`LlavaForConditionalGeneration`,Vn]],[`llava_onevision`,[`LlavaOnevisionForConditionalGeneration`,Hn]],[`moondream1`,[`Moondream1ForConditionalGeneration`,Un]],[`florence2`,[`Florence2ForConditionalGeneration`,Gn]],[`qwen2-vl`,[`Qwen2VLForConditionalGeneration`,Oi]],[`idefics3`,[`Idefics3ForConditionalGeneration`,Qn]],[`smolvlm`,[`SmolVLMForConditionalGeneration`,$n]],[`paligemma`,[`PaliGemmaForConditionalGeneration`,qn]],[`llava_qwen2`,[`LlavaQwen2ForCausalLM`,Jn]],[`gemma3n`,[`Gemma3nForConditionalGeneration`,Xn]]]),Bl=new Map([[`ultravox`,[`UltravoxModel`,sl]]]),Vl=new Map([[`vision-encoder-decoder`,[`VisionEncoderDecoderModel`,zn]]]),Hl=new Map([[`vit`,[`ViTForImageClassification`,Ki]],[`ijepa`,[`IJepaForImageClassification`,Yi]],[`pvt`,[`PvtForImageClassification`,ea]],[`vit_msn`,[`ViTMSNForImageClassification`,aa]],[`fastvit`,[`FastViTForImageClassification`,ua]],[`mobilevit`,[`MobileViTForImageClassification`,ha]],[`mobilevitv2`,[`MobileViTV2ForImageClassification`,va]],[`beit`,[`BeitForImageClassification`,Da]],[`deit`,[`DeiTForImageClassification`,to]],[`hiera`,[`HieraForImageClassification`,io]],[`convnext`,[`ConvNextForImageClassification`,Vo]],[`convnextv2`,[`ConvNextV2ForImageClassification`,Wo]],[`dinov2`,[`Dinov2ForImageClassification`,qo]],[`dinov2_with_registers`,[`Dinov2WithRegistersForImageClassification`,Xo]],[`resnet`,[`ResNetForImageClassification`,so]],[`swin`,[`SwinForImageClassification`,uo]],[`segformer`,[`SegformerForImageClassification`,yc]],[`efficientnet`,[`EfficientNetForImageClassification`,Ec]],[`mobilenet_v1`,[`MobileNetV1ForImageClassification`,Nc]],[`mobilenet_v2`,[`MobileNetV2ForImageClassification`,Lc]],[`mobilenet_v3`,[`MobileNetV3ForImageClassification`,Vc]],[`mobilenet_v4`,[`MobileNetV4ForImageClassification`,Gc]]]),Ul=new Map([[`detr`,[`DetrForObjectDetection`,Aa]],[`rt_detr`,[`RTDetrForObjectDetection`,Ia]],[`rt_detr_v2`,[`RTDetrV2ForObjectDetection`,Ba]],[`rf_detr`,[`RFDetrForObjectDetection`,Wa]],[`d_fine`,[`DFineForObjectDetection`,Ja]],[`table-transformer`,[`TableTransformerForObjectDetection`,Za]],[`yolos`,[`YolosForObjectDetection`,ts]]]),Wl=new Map([[`owlvit`,[`OwlViTForObjectDetection`,xa]],[`owlv2`,[`Owlv2ForObjectDetection`,wa]],[`grounding-dino`,[`GroundingDinoForObjectDetection`,Qo]]]),Gl=new Map([[`detr`,[`DetrForSegmentation`,ja]],[`clipseg`,[`CLIPSegForImageSegmentation`,mr]]]),Kl=new Map([[`segformer`,[`SegformerForSemanticSegmentation`,bc]],[`sapiens`,[`SapiensForSemanticSegmentation`,So]],[`swin`,[`SwinForSemanticSegmentation`,fo]],[`mobilenet_v1`,[`MobileNetV1ForSemanticSegmentation`,Pc]],[`mobilenet_v2`,[`MobileNetV2ForSemanticSegmentation`,Rc]],[`mobilenet_v3`,[`MobileNetV3ForSemanticSegmentation`,Hc]],[`mobilenet_v4`,[`MobileNetV4ForSemanticSegmentation`,Kc]]]),ql=new Map([[`detr`,[`DetrForSegmentation`,ja]],[`maskformer`,[`MaskFormerForInstanceSegmentation`,No]]]),Jl=new Map([[`sam`,[`SamModel`,os]]]),Yl=new Map([[`wav2vec2`,[`Wav2Vec2ForCTC`,gs]],[`wav2vec2-bert`,[`Wav2Vec2BertForCTC`,Fs]],[`unispeech`,[`UniSpeechForCTC`,Es]],[`unispeech-sat`,[`UniSpeechSatForCTC`,As]],[`wavlm`,[`WavLMForCTC`,Us]],[`hubert`,[`HubertForCTC`,zs]]]),Xl=new Map([[`wav2vec2`,[`Wav2Vec2ForSequenceClassification`,_s]],[`wav2vec2-bert`,[`Wav2Vec2BertForSequenceClassification`,Is]],[`unispeech`,[`UniSpeechForSequenceClassification`,Ds]],[`unispeech-sat`,[`UniSpeechSatForSequenceClassification`,js]],[`wavlm`,[`WavLMForSequenceClassification`,Ws]],[`hubert`,[`HubertForSequenceClassification`,Bs]],[`audio-spectrogram-transformer`,[`ASTForAudioClassification`,jn]]]),Zl=new Map([[`wavlm`,[`WavLMForXVector`,Gs]]]),Ql=new Map([[`unispeech-sat`,[`UniSpeechSatForAudioFrameClassification`,Ms]],[`wavlm`,[`WavLMForAudioFrameClassification`,Ks]],[`wav2vec2`,[`Wav2Vec2ForAudioFrameClassification`,vs]],[`pyannote`,[`PyAnnoteForAudioFrameClassification`,xs]]]),$l=new Map([[`vitmatte`,[`VitMatteForImageMatting`,fa]]]),eu=new Map([[`patchtst`,[`PatchTSTForPrediction`,nl]],[`patchtsmixer`,[`PatchTSMixerForPrediction`,al]]]),tu=new Map([[`swin2sr`,[`Swin2SRForImageSuperResolution`,ho]]]),nu=new Map([[`dpt`,[`DPTForDepthEstimation`,vo]],[`depth_anything`,[`DepthAnythingForDepthEstimation`,bo]],[`glpn`,[`GLPNForDepthEstimation`,Io]],[`sapiens`,[`SapiensForDepthEstimation`,Co]],[`depth_pro`,[`DepthProForDepthEstimation`,Eo]],[`metric3d`,[`Metric3DForDepthEstimation`,Oo]],[`metric3dv2`,[`Metric3Dv2ForDepthEstimation`,Ao]]]),ru=new Map([[`sapiens`,[`SapiensForNormalEstimation`,wo]]]),iu=new Map([[`vitpose`,[`VitPoseForPoseEstimation`,Zi]]]),au=new Map([[`clip`,[`CLIPVisionModelWithProjection`,ar]],[`siglip`,[`SiglipVisionModel`,sr]],[`jina_clip`,[`JinaCLIPVisionModel`,fr]]]),ou=[[wl,b.EncoderOnly],[Tl,b.EncoderDecoder],[Dl,b.DecoderOnly],[El,b.AutoEncoder],[jl,b.EncoderOnly],[Ml,b.EncoderOnly],[Nl,b.Seq2Seq],[Ol,b.Seq2Seq],[Pl,b.DecoderOnly],[Fl,b.MultiModality],[Il,b.EncoderOnly],[Ll,b.EncoderOnly],[Rl,b.Vision2Seq],[zl,b.ImageTextToText],[Bl,b.AudioTextToText],[Hl,b.EncoderOnly],[Gl,b.EncoderOnly],[ql,b.EncoderOnly],[Kl,b.EncoderOnly],[$l,b.EncoderOnly],[eu,b.EncoderOnly],[tu,b.EncoderOnly],[nu,b.EncoderOnly],[ru,b.EncoderOnly],[iu,b.EncoderOnly],[Ul,b.EncoderOnly],[Wl,b.EncoderOnly],[Jl,b.MaskGeneration],[Yl,b.EncoderOnly],[Xl,b.EncoderOnly],[kl,b.Seq2Seq],[Al,b.EncoderOnly],[Zl,b.EncoderOnly],[Ql,b.EncoderOnly],[au,b.EncoderOnly]];for(let[e,t]of ou)for(let[n,r]of e.values())x.set(n,t),C.set(r,n),S.set(n,r);let su=[[`MusicgenForConditionalGeneration`,Ac,b.Musicgen],[`Phi3VForCausalLM`,G,b.Phi3V],[`CLIPTextModelWithProjection`,ir,b.EncoderOnly],[`SiglipTextModel`,or,b.EncoderOnly],[`JinaCLIPTextModel`,dr,b.EncoderOnly],[`ClapTextModelWithProjection`,pc,b.EncoderOnly],[`ClapAudioModelWithProjection`,mc,b.EncoderOnly],[`DacEncoderModel`,vl,b.EncoderOnly],[`DacDecoderModel`,yl,b.EncoderOnly],[`MimiEncoderModel`,fl,b.EncoderOnly],[`MimiDecoderModel`,pl,b.EncoderOnly],[`SnacEncoderModel`,Sl,b.EncoderOnly],[`SnacDecoderModel`,Cl,b.EncoderOnly],[`Gemma3nForConditionalGeneration`,Xn,b.ImageAudioTextToText]];for(let[e,t,n]of su)x.set(e,n),C.set(t,e),S.set(e,t);let cu=new Map([[`modnet`,Gl],[`birefnet`,Gl],[`isnet`,Gl],[`ben`,Gl]]);for(let[e,t]of cu.entries())t.set(e,[`PreTrainedModel`,I]),x.set(e,b.EncoderOnly),C.set(I,e),S.set(e,I);class lu extends Z{static MODEL_CLASS_MAPPINGS=ou.map(e=>e[0]);static BASE_IF_FAIL=!0}class uu extends Z{static MODEL_CLASS_MAPPINGS=[jl]}class du extends Z{static MODEL_CLASS_MAPPINGS=[Ml]}class fu extends Z{static MODEL_CLASS_MAPPINGS=[Nl]}class pu extends Z{static MODEL_CLASS_MAPPINGS=[Ol]}class mu extends Z{static MODEL_CLASS_MAPPINGS=[kl]}class hu extends Z{static MODEL_CLASS_MAPPINGS=[Al]}class gu extends Z{static MODEL_CLASS_MAPPINGS=[Pl]}class _u extends Z{static MODEL_CLASS_MAPPINGS=[Il]}class vu extends Z{static MODEL_CLASS_MAPPINGS=[Ll]}class yu extends Z{static MODEL_CLASS_MAPPINGS=[Rl]}class bu extends Z{static MODEL_CLASS_MAPPINGS=[Hl]}class xu extends Z{static MODEL_CLASS_MAPPINGS=[Gl]}class Su extends Z{static MODEL_CLASS_MAPPINGS=[Kl]}class Cu extends Z{static MODEL_CLASS_MAPPINGS=[ql]}class wu extends Z{static MODEL_CLASS_MAPPINGS=[Ul]}class Tu extends Z{static MODEL_CLASS_MAPPINGS=[Wl]}class Eu extends Z{static MODEL_CLASS_MAPPINGS=[Jl]}class Du extends Z{static MODEL_CLASS_MAPPINGS=[Yl]}class Ou extends Z{static MODEL_CLASS_MAPPINGS=[Xl]}class ku extends Z{static MODEL_CLASS_MAPPINGS=[Zl]}class Au extends Z{static MODEL_CLASS_MAPPINGS=[Ql]}class ju extends Z{static MODEL_CLASS_MAPPINGS=[Vl]}class Mu extends Z{static MODEL_CLASS_MAPPINGS=[$l]}class Nu extends Z{static MODEL_CLASS_MAPPINGS=[tu]}class Pu extends Z{static MODEL_CLASS_MAPPINGS=[nu]}class Fu extends Z{static MODEL_CLASS_MAPPINGS=[ru]}class Iu extends Z{static MODEL_CLASS_MAPPINGS=[iu]}class Lu extends Z{static MODEL_CLASS_MAPPINGS=[au]}class Ru extends Z{static MODEL_CLASS_MAPPINGS=[zl]}class zu extends Z{static MODEL_CLASS_MAPPINGS=[Bl]}class Bu extends pe{constructor({logits:e,past_key_values:t,encoder_outputs:n,decoder_attentions:r=null,cross_attentions:i=null}){super(),this.logits=e,this.past_key_values=t,this.encoder_outputs=n,this.decoder_attentions=r,this.cross_attentions=i}}class Q extends pe{constructor({logits:e,...t}){super(),this.logits=e;let n=Object.values(t);n.length>0&&(this.attentions=n)}}class Vu extends pe{constructor({logits:e,embeddings:t}){super(),this.logits=e,this.embeddings=t}}class Hu extends pe{constructor({logits:e}){super(),this.logits=e}}class Uu extends pe{constructor({logits:e}){super(),this.logits=e}}class Wu extends pe{constructor({start_logits:e,end_logits:t}){super(),this.start_logits=e,this.end_logits=t}}class Gu extends pe{constructor({logits:e}){super(),this.logits=e}}class Ku extends pe{constructor({logits:e,past_key_values:t}){super(),this.logits=e,this.past_key_values=t}}class qu extends pe{constructor({alphas:e}){super(),this.alphas=e}}class Ju extends pe{constructor({waveform:e,spectrogram:t}){super(),this.waveform=e,this.spectrogram=t}}},"./src/models/audio_spectrogram_transformer/feature_extraction_audio_spectrogram_transformer.js":(e,t,n)=>{n.r(t),n.d(t,{ASTFeatureExtractor:()=>o});var r=n( +`./src/models/whisper/common_whisper.js`);let b={EncoderOnly:0,EncoderDecoder:1,Seq2Seq:2,Vision2Seq:3,DecoderOnly:4,MaskGeneration:5,ImageTextToText:6,Musicgen:7,MultiModality:8,Phi3V:9,AudioTextToText:10,AutoEncoder:11,ImageAudioTextToText:12},x=new Map,S=new Map,C=new Map;async function w(e,t,n){let o=n.config?.[`transformers.js_config`]??{},s=n.device??o.device;s&&typeof s!=`string`&&(s.hasOwnProperty(t)?s=s[t]:(console.warn(`device not specified for "${t}". Using the default device.`),s=null));let l=s??(_.apis.IS_NODE_ENV?`cpu`:`wasm`),u=(0,i.deviceToExecutionProviders)(l),d=o.device_config??{};d.hasOwnProperty(l)&&(o={...o,...d[l]});let f=n.dtype??o.dtype;if(typeof f!=`string`&&(f&&f.hasOwnProperty(t)?f=f[t]:(f=a.DEFAULT_DEVICE_DTYPE_MAPPING[l]??a.DATA_TYPES.fp32,console.warn(`dtype not specified for "${t}". Using the default dtype (${f}) for this device (${l}).`))),f===a.DATA_TYPES.auto){let e=o.dtype;typeof e!=`string`&&(e=e?.[t]),f=e&&e!==a.DATA_TYPES.auto&&a.DATA_TYPES.hasOwnProperty(e)?e:a.DEFAULT_DEVICE_DTYPE_MAPPING[l]??a.DATA_TYPES.fp32}let p=f;if(a.DEFAULT_DTYPE_SUFFIX_MAPPING.hasOwnProperty(p)){if(p===a.DATA_TYPES.fp16&&l===`webgpu`&&!await(0,a.isWebGpuFp16Supported)())throw Error(`The device (${l}) does not support fp16.`)}else throw Error(`Invalid dtype: ${p}. Should be one of: ${Object.keys(a.DATA_TYPES).join(`, `)}`);let m=o.kv_cache_dtype,h=m?typeof m==`string`?m:m[p]??`float32`:void 0;if(h&&![`float32`,`float16`].includes(h))throw Error(`Invalid kv_cache_dtype: ${h}. Should be one of: float32, float16`);let g={dtype:p,kv_cache_dtype:h,device:l},v=a.DEFAULT_DTYPE_SUFFIX_MAPPING[p],y=`${t}${v}.onnx`,b=`${n.subfolder??``}/${y}`,x={...n.session_options};x.executionProviders??=u;let S=o.free_dimension_overrides;S?x.freeDimensionOverrides??=S:l.startsWith(`webnn`)&&!x.freeDimensionOverrides&&console.warn(`WebNN does not currently support dynamic shapes and requires 'free_dimension_overrides' to be set in config.json, preferably as a field within config["transformers.js_config"]["device_config"]["${l}"]. When 'free_dimension_overrides' is not set, you may experience significant performance degradation.`);let C=_.apis.IS_NODE_ENV&&_.env.useFSCache,w=(0,c.getModelFile)(e,b,!0,n,C),T=n.use_external_data_format??o.use_external_data_format,E=[];if(T){let r;r=typeof T==`object`?T.hasOwnProperty(y)?T[y]:T.hasOwnProperty(t)?T[t]:!1:T;let i=+r;if(i>c.MAX_EXTERNAL_DATA_CHUNKS)throw Error(`The number of external data chunks (${i}) exceeds the maximum allowed value (${c.MAX_EXTERNAL_DATA_CHUNKS}).`);for(let t=0;t{let o=await(0,c.getModelFile)(e,i,!0,n,C);t(o instanceof Uint8Array?{path:r,data:o}:r)}))}}else x.externalData!==void 0&&(E=x.externalData.map(async t=>{if(typeof t.data==`string`){let r=await(0,c.getModelFile)(e,t.data,!0,n);return{...t,data:r}}return t}));if(E.length>0){let e=await Promise.all(E);_.apis.IS_NODE_ENV||(x.externalData=e)}if(l===`webgpu`){let e=(0,r.getKeyValueShapes)(n.config,{prefix:`present`});if(Object.keys(e).length>0&&!(0,i.isONNXProxy)()){let t={};for(let n in e)t[n]=`gpu-buffer`;x.preferredOutputLocation=t}}let D=await w;return{buffer_or_path:D,session_options:x,session_config:g}}async function T(e,t,n){return Object.fromEntries(await Promise.all(Object.keys(t).map(async r=>{let{buffer_or_path:a,session_options:o,session_config:s}=await w(e,t[r],n),c=await(0,i.createInferenceSession)(a,o,s);return[r,c]})))}async function E(e,t,n){return Object.fromEntries(await Promise.all(Object.keys(t).map(async r=>{let i=await(0,c.getModelJSON)(e,t[r],!1,n);return[r,i]})))}function D(e,t){let n=Object.create(null),r=[];for(let a of e.inputNames){let e=t[a];if(!(e instanceof f.Tensor)){r.push(a);continue}n[a]=(0,i.isONNXProxy)()?e.clone():e}if(r.length>0)throw Error(`An error occurred during model execution: "Missing the following inputs: ${r.join(`, `)}.`);let a=Object.keys(t).length,o=e.inputNames.length;if(a>o){let n=Object.keys(t).filter(t=>!e.inputNames.includes(t));console.warn(`WARNING: Too many inputs were provided (${a} > ${o}). The following inputs will be ignored: "${n.join(`, `)}".`)}return n}let O=Promise.resolve();async function k(e,t){let n=D(e,t);try{let t=Object.fromEntries(Object.entries(n).map(([e,t])=>[e,t.ort_tensor])),r=()=>e.run(t),i=await(_.apis.IS_BROWSER_ENV||_.apis.IS_WEBWORKER_ENV?O=O.then(r):r());return A(i)}catch(e){let t=Object.fromEntries(Object.entries(n).map(([e,t])=>{let n={type:t.type,dims:t.dims,location:t.location};return n.location!==`gpu-buffer`&&(n.data=t.data),[e,n]}));throw console.error(`An error occurred during model execution: "${e}".`),console.error(`Inputs given to model:`,t),e}}function A(e){for(let t in e)(0,i.isONNXTensor)(e[t])?e[t]=new f.Tensor(e[t]):typeof e[t]==`object`&&A(e[t]);return e}function ee(e){if(e instanceof f.Tensor)return e;if(e.length===0)throw Error(`items must be non-empty`);if(Array.isArray(e[0])){if(e.some(t=>t.length!==e[0].length))throw Error(`Unable to create tensor, you should probably activate truncation and/or padding with 'padding=True' and/or 'truncation=True' to have batched tensors with the same length.`);return new f.Tensor(`int64`,BigInt64Array.from(e.flat().map(e=>BigInt(e))),[e.length,e[0].length])}else return new f.Tensor(`int64`,BigInt64Array.from(e.map(e=>BigInt(e))),[1,e.length])}function te(e){return new f.Tensor(`bool`,[e],[1])}async function ne(e,t){let{encoder_outputs:n,input_ids:r,decoder_input_ids:i,...a}=t;if(!n){let r=(0,s.pick)(t,e.sessions.model.inputNames);n=(await j(e,r)).last_hidden_state}a.input_ids=i,a.encoder_hidden_states=n,e.sessions.decoder_model_merged.inputNames.includes(`encoder_attention_mask`)&&(a.encoder_attention_mask=t.attention_mask);let o=await ie(e,a,!0);return o}async function j(e,t){let n=e.sessions.model,r=(0,s.pick)(t,n.inputNames);if(n.inputNames.includes(`inputs_embeds`)&&!r.inputs_embeds){if(!t.input_ids)throw Error("Both `input_ids` and `inputs_embeds` are missing in the model inputs.");r.inputs_embeds=await e.encode_text({input_ids:t.input_ids})}if(n.inputNames.includes(`token_type_ids`)&&!r.token_type_ids){if(!r.input_ids)throw Error("Both `input_ids` and `token_type_ids` are missing in the model inputs.");r.token_type_ids=(0,f.zeros_like)(r.input_ids)}if(n.inputNames.includes(`pixel_mask`)&&!r.pixel_mask){if(!r.pixel_values)throw Error("Both `pixel_values` and `pixel_mask` are missing in the model inputs.");let e=r.pixel_values.dims;r.pixel_mask=(0,f.ones)([e[0],e[2],e[3]])}return await k(n,r)}async function re(e,t){let n=await e.encode(t),r=await e.decode(n);return r}async function ie(e,t,n=!1){let r=e.sessions[n?`decoder_model_merged`:`model`],{past_key_values:i,...a}=t;if(r.inputNames.includes(`use_cache_branch`)&&(a.use_cache_branch=te(!!i)),r.inputNames.includes(`position_ids`)&&a.attention_mask&&!a.position_ids){let t=[`paligemma`,`gemma3_text`,`gemma3`].includes(e.config.model_type)?1:0;a.position_ids=ue(a,i,t)}e.addPastKeyValues(a,i);let o=(0,s.pick)(a,r.inputNames);return await k(r,o)}function ae({modality_token_id:e,inputs_embeds:t,modality_features:n,input_ids:r,attention_mask:i}){let a=r.tolist().map(t=>t.reduce((t,n,r)=>(n==e&&t.push(r),t),[])),o=a.reduce((e,t)=>e+t.length,0),s=n.dims[0];if(o!==s)throw Error(`Number of tokens and features do not match: tokens: ${o}, features ${s}`);let c=0;for(let e=0;ee.dims[1]||i[e.at(-1)])),{...n,decoder_input_ids:ee(t)}}function P(e,...t){return e.config.is_encoder_decoder?fe(e,...t):de(e,...t)}function pe(e,t,n,r){let i=!!n.past_key_values;if(r.guidance_scale!==null&&r.guidance_scale>1&&(i?n.input_ids=(0,f.cat)([n.input_ids,n.input_ids],0):(n.input_ids=(0,f.cat)([n.input_ids,(0,f.full_like)(n.input_ids,BigInt(r.pad_token_id))],0),n.attention_mask=(0,f.cat)([n.attention_mask,(0,f.full_like)(n.attention_mask,0n)],0))),(i||!n.pixel_values)&&(n.pixel_values=(0,f.full)([0,0,3,384,384],1)),i){let e=0,t=1,r=e>0?1:0,i=1;n.images_seq_mask=new f.Tensor(`bool`,Array(e+t).fill(!0).fill(!1,0,t),[i,e+t]),n.images_emb_mask=new f.Tensor(`bool`,Array(e).fill(!!r),[i,1,e])}return n}class F extends o.Callable{main_input_name=`input_ids`;forward_params=[`input_ids`,`attention_mask`];constructor(e,t,n){super(),this.config=e,this.sessions=t,this.configs=n;let r=C.get(this.constructor),i=x.get(r);switch(this.can_generate=!1,this._forward=null,this._prepare_inputs_for_generation=null,i){case b.DecoderOnly:this.can_generate=!0,this._forward=ie,this._prepare_inputs_for_generation=de;break;case b.Seq2Seq:case b.Vision2Seq:case b.Musicgen:this.can_generate=!0,this._forward=ne,this._prepare_inputs_for_generation=fe;break;case b.EncoderDecoder:this._forward=ne;break;case b.ImageTextToText:this.can_generate=!0,this._forward=ce,this._prepare_inputs_for_generation=P;break;case b.AudioTextToText:this.can_generate=!0,this._forward=N,this._prepare_inputs_for_generation=P;break;case b.Phi3V:case b.ImageAudioTextToText:this.can_generate=!0,this._prepare_inputs_for_generation=P;break;case b.MultiModality:this.can_generate=!0,this._prepare_inputs_for_generation=pe;break;case b.AutoEncoder:this._forward=re;break;default:this._forward=j;break}this.can_generate&&this.forward_params.push(`past_key_values`),this.custom_config=this.config[`transformers.js_config`]??{}}async dispose(){let e=[];for(let t of Object.values(this.sessions))t?.handler?.dispose&&e.push(t.handler.dispose());return await Promise.all(e)}static async from_pretrained(e,{progress_callback:t=null,config:n=null,cache_dir:i=null,local_files_only:a=!1,revision:o=`main`,model_file_name:s=null,subfolder:c=`onnx`,device:u=null,dtype:d=null,use_external_data_format:f=null,session_options:p={}}={}){let m={progress_callback:t,config:n,cache_dir:i,local_files_only:a,revision:o,model_file_name:s,subfolder:c,device:u,dtype:d,use_external_data_format:f,session_options:p},h=C.get(this),g=x.get(h);n=m.config=await r.AutoConfig.from_pretrained(e,m);let _;if(g===b.DecoderOnly)_=await Promise.all([T(e,{model:m.model_file_name??`model`},m),E(e,{generation_config:`generation_config.json`},m)]);else if(g===b.Seq2Seq||g===b.Vision2Seq)_=await Promise.all([T(e,{model:`encoder_model`,decoder_model_merged:`decoder_model_merged`},m),E(e,{generation_config:`generation_config.json`},m)]);else if(g===b.MaskGeneration)_=await Promise.all([T(e,{model:`vision_encoder`,prompt_encoder_mask_decoder:`prompt_encoder_mask_decoder`},m)]);else if(g===b.EncoderDecoder)_=await Promise.all([T(e,{model:`encoder_model`,decoder_model_merged:`decoder_model_merged`},m)]);else if(g===b.ImageTextToText){let t={embed_tokens:`embed_tokens`,vision_encoder:`vision_encoder`,decoder_model_merged:`decoder_model_merged`};n.is_encoder_decoder&&(t.model=`encoder_model`),_=await Promise.all([T(e,t,m),E(e,{generation_config:`generation_config.json`},m)])}else if(g===b.AudioTextToText){let t={embed_tokens:`embed_tokens`,audio_encoder:`audio_encoder`,decoder_model_merged:`decoder_model_merged`};_=await Promise.all([T(e,t,m),E(e,{generation_config:`generation_config.json`},m)])}else if(g===b.ImageAudioTextToText){let t={embed_tokens:`embed_tokens`,audio_encoder:`audio_encoder`,vision_encoder:`vision_encoder`,decoder_model_merged:`decoder_model_merged`};_=await Promise.all([T(e,t,m),E(e,{generation_config:`generation_config.json`},m)])}else if(g===b.Musicgen)_=await Promise.all([T(e,{model:`text_encoder`,decoder_model_merged:`decoder_model_merged`,encodec_decode:`encodec_decode`},m),E(e,{generation_config:`generation_config.json`},m)]);else if(g===b.MultiModality)_=await Promise.all([T(e,{prepare_inputs_embeds:`prepare_inputs_embeds`,model:`language_model`,lm_head:`lm_head`,gen_head:`gen_head`,gen_img_embeds:`gen_img_embeds`,image_decode:`image_decode`},m),E(e,{generation_config:`generation_config.json`},m)]);else if(g===b.Phi3V)_=await Promise.all([T(e,{prepare_inputs_embeds:`prepare_inputs_embeds`,model:`model`,vision_encoder:`vision_encoder`},m),E(e,{generation_config:`generation_config.json`},m)]);else if(g===b.AutoEncoder)_=await Promise.all([T(e,{encoder_model:`encoder_model`,decoder_model:`decoder_model`},m)]);else{if(g!==b.EncoderOnly){let e=h??n?.model_type;e!==`custom`&&console.warn(`Model type for '${e}' not found, assuming encoder-only architecture. Please report this at ${l.GITHUB_ISSUE_URL}.`)}_=await Promise.all([T(e,{model:m.model_file_name??`model`},m)])}return new this(n,..._)}async _call(e){return await this.forward(e)}async forward(e){return await this._forward(this,e)}get generation_config(){return this.configs?.generation_config??null}_get_logits_warper(e){let t=new u.LogitsProcessorList;return e.temperature!==null&&e.temperature!==1&&t.push(new u.TemperatureLogitsWarper(e.temperature)),e.top_k!==null&&e.top_k!==0&&t.push(new u.TopKLogitsWarper(e.top_k)),e.top_p!==null&&e.top_p<1&&t.push(new u.TopPLogitsWarper(e.top_p)),t}_get_logits_processor(e,t,n=null){let r=new u.LogitsProcessorList;if(e.repetition_penalty!==null&&e.repetition_penalty!==1&&r.push(new u.RepetitionPenaltyLogitsProcessor(e.repetition_penalty)),e.no_repeat_ngram_size!==null&&e.no_repeat_ngram_size>0&&r.push(new u.NoRepeatNGramLogitsProcessor(e.no_repeat_ngram_size)),e.bad_words_ids!==null&&r.push(new u.NoBadWordsLogitsProcessor(e.bad_words_ids,e.eos_token_id)),e.min_length!==null&&e.eos_token_id!==null&&e.min_length>0&&r.push(new u.MinLengthLogitsProcessor(e.min_length,e.eos_token_id)),e.min_new_tokens!==null&&e.eos_token_id!==null&&e.min_new_tokens>0&&r.push(new u.MinNewTokensLengthLogitsProcessor(t,e.min_new_tokens,e.eos_token_id)),e.forced_bos_token_id!==null&&r.push(new u.ForcedBOSTokenLogitsProcessor(e.forced_bos_token_id)),e.forced_eos_token_id!==null&&r.push(new u.ForcedEOSTokenLogitsProcessor(e.max_length,e.forced_eos_token_id)),e.begin_suppress_tokens!==null){let n=t>1||e.forced_bos_token_id===null?t:t+1;r.push(new u.SuppressTokensAtBeginLogitsProcessor(e.begin_suppress_tokens,n))}return e.guidance_scale!==null&&e.guidance_scale>1&&r.push(new u.ClassifierFreeGuidanceLogitsProcessor(e.guidance_scale)),n!==null&&r.extend(n),r}_prepare_generation_config(e,t,n=d.GenerationConfig){let r={...this.config};for(let e of[`decoder`,`generator`,`text_config`])e in r&&Object.assign(r,r[e]);let i=new n(r);return Object.assign(i,this.generation_config??{}),e&&Object.assign(i,e),t&&Object.assign(i,(0,s.pick)(t,Object.getOwnPropertyNames(i))),i}_get_stopping_criteria(e,t=null){let n=new h.StoppingCriteriaList;return e.max_length!==null&&n.push(new h.MaxLengthCriteria(e.max_length,this.config.max_position_embeddings??null)),e.eos_token_id!==null&&n.push(new h.EosTokenCriteria(e.eos_token_id)),t&&n.extend(t),n}_validate_model_class(){if(!this.can_generate){let e=[Bl,Wl,zl,Pl],t=C.get(this.constructor),n=new Set,r=this.config.model_type;for(let t of e){let e=t.get(r);e&&n.add(e[0])}let i=`The current model class (${t}) is not compatible with \`.generate()\`, as it doesn't have a language model head.`;throw n.size>0&&(i+=` Please use the following class instead: ${[...n].join(`, `)}`),Error(i)}}prepare_inputs_for_generation(...e){return this._prepare_inputs_for_generation(this,...e)}_update_model_kwargs_for_generation({generated_input_ids:e,outputs:t,model_inputs:n,is_encoder_decoder:r}){return n.past_key_values=this.getPastKeyValues(t,n.past_key_values),n.input_ids=new f.Tensor(`int64`,e.flat(),[e.length,1]),r?`decoder_attention_mask`in n:n.attention_mask=(0,f.cat)([n.attention_mask,(0,f.ones)([n.attention_mask.dims[0],1])],1),n.position_ids=null,n}_prepare_model_inputs({inputs:e,bos_token_id:t,model_kwargs:n}){let r=(0,s.pick)(n,this.forward_params),i=this.main_input_name;if(i in r){if(e)throw Error("`inputs`: {inputs}` were passed alongside {input_name} which is not allowed. Make sure to either pass {inputs} or {input_name}=...")}else r[i]=e;let a=r[i];return{inputs_tensor:a,model_inputs:r,model_input_name:i}}async _prepare_encoder_decoder_kwargs_for_generation({inputs_tensor:e,model_inputs:t,model_input_name:n,generation_config:r}){if(this.sessions.model.inputNames.includes(`inputs_embeds`)&&!t.inputs_embeds&&`_prepare_inputs_embeds`in this){let{input_ids:e,pixel_values:n,attention_mask:r,...i}=t,a=await this._prepare_inputs_embeds(t);t={...i,...(0,s.pick)(a,[`inputs_embeds`,`attention_mask`])}}let{last_hidden_state:i}=await j(this,t);if(r.guidance_scale!==null&&r.guidance_scale>1)i=(0,f.cat)([i,(0,f.full_like)(i,0)],0),`attention_mask`in t&&(t.attention_mask=(0,f.cat)([t.attention_mask,(0,f.zeros_like)(t.attention_mask)],0));else if(t.decoder_input_ids){let e=ee(t.decoder_input_ids).dims[0];if(e!==i.dims[0]){if(i.dims[0]!==1)throw Error(`The encoder outputs have a different batch size (${i.dims[0]}) than the decoder inputs (${e}).`);i=(0,f.cat)(Array.from({length:e},()=>i),0)}}return t.encoder_outputs=i,t}_prepare_decoder_input_ids_for_generation({batch_size:e,model_input_name:t,model_kwargs:n,decoder_start_token_id:r,bos_token_id:i,generation_config:a}){let{decoder_input_ids:o,...s}=n;if(!(o instanceof f.Tensor)){if(o)Array.isArray(o[0])||(o=Array.from({length:e},()=>o));else if(r??=i,this.config.model_type===`musicgen`)o=Array.from({length:e*this.config.decoder.num_codebooks},()=>[r]);else if(Array.isArray(r)){if(r.length!==e)throw Error(`\`decoder_start_token_id\` expcted to have length ${e} but got ${r.length}`);o=r}else o=Array.from({length:e},()=>[r]);o=ee(o)}return n.decoder_attention_mask=(0,f.ones_like)(o),{input_ids:o,model_inputs:s}}async generate({inputs:e=null,generation_config:t=null,logits_processor:n=null,stopping_criteria:r=null,streamer:i=null,...a}){this._validate_model_class(),t=this._prepare_generation_config(t,a);let{inputs_tensor:o,model_inputs:s,model_input_name:c}=this._prepare_model_inputs({inputs:e,model_kwargs:a}),l=this.config.is_encoder_decoder;l&&(`encoder_outputs`in s||(s=await this._prepare_encoder_decoder_kwargs_for_generation({inputs_tensor:o,model_inputs:s,model_input_name:c,generation_config:t})));let u;l?{input_ids:u,model_inputs:s}=this._prepare_decoder_input_ids_for_generation({batch_size:s[c].dims.at(0),model_input_name:c,model_kwargs:s,decoder_start_token_id:t.decoder_start_token_id,bos_token_id:t.bos_token_id,generation_config:t}):u=s[c];let d=u.dims.at(-1);t.max_new_tokens!==null&&(t.max_length=d+t.max_new_tokens);let p=this._get_logits_processor(t,d,n),m=this._get_stopping_criteria(t,r),h=s[c].dims.at(0),_=g.LogitsSampler.getSampler(t),v=Array(h).fill(0),y=u.tolist();i&&i.put(y);let b,x={};for(;;){if(s=this.prepare_inputs_for_generation(y,s,t),b=await this.forward(s),t.output_attentions&&t.return_dict_in_generate){let e=this.getAttentions(b);for(let t in e)t in x||(x[t]=[]),x[t].push(e[t])}let e=b.logits.slice(null,-1,null),n=p(y,e),r=[];for(let e=0;ee))break;s=this._update_model_kwargs_for_generation({generated_input_ids:r,outputs:b,model_inputs:s,is_encoder_decoder:l})}i&&i.end();let S=this.getPastKeyValues(b,s.past_key_values,!0),C=new f.Tensor(`int64`,y.flat(),[y.length,y[0].length]);if(t.return_dict_in_generate)return{sequences:C,past_key_values:S,...x};for(let e of Object.values(b))e.location===`gpu-buffer`&&e.dispose();return C}getPastKeyValues(e,t,n=!1){let r=Object.create(null);for(let i in e)if(i.startsWith(`present`)){let a=i.replace(`present`,`past_key_values`),o=i.includes(`encoder`);if(o&&t?r[a]=t[a]:r[a]=e[i],t&&(!o||n)){let e=t[a];e.location===`gpu-buffer`&&e.dispose()}}return r}getAttentions(e){let t={};for(let n of[`cross_attentions`,`encoder_attentions`,`decoder_attentions`])for(let r in e)r.startsWith(n)&&(n in t||(t[n]=[]),t[n].push(e[r]));return t}addPastKeyValues(e,t){if(t)Object.assign(e,t);else{let t=this.sessions.decoder_model_merged??this.sessions.model,n=t?.config?.kv_cache_dtype??`float32`,i=n===`float16`?new f.DataTypeMap.float16:[],a=(e[this.main_input_name]??e.attention_mask)?.dims?.[0]??1,o=(0,r.getKeyValueShapes)(this.config,{batch_size:a});for(let t in o)e[t]=new f.Tensor(n,i,o[t])}}async encode_image({pixel_values:e}){return(await k(this.sessions.vision_encoder,{pixel_values:e})).image_features}async encode_text({input_ids:e}){return(await k(this.sessions.embed_tokens,{input_ids:e})).inputs_embeds}async encode_audio({audio_values:e}){return(await k(this.sessions.audio_encoder,{audio_values:e})).audio_features}}class me{}class he extends me{constructor({last_hidden_state:e,hidden_states:t=null,attentions:n=null}){super(),this.last_hidden_state=e,this.hidden_states=t,this.attentions=n}}class ge extends F{}class I extends ge{}class _e extends ge{async _call(e){return new Yu(await super._call(e))}}class L extends ge{async _call(e){return new Q(await super._call(e))}}class R extends ge{async _call(e){return new Ju(await super._call(e))}}class ve extends ge{async _call(e){return new Xu(await super._call(e))}}class ye extends F{}class z extends ye{}class be extends ye{async _call(e){return new Yu(await super._call(e))}}class xe extends ye{async _call(e){return new Q(await super._call(e))}}class Se extends ye{async _call(e){return new Ju(await super._call(e))}}class B extends ye{async _call(e){return new Xu(await super._call(e))}}class Ce extends F{}class we extends Ce{}class Te extends Ce{async _call(e){return new Yu(await super._call(e))}}class Ee extends Ce{async _call(e){return new Q(await super._call(e))}}class De extends Ce{async _call(e){return new Ju(await super._call(e))}}class Oe extends F{}class ke extends Oe{}class Ae extends F{}class je extends Ae{}class Me extends Ae{async _call(e){return new Yu(await super._call(e))}}class Ne extends Ae{async _call(e){return new Q(await super._call(e))}}class Pe extends Ae{async _call(e){return new Ju(await super._call(e))}}class Fe extends Ae{async _call(e){return new Xu(await super._call(e))}}class Ie extends F{}class Le extends Ie{}class Re extends Ie{async _call(e){return new Yu(await super._call(e))}}class V extends Ie{async _call(e){return new Q(await super._call(e))}}class ze extends Ie{async _call(e){return new Ju(await super._call(e))}}class Be extends Ie{async _call(e){return new Xu(await super._call(e))}}class H extends F{}class Ve extends H{}class He extends H{async _call(e){return new Yu(await super._call(e))}}class Ue extends H{async _call(e){return new Q(await super._call(e))}}class We extends H{async _call(e){return new Ju(await super._call(e))}}class Ge extends H{async _call(e){return new Xu(await super._call(e))}}class Ke extends F{}class qe extends Ke{}class Je extends Ke{async _call(e){return new Yu(await super._call(e))}}class Ye extends Ke{async _call(e){return new Q(await super._call(e))}}class Xe extends Ke{async _call(e){return new Ju(await super._call(e))}}class Ze extends Ke{async _call(e){return new Xu(await super._call(e))}}class Qe extends F{}class $e extends Qe{}class et extends Qe{async _call(e){return new Yu(await super._call(e))}}class tt extends Qe{async _call(e){return new Q(await super._call(e))}}class nt extends Qe{async _call(e){return new Ju(await super._call(e))}}class rt extends Qe{async _call(e){return new Xu(await super._call(e))}}class it extends F{}class at extends it{}class ot extends it{async _call(e){return new Yu(await super._call(e))}}class st extends it{async _call(e){return new Q(await super._call(e))}}class ct extends it{async _call(e){return new Ju(await super._call(e))}}class lt extends it{async _call(e){return new Xu(await super._call(e))}}class ut extends F{}class dt extends ut{}class ft extends ut{async _call(e){return new Q(await super._call(e))}}class pt extends ut{async _call(e){return new Ju(await super._call(e))}}class mt extends ut{async _call(e){return new Xu(await super._call(e))}}class ht extends ut{async _call(e){return new Yu(await super._call(e))}}class gt extends F{}class _t extends gt{}class vt extends gt{async _call(e){return new Yu(await super._call(e))}}class yt extends gt{async _call(e){return new Q(await super._call(e))}}class bt extends gt{async _call(e){return new Ju(await super._call(e))}}class xt extends F{}class St extends xt{}class Ct extends xt{async _call(e){return new Yu(await super._call(e))}}class wt extends xt{async _call(e){return new Q(await super._call(e))}}class Tt extends xt{async _call(e){return new Xu(await super._call(e))}}class Et extends F{}class Dt extends Et{}class Ot extends Et{async _call(e){return new Yu(await super._call(e))}}class kt extends Et{async _call(e){return new Q(await super._call(e))}}class At extends Et{async _call(e){return new Ju(await super._call(e))}}class jt extends Et{async _call(e){return new Xu(await super._call(e))}}class Mt extends F{}class Nt extends Mt{}class Pt extends Mt{async _call(e){return new Yu(await super._call(e))}}class Ft extends Mt{async _call(e){return new Q(await super._call(e))}}class It extends Mt{async _call(e){return new Xu(await super._call(e))}}class Lt extends F{}class Rt extends Lt{}class zt extends Lt{async _call(e){return new Q(await super._call(e))}}class Bt extends Lt{async _call(e){return new Xu(await super._call(e))}}class Vt extends Lt{async _call(e){return new Yu(await super._call(e))}}class Ht extends F{forward_params=[`input_ids`,`attention_mask`,`encoder_outputs`,`decoder_input_ids`,`decoder_attention_mask`,`past_key_values`]}class Ut extends Ht{}class Wt extends Ht{}class Gt extends F{}class Kt extends Gt{}class qt extends Gt{}class Jt extends F{}class Yt extends Jt{}class Xt extends Jt{}class Zt extends F{}class Qt extends Zt{}class $t extends Zt{}class en extends Zt{async _call(e){return new Q(await super._call(e))}}class tn extends F{}class U extends tn{}class nn extends tn{}class rn extends tn{async _call(e){return new Q(await super._call(e))}}class an extends tn{}class on extends F{}class sn extends on{}class cn extends on{}class ln extends F{}class un extends ln{}class dn extends ln{}class fn extends F{}class pn extends fn{}class mn extends fn{async _call(e){return new Yu(await super._call(e))}}class W extends fn{async _call(e){return new Q(await super._call(e))}}class hn extends fn{async _call(e){return new Ju(await super._call(e))}}class gn extends fn{async _call(e){return new Xu(await super._call(e))}}class _n extends F{}class vn extends _n{}class G extends _n{async _call(e){return new Yu(await super._call(e))}}class yn extends _n{async _call(e){return new Q(await super._call(e))}}class bn extends _n{async _call(e){return new Ju(await super._call(e))}}class xn extends _n{async _call(e){return new Xu(await super._call(e))}}class Sn extends F{}class Cn extends Sn{}class wn extends Sn{async _call(e){return new Yu(await super._call(e))}}class Tn extends Sn{async _call(e){return new Q(await super._call(e))}}class En extends Sn{async _call(e){return new Ju(await super._call(e))}}class Dn extends Sn{async _call(e){return new Xu(await super._call(e))}}class On extends F{}class kn extends On{}class An extends On{}class jn extends F{requires_attention_mask=!1;main_input_name=`input_features`;forward_params=[`input_features`,`attention_mask`,`decoder_input_ids`,`decoder_attention_mask`,`past_key_values`]}class Mn extends jn{}class Nn extends jn{_prepare_generation_config(e,t){return super._prepare_generation_config(e,t,v.WhisperGenerationConfig)}_retrieve_init_tokens(e){let t=[e.decoder_start_token_id],n=e.language,r=e.task;if(e.is_multilingual){n||(console.warn(`No language specified - defaulting to English (en).`),n=`en`);let i=(0,y.whisper_language_to_code)(n),a=`<|${i}|>`;t.push(e.lang_to_id[a]),t.push(e.task_to_id[r??`transcribe`])}else if(n||r)throw Error("Cannot specify `task` or `language` for an English-only model. If the model is intended to be multilingual, pass `is_multilingual=true` to generate, or update the generation config.");return!e.return_timestamps&&e.no_timestamps_token_id&&t.at(-1)!==e.no_timestamps_token_id?t.push(e.no_timestamps_token_id):e.return_timestamps&&t.at(-1)===e.no_timestamps_token_id&&(console.warn("<|notimestamps|> prompt token is removed from generation_config since `return_timestamps` is set to `true`."),t.pop()),t.filter(e=>e!=null)}async generate({inputs:e=null,generation_config:t=null,logits_processor:n=null,stopping_criteria:r=null,...i}){t=this._prepare_generation_config(t,i);let a=i.decoder_input_ids??this._retrieve_init_tokens(t);if(t.return_timestamps&&(n??=new u.LogitsProcessorList,n.push(new u.WhisperTimeStampLogitsProcessor(t,a))),t.begin_suppress_tokens&&(n??=new u.LogitsProcessorList,n.push(new u.SuppressTokensAtBeginLogitsProcessor(t.begin_suppress_tokens,a.length))),t.return_token_timestamps){if(!t.alignment_heads)throw Error("Model generation config has no `alignment_heads`, token-level timestamps not available. See https://gist.github.com/hollance/42e32852f24243b748ae6bc1f985b13a on how to add this property to the generation config.");t.task===`translate`&&console.warn(`Token-level timestamps may not be reliable for task 'translate'.`),t.output_attentions=!0,t.return_dict_in_generate=!0}let o=await super.generate({inputs:e,generation_config:t,logits_processor:n,decoder_input_ids:a,...i});return t.return_token_timestamps&&(o.token_timestamps=this._extract_token_timestamps(o,t.alignment_heads,t.num_frames)),o}_extract_token_timestamps(e,t,n=null,r=.02){if(!e.cross_attentions)throw Error("Model outputs must contain cross attentions to extract timestamps. This is most likely because the model was not exported with `output_attentions=True`.");n??console.warn("`num_frames` has not been set, meaning the entire audio will be analyzed. This may lead to inaccurate token-level timestamps for short audios (< 30 seconds).");let i=this.config.median_filter_width;i===void 0&&(console.warn("Model config has no `median_filter_width`, using default value of 7."),i=7);let a=e.cross_attentions,o=Array.from({length:this.config.decoder_layers},(e,t)=>(0,f.cat)(a.map(e=>e[t]),2)),c=(0,f.stack)(t.map(([e,t])=>{if(e>=o.length)throw Error(`Layer index ${e} is out of bounds for cross attentions (length ${o.length}).`);return n?o[e].slice(null,t,null,[0,n]):o[e].slice(null,t)})).transpose(1,0,2,3),[l,u]=(0,f.std_mean)(c,-2,0,!0),d=c.clone();for(let e=0;en[t+1]-n[t]),o=(0,s.mergeArrays)([1],a).map(e=>!!e),c=[];for(let e=0;eArray.from({length:e.dims[0]},t=>Array.from({length:e.dims[1]},e=>1))),p=t?t.tolist():[],h=n?n.tolist():[],g=0,_=0;for(let e=0;eu[e][n]==1),n=t.reduce((e,t,n)=>(t==s&&e.push(n),e),[]),r=n.map(e=>t[e+1]),f=r.filter(e=>e==a).length,v=r.filter(e=>e==o).length,y=[],b=0,x=f,S=v;for(let e=0;et>b&&e==a),n=t.findIndex((e,t)=>t>b&&e==o),r=x>0&&e!==-1?e:t.length+1,i=S>0&&n!==-1?n:t.length+1,s,l,u,d;r0?(0,m.max)(y.at(-1))[0]+1:0;y.push(Array.from({length:3*w},(e,t)=>T+t%w));let E=w+T,D=f*v*C,O=Array.from({length:D},(e,t)=>E+Math.floor(t/(v*C))),k=Array.from({length:D},(e,t)=>E+Math.floor(t/C)%v),A=Array.from({length:D},(e,t)=>E+t%C);y.push([O,k,A].flat()),b=s+D}if(b0?(0,m.max)(y.at(-1))[0]+1:0,n=t.length-b;y.push(Array.from({length:3*n},(t,r)=>e+r%n))}let C=y.reduce((e,t)=>e+t.length,0),w=Array(C),T=0;for(let e=0;e<3;++e)for(let t=0;te[n%e.length]),i=Array.from({length:t[0]},(n,r)=>(0,m.max)(e.subarray(t[1]*r,t[1]*(r+1)))[0]+1n+BigInt(t[1]));return[new f.Tensor(`int64`,n,[3,...t]),new f.Tensor(`int64`,i,[i.length,1])]}else{let[t,n]=e.dims,r=BigInt64Array.from({length:3*t*n},(e,r)=>BigInt(Math.floor(r%n/t)));return[new f.Tensor(`int64`,r,[3,...e.dims]),(0,f.zeros)([t,1])]}}async encode_image({pixel_values:e,image_grid_thw:t}){let n=(await k(this.sessions.vision_encoder,{pixel_values:e,grid_thw:t})).image_features;return n}_merge_input_ids_with_image_features(e){return oe({image_token_id:this.config.image_token_id,...e})}prepare_inputs_for_generation(e,t,n){if(t.attention_mask&&!t.position_ids)if(!t.past_key_values)[t.position_ids,t.rope_deltas]=this.get_rope_index(t.input_ids,t.image_grid_thw,t.video_grid_thw,t.attention_mask);else{t.pixel_values=null;let e=BigInt(Object.values(t.past_key_values)[0].dims.at(-2)),n=t.rope_deltas.map(t=>e+t);t.position_ids=(0,f.stack)([n,n,n],0)}return t}}class ji extends F{}class Mi extends ji{}class Ni extends ji{}class Pi extends F{}class Fi extends Pi{}class Ii extends Pi{}class Li extends F{}class Ri extends Li{}class zi extends Li{}class Bi extends F{}class Vi extends Bi{}class Hi extends Bi{}class Ui extends F{}class Wi extends Ui{}class Gi extends Ui{}class Ki extends F{}class qi extends Ki{}class Ji extends Ki{async _call(e){return new Q(await super._call(e))}}class Yi extends F{}class Xi extends Yi{}class Zi extends Yi{async _call(e){return new Q(await super._call(e))}}class Qi extends F{}class $i extends Qi{}class ea extends F{}class ta extends ea{}class na extends ea{async _call(e){return new Q(await super._call(e))}}class ra extends F{}class ia extends ra{}class aa extends F{}class oa extends aa{}class sa extends aa{async _call(e){return new Q(await super._call(e))}}class ca extends F{}class la extends ca{}class ua extends F{}class da extends ua{}class fa extends ua{async _call(e){return new Q(await super._call(e))}}class pa extends F{}class ma extends pa{async _call(e){return new $u(await super._call(e))}}class ha extends F{}class ga extends ha{}class _a extends ha{async _call(e){return new Q(await super._call(e))}}class va extends F{}class ya extends va{}class ba extends va{async _call(e){return new Q(await super._call(e))}}class xa extends F{}class Sa extends xa{}class Ca extends xa{}class wa extends F{}class Ta extends wa{}class Ea extends wa{}class Da extends F{}class Oa extends Da{}class ka extends Da{async _call(e){return new Q(await super._call(e))}}class Aa extends F{}class ja extends Aa{}class Ma extends Aa{async _call(e){return new Pa(await super._call(e))}}class Na extends Aa{async _call(e){return new Fa(await super._call(e))}}class Pa extends me{constructor({logits:e,pred_boxes:t}){super(),this.logits=e,this.pred_boxes=t}}class Fa extends me{constructor({logits:e,pred_boxes:t,pred_masks:n}){super(),this.logits=e,this.pred_boxes=t,this.pred_masks=n}}class Ia extends F{}class La extends Ia{}class Ra extends Ia{async _call(e){return new za(await super._call(e))}}class za extends me{constructor({logits:e,pred_boxes:t}){super(),this.logits=e,this.pred_boxes=t}}class Ba extends F{}class Va extends Ba{}class Ha extends Ba{async _call(e){return new Ua(await super._call(e))}}class Ua extends za{}class Wa extends F{}class Ga extends Wa{}class Ka extends Wa{async _call(e){return new qa(await super._call(e))}}class qa extends za{}class Ja extends F{}class Ya extends Ja{}class Xa extends Ja{async _call(e){return new za(await super._call(e))}}class Za extends F{}class Qa extends Za{}class $a extends Za{async _call(e){return new eo(await super._call(e))}}class eo extends Pa{}class to extends F{}class no extends to{}class ro extends to{async _call(e){return new Q(await super._call(e))}}class io extends F{}class ao extends io{}class oo extends io{async _call(e){return new Q(await super._call(e))}}class so extends F{}class co extends so{}class lo extends so{async _call(e){return new Q(await super._call(e))}}class uo extends F{}class fo extends uo{}class po extends uo{async _call(e){return new Q(await super._call(e))}}class mo extends uo{}class ho extends F{}class go extends ho{}class _o extends ho{}class vo extends F{}class yo extends vo{}class bo extends vo{}class xo extends F{}class So extends xo{}class Co extends F{}class wo extends Co{}class To extends Co{}class Eo extends Co{}class Do extends F{}class Oo extends Do{}class ko extends F{}class Ao extends ko{}class jo extends F{}class Mo extends jo{}class No extends F{}class Po extends No{}class Fo extends No{}class Io extends F{}class Lo extends Io{}class Ro extends Io{}class zo extends F{}class Bo extends zo{}class Vo extends F{}class Ho extends Vo{}class Uo extends Vo{async _call(e){return new Q(await super._call(e))}}class Wo extends F{}class Go extends Wo{}class Ko extends Wo{async _call(e){return new Q(await super._call(e))}}class qo extends F{}class Jo extends qo{}class Yo extends qo{async _call(e){return new Q(await super._call(e))}}class Xo extends F{}class Zo extends Xo{}class Qo extends Xo{async _call(e){return new Q(await super._call(e))}}class $o extends F{}class es extends $o{}class ts extends F{}class ns extends ts{}class rs extends ts{async _call(e){return new os(await super._call(e))}}class os extends me{constructor({logits:e,pred_boxes:t}){super(),this.logits=e,this.pred_boxes=t}}class ss extends F{}class cs extends ss{async get_image_embeddings({pixel_values:e}){return await j(this,{pixel_values:e})}async forward(e){if((!e.image_embeddings||!e.image_positional_embeddings)&&(e={...e,...await this.get_image_embeddings(e)}),!e.input_labels&&e.input_points){let t=e.input_points.dims.slice(0,-1),n=t.reduce((e,t)=>e*t,1);e.input_labels=new f.Tensor(`int64`,new BigInt64Array(n).fill(1n),t)}let t={image_embeddings:e.image_embeddings,image_positional_embeddings:e.image_positional_embeddings};return e.input_points&&(t.input_points=e.input_points),e.input_labels&&(t.input_labels=e.input_labels),e.input_boxes&&(t.input_boxes=e.input_boxes),await k(this.sessions.prompt_encoder_mask_decoder,t)}async _call(e){return new ls(await super._call(e))}}class ls extends me{constructor({iou_scores:e,pred_masks:t}){super(),this.iou_scores=e,this.pred_masks=t}}class us extends F{}class ds extends us{}class fs extends us{}class ps extends F{}class ms extends ps{}class hs extends ps{}class gs extends F{}class _s extends gs{}class vs extends gs{async _call(e){return new Zu(await super._call(e))}}class ys extends gs{async _call(e){return new Q(await super._call(e))}}class bs extends gs{async _call(e){return new Ju(await super._call(e))}}class xs extends F{}class Ss extends xs{}class Cs extends xs{async _call(e){return new Ju(await super._call(e))}}class ws extends F{}class Ts extends ws{}class Es extends F{}class Ds extends Es{}class Os extends Es{async _call(e){return new Zu(await super._call(e))}}class ks extends Es{async _call(e){return new Q(await super._call(e))}}class As extends F{}class js extends As{}class Ms extends As{async _call(e){return new Zu(await super._call(e))}}class Ns extends As{async _call(e){return new Q(await super._call(e))}}class Ps extends As{async _call(e){return new Ju(await super._call(e))}}class Fs extends F{}class Is extends Fs{}class Ls extends Fs{async _call(e){return new Zu(await super._call(e))}}class Rs extends Fs{async _call(e){return new Q(await super._call(e))}}class zs extends F{}class Bs extends gs{}class Vs extends gs{async _call(e){return new Zu(await super._call(e))}}class Hs extends gs{async _call(e){return new Q(await super._call(e))}}class Us extends F{}class Ws extends Us{}class Gs extends Us{async _call(e){return new Zu(await super._call(e))}}class Ks extends Us{async _call(e){return new Q(await super._call(e))}}class qs extends Us{async _call(e){return new qu(await super._call(e))}}class Js extends Us{async _call(e){return new Ju(await super._call(e))}}class Ys extends F{}class Xs extends Ys{}class Zs extends F{}class Qs extends Zs{}class $s extends Zs{}class ec extends Zs{async generate_speech(e,t,{threshold:n=.5,minlenratio:r=0,maxlenratio:i=20,vocoder:a=null}={}){let o={input_ids:e},{encoder_outputs:s,encoder_attention_mask:c}=await j(this,o),l=s.dims[1]/this.config.reduction_factor,u=Math.floor(l*i),d=Math.floor(l*r),p=this.config.num_mel_bins,m=[],h=null,g=null,_=0;for(;;){++_;let e=te(!!g),r;r=g?g.output_sequence_out:new f.Tensor(`float32`,new Float32Array(p),[1,1,p]);let i={use_cache_branch:e,output_sequence:r,encoder_attention_mask:c,speaker_embeddings:t,encoder_hidden_states:s};this.addPastKeyValues(i,h),g=await k(this.sessions.decoder_model_merged,i),h=this.getPastKeyValues(g,h);let{prob:a,spectrum:o}=g;if(m.push(o),_>=d&&(Array.from(a.data).filter(e=>e>=n).length>0||_>=u))break}let v=(0,f.cat)(m),{waveform:y}=await k(a.sessions.model,{spectrogram:v});return{spectrogram:v,waveform:y}}}class tc extends F{main_input_name=`spectrogram`}class nc extends F{}class rc extends nc{}class ic extends F{}class ac extends ic{}class oc extends ic{}class sc extends F{}class cc extends sc{}class lc extends sc{}class uc extends F{}class dc extends uc{}class fc extends uc{}class pc extends F{}class mc extends pc{}class hc extends pc{}class gc extends F{}class _c extends gc{}class vc extends gc{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`text_model`})}}class yc extends gc{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`audio_model`})}}class bc extends F{}class xc extends bc{async _call(e){return new ed(await super._call(e))}}class Sc extends F{}class Cc extends Sc{}class wc extends Sc{}class Tc extends Sc{}class Ec extends F{}class Dc extends Ec{}class Oc extends Ec{}class kc extends F{}class Ac extends kc{}class jc extends kc{async _call(e){return new Q(await super._call(e))}}class Mc extends F{}class Nc extends Mc{}class Pc extends Mc{}class Fc extends F{forward_params=[`input_ids`,`attention_mask`,`encoder_outputs`,`decoder_input_ids`,`decoder_attention_mask`,`past_key_values`];_apply_and_filter_by_delay_pattern_mask(e){let[t,n]=e.dims,r=this.config.decoder.num_codebooks,i=n-r,a=0;for(let t=0;t0&&c<=i&&(e.data[a++]=e.data[t])}let o=Math.floor(t/r),s=a/(o*r);return new f.Tensor(e.type,e.data.slice(0,a),[o,r,s])}prepare_inputs_for_generation(e,t,n){let r=structuredClone(e);for(let e=0;e=t&&(r[e][t]=BigInt(this.config.decoder.pad_token_id));n.guidance_scale!==null&&n.guidance_scale>1&&(r=r.concat(r));let i=super.prepare_inputs_for_generation(r,t,n);return i}async generate(e){let t=await super.generate(e),n=this._apply_and_filter_by_delay_pattern_mask(t).unsqueeze_(0),{audio_values:r}=await k(this.sessions.encodec_decode,{audio_codes:n});return r}}class Ic extends F{}class Lc extends Ic{}class Rc extends Ic{async _call(e){return new Q(await super._call(e))}}class zc extends Ic{}class Bc extends F{}class Vc extends Bc{}class Hc extends Bc{async _call(e){return new Q(await super._call(e))}}class Uc extends Bc{}class Wc extends F{}class Gc extends Wc{}class Kc extends Wc{async _call(e){return new Q(await super._call(e))}}class qc extends Wc{}class Jc extends F{}class Yc extends Jc{}class Xc extends Jc{async _call(e){return new Q(await super._call(e))}}class Zc extends Jc{}class Qc extends F{}class $c extends Qc{}class el extends F{}class tl extends el{forward_params=[`input_ids`,`pixel_values`,`images_seq_mask`,`images_emb_mask`,`attention_mask`,`position_ids`,`past_key_values`];constructor(...e){super(...e),this._generation_mode=`text`}async forward(e){let t=this._generation_mode??`text`,n;if(t===`text`||!e.past_key_values){let t=this.sessions.prepare_inputs_embeds,r=(0,s.pick)(e,t.inputNames);n=await k(t,r)}else{let t=this.sessions.gen_img_embeds,r=(0,s.pick)({image_ids:e.input_ids},t.inputNames);n=await k(t,r)}let r={...e,...n},i=await ie(this,r),a=this.sessions[t===`text`?`lm_head`:`gen_head`];if(!a)throw Error(`Unable to find "${a}" generation head`);let o=await k(a,(0,s.pick)(i,a.inputNames));return{...n,...i,...o}}async generate(e){return this._generation_mode=`text`,super.generate(e)}async generate_images(e){this._generation_mode=`image`;let t=(e.inputs??e[this.main_input_name]).dims[1],n=await super.generate(e),r=n.slice(null,[t,null]),i=this.sessions.image_decode,{decoded_image:a}=await k(i,{generated_tokens:r}),o=a.add_(1).mul_(255/2).clamp_(0,255).to(`uint8`),s=[];for(let e of o){let t=p.RawImage.fromTensor(e);s.push(t)}return s}}class nl extends me{constructor({char_logits:e,bpe_logits:t,wp_logits:n}){super(),this.char_logits=e,this.bpe_logits=t,this.wp_logits=n}get logits(){return[this.char_logits,this.bpe_logits,this.wp_logits]}}class rl extends F{}class il extends rl{async _call(e){return new nl(await super._call(e))}}class al extends F{}class ol extends al{}class sl extends al{}class cl extends F{}class ll extends cl{}class ul extends cl{}class dl extends F{forward_params=[`input_ids`,`attention_mask`,`position_ids`,`audio_values`,`past_key_values`]}class fl extends dl{_merge_input_ids_with_audio_features(e){let t=e.audio_features.dims.at(-1),n=e.audio_features.view(-1,t);return se({audio_token_id:this.config.ignore_index,...e,audio_features:n})}}class pl extends F{main_input_name=`input_values`;forward_params=[`input_values`]}class ml extends me{constructor({audio_codes:e}){super(),this.audio_codes=e}}class hl extends me{constructor({audio_values:e}){super(),this.audio_values=e}}class gl extends pl{async encode(e){return new ml(await k(this.sessions.encoder_model,e))}async decode(e){return new hl(await k(this.sessions.decoder_model,e))}}class _l extends pl{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`encoder_model`})}}class vl extends pl{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`decoder_model`})}}class yl extends F{main_input_name=`input_values`;forward_params=[`input_values`]}class bl extends me{constructor({audio_codes:e}){super(),this.audio_codes=e}}class xl extends me{constructor({audio_values:e}){super(),this.audio_values=e}}class Sl extends yl{async encode(e){return new bl(await k(this.sessions.encoder_model,e))}async decode(e){return new xl(await k(this.sessions.decoder_model,e))}}class Cl extends yl{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`encoder_model`})}}class wl extends yl{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`decoder_model`})}}class Tl extends F{main_input_name=`input_values`;forward_params=[`input_values`]}class El extends Tl{async encode(e){return await k(this.sessions.encoder_model,e)}async decode(e){return await k(this.sessions.decoder_model,e)}}class Dl extends Tl{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`encoder_model`})}}class Ol extends Tl{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`decoder_model`})}}class kl{static MODEL_CLASS_MAPPINGS=null;static BASE_IF_FAIL=!1;static async from_pretrained(e,{progress_callback:t=null,config:n=null,cache_dir:i=null,local_files_only:a=!1,revision:o=`main`,model_file_name:s=null,subfolder:c=`onnx`,device:l=null,dtype:u=null,use_external_data_format:d=null,session_options:f={}}={}){let p={progress_callback:t,config:n,cache_dir:i,local_files_only:a,revision:o,model_file_name:s,subfolder:c,device:l,dtype:u,use_external_data_format:d,session_options:f};if(p.config=await r.AutoConfig.from_pretrained(e,p),!this.MODEL_CLASS_MAPPINGS)throw Error("`MODEL_CLASS_MAPPINGS` not implemented for this type of `AutoClass`: "+this.name);let m=p.config.model_type;for(let t of this.MODEL_CLASS_MAPPINGS){let n=t.get(m);if(!n){for(let e of t.values())if(e[0]===m){n=e;break}if(!n)continue}return await n[1].from_pretrained(e,p)}if(this.BASE_IF_FAIL)return mu.has(m)||console.warn(`Unknown model class "${m}", attempting to construct from base class.`),await F.from_pretrained(e,p);throw Error(`Unsupported model type: ${m}`)}}let Al=new Map([[`bert`,[`BertModel`,I]],[`neobert`,[`NeoBertModel`,z]],[`modernbert`,[`ModernBertModel`,we]],[`nomic_bert`,[`NomicBertModel`,ke]],[`roformer`,[`RoFormerModel`,je]],[`electra`,[`ElectraModel`,Ve]],[`esm`,[`EsmModel`,_t]],[`convbert`,[`ConvBertModel`,Le]],[`camembert`,[`CamembertModel`,qe]],[`deberta`,[`DebertaModel`,$e]],[`deberta-v2`,[`DebertaV2Model`,at]],[`mpnet`,[`MPNetModel`,Dt]],[`albert`,[`AlbertModel`,Rt]],[`distilbert`,[`DistilBertModel`,dt]],[`roberta`,[`RobertaModel`,pn]],[`xlm`,[`XLMModel`,vn]],[`xlm-roberta`,[`XLMRobertaModel`,Cn]],[`clap`,[`ClapModel`,_c]],[`clip`,[`CLIPModel`,tr]],[`clipseg`,[`CLIPSegModel`,fr]],[`chinese_clip`,[`ChineseCLIPModel`,cr]],[`siglip`,[`SiglipModel`,Y]],[`jina_clip`,[`JinaCLIPModel`,lr]],[`mobilebert`,[`MobileBertModel`,St]],[`squeezebert`,[`SqueezeBertModel`,Nt]],[`wav2vec2`,[`Wav2Vec2Model`,_s]],[`wav2vec2-bert`,[`Wav2Vec2BertModel`,Is]],[`unispeech`,[`UniSpeechModel`,Ds]],[`unispeech-sat`,[`UniSpeechSatModel`,js]],[`hubert`,[`HubertModel`,Bs]],[`wavlm`,[`WavLMModel`,Ws]],[`audio-spectrogram-transformer`,[`ASTModel`,kn]],[`vits`,[`VitsModel`,xc]],[`pyannote`,[`PyAnnoteModel`,Ss]],[`wespeaker-resnet`,[`WeSpeakerResNetModel`,Ts]],[`detr`,[`DetrModel`,ja]],[`rt_detr`,[`RTDetrModel`,La]],[`rt_detr_v2`,[`RTDetrV2Model`,Va]],[`rf_detr`,[`RFDetrModel`,Ga]],[`d_fine`,[`DFineModel`,Ya]],[`table-transformer`,[`TableTransformerModel`,Qa]],[`vit`,[`ViTModel`,qi]],[`ijepa`,[`IJepaModel`,Xi]],[`pvt`,[`PvtModel`,ta]],[`vit_msn`,[`ViTMSNModel`,oa]],[`vit_mae`,[`ViTMAEModel`,ia]],[`groupvit`,[`GroupViTModel`,la]],[`fastvit`,[`FastViTModel`,da]],[`mobilevit`,[`MobileViTModel`,ga]],[`mobilevitv2`,[`MobileViTV2Model`,ya]],[`owlvit`,[`OwlViTModel`,Sa]],[`owlv2`,[`Owlv2Model`,Ta]],[`beit`,[`BeitModel`,Oa]],[`deit`,[`DeiTModel`,no]],[`hiera`,[`HieraModel`,ao]],[`convnext`,[`ConvNextModel`,Ho]],[`convnextv2`,[`ConvNextV2Model`,Go]],[`dinov2`,[`Dinov2Model`,Jo]],[`dinov2_with_registers`,[`Dinov2WithRegistersModel`,Zo]],[`resnet`,[`ResNetModel`,co]],[`swin`,[`SwinModel`,fo]],[`swin2sr`,[`Swin2SRModel`,go]],[`donut-swin`,[`DonutSwinModel`,Bo]],[`yolos`,[`YolosModel`,ns]],[`dpt`,[`DPTModel`,yo]],[`glpn`,[`GLPNModel`,Lo]],[`hifigan`,[`SpeechT5HifiGan`,tc]],[`efficientnet`,[`EfficientNetModel`,Ac]],[`decision_transformer`,[`DecisionTransformerModel`,$c]],[`patchtst`,[`PatchTSTForPrediction`,ol]],[`patchtsmixer`,[`PatchTSMixerForPrediction`,ll]],[`mobilenet_v1`,[`MobileNetV1Model`,Lc]],[`mobilenet_v2`,[`MobileNetV2Model`,Vc]],[`mobilenet_v3`,[`MobileNetV3Model`,Gc]],[`mobilenet_v4`,[`MobileNetV4Model`,Yc]],[`maskformer`,[`MaskFormerModel`,Po]],[`mgp-str`,[`MgpstrForSceneTextRecognition`,il]],[`style_text_to_speech_2`,[`StyleTextToSpeech2Model`,Xs]]]),jl=new Map([[`t5`,[`T5Model`,Ut]],[`longt5`,[`LongT5Model`,Kt]],[`mt5`,[`MT5Model`,Yt]],[`bart`,[`BartModel`,Qt]],[`mbart`,[`MBartModel`,U]],[`marian`,[`MarianModel`,ds]],[`whisper`,[`WhisperModel`,Mn]],[`m2m_100`,[`M2M100Model`,ms]],[`blenderbot`,[`BlenderbotModel`,sn]],[`blenderbot-small`,[`BlenderbotSmallModel`,un]]]),Ml=new Map([[`mimi`,[`MimiModel`,gl]],[`dac`,[`DacModel`,Sl]],[`snac`,[`SnacModel`,El]]]),Nl=new Map([[`bloom`,[`BloomModel`,Ri]],[`jais`,[`JAISModel`,vr]],[`gpt2`,[`GPT2Model`,hr]],[`gptj`,[`GPTJModel`,Dr]],[`gpt_bigcode`,[`GPTBigCodeModel`,Ar]],[`gpt_neo`,[`GPTNeoModel`,xr]],[`gpt_neox`,[`GPTNeoXModel`,wr]],[`codegen`,[`CodeGenModel`,Nr]],[`llama`,[`LlamaModel`,Ir]],[`smollm3`,[`SmolLM3Model`,zr]],[`exaone`,[`ExaoneModel`,Jr]],[`olmo`,[`OlmoModel`,ei]],[`olmo2`,[`Olmo2Model`,ri]],[`mobilellm`,[`MobileLLMModel`,Zr]],[`granite`,[`GraniteModel`,oi]],[`cohere`,[`CohereModel`,li]],[`gemma`,[`GemmaModel`,fi]],[`gemma2`,[`Gemma2Model`,hi]],[`gemma3_text`,[`Gemma3Model`,vi]],[`helium`,[`HeliumModel`,Hr]],[`glm`,[`GlmModel`,Gr]],[`openelm`,[`OpenELMModel`,xi]],[`qwen2`,[`Qwen2Model`,wi]],[`qwen3`,[`Qwen3Model`,Di]],[`phi`,[`PhiModel`,Mi]],[`phi3`,[`Phi3Model`,Fi]],[`mpt`,[`MptModel`,Vi]],[`opt`,[`OPTModel`,Wi]],[`mistral`,[`MistralModel`,ac]],[`ernie4_5`,[`Ernie4_5_Model`,cc]],[`starcoder2`,[`Starcoder2Model`,dc]],[`falcon`,[`FalconModel`,mc]],[`stablelm`,[`StableLmModel`,Dc]]]),Pl=new Map([[`speecht5`,[`SpeechT5ForSpeechToText`,$s]],[`whisper`,[`WhisperForConditionalGeneration`,Nn]],[`lite-whisper`,[`LiteWhisperForConditionalGeneration`,Pn]],[`moonshine`,[`MoonshineForConditionalGeneration`,Ln]]]),Fl=new Map([[`speecht5`,[`SpeechT5ForTextToSpeech`,ec]]]),Il=new Map([[`vits`,[`VitsModel`,xc]],[`musicgen`,[`MusicgenForConditionalGeneration`,Fc]]]),Ll=new Map([[`bert`,[`BertForSequenceClassification`,L]],[`neobert`,[`NeoBertForSequenceClassification`,xe]],[`modernbert`,[`ModernBertForSequenceClassification`,Ee]],[`roformer`,[`RoFormerForSequenceClassification`,Ne]],[`electra`,[`ElectraForSequenceClassification`,Ue]],[`esm`,[`EsmForSequenceClassification`,yt]],[`convbert`,[`ConvBertForSequenceClassification`,V]],[`camembert`,[`CamembertForSequenceClassification`,Ye]],[`deberta`,[`DebertaForSequenceClassification`,tt]],[`deberta-v2`,[`DebertaV2ForSequenceClassification`,st]],[`mpnet`,[`MPNetForSequenceClassification`,kt]],[`albert`,[`AlbertForSequenceClassification`,zt]],[`distilbert`,[`DistilBertForSequenceClassification`,ft]],[`roberta`,[`RobertaForSequenceClassification`,W]],[`xlm`,[`XLMForSequenceClassification`,yn]],[`xlm-roberta`,[`XLMRobertaForSequenceClassification`,Tn]],[`bart`,[`BartForSequenceClassification`,en]],[`mbart`,[`MBartForSequenceClassification`,rn]],[`mobilebert`,[`MobileBertForSequenceClassification`,wt]],[`squeezebert`,[`SqueezeBertForSequenceClassification`,Ft]]]),Rl=new Map([[`bert`,[`BertForTokenClassification`,R]],[`neobert`,[`NeoBertForTokenClassification`,Se]],[`modernbert`,[`ModernBertForTokenClassification`,De]],[`roformer`,[`RoFormerForTokenClassification`,Pe]],[`electra`,[`ElectraForTokenClassification`,We]],[`esm`,[`EsmForTokenClassification`,bt]],[`convbert`,[`ConvBertForTokenClassification`,ze]],[`camembert`,[`CamembertForTokenClassification`,Xe]],[`deberta`,[`DebertaForTokenClassification`,nt]],[`deberta-v2`,[`DebertaV2ForTokenClassification`,ct]],[`mpnet`,[`MPNetForTokenClassification`,At]],[`distilbert`,[`DistilBertForTokenClassification`,pt]],[`roberta`,[`RobertaForTokenClassification`,hn]],[`xlm`,[`XLMForTokenClassification`,bn]],[`xlm-roberta`,[`XLMRobertaForTokenClassification`,En]]]),zl=new Map([[`t5`,[`T5ForConditionalGeneration`,Wt]],[`longt5`,[`LongT5ForConditionalGeneration`,qt]],[`mt5`,[`MT5ForConditionalGeneration`,Xt]],[`bart`,[`BartForConditionalGeneration`,$t]],[`mbart`,[`MBartForConditionalGeneration`,nn]],[`marian`,[`MarianMTModel`,fs]],[`m2m_100`,[`M2M100ForConditionalGeneration`,hs]],[`blenderbot`,[`BlenderbotForConditionalGeneration`,cn]],[`blenderbot-small`,[`BlenderbotSmallForConditionalGeneration`,dn]]]),Bl=new Map([[`bloom`,[`BloomForCausalLM`,zi]],[`gpt2`,[`GPT2LMHeadModel`,gr]],[`jais`,[`JAISLMHeadModel`,yr]],[`gptj`,[`GPTJForCausalLM`,Or]],[`gpt_bigcode`,[`GPTBigCodeForCausalLM`,jr]],[`gpt_neo`,[`GPTNeoForCausalLM`,Sr]],[`gpt_neox`,[`GPTNeoXForCausalLM`,Tr]],[`codegen`,[`CodeGenForCausalLM`,Pr]],[`llama`,[`LlamaForCausalLM`,Lr]],[`smollm3`,[`SmolLM3ForCausalLM`,Br]],[`exaone`,[`ExaoneForCausalLM`,Yr]],[`olmo`,[`OlmoForCausalLM`,ti]],[`olmo2`,[`Olmo2ForCausalLM`,ii]],[`mobilellm`,[`MobileLLMForCausalLM`,Qr]],[`granite`,[`GraniteForCausalLM`,si]],[`cohere`,[`CohereForCausalLM`,ui]],[`gemma`,[`GemmaForCausalLM`,pi]],[`gemma2`,[`Gemma2ForCausalLM`,gi]],[`gemma3_text`,[`Gemma3ForCausalLM`,yi]],[`helium`,[`HeliumForCausalLM`,Ur]],[`glm`,[`GlmForCausalLM`,Kr]],[`openelm`,[`OpenELMForCausalLM`,Si]],[`qwen2`,[`Qwen2ForCausalLM`,Ti]],[`qwen3`,[`Qwen3ForCausalLM`,Oi]],[`phi`,[`PhiForCausalLM`,Ni]],[`phi3`,[`Phi3ForCausalLM`,Ii]],[`mpt`,[`MptForCausalLM`,Hi]],[`opt`,[`OPTForCausalLM`,Gi]],[`mbart`,[`MBartForCausalLM`,an]],[`mistral`,[`MistralForCausalLM`,oc]],[`ernie4_5`,[`Ernie4_5_ForCausalLM`,lc]],[`starcoder2`,[`Starcoder2ForCausalLM`,fc]],[`falcon`,[`FalconForCausalLM`,hc]],[`trocr`,[`TrOCRForCausalLM`,rc]],[`stablelm`,[`StableLmForCausalLM`,Oc]],[`phi3_v`,[`Phi3VForCausalLM`,K]]]),Vl=new Map([[`multi_modality`,[`MultiModalityCausalLM`,tl]]]),Hl=new Map([[`bert`,[`BertForMaskedLM`,_e]],[`neobert`,[`NeoBertForMaskedLM`,be]],[`modernbert`,[`ModernBertForMaskedLM`,Te]],[`roformer`,[`RoFormerForMaskedLM`,Me]],[`electra`,[`ElectraForMaskedLM`,He]],[`esm`,[`EsmForMaskedLM`,vt]],[`convbert`,[`ConvBertForMaskedLM`,Re]],[`camembert`,[`CamembertForMaskedLM`,Je]],[`deberta`,[`DebertaForMaskedLM`,et]],[`deberta-v2`,[`DebertaV2ForMaskedLM`,ot]],[`mpnet`,[`MPNetForMaskedLM`,Ot]],[`albert`,[`AlbertForMaskedLM`,Vt]],[`distilbert`,[`DistilBertForMaskedLM`,ht]],[`roberta`,[`RobertaForMaskedLM`,mn]],[`xlm`,[`XLMWithLMHeadModel`,G]],[`xlm-roberta`,[`XLMRobertaForMaskedLM`,wn]],[`mobilebert`,[`MobileBertForMaskedLM`,Ct]],[`squeezebert`,[`SqueezeBertForMaskedLM`,Pt]]]),Ul=new Map([[`bert`,[`BertForQuestionAnswering`,ve]],[`neobert`,[`NeoBertForQuestionAnswering`,B]],[`roformer`,[`RoFormerForQuestionAnswering`,Fe]],[`electra`,[`ElectraForQuestionAnswering`,Ge]],[`convbert`,[`ConvBertForQuestionAnswering`,Be]],[`camembert`,[`CamembertForQuestionAnswering`,Ze]],[`deberta`,[`DebertaForQuestionAnswering`,rt]],[`deberta-v2`,[`DebertaV2ForQuestionAnswering`,lt]],[`mpnet`,[`MPNetForQuestionAnswering`,jt]],[`albert`,[`AlbertForQuestionAnswering`,Bt]],[`distilbert`,[`DistilBertForQuestionAnswering`,mt]],[`roberta`,[`RobertaForQuestionAnswering`,gn]],[`xlm`,[`XLMForQuestionAnswering`,xn]],[`xlm-roberta`,[`XLMRobertaForQuestionAnswering`,Dn]],[`mobilebert`,[`MobileBertForQuestionAnswering`,Tt]],[`squeezebert`,[`SqueezeBertForQuestionAnswering`,It]]]),Wl=new Map([[`vision-encoder-decoder`,[`VisionEncoderDecoderModel`,Rn]],[`idefics3`,[`Idefics3ForConditionalGeneration`,Zn]],[`smolvlm`,[`SmolVLMForConditionalGeneration`,Qn]]]),Gl=new Map([[`llava`,[`LlavaForConditionalGeneration`,Bn]],[`llava_onevision`,[`LlavaOnevisionForConditionalGeneration`,Vn]],[`moondream1`,[`Moondream1ForConditionalGeneration`,Hn]],[`florence2`,[`Florence2ForConditionalGeneration`,Wn]],[`qwen2-vl`,[`Qwen2VLForConditionalGeneration`,Ai]],[`idefics3`,[`Idefics3ForConditionalGeneration`,Zn]],[`smolvlm`,[`SmolVLMForConditionalGeneration`,Qn]],[`paligemma`,[`PaliGemmaForConditionalGeneration`,Kn]],[`llava_qwen2`,[`LlavaQwen2ForCausalLM`,qn]],[`gemma3n`,[`Gemma3nForConditionalGeneration`,Yn]]]),Kl=new Map([[`ultravox`,[`UltravoxModel`,fl]]]),ql=new Map([[`vision-encoder-decoder`,[`VisionEncoderDecoderModel`,Rn]]]),Jl=new Map([[`vit`,[`ViTForImageClassification`,Ji]],[`ijepa`,[`IJepaForImageClassification`,Zi]],[`pvt`,[`PvtForImageClassification`,na]],[`vit_msn`,[`ViTMSNForImageClassification`,sa]],[`fastvit`,[`FastViTForImageClassification`,fa]],[`mobilevit`,[`MobileViTForImageClassification`,_a]],[`mobilevitv2`,[`MobileViTV2ForImageClassification`,ba]],[`beit`,[`BeitForImageClassification`,ka]],[`deit`,[`DeiTForImageClassification`,ro]],[`hiera`,[`HieraForImageClassification`,oo]],[`convnext`,[`ConvNextForImageClassification`,Uo]],[`convnextv2`,[`ConvNextV2ForImageClassification`,Ko]],[`dinov2`,[`Dinov2ForImageClassification`,Yo]],[`dinov2_with_registers`,[`Dinov2WithRegistersForImageClassification`,Qo]],[`resnet`,[`ResNetForImageClassification`,lo]],[`swin`,[`SwinForImageClassification`,po]],[`segformer`,[`SegformerForImageClassification`,wc]],[`efficientnet`,[`EfficientNetForImageClassification`,jc]],[`mobilenet_v1`,[`MobileNetV1ForImageClassification`,Rc]],[`mobilenet_v2`,[`MobileNetV2ForImageClassification`,Hc]],[`mobilenet_v3`,[`MobileNetV3ForImageClassification`,Kc]],[`mobilenet_v4`,[`MobileNetV4ForImageClassification`,Xc]]]),Yl=new Map([[`detr`,[`DetrForObjectDetection`,Ma]],[`rt_detr`,[`RTDetrForObjectDetection`,Ra]],[`rt_detr_v2`,[`RTDetrV2ForObjectDetection`,Ha]],[`rf_detr`,[`RFDetrForObjectDetection`,Ka]],[`d_fine`,[`DFineForObjectDetection`,Xa]],[`table-transformer`,[`TableTransformerForObjectDetection`,$a]],[`yolos`,[`YolosForObjectDetection`,rs]]]),Xl=new Map([[`owlvit`,[`OwlViTForObjectDetection`,Ca]],[`owlv2`,[`Owlv2ForObjectDetection`,Ea]],[`grounding-dino`,[`GroundingDinoForObjectDetection`,es]]]),Zl=new Map([[`detr`,[`DetrForSegmentation`,Na]],[`clipseg`,[`CLIPSegForImageSegmentation`,pr]]]),Ql=new Map([[`segformer`,[`SegformerForSemanticSegmentation`,Tc]],[`sapiens`,[`SapiensForSemanticSegmentation`,wo]],[`swin`,[`SwinForSemanticSegmentation`,mo]],[`mobilenet_v1`,[`MobileNetV1ForSemanticSegmentation`,zc]],[`mobilenet_v2`,[`MobileNetV2ForSemanticSegmentation`,Uc]],[`mobilenet_v3`,[`MobileNetV3ForSemanticSegmentation`,qc]],[`mobilenet_v4`,[`MobileNetV4ForSemanticSegmentation`,Zc]]]),$l=new Map([[`detr`,[`DetrForSegmentation`,Na]],[`maskformer`,[`MaskFormerForInstanceSegmentation`,Fo]]]),eu=new Map([[`sam`,[`SamModel`,cs]]]),tu=new Map([[`wav2vec2`,[`Wav2Vec2ForCTC`,vs]],[`wav2vec2-bert`,[`Wav2Vec2BertForCTC`,Ls]],[`unispeech`,[`UniSpeechForCTC`,Os]],[`unispeech-sat`,[`UniSpeechSatForCTC`,Ms]],[`wavlm`,[`WavLMForCTC`,Gs]],[`hubert`,[`HubertForCTC`,Vs]]]),nu=new Map([[`wav2vec2`,[`Wav2Vec2ForSequenceClassification`,ys]],[`wav2vec2-bert`,[`Wav2Vec2BertForSequenceClassification`,Rs]],[`unispeech`,[`UniSpeechForSequenceClassification`,ks]],[`unispeech-sat`,[`UniSpeechSatForSequenceClassification`,Ns]],[`wavlm`,[`WavLMForSequenceClassification`,Ks]],[`hubert`,[`HubertForSequenceClassification`,Hs]],[`audio-spectrogram-transformer`,[`ASTForAudioClassification`,An]]]),ru=new Map([[`wavlm`,[`WavLMForXVector`,qs]]]),iu=new Map([[`unispeech-sat`,[`UniSpeechSatForAudioFrameClassification`,Ps]],[`wavlm`,[`WavLMForAudioFrameClassification`,Js]],[`wav2vec2`,[`Wav2Vec2ForAudioFrameClassification`,bs]],[`pyannote`,[`PyAnnoteForAudioFrameClassification`,Cs]]]),au=new Map([[`vitmatte`,[`VitMatteForImageMatting`,ma]]]),ou=new Map([[`patchtst`,[`PatchTSTForPrediction`,sl]],[`patchtsmixer`,[`PatchTSMixerForPrediction`,ul]]]),su=new Map([[`swin2sr`,[`Swin2SRForImageSuperResolution`,_o]]]),cu=new Map([[`dpt`,[`DPTForDepthEstimation`,bo]],[`depth_anything`,[`DepthAnythingForDepthEstimation`,So]],[`glpn`,[`GLPNForDepthEstimation`,Ro]],[`sapiens`,[`SapiensForDepthEstimation`,To]],[`depth_pro`,[`DepthProForDepthEstimation`,Oo]],[`metric3d`,[`Metric3DForDepthEstimation`,Ao]],[`metric3dv2`,[`Metric3Dv2ForDepthEstimation`,Mo]]]),lu=new Map([[`sapiens`,[`SapiensForNormalEstimation`,Eo]]]),uu=new Map([[`vitpose`,[`VitPoseForPoseEstimation`,$i]]]),du=new Map([[`clip`,[`CLIPVisionModelWithProjection`,ir]],[`siglip`,[`SiglipVisionModel`,or]],[`jina_clip`,[`JinaCLIPVisionModel`,dr]]]),fu=[[Al,b.EncoderOnly],[jl,b.EncoderDecoder],[Nl,b.DecoderOnly],[Ml,b.AutoEncoder],[Ll,b.EncoderOnly],[Rl,b.EncoderOnly],[zl,b.Seq2Seq],[Pl,b.Seq2Seq],[Bl,b.DecoderOnly],[Vl,b.MultiModality],[Hl,b.EncoderOnly],[Ul,b.EncoderOnly],[Wl,b.Vision2Seq],[Gl,b.ImageTextToText],[Kl,b.AudioTextToText],[Jl,b.EncoderOnly],[Zl,b.EncoderOnly],[$l,b.EncoderOnly],[Ql,b.EncoderOnly],[au,b.EncoderOnly],[ou,b.EncoderOnly],[su,b.EncoderOnly],[cu,b.EncoderOnly],[lu,b.EncoderOnly],[uu,b.EncoderOnly],[Yl,b.EncoderOnly],[Xl,b.EncoderOnly],[eu,b.MaskGeneration],[tu,b.EncoderOnly],[nu,b.EncoderOnly],[Fl,b.Seq2Seq],[Il,b.EncoderOnly],[ru,b.EncoderOnly],[iu,b.EncoderOnly],[du,b.EncoderOnly]];for(let[e,t]of fu)for(let[n,r]of e.values())x.set(n,t),C.set(r,n),S.set(n,r);let pu=[[`MusicgenForConditionalGeneration`,Fc,b.Musicgen],[`Phi3VForCausalLM`,K,b.Phi3V],[`CLIPTextModelWithProjection`,rr,b.EncoderOnly],[`SiglipTextModel`,ar,b.EncoderOnly],[`JinaCLIPTextModel`,ur,b.EncoderOnly],[`ClapTextModelWithProjection`,vc,b.EncoderOnly],[`ClapAudioModelWithProjection`,yc,b.EncoderOnly],[`DacEncoderModel`,Cl,b.EncoderOnly],[`DacDecoderModel`,wl,b.EncoderOnly],[`MimiEncoderModel`,_l,b.EncoderOnly],[`MimiDecoderModel`,vl,b.EncoderOnly],[`SnacEncoderModel`,Dl,b.EncoderOnly],[`SnacDecoderModel`,Ol,b.EncoderOnly],[`Gemma3nForConditionalGeneration`,Yn,b.ImageAudioTextToText]];for(let[e,t,n]of pu)x.set(e,n),C.set(t,e),S.set(e,t);let mu=new Map([[`modnet`,Zl],[`birefnet`,Zl],[`isnet`,Zl],[`ben`,Zl]]);for(let[e,t]of mu.entries())t.set(e,[`PreTrainedModel`,F]),x.set(e,b.EncoderOnly),C.set(F,e),S.set(e,F);class hu extends kl{static MODEL_CLASS_MAPPINGS=fu.map(e=>e[0]);static BASE_IF_FAIL=!0}class gu extends kl{static MODEL_CLASS_MAPPINGS=[Ll]}class _u extends kl{static MODEL_CLASS_MAPPINGS=[Rl]}class vu extends kl{static MODEL_CLASS_MAPPINGS=[zl]}class yu extends kl{static MODEL_CLASS_MAPPINGS=[Pl]}class bu extends kl{static MODEL_CLASS_MAPPINGS=[Fl]}class xu extends kl{static MODEL_CLASS_MAPPINGS=[Il]}class Su extends kl{static MODEL_CLASS_MAPPINGS=[Bl]}class Cu extends kl{static MODEL_CLASS_MAPPINGS=[Hl]}class wu extends kl{static MODEL_CLASS_MAPPINGS=[Ul]}class Tu extends kl{static MODEL_CLASS_MAPPINGS=[Wl]}class Eu extends kl{static MODEL_CLASS_MAPPINGS=[Jl]}class Du extends kl{static MODEL_CLASS_MAPPINGS=[Zl]}class Ou extends kl{static MODEL_CLASS_MAPPINGS=[Ql]}class ku extends kl{static MODEL_CLASS_MAPPINGS=[$l]}class Au extends kl{static MODEL_CLASS_MAPPINGS=[Yl]}class ju extends kl{static MODEL_CLASS_MAPPINGS=[Xl]}class Mu extends kl{static MODEL_CLASS_MAPPINGS=[eu]}class Nu extends kl{static MODEL_CLASS_MAPPINGS=[tu]}class Pu extends kl{static MODEL_CLASS_MAPPINGS=[nu]}class Fu extends kl{static MODEL_CLASS_MAPPINGS=[ru]}class Iu extends kl{static MODEL_CLASS_MAPPINGS=[iu]}class Lu extends kl{static MODEL_CLASS_MAPPINGS=[ql]}class Ru extends kl{static MODEL_CLASS_MAPPINGS=[au]}class zu extends kl{static MODEL_CLASS_MAPPINGS=[su]}class Bu extends kl{static MODEL_CLASS_MAPPINGS=[cu]}class Vu extends kl{static MODEL_CLASS_MAPPINGS=[lu]}class Hu extends kl{static MODEL_CLASS_MAPPINGS=[uu]}class Uu extends kl{static MODEL_CLASS_MAPPINGS=[du]}class Wu extends kl{static MODEL_CLASS_MAPPINGS=[Gl]}class Gu extends kl{static MODEL_CLASS_MAPPINGS=[Kl]}class Ku extends me{constructor({logits:e,past_key_values:t,encoder_outputs:n,decoder_attentions:r=null,cross_attentions:i=null}){super(),this.logits=e,this.past_key_values=t,this.encoder_outputs=n,this.decoder_attentions=r,this.cross_attentions=i}}class Q extends me{constructor({logits:e,...t}){super(),this.logits=e;let n=Object.values(t);n.length>0&&(this.attentions=n)}}class qu extends me{constructor({logits:e,embeddings:t}){super(),this.logits=e,this.embeddings=t}}class Ju extends me{constructor({logits:e}){super(),this.logits=e}}class Yu extends me{constructor({logits:e}){super(),this.logits=e}}class Xu extends me{constructor({start_logits:e,end_logits:t}){super(),this.start_logits=e,this.end_logits=t}}class Zu extends me{constructor({logits:e}){super(),this.logits=e}}class Qu extends me{constructor({logits:e,past_key_values:t}){super(),this.logits=e,this.past_key_values=t}}class $u extends me{constructor({alphas:e}){super(),this.alphas=e}}class ed extends me{constructor({waveform:e,spectrogram:t}){super(),this.waveform=e,this.spectrogram=t}}},"./src/models/audio_spectrogram_transformer/feature_extraction_audio_spectrogram_transformer.js":(e,t,n)=>{n.r(t),n.d(t,{ASTFeatureExtractor:()=>o});var r=n( /*! ../../base/feature_extraction_utils.js */ `./src/base/feature_extraction_utils.js`),i=n( /*! ../../utils/tensor.js */ @@ -3490,7 +3490,7 @@ let af={url:self.location.href};var sf={"onnxruntime-common":e=>{e.exports=ne}," /*! ./utils/tensor.js */ `./src/utils/tensor.js`),f=n( /*! ./utils/image.js */ -`./src/utils/image.js`);async function p(e){return Array.isArray(e)||(e=[e]),await Promise.all(e.map(e=>f.RawImage.read(e)))}async function m(e,t){return Array.isArray(e)||(e=[e]),await Promise.all(e.map(e=>typeof e==`string`||e instanceof URL?(0,u.read_audio)(e,t):e instanceof Float64Array?new Float32Array(e):e))}function h(e,t){t&&(e=e.map(e=>e|0));let[n,r,i,a]=e;return{xmin:n,ymin:r,xmax:i,ymax:a}}class g extends s.Callable{constructor({task:e,model:t,tokenizer:n=null,processor:r=null}){super(),this.task=e,this.model=t,this.tokenizer=n,this.processor=r}async dispose(){await this.model.dispose()}}class _ extends g{constructor(e){super(e)}async _call(e,{top_k:t=1}={}){let n=this.tokenizer(e,{padding:!0,truncation:!0}),r=await this.model(n),i=this.model.config.problem_type===`multi_label_classification`?e=>e.sigmoid():e=>new d.Tensor(`float32`,(0,l.softmax)(e.data),e.dims),a=this.model.config.id2label,o=[];for(let e of r.logits){let n=i(e),r=await(0,d.topk)(n,t),s=r[0].tolist(),c=r[1].tolist(),l=c.map((e,t)=>({label:a?a[e]:`LABEL_${e}`,score:s[t]}));t===1?o.push(...l):o.push(l)}return Array.isArray(e)||t===1?o:o[0]}}class v extends g{constructor(e){super(e)}async _call(e,{ignore_labels:t=[`O`]}={}){let n=Array.isArray(e),r=this.tokenizer(n?e:[e],{padding:!0,truncation:!0}),i=await this.model(r),a=i.logits,o=this.model.config.id2label,s=[];for(let e=0;ee==this.tokenizer.sep_token_id),f=s[e].map((e,n)=>e==1&&(n===0||n>r&&u.findIndex(e=>e==t[n])===-1)),p=i[e].tolist(),m=a[e].tolist();for(let n=1;ne==t[n])!==-1)&&(p[n]=-1/0,m[n]=-1/0);let h=(0,l.softmax)(p).map((e,t)=>[e,t]),g=(0,l.softmax)(m).map((e,t)=>[e,t]);h[0][0]=0,g[0][0]=0;let _=(0,c.product)(h,g).filter(e=>e[0][1]<=e[1][1]).map(e=>[e[0][1],e[1][1],e[0][0]*e[1][0]]).sort((e,t)=>t[2]-e[2]);for(let e=0;ee==this.tokenizer.mask_token_id);if(o===-1)throw Error(`Mask token (${this.tokenizer.mask_token}) not found in text.`);let s=r[e][o],c=await(0,d.topk)(new d.Tensor(`float32`,(0,l.softmax)(s.data),s.dims),t),u=c[0].tolist(),f=c[1].tolist();i.push(f.map((e,t)=>{let r=n.slice();return r[o]=e,{score:u[t],token:Number(e),token_str:this.tokenizer.decode([e]),sequence:this.tokenizer.decode(r,{skip_special_tokens:!0})}}))}return Array.isArray(e)?i:i[0]}}class x extends g{_key=`generated_text`;constructor(e){super(e)}async _call(e,t={}){Array.isArray(e)||(e=[e]),this.model.config.prefix&&(e=e.map(e=>this.model.config.prefix+e));let n=this.model.config.task_specific_params;n&&n[this.task]&&n[this.task].prefix&&(e=e.map(e=>n[this.task].prefix+e));let r=this.tokenizer,i={padding:!0,truncation:!0},a;a=this instanceof C&&`_build_translation_inputs`in r?r._build_translation_inputs(e,i,t):r(e,i);let o=await this.model.generate({...a,...t});return r.batch_decode(o,{skip_special_tokens:!0}).map(e=>({[this._key]:e}))}}class S extends x{_key=`summary_text`;constructor(e){super(e)}}class C extends x{_key=`translation_text`;constructor(e){super(e)}}function w(e){return Array.isArray(e)&&e.every(e=>`role`in e&&`content`in e)}class T extends g{constructor(e){super(e)}async _call(e,t={}){let n=!1,r=!1,i;if(typeof e==`string`)i=e=[e];else if(Array.isArray(e)&&e.every(e=>typeof e==`string`))n=!0,i=e;else{if(w(e))e=[e];else if(Array.isArray(e)&&e.every(w))n=!0;else throw Error(`Input must be a string, an array of strings, a Chat, or an array of Chats`);r=!0,i=e.map(e=>this.tokenizer.apply_chat_template(e,{tokenize:!1,add_generation_prompt:!0}))}let a=t.add_special_tokens??!1,o=r?!1:t.return_full_text??!0;this.tokenizer.padding_side=`left`;let s=this.tokenizer(i,{add_special_tokens:a,padding:!0,truncation:!0}),c=await this.model.generate({...s,...t}),l=this.tokenizer.batch_decode(c,{skip_special_tokens:!0}),u;!o&&s.input_ids.dims.at(-1)>0&&(u=this.tokenizer.batch_decode(s.input_ids,{skip_special_tokens:!0}).map(e=>e.length));let d=Array.from({length:e.length},e=>[]);for(let t=0;t[e.toLowerCase(),t])),this.entailment_id=this.label2id.entailment,this.entailment_id===void 0&&(console.warn(`Could not find 'entailment' in label2id mapping. Using 2 as entailment_id.`),this.entailment_id=2),this.contradiction_id=this.label2id.contradiction??this.label2id.not_entailment,this.contradiction_id===void 0&&(console.warn(`Could not find 'contradiction' in label2id mapping. Using 0 as contradiction_id.`),this.contradiction_id=0)}async _call(e,t,{hypothesis_template:n=`This example is {}.`,multi_label:r=!1}={}){let i=Array.isArray(e);i||(e=[e]),Array.isArray(t)||(t=[t]);let a=t.map(e=>n.replace(`{}`,e)),o=r||t.length===1,s=[];for(let n of e){let e=[];for(let t of a){let r=this.tokenizer(n,{text_pair:t,padding:!0,truncation:!0}),i=await this.model(r);o?e.push([i.logits.data[this.contradiction_id],i.logits.data[this.entailment_id]]):e.push(i.logits.data[this.entailment_id])}let r=o?e.map(e=>(0,l.softmax)(e)[1]):(0,l.softmax)(e),i=r.map((e,t)=>[e,t]).sort((e,t)=>t[0]-e[0]);s.push({sequence:n,labels:i.map(e=>t[e[1]]),scores:i.map(e=>e[0])})}return i?s:s[0]}}class D extends g{constructor(e){super(e)}async _call(e,{pooling:t=`none`,normalize:n=!1,quantize:r=!1,precision:i=`binary`}={}){let a=this.tokenizer(e,{padding:!0,truncation:!0}),o=await this.model(a),s=o.last_hidden_state??o.logits??o.token_embeddings;switch(t){case`none`:break;case`mean`:s=(0,d.mean_pooling)(s,a.attention_mask);break;case`first_token`:case`cls`:s=s.slice(null,0);break;case`last_token`:case`eos`:s=s.slice(null,-1);break;default:throw Error(`Pooling method '${t}' not supported.`)}return n&&(s=s.normalize(2,-1)),r&&(s=(0,d.quantize_embeddings)(s,i)),s}}class O extends g{constructor(e){super(e)}async _call(e,{pool:t=null}={}){let n=await p(e),{pixel_values:r}=await this.processor(n),i=await this.model({pixel_values:r}),a;if(t){if(!(`pooler_output`in i))throw Error(`No pooled output was returned. Make sure the model has a 'pooler' layer when using the 'pool' option.`);a=i.pooler_output}else a=i.last_hidden_state??i.logits??i.image_embeds;return a}}class k extends g{constructor(e){super(e)}async _call(e,{top_k:t=5}={}){let n=this.processor.feature_extractor.config.sampling_rate,r=await m(e,n),i=this.model.config.id2label,a=[];for(let e of r){let n=await this.processor(e),r=await this.model(n),o=r.logits[0],s=await(0,d.topk)(new d.Tensor(`float32`,(0,l.softmax)(o.data),o.dims),t),c=s[0].tolist(),u=s[1].tolist(),f=u.map((e,t)=>({label:i?i[e]:`LABEL_${e}`,score:c[t]}));a.push(f)}return Array.isArray(e)?a:a[0]}}class A extends g{constructor(e){super(e)}async _call(e,t,{hypothesis_template:n=`This is a sound of {}.`}={}){let r=!Array.isArray(e);r&&(e=[e]);let i=t.map(e=>n.replace(`{}`,e)),a=this.tokenizer(i,{padding:!0,truncation:!0}),o=this.processor.feature_extractor.config.sampling_rate,s=await m(e,o),c=[];for(let e of s){let n=await this.processor(e),r=await this.model({...a,...n}),i=(0,l.softmax)(r.logits_per_audio.data);c.push([...i].map((e,n)=>({score:e,label:t[n]})))}return r?c[0]:c}}class ee extends g{constructor(e){super(e)}async _call(e,t={}){switch(this.model.config.model_type){case`whisper`:case`lite-whisper`:return this._call_whisper(e,t);case`wav2vec2`:case`wav2vec2-bert`:case`unispeech`:case`unispeech-sat`:case`hubert`:return this._call_wav2vec2(e,t);case`moonshine`:return this._call_moonshine(e,t);default:throw Error(`AutomaticSpeechRecognitionPipeline does not support model type '${this.model.config.model_type}'.`)}}async _call_wav2vec2(e,t){t.language&&console.warn('`language` parameter is not yet supported for `wav2vec2` models, defaulting to "English".'),t.task&&console.warn('`task` parameter is not yet supported for `wav2vec2` models, defaulting to "transcribe".');let n=!Array.isArray(e);n&&(e=[e]);let r=this.processor.feature_extractor.config.sampling_rate,i=await m(e,r),a=[];for(let e of i){let t=await this.processor(e),n=await this.model(t),r=n.logits[0],i=[];for(let e of r)i.push((0,l.max)(e.data)[1]);let o=this.tokenizer.decode(i);a.push({text:o})}return n?a[0]:a}async _call_whisper(e,t){let n=t.return_timestamps??!1,r=t.chunk_length_s??0,i=t.force_full_sequences??!1,a=t.stride_length_s??null,o={...t};n===`word`&&(o.return_token_timestamps=!0,o.return_timestamps=!1);let s=!Array.isArray(e);s&&(e=[e]);let c=this.processor.feature_extractor.config.chunk_length/this.model.config.max_source_positions,u=this.processor.feature_extractor.config.hop_length,d=this.processor.feature_extractor.config.sampling_rate,f=await m(e,d),p=[];for(let e of f){let t=[];if(r>0){if(a===null)a=r/6;else if(r<=a)throw Error("`chunk_length_s` must be larger than `stride_length_s`.");let n=d*r,i=d*a,o=n-2*i,s=0;for(;;){let r=s+n,a=e.subarray(s,r),c=await this.processor(a),l=s===0,u=r>=e.length;if(t.push({stride:[a.length,l?0:i,u?0:i],input_features:c.input_features,is_last:u}),u)break;s+=o}}else t=[{stride:[e.length,0,0],input_features:(await this.processor(e)).input_features,is_last:!0}];for(let e of t){o.num_frames=Math.floor(e.stride[0]/u);let t=await this.model.generate({inputs:e.input_features,...o});n===`word`?(e.tokens=t.sequences.tolist()[0],e.token_timestamps=t.token_timestamps.tolist()[0].map(e=>(0,l.round)(e,2))):e.tokens=t[0].tolist(),e.stride=e.stride.map(e=>e/d)}let[s,f]=this.tokenizer._decode_asr(t,{time_precision:c,return_timestamps:n,force_full_sequences:i});p.push({text:s,...f})}return s?p[0]:p}async _call_moonshine(e,t){let n=!Array.isArray(e);n&&(e=[e]);let r=this.processor.feature_extractor.config.sampling_rate,i=await m(e,r),a=[];for(let e of i){let n=await this.processor(e),i=Math.floor(e.length/r)*6,o=await this.model.generate({max_new_tokens:i,...t,...n}),s=this.processor.batch_decode(o,{skip_special_tokens:!0})[0];a.push({text:s})}return n?a[0]:a}}class te extends g{constructor(e){super(e)}async _call(e,t={}){let n=Array.isArray(e),r=await p(e),{pixel_values:i}=await this.processor(r),a=[];for(let e of i){e.dims=[1,...e.dims];let n=await this.model.generate({inputs:e,...t}),r=this.tokenizer.batch_decode(n,{skip_special_tokens:!0}).map(e=>({generated_text:e.trim()}));a.push(r)}return n?a:a[0]}}class ne extends g{constructor(e){super(e)}async _call(e,{top_k:t=5}={}){let n=await p(e),{pixel_values:r}=await this.processor(n),i=await this.model({pixel_values:r}),a=this.model.config.id2label,o=[];for(let e of i.logits){let n=await(0,d.topk)(new d.Tensor(`float32`,(0,l.softmax)(e.data),e.dims),t),r=n[0].tolist(),i=n[1].tolist(),s=i.map((e,t)=>({label:a?a[e]:`LABEL_${e}`,score:r[t]}));o.push(s)}return Array.isArray(e)?o:o[0]}}class j extends g{constructor(e){super(e),this.subtasks_mapping={panoptic:`post_process_panoptic_segmentation`,instance:`post_process_instance_segmentation`,semantic:`post_process_semantic_segmentation`}}async _call(e,{threshold:t=.5,mask_threshold:n=.5,overlap_mask_area_threshold:r=.8,label_ids_to_fuse:i=null,target_sizes:a=null,subtask:o=null}={}){let s=Array.isArray(e);if(s&&e.length!==1)throw Error(`Image segmentation pipeline currently only supports a batch size of 1.`);let c=await p(e),l=c.map(e=>[e.height,e.width]),u=await this.processor(c),{inputNames:d,outputNames:m}=this.model.sessions.model;if(!d.includes(`pixel_values`)){if(d.length!==1)throw Error(`Expected a single input name, but got ${d.length} inputs: ${d}.`);let e=d[0];if(e in u)throw Error(`Input name ${e} already exists in the inputs.`);u[e]=u.pixel_values}let h=await this.model(u),g=null;if(o!==null)g=this.subtasks_mapping[o];else if(this.processor.image_processor){for(let[e,t]of Object.entries(this.subtasks_mapping))if(t in this.processor.image_processor){g=this.processor.image_processor[t].bind(this.processor.image_processor),o=e;break}}let _=this.model.config.id2label,v=[];if(o)if(o===`panoptic`||o===`instance`){let e=g(h,t,n,r,i,a??l)[0],o=e.segmentation;for(let t of e.segments_info){let e=new Uint8ClampedArray(o.data.length);for(let n=0;nt<-e||t>1+e)&&i.sigmoid_();let a=await f.RawImage.fromTensor(i.mul_(255).to(`uint8`)).resize(r[1],r[0]);v.push({label:null,score:null,mask:a})}}return v}}class re extends j{constructor(e){super(e)}async _call(e,t={}){let n=Array.isArray(e);if(n&&e.length!==1)throw Error(`Background removal pipeline currently only supports a batch size of 1.`);let r=await p(e),i=await super._call(e,t),a=r.map((e,t)=>{let n=e.clone();return n.putAlpha(i[t].mask),n});return a}}class ie extends g{constructor(e){super(e)}async _call(e,t,{hypothesis_template:n=`This is a photo of {}`}={}){let r=Array.isArray(e),i=await p(e),a=t.map(e=>n.replace(`{}`,e)),o=this.tokenizer(a,{padding:this.model.config.model_type===`siglip`?`max_length`:!0,truncation:!0}),{pixel_values:s}=await this.processor(i),c=await this.model({...o,pixel_values:s}),u=this.model.config.model_type===`siglip`?e=>e.sigmoid().data:e=>(0,l.softmax)(e.data),d=[];for(let e of c.logits_per_image){let n=u(e),r=[...n].map((e,n)=>({score:e,label:t[n]}));r.sort((e,t)=>t.score-e.score),d.push(r)}return r?d:d[0]}}class ae extends g{constructor(e){super(e)}async _call(e,{threshold:t=.9,percentage:n=!1}={}){let r=Array.isArray(e);if(r&&e.length!==1)throw Error(`Object detection pipeline currently only supports a batch size of 1.`);let i=await p(e),a=n?null:i.map(e=>[e.height,e.width]),{pixel_values:o,pixel_mask:s}=await this.processor(i),c=await this.model({pixel_values:o,pixel_mask:s}),l=this.processor.image_processor.post_process_object_detection(c,t,a),u=this.model.config.id2label,d=l.map(e=>e.boxes.map((t,r)=>({score:e.scores[r],label:u[e.classes[r]],box:h(t,!n)})));return r?d:d[0]}}class oe extends g{constructor(e){super(e)}async _call(e,t,{threshold:n=.1,top_k:r=null,percentage:i=!1}={}){let a=Array.isArray(e),o=await p(e),s=this.tokenizer(t,{padding:!0,truncation:!0}),c=await this.processor(o),l=[];for(let e=0;e({score:e.scores[n],label:e.labels[n],box:h(t,!i)}))}else{let e=this.processor.image_processor.post_process_object_detection(f,n,u,!0)[0];p=e.boxes.map((n,r)=>({score:e.scores[r],label:t[e.classes[r]],box:h(n,!i)}))}p.sort((e,t)=>t.score-e.score),r!==null&&(p=p.slice(0,r)),l.push(p)}return a?l:l[0]}}class se extends g{constructor(e){super(e)}async _call(e,t,n={}){let r=(await p(e))[0],{pixel_values:i}=await this.processor(r),a=`${t}`,o=this.tokenizer(a,{add_special_tokens:!1,padding:!0,truncation:!0}).input_ids,s=await this.model.generate({inputs:i,max_length:this.model.config.decoder.max_position_embeddings,decoder_input_ids:o,...n}),c=this.tokenizer.batch_decode(s)[0],l=c.match(/(.*?)<\/s_answer>/),u=null;return l&&l.length>=2&&(u=l[1].trim()),[{answer:u}]}}class M extends g{DEFAULT_VOCODER_ID=`Xenova/speecht5_hifigan`;constructor(e){super(e),this.vocoder=e.vocoder??null}async _call(e,{speaker_embeddings:t=null}={}){return this.processor?this._call_text_to_spectrogram(e,{speaker_embeddings:t}):this._call_text_to_waveform(e)}async _call_text_to_waveform(e){let t=this.tokenizer(e,{padding:!0,truncation:!0}),{waveform:n}=await this.model(t),r=this.model.config.sampling_rate;return new u.RawAudio(n.data,r)}async _call_text_to_spectrogram(e,{speaker_embeddings:t}){if(this.vocoder||(console.log(`No vocoder specified, using default HifiGan vocoder.`),this.vocoder=await i.AutoModel.from_pretrained(this.DEFAULT_VOCODER_ID,{dtype:`fp32`})),(typeof t==`string`||t instanceof URL)&&(t=new Float32Array(await(await fetch(t)).arrayBuffer())),t instanceof Float32Array)t=new d.Tensor(`float32`,t,[1,t.length]);else if(!(t instanceof d.Tensor))throw Error("Speaker embeddings must be a `Tensor`, `Float32Array`, `string`, or `URL`.");let{input_ids:n}=this.tokenizer(e,{padding:!0,truncation:!0}),{waveform:r}=await this.model.generate_speech(n,t,{vocoder:this.vocoder}),a=this.processor.feature_extractor.config.sampling_rate;return new u.RawAudio(r.data,a)}}class N extends g{constructor(e){super(e)}async _call(e){let t=await p(e),n=await this.processor(t),r=await this.model(n),i=[];for(let e of r.reconstruction){let t=e.squeeze().clamp_(0,1).mul_(255).round_().to(`uint8`);i.push(f.RawImage.fromTensor(t))}return i.length>1?i:i[0]}}class ce extends g{constructor(e){super(e)}async _call(e){let t=await p(e),n=await this.processor(t),{predicted_depth:r}=await this.model(n),i=[];for(let e=0;e1?i:i[0]}}let le=Object.freeze({"text-classification":{tokenizer:r.AutoTokenizer,pipeline:_,model:i.AutoModelForSequenceClassification,default:{model:`Xenova/distilbert-base-uncased-finetuned-sst-2-english`},type:`text`},"token-classification":{tokenizer:r.AutoTokenizer,pipeline:v,model:i.AutoModelForTokenClassification,default:{model:`Xenova/bert-base-multilingual-cased-ner-hrl`},type:`text`},"question-answering":{tokenizer:r.AutoTokenizer,pipeline:y,model:i.AutoModelForQuestionAnswering,default:{model:`Xenova/distilbert-base-cased-distilled-squad`},type:`text`},"fill-mask":{tokenizer:r.AutoTokenizer,pipeline:b,model:i.AutoModelForMaskedLM,default:{model:`Xenova/bert-base-uncased`},type:`text`},summarization:{tokenizer:r.AutoTokenizer,pipeline:S,model:i.AutoModelForSeq2SeqLM,default:{model:`Xenova/distilbart-cnn-6-6`},type:`text`},translation:{tokenizer:r.AutoTokenizer,pipeline:C,model:i.AutoModelForSeq2SeqLM,default:{model:`Xenova/t5-small`},type:`text`},"text2text-generation":{tokenizer:r.AutoTokenizer,pipeline:x,model:i.AutoModelForSeq2SeqLM,default:{model:`Xenova/flan-t5-small`},type:`text`},"text-generation":{tokenizer:r.AutoTokenizer,pipeline:T,model:i.AutoModelForCausalLM,default:{model:`Xenova/gpt2`},type:`text`},"zero-shot-classification":{tokenizer:r.AutoTokenizer,pipeline:E,model:i.AutoModelForSequenceClassification,default:{model:`Xenova/distilbert-base-uncased-mnli`},type:`text`},"audio-classification":{pipeline:k,model:i.AutoModelForAudioClassification,processor:a.AutoProcessor,default:{model:`Xenova/wav2vec2-base-superb-ks`},type:`audio`},"zero-shot-audio-classification":{tokenizer:r.AutoTokenizer,pipeline:A,model:i.AutoModel,processor:a.AutoProcessor,default:{model:`Xenova/clap-htsat-unfused`},type:`multimodal`},"automatic-speech-recognition":{tokenizer:r.AutoTokenizer,pipeline:ee,model:[i.AutoModelForSpeechSeq2Seq,i.AutoModelForCTC],processor:a.AutoProcessor,default:{model:`Xenova/whisper-tiny.en`},type:`multimodal`},"text-to-audio":{tokenizer:r.AutoTokenizer,pipeline:M,model:[i.AutoModelForTextToWaveform,i.AutoModelForTextToSpectrogram],processor:[a.AutoProcessor,null],default:{model:`Xenova/speecht5_tts`},type:`text`},"image-to-text":{tokenizer:r.AutoTokenizer,pipeline:te,model:i.AutoModelForVision2Seq,processor:a.AutoProcessor,default:{model:`Xenova/vit-gpt2-image-captioning`},type:`multimodal`},"image-classification":{pipeline:ne,model:i.AutoModelForImageClassification,processor:a.AutoProcessor,default:{model:`Xenova/vit-base-patch16-224`},type:`multimodal`},"image-segmentation":{pipeline:j,model:[i.AutoModelForImageSegmentation,i.AutoModelForSemanticSegmentation,i.AutoModelForUniversalSegmentation],processor:a.AutoProcessor,default:{model:`Xenova/detr-resnet-50-panoptic`},type:`multimodal`},"background-removal":{pipeline:re,model:[i.AutoModelForImageSegmentation,i.AutoModelForSemanticSegmentation,i.AutoModelForUniversalSegmentation],processor:a.AutoProcessor,default:{model:`Xenova/modnet`},type:`image`},"zero-shot-image-classification":{tokenizer:r.AutoTokenizer,pipeline:ie,model:i.AutoModel,processor:a.AutoProcessor,default:{model:`Xenova/clip-vit-base-patch32`},type:`multimodal`},"object-detection":{pipeline:ae,model:i.AutoModelForObjectDetection,processor:a.AutoProcessor,default:{model:`Xenova/detr-resnet-50`},type:`multimodal`},"zero-shot-object-detection":{tokenizer:r.AutoTokenizer,pipeline:oe,model:i.AutoModelForZeroShotObjectDetection,processor:a.AutoProcessor,default:{model:`Xenova/owlvit-base-patch32`},type:`multimodal`},"document-question-answering":{tokenizer:r.AutoTokenizer,pipeline:se,model:i.AutoModelForDocumentQuestionAnswering,processor:a.AutoProcessor,default:{model:`Xenova/donut-base-finetuned-docvqa`},type:`multimodal`},"image-to-image":{pipeline:N,model:i.AutoModelForImageToImage,processor:a.AutoProcessor,default:{model:`Xenova/swin2SR-classical-sr-x2-64`},type:`image`},"depth-estimation":{pipeline:ce,model:i.AutoModelForDepthEstimation,processor:a.AutoProcessor,default:{model:`Xenova/dpt-large`},type:`image`},"feature-extraction":{tokenizer:r.AutoTokenizer,pipeline:D,model:i.AutoModel,default:{model:`Xenova/all-MiniLM-L6-v2`},type:`text`},"image-feature-extraction":{processor:a.AutoProcessor,pipeline:O,model:[i.AutoModelForImageFeatureExtraction,i.AutoModel],default:{model:`Xenova/vit-base-patch16-224-in21k`},type:`image`}}),ue=Object.freeze({"sentiment-analysis":`text-classification`,ner:`token-classification`,asr:`automatic-speech-recognition`,"text-to-speech":`text-to-audio`,embeddings:`feature-extraction`});async function de(e,t=null,{progress_callback:n=null,config:r=null,cache_dir:i=null,local_files_only:a=!1,revision:o=`main`,device:s=null,dtype:l=null,subfolder:u=`onnx`,use_external_data_format:d=null,model_file_name:f=null,session_options:p={}}={}){e=ue[e]??e;let m=le[e.split(`_`,1)[0]];if(!m)throw Error(`Unsupported pipeline: ${e}. Must be one of [${Object.keys(le)}]`);t||(t=m.default.model,console.log(`No model specified. Using default model: "${t}".`));let h={progress_callback:n,config:r,cache_dir:i,local_files_only:a,revision:o,device:s,dtype:l,subfolder:u,use_external_data_format:d,model_file_name:f,session_options:p},g=new Map([[`tokenizer`,m.tokenizer],[`model`,m.model],[`processor`,m.processor]]),_=await P(g,t,h);_.task=e,(0,c.dispatchCallback)(n,{status:`ready`,task:e,model:t});let v=m.pipeline;return new v(_)}async function P(e,t,n){let r=Object.create(null),i=[];for(let[a,o]of e.entries()){if(!o)continue;let e;e=Array.isArray(o)?new Promise(async(e,r)=>{let i;for(let a of o){if(a===null){e(null);return}try{e(await a.from_pretrained(t,n));return}catch(e){if(e.message?.includes(`Unsupported model type`))i=e;else if(e.message?.includes(`Could not locate file`))i=e;else{r(e);return}}}r(i)}):o.from_pretrained(t,n),r[a]=e,i.push(e)}await Promise.all(i);for(let[e,t]of Object.entries(r))r[e]=await t;return r}},"./src/tokenizers.js":(e,t,n)=>{n.r(t),n.d(t,{AlbertTokenizer:()=>He,AutoTokenizer:()=>Nt,BartTokenizer:()=>tt,BertTokenizer:()=>Ve,BlenderbotSmallTokenizer:()=>Dt,BlenderbotTokenizer:()=>Et,BloomTokenizer:()=>at,CLIPTokenizer:()=>St,CamembertTokenizer:()=>Xe,CodeGenTokenizer:()=>xt,CodeLlamaTokenizer:()=>ct,CohereTokenizer:()=>jt,ConvBertTokenizer:()=>qe,DebertaTokenizer:()=>We,DebertaV2Tokenizer:()=>Ge,DistilBertTokenizer:()=>Ye,ElectraTokenizer:()=>Qe,EsmTokenizer:()=>pt,FalconTokenizer:()=>dt,GPT2Tokenizer:()=>et,GPTNeoXTokenizer:()=>ft,GemmaTokenizer:()=>ht,Grok1Tokenizer:()=>gt,HerbertTokenizer:()=>Ke,LlamaTokenizer:()=>st,M2M100Tokenizer:()=>yt,MBart50Tokenizer:()=>rt,MBartTokenizer:()=>nt,MPNetTokenizer:()=>ut,MarianTokenizer:()=>wt,MgpstrTokenizer:()=>Mt,MobileBertTokenizer:()=>B,NllbTokenizer:()=>vt,NougatTokenizer:()=>kt,PreTrainedTokenizer:()=>z,Qwen2Tokenizer:()=>mt,RoFormerTokenizer:()=>Je,RobertaTokenizer:()=>it,SiglipTokenizer:()=>Ct,SpeechT5Tokenizer:()=>Ot,SqueezeBertTokenizer:()=>Ue,T5Tokenizer:()=>$e,TokenizerModel:()=>D,VitsTokenizer:()=>At,Wav2Vec2CTCTokenizer:()=>Tt,WhisperTokenizer:()=>bt,XLMRobertaTokenizer:()=>lt,XLMTokenizer:()=>Ze,is_chinese_char:()=>y});var r=n( +`./src/utils/image.js`);async function p(e){return Array.isArray(e)||(e=[e]),await Promise.all(e.map(e=>f.RawImage.read(e)))}async function m(e,t){return Array.isArray(e)||(e=[e]),await Promise.all(e.map(e=>typeof e==`string`||e instanceof URL?(0,u.read_audio)(e,t):e instanceof Float64Array?new Float32Array(e):e))}function h(e,t){t&&(e=e.map(e=>e|0));let[n,r,i,a]=e;return{xmin:n,ymin:r,xmax:i,ymax:a}}class g extends s.Callable{constructor({task:e,model:t,tokenizer:n=null,processor:r=null}){super(),this.task=e,this.model=t,this.tokenizer=n,this.processor=r}async dispose(){await this.model.dispose()}}class _ extends g{constructor(e){super(e)}async _call(e,{top_k:t=1}={}){let n=this.tokenizer(e,{padding:!0,truncation:!0}),r=await this.model(n),i=this.model.config.problem_type===`multi_label_classification`?e=>e.sigmoid():e=>new d.Tensor(`float32`,(0,l.softmax)(e.data),e.dims),a=this.model.config.id2label,o=[];for(let e of r.logits){let n=i(e),r=await(0,d.topk)(n,t),s=r[0].tolist(),c=r[1].tolist(),l=c.map((e,t)=>({label:a?a[e]:`LABEL_${e}`,score:s[t]}));t===1?o.push(...l):o.push(l)}return Array.isArray(e)||t===1?o:o[0]}}class v extends g{constructor(e){super(e)}async _call(e,{ignore_labels:t=[`O`]}={}){let n=Array.isArray(e),r=this.tokenizer(n?e:[e],{padding:!0,truncation:!0}),i=await this.model(r),a=i.logits,o=this.model.config.id2label,s=[];for(let e=0;ee==this.tokenizer.sep_token_id),f=s[e].map((e,n)=>e==1&&(n===0||n>r&&u.findIndex(e=>e==t[n])===-1)),p=i[e].tolist(),m=a[e].tolist();for(let n=1;ne==t[n])!==-1)&&(p[n]=-1/0,m[n]=-1/0);let h=(0,l.softmax)(p).map((e,t)=>[e,t]),g=(0,l.softmax)(m).map((e,t)=>[e,t]);h[0][0]=0,g[0][0]=0;let _=(0,c.product)(h,g).filter(e=>e[0][1]<=e[1][1]).map(e=>[e[0][1],e[1][1],e[0][0]*e[1][0]]).sort((e,t)=>t[2]-e[2]);for(let e=0;ee==this.tokenizer.mask_token_id);if(o===-1)throw Error(`Mask token (${this.tokenizer.mask_token}) not found in text.`);let s=r[e][o],c=await(0,d.topk)(new d.Tensor(`float32`,(0,l.softmax)(s.data),s.dims),t),u=c[0].tolist(),f=c[1].tolist();i.push(f.map((e,t)=>{let r=n.slice();return r[o]=e,{score:u[t],token:Number(e),token_str:this.tokenizer.decode([e]),sequence:this.tokenizer.decode(r,{skip_special_tokens:!0})}}))}return Array.isArray(e)?i:i[0]}}class x extends g{_key=`generated_text`;constructor(e){super(e)}async _call(e,t={}){Array.isArray(e)||(e=[e]),this.model.config.prefix&&(e=e.map(e=>this.model.config.prefix+e));let n=this.model.config.task_specific_params;n&&n[this.task]&&n[this.task].prefix&&(e=e.map(e=>n[this.task].prefix+e));let r=this.tokenizer,i={padding:!0,truncation:!0},a;a=this instanceof C&&`_build_translation_inputs`in r?r._build_translation_inputs(e,i,t):r(e,i);let o=await this.model.generate({...a,...t});return r.batch_decode(o,{skip_special_tokens:!0}).map(e=>({[this._key]:e}))}}class S extends x{_key=`summary_text`;constructor(e){super(e)}}class C extends x{_key=`translation_text`;constructor(e){super(e)}}function w(e){return Array.isArray(e)&&e.every(e=>`role`in e&&`content`in e)}class T extends g{constructor(e){super(e)}async _call(e,t={}){let n=!1,r=!1,i;if(typeof e==`string`)i=e=[e];else if(Array.isArray(e)&&e.every(e=>typeof e==`string`))n=!0,i=e;else{if(w(e))e=[e];else if(Array.isArray(e)&&e.every(w))n=!0;else throw Error(`Input must be a string, an array of strings, a Chat, or an array of Chats`);r=!0,i=e.map(e=>this.tokenizer.apply_chat_template(e,{tokenize:!1,add_generation_prompt:!0}))}let a=t.add_special_tokens??!1,o=r?!1:t.return_full_text??!0;this.tokenizer.padding_side=`left`;let s=this.tokenizer(i,{add_special_tokens:a,padding:!0,truncation:!0}),c=await this.model.generate({...s,...t}),l=this.tokenizer.batch_decode(c,{skip_special_tokens:!0}),u;!o&&s.input_ids.dims.at(-1)>0&&(u=this.tokenizer.batch_decode(s.input_ids,{skip_special_tokens:!0}).map(e=>e.length));let d=Array.from({length:e.length},e=>[]);for(let t=0;t[e.toLowerCase(),t])),this.entailment_id=this.label2id.entailment,this.entailment_id===void 0&&(console.warn(`Could not find 'entailment' in label2id mapping. Using 2 as entailment_id.`),this.entailment_id=2),this.contradiction_id=this.label2id.contradiction??this.label2id.not_entailment,this.contradiction_id===void 0&&(console.warn(`Could not find 'contradiction' in label2id mapping. Using 0 as contradiction_id.`),this.contradiction_id=0)}async _call(e,t,{hypothesis_template:n=`This example is {}.`,multi_label:r=!1}={}){let i=Array.isArray(e);i||(e=[e]),Array.isArray(t)||(t=[t]);let a=t.map(e=>n.replace(`{}`,e)),o=r||t.length===1,s=[];for(let n of e){let e=[];for(let t of a){let r=this.tokenizer(n,{text_pair:t,padding:!0,truncation:!0}),i=await this.model(r);o?e.push([i.logits.data[this.contradiction_id],i.logits.data[this.entailment_id]]):e.push(i.logits.data[this.entailment_id])}let r=o?e.map(e=>(0,l.softmax)(e)[1]):(0,l.softmax)(e),i=r.map((e,t)=>[e,t]).sort((e,t)=>t[0]-e[0]);s.push({sequence:n,labels:i.map(e=>t[e[1]]),scores:i.map(e=>e[0])})}return i?s:s[0]}}class D extends g{constructor(e){super(e)}async _call(e,{pooling:t=`none`,normalize:n=!1,quantize:r=!1,precision:i=`binary`}={}){let a=this.tokenizer(e,{padding:!0,truncation:!0}),o=await this.model(a),s=o.last_hidden_state??o.logits??o.token_embeddings;switch(t){case`none`:break;case`mean`:s=(0,d.mean_pooling)(s,a.attention_mask);break;case`first_token`:case`cls`:s=s.slice(null,0);break;case`last_token`:case`eos`:s=s.slice(null,-1);break;default:throw Error(`Pooling method '${t}' not supported.`)}return n&&(s=s.normalize(2,-1)),r&&(s=(0,d.quantize_embeddings)(s,i)),s}}class O extends g{constructor(e){super(e)}async _call(e,{pool:t=null}={}){let n=await p(e),{pixel_values:r}=await this.processor(n),i=await this.model({pixel_values:r}),a;if(t){if(!(`pooler_output`in i))throw Error(`No pooled output was returned. Make sure the model has a 'pooler' layer when using the 'pool' option.`);a=i.pooler_output}else a=i.last_hidden_state??i.logits??i.image_embeds;return a}}class k extends g{constructor(e){super(e)}async _call(e,{top_k:t=5}={}){let n=this.processor.feature_extractor.config.sampling_rate,r=await m(e,n),i=this.model.config.id2label,a=[];for(let e of r){let n=await this.processor(e),r=await this.model(n),o=r.logits[0],s=await(0,d.topk)(new d.Tensor(`float32`,(0,l.softmax)(o.data),o.dims),t),c=s[0].tolist(),u=s[1].tolist(),f=u.map((e,t)=>({label:i?i[e]:`LABEL_${e}`,score:c[t]}));a.push(f)}return Array.isArray(e)?a:a[0]}}class A extends g{constructor(e){super(e)}async _call(e,t,{hypothesis_template:n=`This is a sound of {}.`}={}){let r=!Array.isArray(e);r&&(e=[e]);let i=t.map(e=>n.replace(`{}`,e)),a=this.tokenizer(i,{padding:!0,truncation:!0}),o=this.processor.feature_extractor.config.sampling_rate,s=await m(e,o),c=[];for(let e of s){let n=await this.processor(e),r=await this.model({...a,...n}),i=(0,l.softmax)(r.logits_per_audio.data);c.push([...i].map((e,n)=>({score:e,label:t[n]})))}return r?c[0]:c}}class ee extends g{constructor(e){super(e)}async _call(e,t={}){switch(this.model.config.model_type){case`whisper`:case`lite-whisper`:return this._call_whisper(e,t);case`wav2vec2`:case`wav2vec2-bert`:case`unispeech`:case`unispeech-sat`:case`hubert`:return this._call_wav2vec2(e,t);case`moonshine`:return this._call_moonshine(e,t);default:throw Error(`AutomaticSpeechRecognitionPipeline does not support model type '${this.model.config.model_type}'.`)}}async _call_wav2vec2(e,t){t.language&&console.warn('`language` parameter is not yet supported for `wav2vec2` models, defaulting to "English".'),t.task&&console.warn('`task` parameter is not yet supported for `wav2vec2` models, defaulting to "transcribe".');let n=!Array.isArray(e);n&&(e=[e]);let r=this.processor.feature_extractor.config.sampling_rate,i=await m(e,r),a=[];for(let e of i){let t=await this.processor(e),n=await this.model(t),r=n.logits[0],i=[];for(let e of r)i.push((0,l.max)(e.data)[1]);let o=this.tokenizer.decode(i);a.push({text:o})}return n?a[0]:a}async _call_whisper(e,t){let n=t.return_timestamps??!1,r=t.chunk_length_s??0,i=t.force_full_sequences??!1,a=t.stride_length_s??null,o={...t};n===`word`&&(o.return_token_timestamps=!0,o.return_timestamps=!1);let s=!Array.isArray(e);s&&(e=[e]);let c=this.processor.feature_extractor.config.chunk_length/this.model.config.max_source_positions,u=this.processor.feature_extractor.config.hop_length,d=this.processor.feature_extractor.config.sampling_rate,f=await m(e,d),p=[];for(let e of f){let t=[];if(r>0){if(a===null)a=r/6;else if(r<=a)throw Error("`chunk_length_s` must be larger than `stride_length_s`.");let n=d*r,i=d*a,o=n-2*i,s=0;for(;;){let r=s+n,a=e.subarray(s,r),c=await this.processor(a),l=s===0,u=r>=e.length;if(t.push({stride:[a.length,l?0:i,u?0:i],input_features:c.input_features,is_last:u}),u)break;s+=o}}else t=[{stride:[e.length,0,0],input_features:(await this.processor(e)).input_features,is_last:!0}];for(let e of t){o.num_frames=Math.floor(e.stride[0]/u);let t=await this.model.generate({inputs:e.input_features,...o});n===`word`?(e.tokens=t.sequences.tolist()[0],e.token_timestamps=t.token_timestamps.tolist()[0].map(e=>(0,l.round)(e,2))):e.tokens=t[0].tolist(),e.stride=e.stride.map(e=>e/d)}let[s,f]=this.tokenizer._decode_asr(t,{time_precision:c,return_timestamps:n,force_full_sequences:i});p.push({text:s,...f})}return s?p[0]:p}async _call_moonshine(e,t){let n=!Array.isArray(e);n&&(e=[e]);let r=this.processor.feature_extractor.config.sampling_rate,i=await m(e,r),a=[];for(let e of i){let n=await this.processor(e),i=Math.floor(e.length/r)*6,o=await this.model.generate({max_new_tokens:i,...t,...n}),s=this.processor.batch_decode(o,{skip_special_tokens:!0})[0];a.push({text:s})}return n?a[0]:a}}class te extends g{constructor(e){super(e)}async _call(e,t={}){let n=Array.isArray(e),r=await p(e),{pixel_values:i}=await this.processor(r),a=[];for(let e of i){e.dims=[1,...e.dims];let n=await this.model.generate({inputs:e,...t}),r=this.tokenizer.batch_decode(n,{skip_special_tokens:!0}).map(e=>({generated_text:e.trim()}));a.push(r)}return n?a:a[0]}}class ne extends g{constructor(e){super(e)}async _call(e,{top_k:t=5}={}){let n=await p(e),{pixel_values:r}=await this.processor(n),i=await this.model({pixel_values:r}),a=this.model.config.id2label,o=[];for(let e of i.logits){let n=await(0,d.topk)(new d.Tensor(`float32`,(0,l.softmax)(e.data),e.dims),t),r=n[0].tolist(),i=n[1].tolist(),s=i.map((e,t)=>({label:a?a[e]:`LABEL_${e}`,score:r[t]}));o.push(s)}return Array.isArray(e)?o:o[0]}}class j extends g{constructor(e){super(e),this.subtasks_mapping={panoptic:`post_process_panoptic_segmentation`,instance:`post_process_instance_segmentation`,semantic:`post_process_semantic_segmentation`}}async _call(e,{threshold:t=.5,mask_threshold:n=.5,overlap_mask_area_threshold:r=.8,label_ids_to_fuse:i=null,target_sizes:a=null,subtask:o=null}={}){let s=Array.isArray(e);if(s&&e.length!==1)throw Error(`Image segmentation pipeline currently only supports a batch size of 1.`);let c=await p(e),l=c.map(e=>[e.height,e.width]),u=await this.processor(c),{inputNames:d,outputNames:m}=this.model.sessions.model;if(!d.includes(`pixel_values`)){if(d.length!==1)throw Error(`Expected a single input name, but got ${d.length} inputs: ${d}.`);let e=d[0];if(e in u)throw Error(`Input name ${e} already exists in the inputs.`);u[e]=u.pixel_values}let h=await this.model(u),g=null;if(o!==null)g=this.subtasks_mapping[o];else if(this.processor.image_processor){for(let[e,t]of Object.entries(this.subtasks_mapping))if(t in this.processor.image_processor){g=this.processor.image_processor[t].bind(this.processor.image_processor),o=e;break}}let _=this.model.config.id2label,v=[];if(o)if(o===`panoptic`||o===`instance`){let e=g(h,t,n,r,i,a??l)[0],o=e.segmentation;for(let t of e.segments_info){let e=new Uint8ClampedArray(o.data.length);for(let n=0;nt<-e||t>1+e)&&i.sigmoid_();let a=await f.RawImage.fromTensor(i.mul_(255).to(`uint8`)).resize(r[1],r[0]);v.push({label:null,score:null,mask:a})}}return v}}class re extends j{constructor(e){super(e)}async _call(e,t={}){let n=Array.isArray(e);if(n&&e.length!==1)throw Error(`Background removal pipeline currently only supports a batch size of 1.`);let r=await p(e),i=await super._call(e,t),a=r.map((e,t)=>{let n=e.clone();return n.putAlpha(i[t].mask),n});return a}}class ie extends g{constructor(e){super(e)}async _call(e,t,{hypothesis_template:n=`This is a photo of {}`}={}){let r=Array.isArray(e),i=await p(e),a=t.map(e=>n.replace(`{}`,e)),o=this.tokenizer(a,{padding:this.model.config.model_type===`siglip`?`max_length`:!0,truncation:!0}),{pixel_values:s}=await this.processor(i),c=await this.model({...o,pixel_values:s}),u=this.model.config.model_type===`siglip`?e=>e.sigmoid().data:e=>(0,l.softmax)(e.data),d=[];for(let e of c.logits_per_image){let n=u(e),r=[...n].map((e,n)=>({score:e,label:t[n]}));r.sort((e,t)=>t.score-e.score),d.push(r)}return r?d:d[0]}}class ae extends g{constructor(e){super(e)}async _call(e,{threshold:t=.9,percentage:n=!1}={}){let r=Array.isArray(e);if(r&&e.length!==1)throw Error(`Object detection pipeline currently only supports a batch size of 1.`);let i=await p(e),a=n?null:i.map(e=>[e.height,e.width]),{pixel_values:o,pixel_mask:s}=await this.processor(i),c=await this.model({pixel_values:o,pixel_mask:s}),l=this.processor.image_processor.post_process_object_detection(c,t,a),u=this.model.config.id2label,d=l.map(e=>e.boxes.map((t,r)=>({score:e.scores[r],label:u[e.classes[r]],box:h(t,!n)})));return r?d:d[0]}}class oe extends g{constructor(e){super(e)}async _call(e,t,{threshold:n=.1,top_k:r=null,percentage:i=!1}={}){let a=Array.isArray(e),o=await p(e),s=this.tokenizer(t,{padding:!0,truncation:!0}),c=await this.processor(o),l=[];for(let e=0;e({score:e.scores[n],label:e.labels[n],box:h(t,!i)}))}else{let e=this.processor.image_processor.post_process_object_detection(f,n,u,!0)[0];p=e.boxes.map((n,r)=>({score:e.scores[r],label:t[e.classes[r]],box:h(n,!i)}))}p.sort((e,t)=>t.score-e.score),r!==null&&(p=p.slice(0,r)),l.push(p)}return a?l:l[0]}}class se extends g{constructor(e){super(e)}async _call(e,t,n={}){let r=(await p(e))[0],{pixel_values:i}=await this.processor(r),a=`${t}`,o=this.tokenizer(a,{add_special_tokens:!1,padding:!0,truncation:!0}).input_ids,s=await this.model.generate({inputs:i,max_length:this.model.config.decoder.max_position_embeddings,decoder_input_ids:o,...n}),c=this.tokenizer.batch_decode(s)[0],l=c.match(/(.*?)<\/s_answer>/),u=null;return l&&l.length>=2&&(u=l[1].trim()),[{answer:u}]}}class M extends g{DEFAULT_VOCODER_ID=`Xenova/speecht5_hifigan`;constructor(e){super(e),this.vocoder=e.vocoder??null}async _call(e,{speaker_embeddings:t=null}={}){return this.processor?this._call_text_to_spectrogram(e,{speaker_embeddings:t}):this._call_text_to_waveform(e)}async _call_text_to_waveform(e){let t=this.tokenizer(e,{padding:!0,truncation:!0}),{waveform:n}=await this.model(t),r=this.model.config.sampling_rate;return new u.RawAudio(n.data,r)}async _call_text_to_spectrogram(e,{speaker_embeddings:t}){if(this.vocoder||(console.log(`No vocoder specified, using default HifiGan vocoder.`),this.vocoder=await i.AutoModel.from_pretrained(this.DEFAULT_VOCODER_ID,{dtype:`fp32`})),(typeof t==`string`||t instanceof URL)&&(t=new Float32Array(await(await fetch(t)).arrayBuffer())),t instanceof Float32Array)t=new d.Tensor(`float32`,t,[1,t.length]);else if(!(t instanceof d.Tensor))throw Error("Speaker embeddings must be a `Tensor`, `Float32Array`, `string`, or `URL`.");let{input_ids:n}=this.tokenizer(e,{padding:!0,truncation:!0}),{waveform:r}=await this.model.generate_speech(n,t,{vocoder:this.vocoder}),a=this.processor.feature_extractor.config.sampling_rate;return new u.RawAudio(r.data,a)}}class N extends g{constructor(e){super(e)}async _call(e){let t=await p(e),n=await this.processor(t),r=await this.model(n),i=[];for(let e of r.reconstruction){let t=e.squeeze().clamp_(0,1).mul_(255).round_().to(`uint8`);i.push(f.RawImage.fromTensor(t))}return i.length>1?i:i[0]}}class ce extends g{constructor(e){super(e)}async _call(e){let t=await p(e),n=await this.processor(t),{predicted_depth:r}=await this.model(n),i=[];for(let e=0;e1?i:i[0]}}let le=Object.freeze({"text-classification":{tokenizer:r.AutoTokenizer,pipeline:_,model:i.AutoModelForSequenceClassification,default:{model:`Xenova/distilbert-base-uncased-finetuned-sst-2-english`},type:`text`},"token-classification":{tokenizer:r.AutoTokenizer,pipeline:v,model:i.AutoModelForTokenClassification,default:{model:`Xenova/bert-base-multilingual-cased-ner-hrl`},type:`text`},"question-answering":{tokenizer:r.AutoTokenizer,pipeline:y,model:i.AutoModelForQuestionAnswering,default:{model:`Xenova/distilbert-base-cased-distilled-squad`},type:`text`},"fill-mask":{tokenizer:r.AutoTokenizer,pipeline:b,model:i.AutoModelForMaskedLM,default:{model:`Xenova/bert-base-uncased`},type:`text`},summarization:{tokenizer:r.AutoTokenizer,pipeline:S,model:i.AutoModelForSeq2SeqLM,default:{model:`Xenova/distilbart-cnn-6-6`},type:`text`},translation:{tokenizer:r.AutoTokenizer,pipeline:C,model:i.AutoModelForSeq2SeqLM,default:{model:`Xenova/t5-small`},type:`text`},"text2text-generation":{tokenizer:r.AutoTokenizer,pipeline:x,model:i.AutoModelForSeq2SeqLM,default:{model:`Xenova/flan-t5-small`},type:`text`},"text-generation":{tokenizer:r.AutoTokenizer,pipeline:T,model:i.AutoModelForCausalLM,default:{model:`Xenova/gpt2`},type:`text`},"zero-shot-classification":{tokenizer:r.AutoTokenizer,pipeline:E,model:i.AutoModelForSequenceClassification,default:{model:`Xenova/distilbert-base-uncased-mnli`},type:`text`},"audio-classification":{pipeline:k,model:i.AutoModelForAudioClassification,processor:a.AutoProcessor,default:{model:`Xenova/wav2vec2-base-superb-ks`},type:`audio`},"zero-shot-audio-classification":{tokenizer:r.AutoTokenizer,pipeline:A,model:i.AutoModel,processor:a.AutoProcessor,default:{model:`Xenova/clap-htsat-unfused`},type:`multimodal`},"automatic-speech-recognition":{tokenizer:r.AutoTokenizer,pipeline:ee,model:[i.AutoModelForSpeechSeq2Seq,i.AutoModelForCTC],processor:a.AutoProcessor,default:{model:`Xenova/whisper-tiny.en`},type:`multimodal`},"text-to-audio":{tokenizer:r.AutoTokenizer,pipeline:M,model:[i.AutoModelForTextToWaveform,i.AutoModelForTextToSpectrogram],processor:[a.AutoProcessor,null],default:{model:`Xenova/speecht5_tts`},type:`text`},"image-to-text":{tokenizer:r.AutoTokenizer,pipeline:te,model:i.AutoModelForVision2Seq,processor:a.AutoProcessor,default:{model:`Xenova/vit-gpt2-image-captioning`},type:`multimodal`},"image-classification":{pipeline:ne,model:i.AutoModelForImageClassification,processor:a.AutoProcessor,default:{model:`Xenova/vit-base-patch16-224`},type:`multimodal`},"image-segmentation":{pipeline:j,model:[i.AutoModelForImageSegmentation,i.AutoModelForSemanticSegmentation,i.AutoModelForUniversalSegmentation],processor:a.AutoProcessor,default:{model:`Xenova/detr-resnet-50-panoptic`},type:`multimodal`},"background-removal":{pipeline:re,model:[i.AutoModelForImageSegmentation,i.AutoModelForSemanticSegmentation,i.AutoModelForUniversalSegmentation],processor:a.AutoProcessor,default:{model:`Xenova/modnet`},type:`image`},"zero-shot-image-classification":{tokenizer:r.AutoTokenizer,pipeline:ie,model:i.AutoModel,processor:a.AutoProcessor,default:{model:`Xenova/clip-vit-base-patch32`},type:`multimodal`},"object-detection":{pipeline:ae,model:i.AutoModelForObjectDetection,processor:a.AutoProcessor,default:{model:`Xenova/detr-resnet-50`},type:`multimodal`},"zero-shot-object-detection":{tokenizer:r.AutoTokenizer,pipeline:oe,model:i.AutoModelForZeroShotObjectDetection,processor:a.AutoProcessor,default:{model:`Xenova/owlvit-base-patch32`},type:`multimodal`},"document-question-answering":{tokenizer:r.AutoTokenizer,pipeline:se,model:i.AutoModelForDocumentQuestionAnswering,processor:a.AutoProcessor,default:{model:`Xenova/donut-base-finetuned-docvqa`},type:`multimodal`},"image-to-image":{pipeline:N,model:i.AutoModelForImageToImage,processor:a.AutoProcessor,default:{model:`Xenova/swin2SR-classical-sr-x2-64`},type:`image`},"depth-estimation":{pipeline:ce,model:i.AutoModelForDepthEstimation,processor:a.AutoProcessor,default:{model:`Xenova/dpt-large`},type:`image`},"feature-extraction":{tokenizer:r.AutoTokenizer,pipeline:D,model:i.AutoModel,default:{model:`Xenova/all-MiniLM-L6-v2`},type:`text`},"image-feature-extraction":{processor:a.AutoProcessor,pipeline:O,model:[i.AutoModelForImageFeatureExtraction,i.AutoModel],default:{model:`Xenova/vit-base-patch16-224-in21k`},type:`image`}}),ue=Object.freeze({"sentiment-analysis":`text-classification`,ner:`token-classification`,asr:`automatic-speech-recognition`,"text-to-speech":`text-to-audio`,embeddings:`feature-extraction`});async function de(e,t=null,{progress_callback:n=null,config:r=null,cache_dir:i=null,local_files_only:a=!1,revision:o=`main`,device:s=null,dtype:l=null,subfolder:u=`onnx`,use_external_data_format:d=null,model_file_name:f=null,session_options:p={}}={}){e=ue[e]??e;let m=le[e.split(`_`,1)[0]];if(!m)throw Error(`Unsupported pipeline: ${e}. Must be one of [${Object.keys(le)}]`);t||(t=m.default.model,console.log(`No model specified. Using default model: "${t}".`));let h={progress_callback:n,config:r,cache_dir:i,local_files_only:a,revision:o,device:s,dtype:l,subfolder:u,use_external_data_format:d,model_file_name:f,session_options:p},g=new Map([[`tokenizer`,m.tokenizer],[`model`,m.model],[`processor`,m.processor]]),_=await fe(g,t,h);_.task=e,(0,c.dispatchCallback)(n,{status:`ready`,task:e,model:t});let v=m.pipeline;return new v(_)}async function fe(e,t,n){let r=Object.create(null),i=[];for(let[a,o]of e.entries()){if(!o)continue;let e;e=Array.isArray(o)?new Promise(async(e,r)=>{let i;for(let a of o){if(a===null){e(null);return}try{e(await a.from_pretrained(t,n));return}catch(e){if(e.message?.includes(`Unsupported model type`))i=e;else if(e.message?.includes(`Could not locate file`))i=e;else{r(e);return}}}r(i)}):o.from_pretrained(t,n),r[a]=e,i.push(e)}await Promise.all(i);for(let[e,t]of Object.entries(r))r[e]=await t;return r}},"./src/tokenizers.js":(e,t,n)=>{n.r(t),n.d(t,{AlbertTokenizer:()=>Be,AutoTokenizer:()=>Mt,BartTokenizer:()=>$e,BertTokenizer:()=>ze,BlenderbotSmallTokenizer:()=>Tt,BlenderbotTokenizer:()=>wt,BloomTokenizer:()=>rt,CLIPTokenizer:()=>bt,CamembertTokenizer:()=>Je,CodeGenTokenizer:()=>yt,CodeLlamaTokenizer:()=>ot,CohereTokenizer:()=>kt,ConvBertTokenizer:()=>Ge,DebertaTokenizer:()=>He,DebertaV2Tokenizer:()=>Ue,DistilBertTokenizer:()=>qe,ElectraTokenizer:()=>Xe,Ernie4_5_Tokenizer:()=>jt,EsmTokenizer:()=>dt,FalconTokenizer:()=>lt,GPT2Tokenizer:()=>Qe,GPTNeoXTokenizer:()=>ut,GemmaTokenizer:()=>pt,Grok1Tokenizer:()=>mt,HerbertTokenizer:()=>We,LlamaTokenizer:()=>at,M2M100Tokenizer:()=>_t,MBart50Tokenizer:()=>tt,MBartTokenizer:()=>et,MPNetTokenizer:()=>ct,MarianTokenizer:()=>St,MgpstrTokenizer:()=>At,MobileBertTokenizer:()=>H,NllbTokenizer:()=>gt,NougatTokenizer:()=>Dt,PreTrainedTokenizer:()=>V,Qwen2Tokenizer:()=>ft,RoFormerTokenizer:()=>Ke,RobertaTokenizer:()=>nt,SiglipTokenizer:()=>xt,SpeechT5Tokenizer:()=>Et,SqueezeBertTokenizer:()=>Ve,T5Tokenizer:()=>Ze,TokenizerModel:()=>D,VitsTokenizer:()=>Ot,Wav2Vec2CTCTokenizer:()=>Ct,WhisperTokenizer:()=>vt,XLMRobertaTokenizer:()=>st,XLMTokenizer:()=>Ye,is_chinese_char:()=>y});var r=n( /*! ./utils/generic.js */ `./src/utils/generic.js`),i=n( /*! ./utils/core.js */ @@ -3506,8 +3506,8 @@ let af={url:self.location.href};var sf={"onnxruntime-common":e=>{e.exports=ne}," /*! @huggingface/jinja */ `./node_modules/@huggingface/jinja/dist/index.js`),u=n( /*! ./models/whisper/common_whisper.js */ -`./src/models/whisper/common_whisper.js`);async function d(e,t){let n=await Promise.all([(0,a.getModelJSON)(e,`tokenizer.json`,!0,t),(0,a.getModelJSON)(e,`tokenizer_config.json`,!0,t)]);return t.legacy!==null&&(n[1].legacy=t.legacy),n}function f(e,t){let n=[],r=0;for(let i of e.matchAll(t)){let t=i[0];r0&&n.push(t),r=i.index+t.length}return r=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=63744&&e<=64255||e>=194560&&e<=195103}function b(e,t,n){let r=[],i=0;for(;ithis.tokens_to_ids.get(e)??this.unk_token_id)}convert_ids_to_tokens(e){return e.map(e=>this.vocab[e]??this.unk_token)}}class O extends D{constructor(e){super(e),this.tokens_to_ids=m(e.vocab),this.unk_token_id=this.tokens_to_ids.get(e.unk_token),this.unk_token=e.unk_token,this.max_input_chars_per_word=e.max_input_chars_per_word??100,this.vocab=Array(this.tokens_to_ids.size);for(let[e,t]of this.tokens_to_ids)this.vocab[t]=e}encode(e){let t=[];for(let n of e){let e=[...n];if(e.length>this.max_input_chars_per_word){t.push(this.unk_token);continue}let r=!1,i=0,a=[];for(;i0&&(r=this.config.continuing_subword_prefix+r),this.tokens_to_ids.has(r)){n=r;break}--t}if(n===null){r=!0;break}a.push(n),i=t}r?t.push(this.unk_token):t.push(...a)}return t}}class k extends D{constructor(e,t){super(e);let n=e.vocab.length;this.vocab=Array(n),this.scores=Array(n);for(let t=0;t[e,t])),this.bos_token=` `,this.bos_token_id=this.tokens_to_ids.get(this.bos_token),this.eos_token=t.eos_token,this.eos_token_id=this.tokens_to_ids.get(this.eos_token),this.unk_token=this.vocab[this.unk_token_id],this.minScore=(0,o.min)(this.scores)[0],this.unk_score=this.minScore-10,this.scores[this.unk_token_id]=this.unk_score,this.trie=new c.CharTrie,this.trie.extend(this.vocab),this.fuse_unk=!0}populateNodes(e){let t=e.chars,n=1,r=0;for(;r{let e=[...Array.from({length:94},(e,t)=>t+33),...Array.from({length:12},(e,t)=>t+161),...Array.from({length:82},(e,t)=>t+174)],t=e.slice(),n=0;for(let r=0;r<256;++r)e.includes(r)||(e.push(r),t.push(256+n),n+=1);let r=t.map(e=>String.fromCharCode(e));return Object.fromEntries(e.map((e,t)=>[e,r[t]]))})(),ee=(0,i.reverseDictionary)(A);class te extends D{constructor(e){super(e),this.tokens_to_ids=m(e.vocab),this.unk_token_id=this.tokens_to_ids.get(e.unk_token),this.unk_token=e.unk_token,this.vocab=Array(this.tokens_to_ids.size);for(let[e,t]of this.tokens_to_ids)this.vocab[t]=e;let t=Array.isArray(e.merges[0]);this.merges=t?e.merges:e.merges.map(e=>e.split(` `,2)),this.bpe_ranks=new Map(this.merges.map((e,t)=>[JSON.stringify(e),t])),this.end_of_word_suffix=e.end_of_word_suffix,this.continuing_subword_suffix=e.continuing_subword_suffix??null,this.byte_fallback=this.config.byte_fallback??!1,this.byte_fallback&&(this.text_encoder=new TextEncoder),this.ignore_merges=this.config.ignore_merges??!1,this.max_length_to_cache=256,this.cache_capacity=1e4,this.cache=new c.LRUCache(this.cache_capacity)}clear_cache(){this.cache.clear()}bpe(e){if(e.length===0)return[];let t=this.cache.get(e);if(t!==void 0)return t;let n=Array.from(e);this.end_of_word_suffix&&(n[n.length-1]+=this.end_of_word_suffix);let r=[];if(n.length>1){let e=new c.PriorityQueue((e,t)=>e.score`<0x${e.toString(16).toUpperCase().padStart(2,`0`)}>`);e.every(e=>this.tokens_to_ids.has(e))?t.push(...e):t.push(this.unk_token)}else t.push(this.unk_token)}return t}}class ne extends D{constructor(e,t){super(e),this.tokens_to_ids=m(t.target_lang?e.vocab[t.target_lang]:e.vocab),this.bos_token=t.bos_token,this.bos_token_id=this.tokens_to_ids.get(this.bos_token),this.eos_token=t.eos_token,this.eos_token_id=this.tokens_to_ids.get(this.eos_token),this.pad_token=t.pad_token,this.pad_token_id=this.tokens_to_ids.get(this.pad_token),this.unk_token=t.unk_token,this.unk_token_id=this.tokens_to_ids.get(this.unk_token),this.vocab=Array(this.tokens_to_ids.size);for(let[e,t]of this.tokens_to_ids)this.vocab[t]=e}encode(e){return e}}class j extends r.Callable{constructor(e){super(),this.config=e}static fromConfig(e){if(e===null)return null;switch(e.type){case`BertNormalizer`:return new P(e);case`Precompiled`:return new R(e);case`Sequence`:return new de(e);case`Replace`:return new re(e);case`NFC`:return new ae(e);case`NFD`:return new oe(e);case`NFKC`:return new se(e);case`NFKD`:return new M(e);case`Strip`:return new N(e);case`StripAccents`:return new ce(e);case`Lowercase`:return new le(e);case`Prepend`:return new ue(e);default:throw Error(`Unknown Normalizer type: ${e.type}`)}}normalize(e){throw Error(`normalize should be implemented in subclass.`)}_call(e){return this.normalize(e)}}class re extends j{normalize(e){let t=p(this.config.pattern);return t===null?e:e.replaceAll(t,this.config.content)}}class ie extends j{form=void 0;normalize(e){return e=e.normalize(this.form),e}}class ae extends ie{form=`NFC`}class oe extends ie{form=`NFD`}class se extends ie{form=`NFKC`}class M extends ie{form=`NFKD`}class N extends j{normalize(e){return this.config.strip_left&&this.config.strip_right?e=e.trim():(this.config.strip_left&&(e=e.trimStart()),this.config.strip_right&&(e=e.trimEnd())),e}}class ce extends j{normalize(e){return e=_(e),e}}class le extends j{normalize(e){return e=e.toLowerCase(),e}}class ue extends j{normalize(e){return e=this.config.prepend+e,e}}class de extends j{constructor(e){super(e),this.normalizers=e.normalizers.map(e=>j.fromConfig(e))}normalize(e){return this.normalizers.reduce((e,t)=>t.normalize(e),e)}}class P extends j{_tokenize_chinese_chars(e){let t=[];for(let n=0;nthis.pre_tokenize_text(e,t)):this.pre_tokenize_text(e,t)).flat()}_call(e,t){return this.pre_tokenize(e,t)}}class fe extends F{constructor(e){super(),this.pattern=RegExp(`[^\\s${S}]+|[${S}]`,`gu`)}pre_tokenize_text(e,t){return e.trim().match(this.pattern)||[]}}class I extends F{constructor(e){super(),this.config=e,this.add_prefix_space=this.config.add_prefix_space,this.trim_offsets=this.config.trim_offsets,this.use_regex=this.config.use_regex??!0,this.pattern=/'s|'t|'re|'ve|'m|'ll|'d| ?\p{L}+| ?\p{N}+| ?[^\s\p{L}\p{N}]+|\s+(?!\S)|\s+/gu,this.byte_encoder=A,this.text_encoder=new TextEncoder}pre_tokenize_text(e,t){this.add_prefix_space&&!e.startsWith(` `)&&(e=` `+e);let n=this.use_regex?e.match(this.pattern)||[]:[e];return n.map(e=>Array.from(this.text_encoder.encode(e),e=>this.byte_encoder[e]).join(``))}}class pe extends F{constructor(e){super(),this.config=e,this.pattern=p(this.config.pattern,this.config.invert)}pre_tokenize_text(e,t){return this.pattern===null?[]:this.config.invert?e.match(this.pattern)||[]:this.config.behavior?.toLowerCase()===`removed`?e.split(this.pattern).filter(e=>e):f(e,this.pattern)}}class me extends F{constructor(e){super(),this.config=e,this.pattern=RegExp(`[^${S}]+|[${S}]+`,`gu`)}pre_tokenize_text(e,t){return e.match(this.pattern)||[]}}class he extends F{constructor(e){super(),this.config=e;let t=`[^\\d]+|\\d${this.config.individual_digits?``:`+`}`;this.pattern=new RegExp(t,`gu`)}pre_tokenize_text(e,t){return e.match(this.pattern)||[]}}class ge extends r.Callable{constructor(e){super(),this.config=e}static fromConfig(e){if(e===null)return null;switch(e.type){case`TemplateProcessing`:return new L(e);case`ByteLevel`:return new ye(e);case`RobertaProcessing`:return new ve(e);case`BertProcessing`:return new _e(e);case`Sequence`:return new be(e);default:throw Error(`Unknown PostProcessor type: ${e.type}`)}}post_process(e,...t){throw Error(`post_process should be implemented in subclass.`)}_call(e,...t){return this.post_process(e,...t)}}class _e extends ge{constructor(e){super(e),this.cls=e.cls[0],this.sep=e.sep[0]}post_process(e,t=null,{add_special_tokens:n=!0}={}){n&&(e=(0,i.mergeArrays)([this.cls],e,[this.sep]));let r=Array(e.length).fill(0);if(t!==null){let a=n&&this instanceof ve?[this.sep]:[],o=n?[this.sep]:[];e=(0,i.mergeArrays)(e,a,t,o),r=(0,i.mergeArrays)(r,Array(t.length+a.length+o.length).fill(1))}return{tokens:e,token_type_ids:r}}}class ve extends _e{}class L extends ge{constructor(e){super(e),this.single=e.single,this.pair=e.pair}post_process(e,t=null,{add_special_tokens:n=!0}={}){let r=t===null?this.single:this.pair,a=[],o=[];for(let s of r)`SpecialToken`in s?n&&(a.push(s.SpecialToken.id),o.push(s.SpecialToken.type_id)):`Sequence`in s&&(s.Sequence.id===`A`?(a=(0,i.mergeArrays)(a,e),o=(0,i.mergeArrays)(o,Array(e.length).fill(s.Sequence.type_id))):s.Sequence.id===`B`&&(a=(0,i.mergeArrays)(a,t),o=(0,i.mergeArrays)(o,Array(t.length).fill(s.Sequence.type_id))));return{tokens:a,token_type_ids:o}}}class ye extends ge{post_process(e,t=null){return t&&(e=(0,i.mergeArrays)(e,t)),{tokens:e}}}class be extends ge{constructor(e){super(e),this.processors=e.processors.map(e=>ge.fromConfig(e))}post_process(e,t=null,n={}){let r;for(let i of this.processors)if(i instanceof ye){let n=i.post_process(e);if(e=n.tokens,t){let e=i.post_process(t);t=e.tokens}}else{let a=i.post_process(e,t,n);e=a.tokens,r=a.token_type_ids}return{tokens:e,token_type_ids:r}}}class xe extends r.Callable{constructor(e){super(),this.config=e,this.added_tokens=[],this.end_of_word_suffix=null,this.trim_offsets=e.trim_offsets}static fromConfig(e){if(e===null)return null;switch(e.type){case`WordPiece`:return new Ee(e);case`Metaspace`:return new Ne(e);case`ByteLevel`:return new De(e);case`Replace`:return new Se(e);case`ByteFallback`:return new Ce(e);case`Fuse`:return new we(e);case`Strip`:return new Te(e);case`Sequence`:return new ke(e);case`CTC`:return new Oe(e);case`BPEDecoder`:return new Ae(e);default:throw Error(`Unknown Decoder type: ${e.type}`)}}_call(e){return this.decode(e)}decode(e){return this.decode_chain(e).join(``)}decode_chain(e){throw Error("`decode_chain` should be implemented in subclass.")}}class Se extends xe{decode_chain(e){let t=p(this.config.pattern);return t===null?e:e.map(e=>e.replaceAll(t,this.config.content))}}class Ce extends xe{constructor(e){super(e),this.text_decoder=new TextDecoder}decode_chain(e){let t=[],n=[];for(let r of e){let e=null;if(r.length===6&&r.startsWith(`<0x`)&&r.endsWith(`>`)){let t=parseInt(r.slice(3,5),16);isNaN(t)||(e=t)}if(e!==null)n.push(e);else{if(n.length>0){let e=this.text_decoder.decode(Uint8Array.from(n));t.push(e),n=[]}t.push(r)}}if(n.length>0){let e=this.text_decoder.decode(Uint8Array.from(n));t.push(e),n=[]}return t}}class we extends xe{decode_chain(e){return[e.join(``)]}}class Te extends xe{constructor(e){super(e),this.content=this.config.content,this.start=this.config.start,this.stop=this.config.stop}decode_chain(e){return e.map(e=>{let t=0;for(let n=0;n(t!==0&&(e=e.startsWith(this.config.prefix)?e.replace(this.config.prefix,``):` `+e),this.cleanup&&(e=g(e)),e))}}class De extends xe{constructor(e){super(e),this.byte_decoder=ee,this.text_decoder=new TextDecoder(`utf-8`,{fatal:!1,ignoreBOM:!0}),this.end_of_word_suffix=null}convert_tokens_to_string(e){let t=e.join(``),n=new Uint8Array([...t].map(e=>this.byte_decoder[e])),r=this.text_decoder.decode(n);return r}decode_chain(e){let t=[],n=[];for(let r of e)this.added_tokens.find(e=>e.content===r)===void 0?n.push(r):(n.length>0&&(t.push(this.convert_tokens_to_string(n)),n=[]),t.push(r));return n.length>0&&t.push(this.convert_tokens_to_string(n)),t}}class Oe extends xe{constructor(e){super(e),this.pad_token=this.config.pad_token,this.word_delimiter_token=this.config.word_delimiter_token,this.cleanup=this.config.cleanup}convert_tokens_to_string(e){if(e.length===0)return``;let t=[e[0]];for(let n=1;ne!==this.pad_token),r=n.join(``);return this.cleanup&&(r=g(r).replaceAll(this.word_delimiter_token,` `).trim()),r}decode_chain(e){return[this.convert_tokens_to_string(e)]}}class ke extends xe{constructor(e){super(e),this.decoders=e.decoders.map(e=>xe.fromConfig(e))}decode_chain(e){return this.decoders.reduce((e,t)=>t.decode_chain(e),e)}}class Ae extends xe{constructor(e){super(e),this.suffix=this.config.suffix}decode_chain(e){return e.map((t,n)=>t.replaceAll(this.suffix,n===e.length-1?``:` `))}}class je extends xe{decode_chain(e){let t=``;for(let n=1;ne.normalize(`NFKC`)).join(`~`)}else e=e.normalize(`NFKC`);return e}}class Pe extends F{constructor(e){super(),this.tokenizers=e.pretokenizers.map(e=>F.fromConfig(e))}pre_tokenize_text(e,t){return this.tokenizers.reduce((e,n)=>n.pre_tokenize(e,t),[e])}}class Fe extends F{constructor(e){super()}pre_tokenize_text(e,t){return e.match(/\w+|[^\w\s]+/g)||[]}}class Ie extends F{constructor(e){super()}pre_tokenize_text(e,t){return x(e)}}class Le extends F{constructor(e){super(),this.config=e,this.pattern=p(this.config.pattern),this.content=this.config.content}pre_tokenize_text(e,t){return this.pattern===null?[e]:[e.replaceAll(this.pattern,this.config.content)]}}let Re=[`bos_token`,`eos_token`,`unk_token`,`sep_token`,`pad_token`,`cls_token`,`mask_token`];function ze(e,t,n,r){for(let a of Object.keys(e)){let o=t-e[a].length,s=n(a),c=Array(o).fill(s);e[a]=r===`right`?(0,i.mergeArrays)(e[a],c):(0,i.mergeArrays)(c,e[a])}}function Be(e,t){for(let n of Object.keys(e))e[n].length=t}class z extends r.Callable{return_token_type_ids=!1;padding_side=`right`;constructor(e,t){super(),this.config=t,this.normalizer=j.fromConfig(e.normalizer),this.pre_tokenizer=F.fromConfig(e.pre_tokenizer),this.model=D.fromConfig(e.model,t),this.post_processor=ge.fromConfig(e.post_processor),this.decoder=xe.fromConfig(e.decoder),this.special_tokens=[],this.all_special_ids=[],this.added_tokens=[];for(let t of e.added_tokens){let e=new E(t);this.added_tokens.push(e),this.model.tokens_to_ids.set(e.content,e.id),this.model.vocab[e.id]=e.content,e.special&&(this.special_tokens.push(e.content),this.all_special_ids.push(e.id))}if(this.additional_special_tokens=t.additional_special_tokens??[],this.special_tokens.push(...this.additional_special_tokens),this.special_tokens=[...new Set(this.special_tokens)],this.decoder&&(this.decoder.added_tokens=this.added_tokens,this.decoder.end_of_word_suffix=this.model.end_of_word_suffix),this.added_tokens_splitter=new c.DictionarySplitter(this.added_tokens.map(e=>e.content)),this.added_tokens_map=new Map(this.added_tokens.map(e=>[e.content,e])),this.mask_token=this.getToken(`mask_token`),this.mask_token_id=this.model.tokens_to_ids.get(this.mask_token),this.pad_token=this.getToken(`pad_token`,`eos_token`),this.pad_token_id=this.model.tokens_to_ids.get(this.pad_token),this.sep_token=this.getToken(`sep_token`),this.sep_token_id=this.model.tokens_to_ids.get(this.sep_token),this.unk_token=this.getToken(`unk_token`),this.unk_token_id=this.model.tokens_to_ids.get(this.unk_token),this.bos_token=this.getToken(`bos_token`),this.bos_token_id=this.model.tokens_to_ids.get(this.bos_token),this.eos_token=this.getToken(`eos_token`),this.eos_token_id=this.model.tokens_to_ids.get(this.eos_token),this.model_max_length=t.model_max_length,this.remove_space=t.remove_space,this.clean_up_tokenization_spaces=t.clean_up_tokenization_spaces??!0,this.do_lowercase_and_remove_accent=t.do_lowercase_and_remove_accent??!1,t.padding_side&&(this.padding_side=t.padding_side),this.legacy=!1,this.chat_template=t.chat_template??null,Array.isArray(this.chat_template)){let e=Object.create(null);for(let{name:t,template:n}of this.chat_template){if(typeof t!=`string`||typeof n!=`string`)throw Error(`Chat template must be a list of objects with "name" and "template" properties`);e[t]=n}this.chat_template=e}this._compiled_template_cache=new Map}getToken(...e){for(let t of e){let e=this.config[t];if(!e)continue;if(typeof e==`object`){if(e.__type===`AddedToken`)return e.content;throw Error(`Unknown token: ${e}`)}else return e}return null}static async from_pretrained(e,{progress_callback:t=null,config:n=null,cache_dir:r=null,local_files_only:i=!1,revision:a=`main`,legacy:o=null}={}){let s=await d(e,{progress_callback:t,config:n,cache_dir:r,local_files_only:i,revision:a,legacy:o});return new this(...s)}_call(e,{text_pair:t=null,add_special_tokens:n=!0,padding:r=!1,truncation:i=null,max_length:a=null,return_tensor:c=!0,return_token_type_ids:l=null}={}){let u=Array.isArray(e),d;if(u){if(e.length===0)throw Error(`text array must be non-empty`);if(t!==null){if(Array.isArray(t)){if(e.length!==t.length)throw Error(`text and text_pair must have the same length`)}else throw Error(`text_pair must also be an array`);d=e.map((e,r)=>this._encode_plus(e,{text_pair:t[r],add_special_tokens:n,return_token_type_ids:l}))}else d=e.map(e=>this._encode_plus(e,{add_special_tokens:n,return_token_type_ids:l}))}else{if(e==null)throw Error(`text may not be null or undefined`);if(Array.isArray(t))throw Error("When specifying `text_pair`, since `text` is a string, `text_pair` must also be a string (i.e., not an array).");d=[this._encode_plus(e,{text_pair:t,add_special_tokens:n,return_token_type_ids:l})]}if(a===null?a=this.model_max_length:i===null&&(r===!0?(console.warn("`max_length` is ignored when `padding: true` and there is no truncation strategy. To pad to max length, use `padding: 'max_length'`."),a=this.model_max_length):r===!1&&(console.warn("Truncation was not explicitly activated but `max_length` is provided a specific value, please use `truncation: true` to explicitly truncate examples to max length."),i=!0)),r===!0&&(a=Math.min((0,o.max)(d.map(e=>e.input_ids.length))[0],a??1/0)),a=Math.min(a,this.model_max_length??1/0),r||i)for(let e=0;ea?i&&Be(d[e],a):r&&ze(d[e],a,e=>e===`input_ids`?this.pad_token_id:0,this.padding_side);let f={};if(c){if(!(r&&i)&&d.some(e=>{for(let t of Object.keys(e))if(e[t].length!==d[0][t]?.length)return!0;return!1}))throw Error(`Unable to create tensor, you should probably activate truncation and/or padding with 'padding=true' and 'truncation=true' to have batched tensors with the same length.`);let e=[d.length,d[0].input_ids.length];for(let t of Object.keys(d[0]))f[t]=new s.Tensor(`int64`,BigInt64Array.from(d.flatMap(e=>e[t]).map(BigInt)),e)}else{for(let e of Object.keys(d[0]))f[e]=d.map(t=>t[e]);if(!u)for(let e of Object.keys(f))f[e]=f[e][0]}return f}_encode_text(e){if(e===null)return null;let t=this.added_tokens_splitter.split(e);for(let e=0;e0&&(t[e-1]=t[e-1].trimEnd()),n.rstrip&&e{if(e.length===0)return[];if(this.added_tokens_map.has(e))return[e];if(this.remove_space===!0&&(e=e.trim().split(/\s+/).join(` `)),this.do_lowercase_and_remove_accent&&(e=v(e)),this.normalizer!==null&&(e=this.normalizer(e)),e.length===0)return[];let n=this.pre_tokenizer===null?[e]:this.pre_tokenizer(e,{section_index:t}),r=this.model(n);return r});return n}_encode_plus(e,{text_pair:t=null,add_special_tokens:n=!0,return_token_type_ids:r=null}={}){let{tokens:i,token_type_ids:a}=this._tokenize_helper(e,{pair:t,add_special_tokens:n}),o=this.model.convert_tokens_to_ids(i),s={input_ids:o,attention_mask:Array(o.length).fill(1)};return(r??this.return_token_type_ids)&&a&&(s.token_type_ids=a),s}_tokenize_helper(e,{pair:t=null,add_special_tokens:n=!1}={}){let r=this._encode_text(e),a=this._encode_text(t);return this.post_processor?this.post_processor(r,a,{add_special_tokens:n}):{tokens:(0,i.mergeArrays)(r??[],a??[])}}tokenize(e,{pair:t=null,add_special_tokens:n=!1}={}){return this._tokenize_helper(e,{pair:t,add_special_tokens:n}).tokens}encode(e,{text_pair:t=null,add_special_tokens:n=!0,return_token_type_ids:r=null}={}){return this._encode_plus(e,{text_pair:t,add_special_tokens:n,return_token_type_ids:r}).input_ids}batch_decode(e,t={}){return e instanceof s.Tensor&&(e=e.tolist()),e.map(e=>this.decode(e,t))}decode(e,t={}){if(e instanceof s.Tensor&&(e=h(e)),!Array.isArray(e)||e.length===0||!(0,i.isIntegralNumber)(e[0]))throw Error(`token_ids must be a non-empty array of integers.`);return this.decode_single(e,t)}decode_single(e,{skip_special_tokens:t=!1,clean_up_tokenization_spaces:n=null}){let r=this.model.convert_ids_to_tokens(e);t&&(r=r.filter(e=>!this.special_tokens.includes(e)));let i=this.decoder?this.decoder(r):r.join(` `);return this.decoder&&this.decoder.end_of_word_suffix&&(i=i.replaceAll(this.decoder.end_of_word_suffix,` `),t&&(i=i.trim())),(n??this.clean_up_tokenization_spaces)&&(i=g(i)),i}get_chat_template({chat_template:e=null,tools:t=null}={}){if(this.chat_template&&typeof this.chat_template==`object`){let n=this.chat_template;if(e!==null&&Object.hasOwn(n,e))e=n[e];else if(e===null)if(t!==null&&`tool_use`in n)e=n.tool_use;else if(`default`in n)e=n.default;else throw Error(`This model has multiple chat templates with no default specified! Please either pass a chat template or the name of the template you wish to use to the 'chat_template' argument. Available template names are ${Object.keys(n).sort()}.`)}else if(e===null)if(this.chat_template)e=this.chat_template;else throw Error(`Cannot use apply_chat_template() because tokenizer.chat_template is not set and no template argument was passed! For information about writing templates and setting the tokenizer.chat_template attribute, please see the documentation at https://huggingface.co/docs/transformers/main/en/chat_templating`);return e}apply_chat_template(e,{tools:t=null,documents:n=null,chat_template:r=null,add_generation_prompt:i=!1,tokenize:a=!0,padding:o=!1,truncation:s=!1,max_length:c=null,return_tensor:u=!0,return_dict:d=!1,tokenizer_kwargs:f={},...p}={}){if(r=this.get_chat_template({chat_template:r,tools:t}),typeof r!=`string`)throw Error(`chat_template must be a string, but got ${typeof r}`);let m=this._compiled_template_cache.get(r);m===void 0&&(m=new l.Template(r),this._compiled_template_cache.set(r,m));let h=Object.create(null);for(let e of Re){let t=this.getToken(e);t&&(h[e]=t)}let g=m.render({messages:e,add_generation_prompt:i,tools:t,documents:n,...h,...p});if(a){let e=this._call(g,{add_special_tokens:!1,padding:o,truncation:s,max_length:c,return_tensor:u,...f});return d?e:e.input_ids}return g}}class Ve extends z{return_token_type_ids=!0}class He extends z{return_token_type_ids=!0}class B extends z{return_token_type_ids=!0}class Ue extends z{return_token_type_ids=!0}class We extends z{return_token_type_ids=!0}class Ge extends z{return_token_type_ids=!0}class Ke extends z{return_token_type_ids=!0}class qe extends z{return_token_type_ids=!0}class Je extends z{return_token_type_ids=!0}class Ye extends z{}class Xe extends z{}class Ze extends z{return_token_type_ids=!0;constructor(e,t){super(e,t),console.warn('WARNING: `XLMTokenizer` is not yet supported by Hugging Face\'s "fast" tokenizers library. Therefore, you may experience slightly inaccurate results.')}}class Qe extends z{return_token_type_ids=!0}class $e extends z{}class et extends z{}class tt extends z{}class nt extends z{constructor(e,t){super(e,t),this.languageRegex=/^[a-z]{2}_[A-Z]{2}$/,this.language_codes=this.special_tokens.filter(e=>this.languageRegex.test(e)),this.lang_to_token=e=>e}_build_translation_inputs(e,t,n){return _t(this,e,t,n)}}class rt extends nt{}class it extends z{}class at extends z{}let ot=`▁`;class st extends z{padding_side=`left`;constructor(e,t){super(e,t),this.legacy=t.legacy??!0,this.legacy||(this.normalizer=null,this.pre_tokenizer=new Me({replacement:ot,add_prefix_space:!0,prepend_scheme:`first`}))}_encode_text(e){if(e===null)return null;if(this.legacy||e.length===0)return super._encode_text(e);let t=super._encode_text(ot+e.replaceAll(ot,` `));return t.length>1&&t[0]===ot&&this.special_tokens.includes(t[1])&&(t=t.slice(1)),t}}class ct extends z{}class lt extends z{}class ut extends z{}class dt extends z{}class ft extends z{}class pt extends z{}class mt extends z{}class ht extends z{}class gt extends z{}function _t(e,t,n,r){if(!(`language_codes`in e)||!Array.isArray(e.language_codes))throw Error("Tokenizer must have `language_codes` attribute set and it should be an array of language ids.");if(!(`languageRegex`in e)||!(e.languageRegex instanceof RegExp))throw Error("Tokenizer must have `languageRegex` attribute set and it should be a regular expression.");if(!(`lang_to_token`in e)||typeof e.lang_to_token!=`function`)throw Error("Tokenizer must have `lang_to_token` attribute set and it should be a function.");let i=r.src_lang,a=r.tgt_lang;if(!e.language_codes.includes(a))throw Error(`Target language code "${a}" is not valid. Must be one of: {${e.language_codes.join(`, `)}}`);if(i!==void 0){if(!e.language_codes.includes(i))throw Error(`Source language code "${i}" is not valid. Must be one of: {${e.language_codes.join(`, `)}}`);for(let t of e.post_processor.config.single)if(`SpecialToken`in t&&e.languageRegex.test(t.SpecialToken.id)){t.SpecialToken.id=e.lang_to_token(i);break}}return r.forced_bos_token_id=e.model.convert_tokens_to_ids([e.lang_to_token(a)])[0],e._call(t,n)}class vt extends z{constructor(e,t){super(e,t),this.languageRegex=/^[a-z]{3}_[A-Z][a-z]{3}$/,this.language_codes=this.special_tokens.filter(e=>this.languageRegex.test(e)),this.lang_to_token=e=>e}_build_translation_inputs(e,t,n){return _t(this,e,t,n)}}class yt extends z{constructor(e,t){super(e,t),this.languageRegex=/^__[a-z]{2,3}__$/,this.language_codes=this.special_tokens.filter(e=>this.languageRegex.test(e)).map(e=>e.slice(2,-2)),this.lang_to_token=e=>`__${e}__`}_build_translation_inputs(e,t,n){return _t(this,e,t,n)}}class bt extends z{get timestamp_begin(){return this.model.convert_tokens_to_ids([`<|notimestamps|>`])[0]+1}_decode_asr(e,{return_timestamps:t=!1,return_language:n=!1,time_precision:r=null,force_full_sequences:i=!0}={}){if(r===null)throw Error(`Must specify time_precision`);let a=null,s=t===`word`;function c(){return{language:a,timestamp:[null,null],text:``}}let l=[],d=c(),f=0,p=this.timestamp_begin,m=1500,h=p+m,g=[],_=[],v=!1,y=null,b=new Set(this.all_special_ids);for(let n of e){let e=n.tokens,i=s?n.token_timestamps:null,m=null,x=p;if(`stride`in n){let[t,i,a]=n.stride;if(f-=i,y=t-a,i&&(x=i/r+p),a)for(let t=e.length-1;t>=0;--t){let n=Number(e[t]);if(n>=p){if(m!==null&&(n-p)*r=p&&y<=h){let e=(y-p)*r+f,t=(0,o.round)(e,2);if(m!==null&&y>=m)v=!0;else if(v||g.length>0&&y0?(g.push(S),s&&_.push(w)):g.every(e=>e.length===0)&&(d=c(),g=[],S=[],_=[],w=[])}if(g.length>0){if(i&&t)throw Error(`Whisper did not predict an ending timestamp, which can happen if audio is cut off in the middle of a word. Also make sure WhisperTimeStampLogitsProcessor was used during generation.`);let[e,n]=this.findLongestCommonSequence(g,_),r=this.decode(e);d.text=r,s&&(d.words=this.collateWordTimestamps(e,n,a)),l.push(d)}let x=Object.create(null),S=l.map(e=>e.text).join(``);if(t||n){for(let e=0;e0,o=a?[]:null,s=a?t[0]:null;for(let c=1;ce===g[n]&&s[i+n]<=t[c][m+n]).length:p.filter((e,t)=>e===g[t]).length;let v=e/1e4,y=_/e+v;_>1&&y>u&&(u=y,d=[i,o,m,h])}let[p,m,h,g]=d,_=Math.floor((m+p)/2),v=Math.floor((g+h)/2);i.push(...n.slice(0,_)),n=l.slice(v),r=n.length,a&&(o.push(...s.slice(0,_)),s=t[c].slice(v))}return i.push(...n),a?(o.push(...s),[i,o]):[i,[]]}collateWordTimestamps(e,t,n){let[r,i,a]=this.combineTokensIntoWords(e,n),o=[];for(let e=0;e=r){let e=((t-r)*n).toFixed(2);i.push(`<|${e}|>`),i.push([])}else i[i.length-1].push(t);return i=i.map(e=>typeof e==`string`?e:super.decode(e,t)),i.join(``)}splitTokensOnUnicode(e){let t=this.decode(e,{decode_with_timestamps:!0}),n=`�`,r=[],i=[],a=[],o=[],s=[],c=0;for(let l=0;l=this.model.tokens_to_ids.get(`<|endoftext|>`),f=c.startsWith(` `),p=c.trim(),m=s.test(p);if(d||f||m||i.length===0)i.push(c),a.push(l),o.push(u);else{let e=i.length-1;i[e]+=c,a[e].push(...l),o[e].push(...u)}}return[i,a,o]}mergePunctuations(e,t,n,r,a){let o=structuredClone(e),s=structuredClone(t),c=structuredClone(n),l=o.length-2,u=o.length-1;for(;l>=0;)o[l].startsWith(` `)&&r.includes(o[l].trim())?(o[u]=o[l]+o[u],s[u]=(0,i.mergeArrays)(s[l],s[u]),c[u]=(0,i.mergeArrays)(c[l],c[u]),o[l]=``,s[l]=[],c[l]=[]):u=l,--l;for(l=0,u=1;ue),s.filter(e=>e.length>0),c.filter(e=>e.length>0)]}}class xt extends z{}class St extends z{}class Ct extends z{}class wt extends z{constructor(e,t){super(e,t),this.languageRegex=/^(>>\w+<<)\s*/g,this.supported_language_codes=this.model.vocab.filter(e=>this.languageRegex.test(e)),console.warn('WARNING: `MarianTokenizer` is not yet supported by Hugging Face\'s "fast" tokenizers library. Therefore, you may experience slightly inaccurate results.')}_encode_text(e){if(e===null)return null;let[t,...n]=e.trim().split(this.languageRegex);if(n.length===0)return super._encode_text(t);if(n.length===2){let[e,t]=n;return this.supported_language_codes.includes(e)||console.warn(`Unsupported language code "${e}" detected, which may lead to unexpected behavior. Should be one of: ${JSON.stringify(this.supported_language_codes)}`),(0,i.mergeArrays)([e],super._encode_text(t))}}}class Tt extends z{}class Et extends z{}class Dt extends z{}class Ot extends z{}class kt extends z{}class At extends z{constructor(e,t){super(e,t),this.decoder=new je({})}}class jt extends z{}class Mt extends z{}class Nt{static TOKENIZER_CLASS_MAPPING={T5Tokenizer:$e,DistilBertTokenizer:Ye,CamembertTokenizer:Xe,DebertaTokenizer:We,DebertaV2Tokenizer:Ge,BertTokenizer:Ve,HerbertTokenizer:Ke,ConvBertTokenizer:qe,RoFormerTokenizer:Je,XLMTokenizer:Ze,ElectraTokenizer:Qe,MobileBertTokenizer:B,SqueezeBertTokenizer:Ue,AlbertTokenizer:He,GPT2Tokenizer:et,BartTokenizer:tt,MBartTokenizer:nt,MBart50Tokenizer:rt,RobertaTokenizer:it,WhisperTokenizer:bt,CodeGenTokenizer:xt,CLIPTokenizer:St,SiglipTokenizer:Ct,MarianTokenizer:wt,BloomTokenizer:at,NllbTokenizer:vt,M2M100Tokenizer:yt,LlamaTokenizer:st,CodeLlamaTokenizer:ct,XLMRobertaTokenizer:lt,MPNetTokenizer:ut,FalconTokenizer:dt,GPTNeoXTokenizer:ft,EsmTokenizer:pt,Wav2Vec2CTCTokenizer:Tt,BlenderbotTokenizer:Et,BlenderbotSmallTokenizer:Dt,SpeechT5Tokenizer:Ot,NougatTokenizer:kt,VitsTokenizer:At,Qwen2Tokenizer:mt,GemmaTokenizer:ht,Grok1Tokenizer:gt,CohereTokenizer:jt,MgpstrTokenizer:Mt,PreTrainedTokenizer:z};static async from_pretrained(e,{progress_callback:t=null,config:n=null,cache_dir:r=null,local_files_only:i=!1,revision:a=`main`,legacy:o=null}={}){let[s,c]=await d(e,{progress_callback:t,config:n,cache_dir:r,local_files_only:i,revision:a,legacy:o}),l=c.tokenizer_class?.replace(/Fast$/,``)??`PreTrainedTokenizer`,u=this.TOKENIZER_CLASS_MAPPING[l];return u||(console.warn(`Unknown tokenizer class "${l}", attempting to construct from base class.`),u=z),new u(s,c)}}},"./src/utils/audio.js":(e,t,n)=>{n.r(t),n.d(t,{RawAudio:()=>O,hamming:()=>f,hanning:()=>d,mel_filter_bank:()=>y,read_audio:()=>l,spectrogram:()=>w,window_function:()=>T});var r=n( +`./src/models/whisper/common_whisper.js`);async function d(e,t){let n=await Promise.all([(0,a.getModelJSON)(e,`tokenizer.json`,!0,t),(0,a.getModelJSON)(e,`tokenizer_config.json`,!0,t)]);return t.legacy!==null&&(n[1].legacy=t.legacy),n}function f(e,t){let n=[],r=0;for(let i of e.matchAll(t)){let t=i[0];r0&&n.push(t),r=i.index+t.length}return r=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=63744&&e<=64255||e>=194560&&e<=195103}function b(e,t,n){let r=[],i=0;for(;ithis.tokens_to_ids.get(e)??this.unk_token_id)}convert_ids_to_tokens(e){return e.map(e=>this.vocab[e]??this.unk_token)}}class O extends D{constructor(e){super(e),this.tokens_to_ids=m(e.vocab),this.unk_token_id=this.tokens_to_ids.get(e.unk_token),this.unk_token=e.unk_token,this.max_input_chars_per_word=e.max_input_chars_per_word??100,this.vocab=Array(this.tokens_to_ids.size);for(let[e,t]of this.tokens_to_ids)this.vocab[t]=e}encode(e){let t=[];for(let n of e){let e=[...n];if(e.length>this.max_input_chars_per_word){t.push(this.unk_token);continue}let r=!1,i=0,a=[];for(;i0&&(r=this.config.continuing_subword_prefix+r),this.tokens_to_ids.has(r)){n=r;break}--t}if(n===null){r=!0;break}a.push(n),i=t}r?t.push(this.unk_token):t.push(...a)}return t}}class k extends D{constructor(e,t){super(e);let n=e.vocab.length;this.vocab=Array(n),this.scores=Array(n);for(let t=0;t[e,t])),this.bos_token=` `,this.bos_token_id=this.tokens_to_ids.get(this.bos_token),this.eos_token=t.eos_token,this.eos_token_id=this.tokens_to_ids.get(this.eos_token),this.unk_token=this.vocab[this.unk_token_id],this.minScore=(0,o.min)(this.scores)[0],this.unk_score=this.minScore-10,this.scores[this.unk_token_id]=this.unk_score,this.trie=new c.CharTrie,this.trie.extend(this.vocab),this.fuse_unk=!0}populateNodes(e){let t=e.chars,n=1,r=0;for(;r{let e=[...Array.from({length:94},(e,t)=>t+33),...Array.from({length:12},(e,t)=>t+161),...Array.from({length:82},(e,t)=>t+174)],t=e.slice(),n=0;for(let r=0;r<256;++r)e.includes(r)||(e.push(r),t.push(256+n),n+=1);let r=t.map(e=>String.fromCharCode(e));return Object.fromEntries(e.map((e,t)=>[e,r[t]]))})(),ee=(0,i.reverseDictionary)(A);class te extends D{constructor(e){super(e),this.tokens_to_ids=m(e.vocab),this.unk_token_id=this.tokens_to_ids.get(e.unk_token),this.unk_token=e.unk_token,this.vocab=Array(this.tokens_to_ids.size);for(let[e,t]of this.tokens_to_ids)this.vocab[t]=e;let t=Array.isArray(e.merges[0]);this.merges=t?e.merges:e.merges.map(e=>e.split(` `,2)),this.bpe_ranks=new Map(this.merges.map((e,t)=>[JSON.stringify(e),t])),this.end_of_word_suffix=e.end_of_word_suffix,this.continuing_subword_suffix=e.continuing_subword_suffix??null,this.byte_fallback=this.config.byte_fallback??!1,this.byte_fallback&&(this.text_encoder=new TextEncoder),this.ignore_merges=this.config.ignore_merges??!1,this.max_length_to_cache=256,this.cache_capacity=1e4,this.cache=new c.LRUCache(this.cache_capacity)}clear_cache(){this.cache.clear()}bpe(e){if(e.length===0)return[];let t=this.cache.get(e);if(t!==void 0)return t;let n=Array.from(e);this.end_of_word_suffix&&(n[n.length-1]+=this.end_of_word_suffix);let r=[];if(n.length>1){let e=new c.PriorityQueue((e,t)=>e.score`<0x${e.toString(16).toUpperCase().padStart(2,`0`)}>`);e.every(e=>this.tokens_to_ids.has(e))?t.push(...e):t.push(this.unk_token)}else t.push(this.unk_token)}return t}}class ne extends D{constructor(e,t){super(e),this.tokens_to_ids=m(t.target_lang?e.vocab[t.target_lang]:e.vocab),this.bos_token=t.bos_token,this.bos_token_id=this.tokens_to_ids.get(this.bos_token),this.eos_token=t.eos_token,this.eos_token_id=this.tokens_to_ids.get(this.eos_token),this.pad_token=t.pad_token,this.pad_token_id=this.tokens_to_ids.get(this.pad_token),this.unk_token=t.unk_token,this.unk_token_id=this.tokens_to_ids.get(this.unk_token),this.vocab=Array(this.tokens_to_ids.size);for(let[e,t]of this.tokens_to_ids)this.vocab[t]=e}encode(e){return e}}class j extends r.Callable{constructor(e){super(),this.config=e}static fromConfig(e){if(e===null)return null;switch(e.type){case`BertNormalizer`:return new fe(e);case`Precompiled`:return new je(e);case`Sequence`:return new de(e);case`Replace`:return new re(e);case`NFC`:return new ae(e);case`NFD`:return new oe(e);case`NFKC`:return new se(e);case`NFKD`:return new M(e);case`Strip`:return new N(e);case`StripAccents`:return new ce(e);case`Lowercase`:return new le(e);case`Prepend`:return new ue(e);default:throw Error(`Unknown Normalizer type: ${e.type}`)}}normalize(e){throw Error(`normalize should be implemented in subclass.`)}_call(e){return this.normalize(e)}}class re extends j{normalize(e){let t=p(this.config.pattern);return t===null?e:e.replaceAll(t,this.config.content)}}class ie extends j{form=void 0;normalize(e){return e=e.normalize(this.form),e}}class ae extends ie{form=`NFC`}class oe extends ie{form=`NFD`}class se extends ie{form=`NFKC`}class M extends ie{form=`NFKD`}class N extends j{normalize(e){return this.config.strip_left&&this.config.strip_right?e=e.trim():(this.config.strip_left&&(e=e.trimStart()),this.config.strip_right&&(e=e.trimEnd())),e}}class ce extends j{normalize(e){return e=_(e),e}}class le extends j{normalize(e){return e=e.toLowerCase(),e}}class ue extends j{normalize(e){return e=this.config.prepend+e,e}}class de extends j{constructor(e){super(e),this.normalizers=e.normalizers.map(e=>j.fromConfig(e))}normalize(e){return this.normalizers.reduce((e,t)=>t.normalize(e),e)}}class fe extends j{_tokenize_chinese_chars(e){let t=[];for(let n=0;nthis.pre_tokenize_text(e,t)):this.pre_tokenize_text(e,t)).flat()}_call(e,t){return this.pre_tokenize(e,t)}}class pe extends P{constructor(e){super(),this.pattern=RegExp(`[^\\s${S}]+|[${S}]`,`gu`)}pre_tokenize_text(e,t){return e.trim().match(this.pattern)||[]}}class F extends P{constructor(e){super(),this.config=e,this.add_prefix_space=this.config.add_prefix_space,this.trim_offsets=this.config.trim_offsets,this.use_regex=this.config.use_regex??!0,this.pattern=/'s|'t|'re|'ve|'m|'ll|'d| ?\p{L}+| ?\p{N}+| ?[^\s\p{L}\p{N}]+|\s+(?!\S)|\s+/gu,this.byte_encoder=A,this.text_encoder=new TextEncoder}pre_tokenize_text(e,t){this.add_prefix_space&&!e.startsWith(` `)&&(e=` `+e);let n=this.use_regex?e.match(this.pattern)||[]:[e];return n.map(e=>Array.from(this.text_encoder.encode(e),e=>this.byte_encoder[e]).join(``))}}class me extends P{constructor(e){super(),this.config=e,this.pattern=p(this.config.pattern,this.config.invert)}pre_tokenize_text(e,t){return this.pattern===null?[]:this.config.invert?e.match(this.pattern)||[]:this.config.behavior?.toLowerCase()===`removed`?e.split(this.pattern).filter(e=>e):f(e,this.pattern)}}class he extends P{constructor(e){super(),this.config=e,this.pattern=RegExp(`[^${S}]+|[${S}]+`,`gu`)}pre_tokenize_text(e,t){return e.match(this.pattern)||[]}}class ge extends P{constructor(e){super(),this.config=e;let t=`[^\\d]+|\\d${this.config.individual_digits?``:`+`}`;this.pattern=new RegExp(t,`gu`)}pre_tokenize_text(e,t){return e.match(this.pattern)||[]}}class I extends r.Callable{constructor(e){super(),this.config=e}static fromConfig(e){if(e===null)return null;switch(e.type){case`TemplateProcessing`:return new R(e);case`ByteLevel`:return new ve(e);case`RobertaProcessing`:return new L(e);case`BertProcessing`:return new _e(e);case`Sequence`:return new ye(e);default:throw Error(`Unknown PostProcessor type: ${e.type}`)}}post_process(e,...t){throw Error(`post_process should be implemented in subclass.`)}_call(e,...t){return this.post_process(e,...t)}}class _e extends I{constructor(e){super(e),this.cls=e.cls[0],this.sep=e.sep[0]}post_process(e,t=null,{add_special_tokens:n=!0}={}){n&&(e=(0,i.mergeArrays)([this.cls],e,[this.sep]));let r=Array(e.length).fill(0);if(t!==null){let a=n&&this instanceof L?[this.sep]:[],o=n?[this.sep]:[];e=(0,i.mergeArrays)(e,a,t,o),r=(0,i.mergeArrays)(r,Array(t.length+a.length+o.length).fill(1))}return{tokens:e,token_type_ids:r}}}class L extends _e{}class R extends I{constructor(e){super(e),this.single=e.single,this.pair=e.pair}post_process(e,t=null,{add_special_tokens:n=!0}={}){let r=t===null?this.single:this.pair,a=[],o=[];for(let s of r)`SpecialToken`in s?n&&(a.push(s.SpecialToken.id),o.push(s.SpecialToken.type_id)):`Sequence`in s&&(s.Sequence.id===`A`?(a=(0,i.mergeArrays)(a,e),o=(0,i.mergeArrays)(o,Array(e.length).fill(s.Sequence.type_id))):s.Sequence.id===`B`&&(a=(0,i.mergeArrays)(a,t),o=(0,i.mergeArrays)(o,Array(t.length).fill(s.Sequence.type_id))));return{tokens:a,token_type_ids:o}}}class ve extends I{post_process(e,t=null){return t&&(e=(0,i.mergeArrays)(e,t)),{tokens:e}}}class ye extends I{constructor(e){super(e),this.processors=e.processors.map(e=>I.fromConfig(e))}post_process(e,t=null,n={}){let r;for(let i of this.processors)if(i instanceof ve){let n=i.post_process(e);if(e=n.tokens,t){let e=i.post_process(t);t=e.tokens}}else{let a=i.post_process(e,t,n);e=a.tokens,r=a.token_type_ids}return{tokens:e,token_type_ids:r}}}class z extends r.Callable{constructor(e){super(),this.config=e,this.added_tokens=[],this.end_of_word_suffix=null,this.trim_offsets=e.trim_offsets}static fromConfig(e){if(e===null)return null;switch(e.type){case`WordPiece`:return new Ce(e);case`Metaspace`:return new Ae(e);case`ByteLevel`:return new we(e);case`Replace`:return new be(e);case`ByteFallback`:return new xe(e);case`Fuse`:return new Se(e);case`Strip`:return new B(e);case`Sequence`:return new Ee(e);case`CTC`:return new Te(e);case`BPEDecoder`:return new De(e);default:throw Error(`Unknown Decoder type: ${e.type}`)}}_call(e){return this.decode(e)}decode(e){return this.decode_chain(e).join(``)}decode_chain(e){throw Error("`decode_chain` should be implemented in subclass.")}}class be extends z{decode_chain(e){let t=p(this.config.pattern);return t===null?e:e.map(e=>e.replaceAll(t,this.config.content))}}class xe extends z{constructor(e){super(e),this.text_decoder=new TextDecoder}decode_chain(e){let t=[],n=[];for(let r of e){let e=null;if(r.length===6&&r.startsWith(`<0x`)&&r.endsWith(`>`)){let t=parseInt(r.slice(3,5),16);isNaN(t)||(e=t)}if(e!==null)n.push(e);else{if(n.length>0){let e=this.text_decoder.decode(Uint8Array.from(n));t.push(e),n=[]}t.push(r)}}if(n.length>0){let e=this.text_decoder.decode(Uint8Array.from(n));t.push(e),n=[]}return t}}class Se extends z{decode_chain(e){return[e.join(``)]}}class B extends z{constructor(e){super(e),this.content=this.config.content,this.start=this.config.start,this.stop=this.config.stop}decode_chain(e){return e.map(e=>{let t=0;for(let n=0;n(t!==0&&(e=e.startsWith(this.config.prefix)?e.replace(this.config.prefix,``):` `+e),this.cleanup&&(e=g(e)),e))}}class we extends z{constructor(e){super(e),this.byte_decoder=ee,this.text_decoder=new TextDecoder(`utf-8`,{fatal:!1,ignoreBOM:!0}),this.end_of_word_suffix=null}convert_tokens_to_string(e){let t=e.join(``),n=new Uint8Array([...t].map(e=>this.byte_decoder[e])),r=this.text_decoder.decode(n);return r}decode_chain(e){let t=[],n=[];for(let r of e)this.added_tokens.find(e=>e.content===r)===void 0?n.push(r):(n.length>0&&(t.push(this.convert_tokens_to_string(n)),n=[]),t.push(r));return n.length>0&&t.push(this.convert_tokens_to_string(n)),t}}class Te extends z{constructor(e){super(e),this.pad_token=this.config.pad_token,this.word_delimiter_token=this.config.word_delimiter_token,this.cleanup=this.config.cleanup}convert_tokens_to_string(e){if(e.length===0)return``;let t=[e[0]];for(let n=1;ne!==this.pad_token),r=n.join(``);return this.cleanup&&(r=g(r).replaceAll(this.word_delimiter_token,` `).trim()),r}decode_chain(e){return[this.convert_tokens_to_string(e)]}}class Ee extends z{constructor(e){super(e),this.decoders=e.decoders.map(e=>z.fromConfig(e))}decode_chain(e){return this.decoders.reduce((e,t)=>t.decode_chain(e),e)}}class De extends z{constructor(e){super(e),this.suffix=this.config.suffix}decode_chain(e){return e.map((t,n)=>t.replaceAll(this.suffix,n===e.length-1?``:` `))}}class Oe extends z{decode_chain(e){let t=``;for(let n=1;ne.normalize(`NFKC`)).join(`~`)}else e=e.normalize(`NFKC`);return e}}class Me extends P{constructor(e){super(),this.tokenizers=e.pretokenizers.map(e=>P.fromConfig(e))}pre_tokenize_text(e,t){return this.tokenizers.reduce((e,n)=>n.pre_tokenize(e,t),[e])}}class Ne extends P{constructor(e){super()}pre_tokenize_text(e,t){return e.match(/\w+|[^\w\s]+/g)||[]}}class Pe extends P{constructor(e){super()}pre_tokenize_text(e,t){return x(e)}}class Fe extends P{constructor(e){super(),this.config=e,this.pattern=p(this.config.pattern),this.content=this.config.content}pre_tokenize_text(e,t){return this.pattern===null?[e]:[e.replaceAll(this.pattern,this.config.content)]}}let Ie=[`bos_token`,`eos_token`,`unk_token`,`sep_token`,`pad_token`,`cls_token`,`mask_token`];function Le(e,t,n,r){for(let a of Object.keys(e)){let o=t-e[a].length,s=n(a),c=Array(o).fill(s);e[a]=r===`right`?(0,i.mergeArrays)(e[a],c):(0,i.mergeArrays)(c,e[a])}}function Re(e,t){for(let n of Object.keys(e))e[n].length=t}class V extends r.Callable{return_token_type_ids=!1;padding_side=`right`;constructor(e,t){super(),this.config=t,this.normalizer=j.fromConfig(e.normalizer),this.pre_tokenizer=P.fromConfig(e.pre_tokenizer),this.model=D.fromConfig(e.model,t),this.post_processor=I.fromConfig(e.post_processor),this.decoder=z.fromConfig(e.decoder),this.special_tokens=[],this.all_special_ids=[],this.added_tokens=[];for(let t of e.added_tokens){let e=new E(t);this.added_tokens.push(e),this.model.tokens_to_ids.set(e.content,e.id),this.model.vocab[e.id]=e.content,e.special&&(this.special_tokens.push(e.content),this.all_special_ids.push(e.id))}if(this.additional_special_tokens=t.additional_special_tokens??[],this.special_tokens.push(...this.additional_special_tokens),this.special_tokens=[...new Set(this.special_tokens)],this.decoder&&(this.decoder.added_tokens=this.added_tokens,this.decoder.end_of_word_suffix=this.model.end_of_word_suffix),this.added_tokens_splitter=new c.DictionarySplitter(this.added_tokens.map(e=>e.content)),this.added_tokens_map=new Map(this.added_tokens.map(e=>[e.content,e])),this.mask_token=this.getToken(`mask_token`),this.mask_token_id=this.model.tokens_to_ids.get(this.mask_token),this.pad_token=this.getToken(`pad_token`,`eos_token`),this.pad_token_id=this.model.tokens_to_ids.get(this.pad_token),this.sep_token=this.getToken(`sep_token`),this.sep_token_id=this.model.tokens_to_ids.get(this.sep_token),this.unk_token=this.getToken(`unk_token`),this.unk_token_id=this.model.tokens_to_ids.get(this.unk_token),this.bos_token=this.getToken(`bos_token`),this.bos_token_id=this.model.tokens_to_ids.get(this.bos_token),this.eos_token=this.getToken(`eos_token`),this.eos_token_id=this.model.tokens_to_ids.get(this.eos_token),this.model_max_length=t.model_max_length,this.remove_space=t.remove_space,this.clean_up_tokenization_spaces=t.clean_up_tokenization_spaces??!0,this.do_lowercase_and_remove_accent=t.do_lowercase_and_remove_accent??!1,t.padding_side&&(this.padding_side=t.padding_side),this.legacy=!1,this.chat_template=t.chat_template??null,Array.isArray(this.chat_template)){let e=Object.create(null);for(let{name:t,template:n}of this.chat_template){if(typeof t!=`string`||typeof n!=`string`)throw Error(`Chat template must be a list of objects with "name" and "template" properties`);e[t]=n}this.chat_template=e}this._compiled_template_cache=new Map}getToken(...e){for(let t of e){let e=this.config[t];if(!e)continue;if(typeof e==`object`){if(e.__type===`AddedToken`)return e.content;throw Error(`Unknown token: ${e}`)}else return e}return null}static async from_pretrained(e,{progress_callback:t=null,config:n=null,cache_dir:r=null,local_files_only:i=!1,revision:a=`main`,legacy:o=null}={}){let s=await d(e,{progress_callback:t,config:n,cache_dir:r,local_files_only:i,revision:a,legacy:o});return new this(...s)}_call(e,{text_pair:t=null,add_special_tokens:n=!0,padding:r=!1,truncation:i=null,max_length:a=null,return_tensor:c=!0,return_token_type_ids:l=null}={}){let u=Array.isArray(e),d;if(u){if(e.length===0)throw Error(`text array must be non-empty`);if(t!==null){if(Array.isArray(t)){if(e.length!==t.length)throw Error(`text and text_pair must have the same length`)}else throw Error(`text_pair must also be an array`);d=e.map((e,r)=>this._encode_plus(e,{text_pair:t[r],add_special_tokens:n,return_token_type_ids:l}))}else d=e.map(e=>this._encode_plus(e,{add_special_tokens:n,return_token_type_ids:l}))}else{if(e==null)throw Error(`text may not be null or undefined`);if(Array.isArray(t))throw Error("When specifying `text_pair`, since `text` is a string, `text_pair` must also be a string (i.e., not an array).");d=[this._encode_plus(e,{text_pair:t,add_special_tokens:n,return_token_type_ids:l})]}if(a===null?a=this.model_max_length:i===null&&(r===!0?(console.warn("`max_length` is ignored when `padding: true` and there is no truncation strategy. To pad to max length, use `padding: 'max_length'`."),a=this.model_max_length):r===!1&&(console.warn("Truncation was not explicitly activated but `max_length` is provided a specific value, please use `truncation: true` to explicitly truncate examples to max length."),i=!0)),r===!0&&(a=Math.min((0,o.max)(d.map(e=>e.input_ids.length))[0],a??1/0)),a=Math.min(a,this.model_max_length??1/0),r||i)for(let e=0;ea?i&&Re(d[e],a):r&&Le(d[e],a,e=>e===`input_ids`?this.pad_token_id:0,this.padding_side);let f={};if(c){if(!(r&&i)&&d.some(e=>{for(let t of Object.keys(e))if(e[t].length!==d[0][t]?.length)return!0;return!1}))throw Error(`Unable to create tensor, you should probably activate truncation and/or padding with 'padding=true' and 'truncation=true' to have batched tensors with the same length.`);let e=[d.length,d[0].input_ids.length];for(let t of Object.keys(d[0]))f[t]=new s.Tensor(`int64`,BigInt64Array.from(d.flatMap(e=>e[t]).map(BigInt)),e)}else{for(let e of Object.keys(d[0]))f[e]=d.map(t=>t[e]);if(!u)for(let e of Object.keys(f))f[e]=f[e][0]}return f}_encode_text(e){if(e===null)return null;let t=this.added_tokens_splitter.split(e);for(let e=0;e0&&(t[e-1]=t[e-1].trimEnd()),n.rstrip&&e{if(e.length===0)return[];if(this.added_tokens_map.has(e))return[e];if(this.remove_space===!0&&(e=e.trim().split(/\s+/).join(` `)),this.do_lowercase_and_remove_accent&&(e=v(e)),this.normalizer!==null&&(e=this.normalizer(e)),e.length===0)return[];let n=this.pre_tokenizer===null?[e]:this.pre_tokenizer(e,{section_index:t}),r=this.model(n);return r});return n}_encode_plus(e,{text_pair:t=null,add_special_tokens:n=!0,return_token_type_ids:r=null}={}){let{tokens:i,token_type_ids:a}=this._tokenize_helper(e,{pair:t,add_special_tokens:n}),o=this.model.convert_tokens_to_ids(i),s={input_ids:o,attention_mask:Array(o.length).fill(1)};return(r??this.return_token_type_ids)&&a&&(s.token_type_ids=a),s}_tokenize_helper(e,{pair:t=null,add_special_tokens:n=!1}={}){let r=this._encode_text(e),a=this._encode_text(t);return this.post_processor?this.post_processor(r,a,{add_special_tokens:n}):{tokens:(0,i.mergeArrays)(r??[],a??[])}}tokenize(e,{pair:t=null,add_special_tokens:n=!1}={}){return this._tokenize_helper(e,{pair:t,add_special_tokens:n}).tokens}encode(e,{text_pair:t=null,add_special_tokens:n=!0,return_token_type_ids:r=null}={}){return this._encode_plus(e,{text_pair:t,add_special_tokens:n,return_token_type_ids:r}).input_ids}batch_decode(e,t={}){return e instanceof s.Tensor&&(e=e.tolist()),e.map(e=>this.decode(e,t))}decode(e,t={}){if(e instanceof s.Tensor&&(e=h(e)),!Array.isArray(e)||e.length===0||!(0,i.isIntegralNumber)(e[0]))throw Error(`token_ids must be a non-empty array of integers.`);return this.decode_single(e,t)}decode_single(e,{skip_special_tokens:t=!1,clean_up_tokenization_spaces:n=null}){let r=this.model.convert_ids_to_tokens(e);t&&(r=r.filter(e=>!this.special_tokens.includes(e)));let i=this.decoder?this.decoder(r):r.join(` `);return this.decoder&&this.decoder.end_of_word_suffix&&(i=i.replaceAll(this.decoder.end_of_word_suffix,` `),t&&(i=i.trim())),(n??this.clean_up_tokenization_spaces)&&(i=g(i)),i}get_chat_template({chat_template:e=null,tools:t=null}={}){if(this.chat_template&&typeof this.chat_template==`object`){let n=this.chat_template;if(e!==null&&Object.hasOwn(n,e))e=n[e];else if(e===null)if(t!==null&&`tool_use`in n)e=n.tool_use;else if(`default`in n)e=n.default;else throw Error(`This model has multiple chat templates with no default specified! Please either pass a chat template or the name of the template you wish to use to the 'chat_template' argument. Available template names are ${Object.keys(n).sort()}.`)}else if(e===null)if(this.chat_template)e=this.chat_template;else throw Error(`Cannot use apply_chat_template() because tokenizer.chat_template is not set and no template argument was passed! For information about writing templates and setting the tokenizer.chat_template attribute, please see the documentation at https://huggingface.co/docs/transformers/main/en/chat_templating`);return e}apply_chat_template(e,{tools:t=null,documents:n=null,chat_template:r=null,add_generation_prompt:i=!1,tokenize:a=!0,padding:o=!1,truncation:s=!1,max_length:c=null,return_tensor:u=!0,return_dict:d=!1,tokenizer_kwargs:f={},...p}={}){if(r=this.get_chat_template({chat_template:r,tools:t}),typeof r!=`string`)throw Error(`chat_template must be a string, but got ${typeof r}`);let m=this._compiled_template_cache.get(r);m===void 0&&(m=new l.Template(r),this._compiled_template_cache.set(r,m));let h=Object.create(null);for(let e of Ie){let t=this.getToken(e);t&&(h[e]=t)}let g=m.render({messages:e,add_generation_prompt:i,tools:t,documents:n,...h,...p});if(a){let e=this._call(g,{add_special_tokens:!1,padding:o,truncation:s,max_length:c,return_tensor:u,...f});return d?e:e.input_ids}return g}}class ze extends V{return_token_type_ids=!0}class Be extends V{return_token_type_ids=!0}class H extends V{return_token_type_ids=!0}class Ve extends V{return_token_type_ids=!0}class He extends V{return_token_type_ids=!0}class Ue extends V{return_token_type_ids=!0}class We extends V{return_token_type_ids=!0}class Ge extends V{return_token_type_ids=!0}class Ke extends V{return_token_type_ids=!0}class qe extends V{}class Je extends V{}class Ye extends V{return_token_type_ids=!0;constructor(e,t){super(e,t),console.warn('WARNING: `XLMTokenizer` is not yet supported by Hugging Face\'s "fast" tokenizers library. Therefore, you may experience slightly inaccurate results.')}}class Xe extends V{return_token_type_ids=!0}class Ze extends V{}class Qe extends V{}class $e extends V{}class et extends V{constructor(e,t){super(e,t),this.languageRegex=/^[a-z]{2}_[A-Z]{2}$/,this.language_codes=this.special_tokens.filter(e=>this.languageRegex.test(e)),this.lang_to_token=e=>e}_build_translation_inputs(e,t,n){return ht(this,e,t,n)}}class tt extends et{}class nt extends V{}class rt extends V{}let it=`▁`;class at extends V{padding_side=`left`;constructor(e,t){super(e,t),this.legacy=t.legacy??!0,this.legacy||(this.normalizer=null,this.pre_tokenizer=new ke({replacement:it,add_prefix_space:!0,prepend_scheme:`first`}))}_encode_text(e){if(e===null)return null;if(this.legacy||e.length===0)return super._encode_text(e);let t=super._encode_text(it+e.replaceAll(it,` `));return t.length>1&&t[0]===it&&this.special_tokens.includes(t[1])&&(t=t.slice(1)),t}}class ot extends V{}class st extends V{}class ct extends V{}class lt extends V{}class ut extends V{}class dt extends V{}class ft extends V{}class pt extends V{}class mt extends V{}function ht(e,t,n,r){if(!(`language_codes`in e)||!Array.isArray(e.language_codes))throw Error("Tokenizer must have `language_codes` attribute set and it should be an array of language ids.");if(!(`languageRegex`in e)||!(e.languageRegex instanceof RegExp))throw Error("Tokenizer must have `languageRegex` attribute set and it should be a regular expression.");if(!(`lang_to_token`in e)||typeof e.lang_to_token!=`function`)throw Error("Tokenizer must have `lang_to_token` attribute set and it should be a function.");let i=r.src_lang,a=r.tgt_lang;if(!e.language_codes.includes(a))throw Error(`Target language code "${a}" is not valid. Must be one of: {${e.language_codes.join(`, `)}}`);if(i!==void 0){if(!e.language_codes.includes(i))throw Error(`Source language code "${i}" is not valid. Must be one of: {${e.language_codes.join(`, `)}}`);for(let t of e.post_processor.config.single)if(`SpecialToken`in t&&e.languageRegex.test(t.SpecialToken.id)){t.SpecialToken.id=e.lang_to_token(i);break}}return r.forced_bos_token_id=e.model.convert_tokens_to_ids([e.lang_to_token(a)])[0],e._call(t,n)}class gt extends V{constructor(e,t){super(e,t),this.languageRegex=/^[a-z]{3}_[A-Z][a-z]{3}$/,this.language_codes=this.special_tokens.filter(e=>this.languageRegex.test(e)),this.lang_to_token=e=>e}_build_translation_inputs(e,t,n){return ht(this,e,t,n)}}class _t extends V{constructor(e,t){super(e,t),this.languageRegex=/^__[a-z]{2,3}__$/,this.language_codes=this.special_tokens.filter(e=>this.languageRegex.test(e)).map(e=>e.slice(2,-2)),this.lang_to_token=e=>`__${e}__`}_build_translation_inputs(e,t,n){return ht(this,e,t,n)}}class vt extends V{get timestamp_begin(){return this.model.convert_tokens_to_ids([`<|notimestamps|>`])[0]+1}_decode_asr(e,{return_timestamps:t=!1,return_language:n=!1,time_precision:r=null,force_full_sequences:i=!0}={}){if(r===null)throw Error(`Must specify time_precision`);let a=null,s=t===`word`;function c(){return{language:a,timestamp:[null,null],text:``}}let l=[],d=c(),f=0,p=this.timestamp_begin,m=1500,h=p+m,g=[],_=[],v=!1,y=null,b=new Set(this.all_special_ids);for(let n of e){let e=n.tokens,i=s?n.token_timestamps:null,m=null,x=p;if(`stride`in n){let[t,i,a]=n.stride;if(f-=i,y=t-a,i&&(x=i/r+p),a)for(let t=e.length-1;t>=0;--t){let n=Number(e[t]);if(n>=p){if(m!==null&&(n-p)*r=p&&y<=h){let e=(y-p)*r+f,t=(0,o.round)(e,2);if(m!==null&&y>=m)v=!0;else if(v||g.length>0&&y0?(g.push(S),s&&_.push(w)):g.every(e=>e.length===0)&&(d=c(),g=[],S=[],_=[],w=[])}if(g.length>0){if(i&&t)throw Error(`Whisper did not predict an ending timestamp, which can happen if audio is cut off in the middle of a word. Also make sure WhisperTimeStampLogitsProcessor was used during generation.`);let[e,n]=this.findLongestCommonSequence(g,_),r=this.decode(e);d.text=r,s&&(d.words=this.collateWordTimestamps(e,n,a)),l.push(d)}let x=Object.create(null),S=l.map(e=>e.text).join(``);if(t||n){for(let e=0;e0,o=a?[]:null,s=a?t[0]:null;for(let c=1;ce===g[n]&&s[i+n]<=t[c][m+n]).length:p.filter((e,t)=>e===g[t]).length;let v=e/1e4,y=_/e+v;_>1&&y>u&&(u=y,d=[i,o,m,h])}let[p,m,h,g]=d,_=Math.floor((m+p)/2),v=Math.floor((g+h)/2);i.push(...n.slice(0,_)),n=l.slice(v),r=n.length,a&&(o.push(...s.slice(0,_)),s=t[c].slice(v))}return i.push(...n),a?(o.push(...s),[i,o]):[i,[]]}collateWordTimestamps(e,t,n){let[r,i,a]=this.combineTokensIntoWords(e,n),o=[];for(let e=0;e=r){let e=((t-r)*n).toFixed(2);i.push(`<|${e}|>`),i.push([])}else i[i.length-1].push(t);return i=i.map(e=>typeof e==`string`?e:super.decode(e,t)),i.join(``)}splitTokensOnUnicode(e){let t=this.decode(e,{decode_with_timestamps:!0}),n=`�`,r=[],i=[],a=[],o=[],s=[],c=0;for(let l=0;l=this.model.tokens_to_ids.get(`<|endoftext|>`),f=c.startsWith(` `),p=c.trim(),m=s.test(p);if(d||f||m||i.length===0)i.push(c),a.push(l),o.push(u);else{let e=i.length-1;i[e]+=c,a[e].push(...l),o[e].push(...u)}}return[i,a,o]}mergePunctuations(e,t,n,r,a){let o=structuredClone(e),s=structuredClone(t),c=structuredClone(n),l=o.length-2,u=o.length-1;for(;l>=0;)o[l].startsWith(` `)&&r.includes(o[l].trim())?(o[u]=o[l]+o[u],s[u]=(0,i.mergeArrays)(s[l],s[u]),c[u]=(0,i.mergeArrays)(c[l],c[u]),o[l]=``,s[l]=[],c[l]=[]):u=l,--l;for(l=0,u=1;ue),s.filter(e=>e.length>0),c.filter(e=>e.length>0)]}}class yt extends V{}class bt extends V{}class xt extends V{}class St extends V{constructor(e,t){super(e,t),this.languageRegex=/^(>>\w+<<)\s*/g,this.supported_language_codes=this.model.vocab.filter(e=>this.languageRegex.test(e)),console.warn('WARNING: `MarianTokenizer` is not yet supported by Hugging Face\'s "fast" tokenizers library. Therefore, you may experience slightly inaccurate results.')}_encode_text(e){if(e===null)return null;let[t,...n]=e.trim().split(this.languageRegex);if(n.length===0)return super._encode_text(t);if(n.length===2){let[e,t]=n;return this.supported_language_codes.includes(e)||console.warn(`Unsupported language code "${e}" detected, which may lead to unexpected behavior. Should be one of: ${JSON.stringify(this.supported_language_codes)}`),(0,i.mergeArrays)([e],super._encode_text(t))}}}class Ct extends V{}class wt extends V{}class Tt extends V{}class Et extends V{}class Dt extends V{}class Ot extends V{constructor(e,t){super(e,t),this.decoder=new Oe({})}}class kt extends V{}class At extends V{}class jt extends V{}class Mt{static TOKENIZER_CLASS_MAPPING={T5Tokenizer:Ze,DistilBertTokenizer:qe,CamembertTokenizer:Je,DebertaTokenizer:He,DebertaV2Tokenizer:Ue,BertTokenizer:ze,HerbertTokenizer:We,ConvBertTokenizer:Ge,RoFormerTokenizer:Ke,XLMTokenizer:Ye,ElectraTokenizer:Xe,MobileBertTokenizer:H,SqueezeBertTokenizer:Ve,AlbertTokenizer:Be,GPT2Tokenizer:Qe,BartTokenizer:$e,MBartTokenizer:et,MBart50Tokenizer:tt,RobertaTokenizer:nt,WhisperTokenizer:vt,CodeGenTokenizer:yt,CLIPTokenizer:bt,SiglipTokenizer:xt,MarianTokenizer:St,BloomTokenizer:rt,NllbTokenizer:gt,M2M100Tokenizer:_t,LlamaTokenizer:at,CodeLlamaTokenizer:ot,XLMRobertaTokenizer:st,MPNetTokenizer:ct,FalconTokenizer:lt,GPTNeoXTokenizer:ut,EsmTokenizer:dt,Wav2Vec2CTCTokenizer:Ct,BlenderbotTokenizer:wt,BlenderbotSmallTokenizer:Tt,SpeechT5Tokenizer:Et,NougatTokenizer:Dt,VitsTokenizer:Ot,Qwen2Tokenizer:ft,GemmaTokenizer:pt,Grok1Tokenizer:mt,CohereTokenizer:kt,MgpstrTokenizer:At,Ernie4_5_Tokenizer:jt,PreTrainedTokenizer:V};static async from_pretrained(e,{progress_callback:t=null,config:n=null,cache_dir:r=null,local_files_only:i=!1,revision:a=`main`,legacy:o=null}={}){let[s,c]=await d(e,{progress_callback:t,config:n,cache_dir:r,local_files_only:i,revision:a,legacy:o}),l=c.tokenizer_class?.replace(/Fast$/,``)??`PreTrainedTokenizer`,u=this.TOKENIZER_CLASS_MAPPING[l];return u||(console.warn(`Unknown tokenizer class "${l}", attempting to construct from base class.`),u=V),new u(s,c)}}},"./src/utils/audio.js":(e,t,n)=>{n.r(t),n.d(t,{RawAudio:()=>O,hamming:()=>f,hanning:()=>d,mel_filter_bank:()=>y,read_audio:()=>l,spectrogram:()=>w,window_function:()=>T});var r=n( /*! ./hub.js */ `./src/utils/hub.js`),i=n( /*! ./maths.js */ @@ -3551,7 +3551,7 @@ let af={url:self.location.href};var sf={"onnxruntime-common":e=>{e.exports=ne}," /*! ./image.js */ `./src/utils/image.js`),i=n( /*! ../env.js */ -`./src/env.js`);class a{constructor(e,t){this.image=e,this.timestamp=t}}class o{constructor(e,t){e.length>0&&e[0]instanceof r.RawImage&&(e=e.map((n,r)=>new a(n,(r+1)/(e.length+1)*t))),this.frames=e,this.duration=t}get width(){return this.frames[0].image.width}get height(){return this.frames[0].image.height}get fps(){return this.frames.length/this.duration}}async function s(e,{num_frames:t=null,fps:n=null}={}){if(!i.apis.IS_BROWSER_ENV)throw Error("`load_video` is currently only supported in browser environments.");if(t==null&&n==null)throw Error(`Either num_frames or fps must be provided.`);let s=[],c=document.createElement(`video`);if(c.crossOrigin=`anonymous`,c.muted=!0,typeof e==`string`)c.src=e;else if(e instanceof Blob)c.src=URL.createObjectURL(e);else if(e instanceof HTMLVideoElement)c.src=e.src;else throw Error(`Invalid URL or video element provided.`);if(await new Promise(e=>c.onloadedmetadata=e),c.seekable.start(0)===c.seekable.end(0)){let e=await fetch(c.src),t=await e.blob();c.src=URL.createObjectURL(t),await new Promise(e=>c.onloadedmetadata=e)}let l=c.duration,u,d;t==null?(d=1/n,u=Math.floor(l/d)):(u=t,d=t===1?0:l/(t-1));let f=[];for(let e=0;e{c.onseeked=e}),m.drawImage(c,0,0,p.width,p.height);let t=m.getImageData(0,0,p.width,p.height),n=new r.RawImage(t.data,p.width,p.height,4),i=new a(n,e);s.push(i)}return c.remove(),new o(s,l)}}},cf={};function lf(e){var t=cf[e];if(t!==void 0)return t.exports;var n=cf[e]={exports:{}};return sf[e](n,n.exports,lf),n.exports}(()=>{var e=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,t;lf.t=function(n,r){if(r&1&&(n=this(n)),r&8||typeof n==`object`&&n&&(r&4&&n.__esModule||r&16&&typeof n.then==`function`))return n;var i=Object.create(null);lf.r(i);var a={};t||=[null,e({}),e([]),e(e)];for(var o=r&2&&n;typeof o==`object`&&!~t.indexOf(o);o=e(o))Object.getOwnPropertyNames(o).forEach(e=>a[e]=()=>n[e]);return a.default=()=>n,lf.d(i,a),i}})(),lf.d=(e,t)=>{for(var n in t)lf.o(t,n)&&!lf.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},lf.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),lf.r=e=>{typeof Symbol<`u`&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),Object.defineProperty(e,`__esModule`,{value:!0})};var $={};(()=>{lf.r($),lf.d($,{ASTFeatureExtractor:()=>d.ASTFeatureExtractor,ASTForAudioClassification:()=>n.ASTForAudioClassification,ASTModel:()=>n.ASTModel,ASTPreTrainedModel:()=>n.ASTPreTrainedModel,AlbertForMaskedLM:()=>n.AlbertForMaskedLM,AlbertForQuestionAnswering:()=>n.AlbertForQuestionAnswering,AlbertForSequenceClassification:()=>n.AlbertForSequenceClassification,AlbertModel:()=>n.AlbertModel,AlbertPreTrainedModel:()=>n.AlbertPreTrainedModel,AlbertTokenizer:()=>r.AlbertTokenizer,AudioClassificationPipeline:()=>t.AudioClassificationPipeline,AutoConfig:()=>i.AutoConfig,AutoFeatureExtractor:()=>f.AutoFeatureExtractor,AutoImageProcessor:()=>h.AutoImageProcessor,AutoModel:()=>n.AutoModel,AutoModelForAudioClassification:()=>n.AutoModelForAudioClassification,AutoModelForAudioFrameClassification:()=>n.AutoModelForAudioFrameClassification,AutoModelForAudioTextToText:()=>n.AutoModelForAudioTextToText,AutoModelForCTC:()=>n.AutoModelForCTC,AutoModelForCausalLM:()=>n.AutoModelForCausalLM,AutoModelForDepthEstimation:()=>n.AutoModelForDepthEstimation,AutoModelForDocumentQuestionAnswering:()=>n.AutoModelForDocumentQuestionAnswering,AutoModelForImageClassification:()=>n.AutoModelForImageClassification,AutoModelForImageFeatureExtraction:()=>n.AutoModelForImageFeatureExtraction,AutoModelForImageMatting:()=>n.AutoModelForImageMatting,AutoModelForImageSegmentation:()=>n.AutoModelForImageSegmentation,AutoModelForImageTextToText:()=>n.AutoModelForImageTextToText,AutoModelForImageToImage:()=>n.AutoModelForImageToImage,AutoModelForMaskGeneration:()=>n.AutoModelForMaskGeneration,AutoModelForMaskedLM:()=>n.AutoModelForMaskedLM,AutoModelForNormalEstimation:()=>n.AutoModelForNormalEstimation,AutoModelForObjectDetection:()=>n.AutoModelForObjectDetection,AutoModelForPoseEstimation:()=>n.AutoModelForPoseEstimation,AutoModelForQuestionAnswering:()=>n.AutoModelForQuestionAnswering,AutoModelForSemanticSegmentation:()=>n.AutoModelForSemanticSegmentation,AutoModelForSeq2SeqLM:()=>n.AutoModelForSeq2SeqLM,AutoModelForSequenceClassification:()=>n.AutoModelForSequenceClassification,AutoModelForSpeechSeq2Seq:()=>n.AutoModelForSpeechSeq2Seq,AutoModelForTextToSpectrogram:()=>n.AutoModelForTextToSpectrogram,AutoModelForTextToWaveform:()=>n.AutoModelForTextToWaveform,AutoModelForTokenClassification:()=>n.AutoModelForTokenClassification,AutoModelForUniversalSegmentation:()=>n.AutoModelForUniversalSegmentation,AutoModelForVision2Seq:()=>n.AutoModelForVision2Seq,AutoModelForXVector:()=>n.AutoModelForXVector,AutoModelForZeroShotObjectDetection:()=>n.AutoModelForZeroShotObjectDetection,AutoProcessor:()=>v.AutoProcessor,AutoTokenizer:()=>r.AutoTokenizer,AutomaticSpeechRecognitionPipeline:()=>t.AutomaticSpeechRecognitionPipeline,BackgroundRemovalPipeline:()=>t.BackgroundRemovalPipeline,BartForConditionalGeneration:()=>n.BartForConditionalGeneration,BartForSequenceClassification:()=>n.BartForSequenceClassification,BartModel:()=>n.BartModel,BartPretrainedModel:()=>n.BartPretrainedModel,BartTokenizer:()=>r.BartTokenizer,BaseModelOutput:()=>n.BaseModelOutput,BaseStreamer:()=>y.BaseStreamer,BeitFeatureExtractor:()=>m.BeitFeatureExtractor,BeitForImageClassification:()=>n.BeitForImageClassification,BeitModel:()=>n.BeitModel,BeitPreTrainedModel:()=>n.BeitPreTrainedModel,BertForMaskedLM:()=>n.BertForMaskedLM,BertForQuestionAnswering:()=>n.BertForQuestionAnswering,BertForSequenceClassification:()=>n.BertForSequenceClassification,BertForTokenClassification:()=>n.BertForTokenClassification,BertModel:()=>n.BertModel,BertPreTrainedModel:()=>n.BertPreTrainedModel,BertTokenizer:()=>r.BertTokenizer,BitImageProcessor:()=>m.BitImageProcessor,BlenderbotForConditionalGeneration:()=>n.BlenderbotForConditionalGeneration,BlenderbotModel:()=>n.BlenderbotModel,BlenderbotPreTrainedModel:()=>n.BlenderbotPreTrainedModel,BlenderbotSmallForConditionalGeneration:()=>n.BlenderbotSmallForConditionalGeneration,BlenderbotSmallModel:()=>n.BlenderbotSmallModel,BlenderbotSmallPreTrainedModel:()=>n.BlenderbotSmallPreTrainedModel,BlenderbotSmallTokenizer:()=>r.BlenderbotSmallTokenizer,BlenderbotTokenizer:()=>r.BlenderbotTokenizer,BloomForCausalLM:()=>n.BloomForCausalLM,BloomModel:()=>n.BloomModel,BloomPreTrainedModel:()=>n.BloomPreTrainedModel,BloomTokenizer:()=>r.BloomTokenizer,CLIPFeatureExtractor:()=>m.CLIPFeatureExtractor,CLIPImageProcessor:()=>m.CLIPImageProcessor,CLIPModel:()=>n.CLIPModel,CLIPPreTrainedModel:()=>n.CLIPPreTrainedModel,CLIPSegForImageSegmentation:()=>n.CLIPSegForImageSegmentation,CLIPSegModel:()=>n.CLIPSegModel,CLIPSegPreTrainedModel:()=>n.CLIPSegPreTrainedModel,CLIPTextModel:()=>n.CLIPTextModel,CLIPTextModelWithProjection:()=>n.CLIPTextModelWithProjection,CLIPTokenizer:()=>r.CLIPTokenizer,CLIPVisionModel:()=>n.CLIPVisionModel,CLIPVisionModelWithProjection:()=>n.CLIPVisionModelWithProjection,CamembertForMaskedLM:()=>n.CamembertForMaskedLM,CamembertForQuestionAnswering:()=>n.CamembertForQuestionAnswering,CamembertForSequenceClassification:()=>n.CamembertForSequenceClassification,CamembertForTokenClassification:()=>n.CamembertForTokenClassification,CamembertModel:()=>n.CamembertModel,CamembertPreTrainedModel:()=>n.CamembertPreTrainedModel,CamembertTokenizer:()=>r.CamembertTokenizer,CausalLMOutput:()=>n.CausalLMOutput,CausalLMOutputWithPast:()=>n.CausalLMOutputWithPast,ChineseCLIPFeatureExtractor:()=>m.ChineseCLIPFeatureExtractor,ChineseCLIPModel:()=>n.ChineseCLIPModel,ChineseCLIPPreTrainedModel:()=>n.ChineseCLIPPreTrainedModel,ClapAudioModelWithProjection:()=>n.ClapAudioModelWithProjection,ClapFeatureExtractor:()=>d.ClapFeatureExtractor,ClapModel:()=>n.ClapModel,ClapPreTrainedModel:()=>n.ClapPreTrainedModel,ClapTextModelWithProjection:()=>n.ClapTextModelWithProjection,ClassifierFreeGuidanceLogitsProcessor:()=>x.ClassifierFreeGuidanceLogitsProcessor,CodeGenForCausalLM:()=>n.CodeGenForCausalLM,CodeGenModel:()=>n.CodeGenModel,CodeGenPreTrainedModel:()=>n.CodeGenPreTrainedModel,CodeGenTokenizer:()=>r.CodeGenTokenizer,CodeLlamaTokenizer:()=>r.CodeLlamaTokenizer,CohereForCausalLM:()=>n.CohereForCausalLM,CohereModel:()=>n.CohereModel,CoherePreTrainedModel:()=>n.CoherePreTrainedModel,CohereTokenizer:()=>r.CohereTokenizer,ConvBertForMaskedLM:()=>n.ConvBertForMaskedLM,ConvBertForQuestionAnswering:()=>n.ConvBertForQuestionAnswering,ConvBertForSequenceClassification:()=>n.ConvBertForSequenceClassification,ConvBertForTokenClassification:()=>n.ConvBertForTokenClassification,ConvBertModel:()=>n.ConvBertModel,ConvBertPreTrainedModel:()=>n.ConvBertPreTrainedModel,ConvBertTokenizer:()=>r.ConvBertTokenizer,ConvNextFeatureExtractor:()=>m.ConvNextFeatureExtractor,ConvNextForImageClassification:()=>n.ConvNextForImageClassification,ConvNextImageProcessor:()=>m.ConvNextImageProcessor,ConvNextModel:()=>n.ConvNextModel,ConvNextPreTrainedModel:()=>n.ConvNextPreTrainedModel,ConvNextV2ForImageClassification:()=>n.ConvNextV2ForImageClassification,ConvNextV2Model:()=>n.ConvNextV2Model,ConvNextV2PreTrainedModel:()=>n.ConvNextV2PreTrainedModel,DFineForObjectDetection:()=>n.DFineForObjectDetection,DFineModel:()=>n.DFineModel,DFinePreTrainedModel:()=>n.DFinePreTrainedModel,DPTFeatureExtractor:()=>m.DPTFeatureExtractor,DPTForDepthEstimation:()=>n.DPTForDepthEstimation,DPTImageProcessor:()=>m.DPTImageProcessor,DPTModel:()=>n.DPTModel,DPTPreTrainedModel:()=>n.DPTPreTrainedModel,DacDecoderModel:()=>n.DacDecoderModel,DacDecoderOutput:()=>n.DacDecoderOutput,DacEncoderModel:()=>n.DacEncoderModel,DacEncoderOutput:()=>n.DacEncoderOutput,DacFeatureExtractor:()=>d.DacFeatureExtractor,DacModel:()=>n.DacModel,DacPreTrainedModel:()=>n.DacPreTrainedModel,DataTypeMap:()=>c.DataTypeMap,DebertaForMaskedLM:()=>n.DebertaForMaskedLM,DebertaForQuestionAnswering:()=>n.DebertaForQuestionAnswering,DebertaForSequenceClassification:()=>n.DebertaForSequenceClassification,DebertaForTokenClassification:()=>n.DebertaForTokenClassification,DebertaModel:()=>n.DebertaModel,DebertaPreTrainedModel:()=>n.DebertaPreTrainedModel,DebertaTokenizer:()=>r.DebertaTokenizer,DebertaV2ForMaskedLM:()=>n.DebertaV2ForMaskedLM,DebertaV2ForQuestionAnswering:()=>n.DebertaV2ForQuestionAnswering,DebertaV2ForSequenceClassification:()=>n.DebertaV2ForSequenceClassification,DebertaV2ForTokenClassification:()=>n.DebertaV2ForTokenClassification,DebertaV2Model:()=>n.DebertaV2Model,DebertaV2PreTrainedModel:()=>n.DebertaV2PreTrainedModel,DebertaV2Tokenizer:()=>r.DebertaV2Tokenizer,DecisionTransformerModel:()=>n.DecisionTransformerModel,DecisionTransformerPreTrainedModel:()=>n.DecisionTransformerPreTrainedModel,DeiTFeatureExtractor:()=>m.DeiTFeatureExtractor,DeiTForImageClassification:()=>n.DeiTForImageClassification,DeiTImageProcessor:()=>m.DeiTImageProcessor,DeiTModel:()=>n.DeiTModel,DeiTPreTrainedModel:()=>n.DeiTPreTrainedModel,DepthAnythingForDepthEstimation:()=>n.DepthAnythingForDepthEstimation,DepthAnythingPreTrainedModel:()=>n.DepthAnythingPreTrainedModel,DepthEstimationPipeline:()=>t.DepthEstimationPipeline,DepthProForDepthEstimation:()=>n.DepthProForDepthEstimation,DepthProPreTrainedModel:()=>n.DepthProPreTrainedModel,DetrFeatureExtractor:()=>m.DetrFeatureExtractor,DetrForObjectDetection:()=>n.DetrForObjectDetection,DetrForSegmentation:()=>n.DetrForSegmentation,DetrImageProcessor:()=>m.DetrImageProcessor,DetrModel:()=>n.DetrModel,DetrObjectDetectionOutput:()=>n.DetrObjectDetectionOutput,DetrPreTrainedModel:()=>n.DetrPreTrainedModel,DetrSegmentationOutput:()=>n.DetrSegmentationOutput,Dinov2ForImageClassification:()=>n.Dinov2ForImageClassification,Dinov2Model:()=>n.Dinov2Model,Dinov2PreTrainedModel:()=>n.Dinov2PreTrainedModel,Dinov2WithRegistersForImageClassification:()=>n.Dinov2WithRegistersForImageClassification,Dinov2WithRegistersModel:()=>n.Dinov2WithRegistersModel,Dinov2WithRegistersPreTrainedModel:()=>n.Dinov2WithRegistersPreTrainedModel,DistilBertForMaskedLM:()=>n.DistilBertForMaskedLM,DistilBertForQuestionAnswering:()=>n.DistilBertForQuestionAnswering,DistilBertForSequenceClassification:()=>n.DistilBertForSequenceClassification,DistilBertForTokenClassification:()=>n.DistilBertForTokenClassification,DistilBertModel:()=>n.DistilBertModel,DistilBertPreTrainedModel:()=>n.DistilBertPreTrainedModel,DistilBertTokenizer:()=>r.DistilBertTokenizer,DocumentQuestionAnsweringPipeline:()=>t.DocumentQuestionAnsweringPipeline,DonutFeatureExtractor:()=>m.DonutFeatureExtractor,DonutImageProcessor:()=>m.DonutImageProcessor,DonutSwinModel:()=>n.DonutSwinModel,DonutSwinPreTrainedModel:()=>n.DonutSwinPreTrainedModel,EfficientNetForImageClassification:()=>n.EfficientNetForImageClassification,EfficientNetImageProcessor:()=>m.EfficientNetImageProcessor,EfficientNetModel:()=>n.EfficientNetModel,EfficientNetPreTrainedModel:()=>n.EfficientNetPreTrainedModel,ElectraForMaskedLM:()=>n.ElectraForMaskedLM,ElectraForQuestionAnswering:()=>n.ElectraForQuestionAnswering,ElectraForSequenceClassification:()=>n.ElectraForSequenceClassification,ElectraForTokenClassification:()=>n.ElectraForTokenClassification,ElectraModel:()=>n.ElectraModel,ElectraPreTrainedModel:()=>n.ElectraPreTrainedModel,ElectraTokenizer:()=>r.ElectraTokenizer,EncodecFeatureExtractor:()=>d.EncodecFeatureExtractor,EosTokenCriteria:()=>b.EosTokenCriteria,EsmForMaskedLM:()=>n.EsmForMaskedLM,EsmForSequenceClassification:()=>n.EsmForSequenceClassification,EsmForTokenClassification:()=>n.EsmForTokenClassification,EsmModel:()=>n.EsmModel,EsmPreTrainedModel:()=>n.EsmPreTrainedModel,EsmTokenizer:()=>r.EsmTokenizer,ExaoneForCausalLM:()=>n.ExaoneForCausalLM,ExaoneModel:()=>n.ExaoneModel,ExaonePreTrainedModel:()=>n.ExaonePreTrainedModel,FFT:()=>l.FFT,FalconForCausalLM:()=>n.FalconForCausalLM,FalconModel:()=>n.FalconModel,FalconPreTrainedModel:()=>n.FalconPreTrainedModel,FalconTokenizer:()=>r.FalconTokenizer,FastViTForImageClassification:()=>n.FastViTForImageClassification,FastViTModel:()=>n.FastViTModel,FastViTPreTrainedModel:()=>n.FastViTPreTrainedModel,FeatureExtractionPipeline:()=>t.FeatureExtractionPipeline,FeatureExtractor:()=>u.FeatureExtractor,FillMaskPipeline:()=>t.FillMaskPipeline,Florence2ForConditionalGeneration:()=>n.Florence2ForConditionalGeneration,Florence2PreTrainedModel:()=>n.Florence2PreTrainedModel,Florence2Processor:()=>_.Florence2Processor,ForcedBOSTokenLogitsProcessor:()=>x.ForcedBOSTokenLogitsProcessor,ForcedEOSTokenLogitsProcessor:()=>x.ForcedEOSTokenLogitsProcessor,GLPNFeatureExtractor:()=>m.GLPNFeatureExtractor,GLPNForDepthEstimation:()=>n.GLPNForDepthEstimation,GLPNModel:()=>n.GLPNModel,GLPNPreTrainedModel:()=>n.GLPNPreTrainedModel,GPT2LMHeadModel:()=>n.GPT2LMHeadModel,GPT2Model:()=>n.GPT2Model,GPT2PreTrainedModel:()=>n.GPT2PreTrainedModel,GPT2Tokenizer:()=>r.GPT2Tokenizer,GPTBigCodeForCausalLM:()=>n.GPTBigCodeForCausalLM,GPTBigCodeModel:()=>n.GPTBigCodeModel,GPTBigCodePreTrainedModel:()=>n.GPTBigCodePreTrainedModel,GPTJForCausalLM:()=>n.GPTJForCausalLM,GPTJModel:()=>n.GPTJModel,GPTJPreTrainedModel:()=>n.GPTJPreTrainedModel,GPTNeoForCausalLM:()=>n.GPTNeoForCausalLM,GPTNeoModel:()=>n.GPTNeoModel,GPTNeoPreTrainedModel:()=>n.GPTNeoPreTrainedModel,GPTNeoXForCausalLM:()=>n.GPTNeoXForCausalLM,GPTNeoXModel:()=>n.GPTNeoXModel,GPTNeoXPreTrainedModel:()=>n.GPTNeoXPreTrainedModel,GPTNeoXTokenizer:()=>r.GPTNeoXTokenizer,Gemma2ForCausalLM:()=>n.Gemma2ForCausalLM,Gemma2Model:()=>n.Gemma2Model,Gemma2PreTrainedModel:()=>n.Gemma2PreTrainedModel,Gemma3ForCausalLM:()=>n.Gemma3ForCausalLM,Gemma3Model:()=>n.Gemma3Model,Gemma3PreTrainedModel:()=>n.Gemma3PreTrainedModel,Gemma3nAudioFeatureExtractor:()=>d.Gemma3nAudioFeatureExtractor,Gemma3nForConditionalGeneration:()=>n.Gemma3nForConditionalGeneration,Gemma3nPreTrainedModel:()=>n.Gemma3nPreTrainedModel,Gemma3nProcessor:()=>_.Gemma3nProcessor,GemmaForCausalLM:()=>n.GemmaForCausalLM,GemmaModel:()=>n.GemmaModel,GemmaPreTrainedModel:()=>n.GemmaPreTrainedModel,GemmaTokenizer:()=>r.GemmaTokenizer,GlmForCausalLM:()=>n.GlmForCausalLM,GlmModel:()=>n.GlmModel,GlmPreTrainedModel:()=>n.GlmPreTrainedModel,GraniteForCausalLM:()=>n.GraniteForCausalLM,GraniteModel:()=>n.GraniteModel,GranitePreTrainedModel:()=>n.GranitePreTrainedModel,Grok1Tokenizer:()=>r.Grok1Tokenizer,GroundingDinoForObjectDetection:()=>n.GroundingDinoForObjectDetection,GroundingDinoImageProcessor:()=>m.GroundingDinoImageProcessor,GroundingDinoPreTrainedModel:()=>n.GroundingDinoPreTrainedModel,GroundingDinoProcessor:()=>_.GroundingDinoProcessor,GroupViTModel:()=>n.GroupViTModel,GroupViTPreTrainedModel:()=>n.GroupViTPreTrainedModel,HeliumForCausalLM:()=>n.HeliumForCausalLM,HeliumModel:()=>n.HeliumModel,HeliumPreTrainedModel:()=>n.HeliumPreTrainedModel,HerbertTokenizer:()=>r.HerbertTokenizer,HieraForImageClassification:()=>n.HieraForImageClassification,HieraModel:()=>n.HieraModel,HieraPreTrainedModel:()=>n.HieraPreTrainedModel,HubertForCTC:()=>n.HubertForCTC,HubertForSequenceClassification:()=>n.HubertForSequenceClassification,HubertModel:()=>n.HubertModel,HubertPreTrainedModel:()=>n.HubertPreTrainedModel,IJepaForImageClassification:()=>n.IJepaForImageClassification,IJepaModel:()=>n.IJepaModel,IJepaPreTrainedModel:()=>n.IJepaPreTrainedModel,Idefics3ForConditionalGeneration:()=>n.Idefics3ForConditionalGeneration,Idefics3ImageProcessor:()=>m.Idefics3ImageProcessor,Idefics3PreTrainedModel:()=>n.Idefics3PreTrainedModel,Idefics3Processor:()=>_.Idefics3Processor,ImageClassificationPipeline:()=>t.ImageClassificationPipeline,ImageFeatureExtractionPipeline:()=>t.ImageFeatureExtractionPipeline,ImageFeatureExtractor:()=>d.ImageFeatureExtractor,ImageMattingOutput:()=>n.ImageMattingOutput,ImageProcessor:()=>p.ImageProcessor,ImageSegmentationPipeline:()=>t.ImageSegmentationPipeline,ImageToImagePipeline:()=>t.ImageToImagePipeline,ImageToTextPipeline:()=>t.ImageToTextPipeline,InterruptableStoppingCriteria:()=>b.InterruptableStoppingCriteria,JAISLMHeadModel:()=>n.JAISLMHeadModel,JAISModel:()=>n.JAISModel,JAISPreTrainedModel:()=>n.JAISPreTrainedModel,JinaCLIPImageProcessor:()=>m.JinaCLIPImageProcessor,JinaCLIPModel:()=>n.JinaCLIPModel,JinaCLIPPreTrainedModel:()=>n.JinaCLIPPreTrainedModel,JinaCLIPProcessor:()=>_.JinaCLIPProcessor,JinaCLIPTextModel:()=>n.JinaCLIPTextModel,JinaCLIPVisionModel:()=>n.JinaCLIPVisionModel,LiteWhisperForConditionalGeneration:()=>n.LiteWhisperForConditionalGeneration,LlamaForCausalLM:()=>n.LlamaForCausalLM,LlamaModel:()=>n.LlamaModel,LlamaPreTrainedModel:()=>n.LlamaPreTrainedModel,LlamaTokenizer:()=>r.LlamaTokenizer,LlavaForConditionalGeneration:()=>n.LlavaForConditionalGeneration,LlavaOnevisionForConditionalGeneration:()=>n.LlavaOnevisionForConditionalGeneration,LlavaOnevisionImageProcessor:()=>m.LlavaOnevisionImageProcessor,LlavaPreTrainedModel:()=>n.LlavaPreTrainedModel,LlavaProcessor:()=>_.LlavaProcessor,LlavaQwen2ForCausalLM:()=>n.LlavaQwen2ForCausalLM,LogitsProcessor:()=>x.LogitsProcessor,LogitsProcessorList:()=>x.LogitsProcessorList,LogitsWarper:()=>x.LogitsWarper,LongT5ForConditionalGeneration:()=>n.LongT5ForConditionalGeneration,LongT5Model:()=>n.LongT5Model,LongT5PreTrainedModel:()=>n.LongT5PreTrainedModel,M2M100ForConditionalGeneration:()=>n.M2M100ForConditionalGeneration,M2M100Model:()=>n.M2M100Model,M2M100PreTrainedModel:()=>n.M2M100PreTrainedModel,M2M100Tokenizer:()=>r.M2M100Tokenizer,MBart50Tokenizer:()=>r.MBart50Tokenizer,MBartForCausalLM:()=>n.MBartForCausalLM,MBartForConditionalGeneration:()=>n.MBartForConditionalGeneration,MBartForSequenceClassification:()=>n.MBartForSequenceClassification,MBartModel:()=>n.MBartModel,MBartPreTrainedModel:()=>n.MBartPreTrainedModel,MBartTokenizer:()=>r.MBartTokenizer,MPNetForMaskedLM:()=>n.MPNetForMaskedLM,MPNetForQuestionAnswering:()=>n.MPNetForQuestionAnswering,MPNetForSequenceClassification:()=>n.MPNetForSequenceClassification,MPNetForTokenClassification:()=>n.MPNetForTokenClassification,MPNetModel:()=>n.MPNetModel,MPNetPreTrainedModel:()=>n.MPNetPreTrainedModel,MPNetTokenizer:()=>r.MPNetTokenizer,MT5ForConditionalGeneration:()=>n.MT5ForConditionalGeneration,MT5Model:()=>n.MT5Model,MT5PreTrainedModel:()=>n.MT5PreTrainedModel,MarianMTModel:()=>n.MarianMTModel,MarianModel:()=>n.MarianModel,MarianPreTrainedModel:()=>n.MarianPreTrainedModel,MarianTokenizer:()=>r.MarianTokenizer,Mask2FormerImageProcessor:()=>m.Mask2FormerImageProcessor,MaskFormerFeatureExtractor:()=>m.MaskFormerFeatureExtractor,MaskFormerForInstanceSegmentation:()=>n.MaskFormerForInstanceSegmentation,MaskFormerImageProcessor:()=>m.MaskFormerImageProcessor,MaskFormerModel:()=>n.MaskFormerModel,MaskFormerPreTrainedModel:()=>n.MaskFormerPreTrainedModel,MaskedLMOutput:()=>n.MaskedLMOutput,MaxLengthCriteria:()=>b.MaxLengthCriteria,Metric3DForDepthEstimation:()=>n.Metric3DForDepthEstimation,Metric3DPreTrainedModel:()=>n.Metric3DPreTrainedModel,Metric3Dv2ForDepthEstimation:()=>n.Metric3Dv2ForDepthEstimation,Metric3Dv2PreTrainedModel:()=>n.Metric3Dv2PreTrainedModel,MgpstrForSceneTextRecognition:()=>n.MgpstrForSceneTextRecognition,MgpstrModelOutput:()=>n.MgpstrModelOutput,MgpstrPreTrainedModel:()=>n.MgpstrPreTrainedModel,MgpstrProcessor:()=>_.MgpstrProcessor,MgpstrTokenizer:()=>r.MgpstrTokenizer,MimiDecoderModel:()=>n.MimiDecoderModel,MimiDecoderOutput:()=>n.MimiDecoderOutput,MimiEncoderModel:()=>n.MimiEncoderModel,MimiEncoderOutput:()=>n.MimiEncoderOutput,MimiModel:()=>n.MimiModel,MimiPreTrainedModel:()=>n.MimiPreTrainedModel,MinLengthLogitsProcessor:()=>x.MinLengthLogitsProcessor,MinNewTokensLengthLogitsProcessor:()=>x.MinNewTokensLengthLogitsProcessor,MistralForCausalLM:()=>n.MistralForCausalLM,MistralModel:()=>n.MistralModel,MistralPreTrainedModel:()=>n.MistralPreTrainedModel,MobileBertForMaskedLM:()=>n.MobileBertForMaskedLM,MobileBertForQuestionAnswering:()=>n.MobileBertForQuestionAnswering,MobileBertForSequenceClassification:()=>n.MobileBertForSequenceClassification,MobileBertModel:()=>n.MobileBertModel,MobileBertPreTrainedModel:()=>n.MobileBertPreTrainedModel,MobileBertTokenizer:()=>r.MobileBertTokenizer,MobileLLMForCausalLM:()=>n.MobileLLMForCausalLM,MobileLLMModel:()=>n.MobileLLMModel,MobileLLMPreTrainedModel:()=>n.MobileLLMPreTrainedModel,MobileNetV1FeatureExtractor:()=>m.MobileNetV1FeatureExtractor,MobileNetV1ForImageClassification:()=>n.MobileNetV1ForImageClassification,MobileNetV1ForSemanticSegmentation:()=>n.MobileNetV1ForSemanticSegmentation,MobileNetV1ImageProcessor:()=>m.MobileNetV1ImageProcessor,MobileNetV1Model:()=>n.MobileNetV1Model,MobileNetV1PreTrainedModel:()=>n.MobileNetV1PreTrainedModel,MobileNetV2FeatureExtractor:()=>m.MobileNetV2FeatureExtractor,MobileNetV2ForImageClassification:()=>n.MobileNetV2ForImageClassification,MobileNetV2ForSemanticSegmentation:()=>n.MobileNetV2ForSemanticSegmentation,MobileNetV2ImageProcessor:()=>m.MobileNetV2ImageProcessor,MobileNetV2Model:()=>n.MobileNetV2Model,MobileNetV2PreTrainedModel:()=>n.MobileNetV2PreTrainedModel,MobileNetV3FeatureExtractor:()=>m.MobileNetV3FeatureExtractor,MobileNetV3ForImageClassification:()=>n.MobileNetV3ForImageClassification,MobileNetV3ForSemanticSegmentation:()=>n.MobileNetV3ForSemanticSegmentation,MobileNetV3ImageProcessor:()=>m.MobileNetV3ImageProcessor,MobileNetV3Model:()=>n.MobileNetV3Model,MobileNetV3PreTrainedModel:()=>n.MobileNetV3PreTrainedModel,MobileNetV4FeatureExtractor:()=>m.MobileNetV4FeatureExtractor,MobileNetV4ForImageClassification:()=>n.MobileNetV4ForImageClassification,MobileNetV4ForSemanticSegmentation:()=>n.MobileNetV4ForSemanticSegmentation,MobileNetV4ImageProcessor:()=>m.MobileNetV4ImageProcessor,MobileNetV4Model:()=>n.MobileNetV4Model,MobileNetV4PreTrainedModel:()=>n.MobileNetV4PreTrainedModel,MobileViTFeatureExtractor:()=>m.MobileViTFeatureExtractor,MobileViTForImageClassification:()=>n.MobileViTForImageClassification,MobileViTImageProcessor:()=>m.MobileViTImageProcessor,MobileViTModel:()=>n.MobileViTModel,MobileViTPreTrainedModel:()=>n.MobileViTPreTrainedModel,MobileViTV2ForImageClassification:()=>n.MobileViTV2ForImageClassification,MobileViTV2Model:()=>n.MobileViTV2Model,MobileViTV2PreTrainedModel:()=>n.MobileViTV2PreTrainedModel,ModelOutput:()=>n.ModelOutput,ModernBertForMaskedLM:()=>n.ModernBertForMaskedLM,ModernBertForSequenceClassification:()=>n.ModernBertForSequenceClassification,ModernBertForTokenClassification:()=>n.ModernBertForTokenClassification,ModernBertModel:()=>n.ModernBertModel,ModernBertPreTrainedModel:()=>n.ModernBertPreTrainedModel,Moondream1ForConditionalGeneration:()=>n.Moondream1ForConditionalGeneration,MoonshineFeatureExtractor:()=>d.MoonshineFeatureExtractor,MoonshineForConditionalGeneration:()=>n.MoonshineForConditionalGeneration,MoonshineModel:()=>n.MoonshineModel,MoonshinePreTrainedModel:()=>n.MoonshinePreTrainedModel,MoonshineProcessor:()=>_.MoonshineProcessor,MptForCausalLM:()=>n.MptForCausalLM,MptModel:()=>n.MptModel,MptPreTrainedModel:()=>n.MptPreTrainedModel,MultiModalityCausalLM:()=>n.MultiModalityCausalLM,MultiModalityPreTrainedModel:()=>n.MultiModalityPreTrainedModel,MusicgenForCausalLM:()=>n.MusicgenForCausalLM,MusicgenForConditionalGeneration:()=>n.MusicgenForConditionalGeneration,MusicgenModel:()=>n.MusicgenModel,MusicgenPreTrainedModel:()=>n.MusicgenPreTrainedModel,NeoBertForMaskedLM:()=>n.NeoBertForMaskedLM,NeoBertForQuestionAnswering:()=>n.NeoBertForQuestionAnswering,NeoBertForSequenceClassification:()=>n.NeoBertForSequenceClassification,NeoBertForTokenClassification:()=>n.NeoBertForTokenClassification,NeoBertModel:()=>n.NeoBertModel,NeoBertPreTrainedModel:()=>n.NeoBertPreTrainedModel,NllbTokenizer:()=>r.NllbTokenizer,NoBadWordsLogitsProcessor:()=>x.NoBadWordsLogitsProcessor,NoRepeatNGramLogitsProcessor:()=>x.NoRepeatNGramLogitsProcessor,NomicBertModel:()=>n.NomicBertModel,NomicBertPreTrainedModel:()=>n.NomicBertPreTrainedModel,NougatImageProcessor:()=>m.NougatImageProcessor,NougatTokenizer:()=>r.NougatTokenizer,OPTForCausalLM:()=>n.OPTForCausalLM,OPTModel:()=>n.OPTModel,OPTPreTrainedModel:()=>n.OPTPreTrainedModel,ObjectDetectionPipeline:()=>t.ObjectDetectionPipeline,Olmo2ForCausalLM:()=>n.Olmo2ForCausalLM,Olmo2Model:()=>n.Olmo2Model,Olmo2PreTrainedModel:()=>n.Olmo2PreTrainedModel,OlmoForCausalLM:()=>n.OlmoForCausalLM,OlmoModel:()=>n.OlmoModel,OlmoPreTrainedModel:()=>n.OlmoPreTrainedModel,OpenELMForCausalLM:()=>n.OpenELMForCausalLM,OpenELMModel:()=>n.OpenELMModel,OpenELMPreTrainedModel:()=>n.OpenELMPreTrainedModel,OwlViTFeatureExtractor:()=>m.OwlViTFeatureExtractor,OwlViTForObjectDetection:()=>n.OwlViTForObjectDetection,OwlViTImageProcessor:()=>m.OwlViTImageProcessor,OwlViTModel:()=>n.OwlViTModel,OwlViTPreTrainedModel:()=>n.OwlViTPreTrainedModel,OwlViTProcessor:()=>_.OwlViTProcessor,Owlv2ForObjectDetection:()=>n.Owlv2ForObjectDetection,Owlv2ImageProcessor:()=>m.Owlv2ImageProcessor,Owlv2Model:()=>n.Owlv2Model,Owlv2PreTrainedModel:()=>n.Owlv2PreTrainedModel,PaliGemmaForConditionalGeneration:()=>n.PaliGemmaForConditionalGeneration,PaliGemmaPreTrainedModel:()=>n.PaliGemmaPreTrainedModel,PaliGemmaProcessor:()=>_.PaliGemmaProcessor,PatchTSMixerForPrediction:()=>n.PatchTSMixerForPrediction,PatchTSMixerModel:()=>n.PatchTSMixerModel,PatchTSMixerPreTrainedModel:()=>n.PatchTSMixerPreTrainedModel,PatchTSTForPrediction:()=>n.PatchTSTForPrediction,PatchTSTModel:()=>n.PatchTSTModel,PatchTSTPreTrainedModel:()=>n.PatchTSTPreTrainedModel,Phi3ForCausalLM:()=>n.Phi3ForCausalLM,Phi3Model:()=>n.Phi3Model,Phi3PreTrainedModel:()=>n.Phi3PreTrainedModel,Phi3VForCausalLM:()=>n.Phi3VForCausalLM,Phi3VImageProcessor:()=>m.Phi3VImageProcessor,Phi3VPreTrainedModel:()=>n.Phi3VPreTrainedModel,Phi3VProcessor:()=>_.Phi3VProcessor,PhiForCausalLM:()=>n.PhiForCausalLM,PhiModel:()=>n.PhiModel,PhiPreTrainedModel:()=>n.PhiPreTrainedModel,Pipeline:()=>t.Pipeline,PreTrainedModel:()=>n.PreTrainedModel,PreTrainedTokenizer:()=>r.PreTrainedTokenizer,PretrainedConfig:()=>i.PretrainedConfig,PretrainedMixin:()=>n.PretrainedMixin,Processor:()=>g.Processor,PvtForImageClassification:()=>n.PvtForImageClassification,PvtImageProcessor:()=>m.PvtImageProcessor,PvtModel:()=>n.PvtModel,PvtPreTrainedModel:()=>n.PvtPreTrainedModel,PyAnnoteFeatureExtractor:()=>d.PyAnnoteFeatureExtractor,PyAnnoteForAudioFrameClassification:()=>n.PyAnnoteForAudioFrameClassification,PyAnnoteModel:()=>n.PyAnnoteModel,PyAnnotePreTrainedModel:()=>n.PyAnnotePreTrainedModel,PyAnnoteProcessor:()=>_.PyAnnoteProcessor,QuestionAnsweringModelOutput:()=>n.QuestionAnsweringModelOutput,QuestionAnsweringPipeline:()=>t.QuestionAnsweringPipeline,Qwen2ForCausalLM:()=>n.Qwen2ForCausalLM,Qwen2Model:()=>n.Qwen2Model,Qwen2PreTrainedModel:()=>n.Qwen2PreTrainedModel,Qwen2Tokenizer:()=>r.Qwen2Tokenizer,Qwen2VLForConditionalGeneration:()=>n.Qwen2VLForConditionalGeneration,Qwen2VLImageProcessor:()=>m.Qwen2VLImageProcessor,Qwen2VLPreTrainedModel:()=>n.Qwen2VLPreTrainedModel,Qwen2VLProcessor:()=>_.Qwen2VLProcessor,Qwen3ForCausalLM:()=>n.Qwen3ForCausalLM,Qwen3Model:()=>n.Qwen3Model,Qwen3PreTrainedModel:()=>n.Qwen3PreTrainedModel,RFDetrForObjectDetection:()=>n.RFDetrForObjectDetection,RFDetrModel:()=>n.RFDetrModel,RFDetrObjectDetectionOutput:()=>n.RFDetrObjectDetectionOutput,RFDetrPreTrainedModel:()=>n.RFDetrPreTrainedModel,RTDetrForObjectDetection:()=>n.RTDetrForObjectDetection,RTDetrImageProcessor:()=>m.RTDetrImageProcessor,RTDetrModel:()=>n.RTDetrModel,RTDetrObjectDetectionOutput:()=>n.RTDetrObjectDetectionOutput,RTDetrPreTrainedModel:()=>n.RTDetrPreTrainedModel,RTDetrV2ForObjectDetection:()=>n.RTDetrV2ForObjectDetection,RTDetrV2Model:()=>n.RTDetrV2Model,RTDetrV2ObjectDetectionOutput:()=>n.RTDetrV2ObjectDetectionOutput,RTDetrV2PreTrainedModel:()=>n.RTDetrV2PreTrainedModel,RawAudio:()=>a.RawAudio,RawImage:()=>o.RawImage,RawVideo:()=>s.RawVideo,RawVideoFrame:()=>s.RawVideoFrame,RepetitionPenaltyLogitsProcessor:()=>x.RepetitionPenaltyLogitsProcessor,ResNetForImageClassification:()=>n.ResNetForImageClassification,ResNetModel:()=>n.ResNetModel,ResNetPreTrainedModel:()=>n.ResNetPreTrainedModel,RoFormerForMaskedLM:()=>n.RoFormerForMaskedLM,RoFormerForQuestionAnswering:()=>n.RoFormerForQuestionAnswering,RoFormerForSequenceClassification:()=>n.RoFormerForSequenceClassification,RoFormerForTokenClassification:()=>n.RoFormerForTokenClassification,RoFormerModel:()=>n.RoFormerModel,RoFormerPreTrainedModel:()=>n.RoFormerPreTrainedModel,RoFormerTokenizer:()=>r.RoFormerTokenizer,RobertaForMaskedLM:()=>n.RobertaForMaskedLM,RobertaForQuestionAnswering:()=>n.RobertaForQuestionAnswering,RobertaForSequenceClassification:()=>n.RobertaForSequenceClassification,RobertaForTokenClassification:()=>n.RobertaForTokenClassification,RobertaModel:()=>n.RobertaModel,RobertaPreTrainedModel:()=>n.RobertaPreTrainedModel,RobertaTokenizer:()=>r.RobertaTokenizer,SamImageProcessor:()=>m.SamImageProcessor,SamImageSegmentationOutput:()=>n.SamImageSegmentationOutput,SamModel:()=>n.SamModel,SamPreTrainedModel:()=>n.SamPreTrainedModel,SamProcessor:()=>_.SamProcessor,SapiensForDepthEstimation:()=>n.SapiensForDepthEstimation,SapiensForNormalEstimation:()=>n.SapiensForNormalEstimation,SapiensForSemanticSegmentation:()=>n.SapiensForSemanticSegmentation,SapiensPreTrainedModel:()=>n.SapiensPreTrainedModel,SeamlessM4TFeatureExtractor:()=>d.SeamlessM4TFeatureExtractor,SegformerFeatureExtractor:()=>m.SegformerFeatureExtractor,SegformerForImageClassification:()=>n.SegformerForImageClassification,SegformerForSemanticSegmentation:()=>n.SegformerForSemanticSegmentation,SegformerImageProcessor:()=>m.SegformerImageProcessor,SegformerModel:()=>n.SegformerModel,SegformerPreTrainedModel:()=>n.SegformerPreTrainedModel,Seq2SeqLMOutput:()=>n.Seq2SeqLMOutput,SequenceClassifierOutput:()=>n.SequenceClassifierOutput,SiglipImageProcessor:()=>m.SiglipImageProcessor,SiglipModel:()=>n.SiglipModel,SiglipPreTrainedModel:()=>n.SiglipPreTrainedModel,SiglipTextModel:()=>n.SiglipTextModel,SiglipTokenizer:()=>r.SiglipTokenizer,SiglipVisionModel:()=>n.SiglipVisionModel,SmolVLMForConditionalGeneration:()=>n.SmolVLMForConditionalGeneration,SmolVLMImageProcessor:()=>m.SmolVLMImageProcessor,SmolVLMProcessor:()=>_.SmolVLMProcessor,SnacDecoderModel:()=>n.SnacDecoderModel,SnacEncoderModel:()=>n.SnacEncoderModel,SnacFeatureExtractor:()=>d.SnacFeatureExtractor,SnacModel:()=>n.SnacModel,SnacPreTrainedModel:()=>n.SnacPreTrainedModel,SpeechT5FeatureExtractor:()=>d.SpeechT5FeatureExtractor,SpeechT5ForSpeechToText:()=>n.SpeechT5ForSpeechToText,SpeechT5ForTextToSpeech:()=>n.SpeechT5ForTextToSpeech,SpeechT5HifiGan:()=>n.SpeechT5HifiGan,SpeechT5Model:()=>n.SpeechT5Model,SpeechT5PreTrainedModel:()=>n.SpeechT5PreTrainedModel,SpeechT5Processor:()=>_.SpeechT5Processor,SpeechT5Tokenizer:()=>r.SpeechT5Tokenizer,SqueezeBertForMaskedLM:()=>n.SqueezeBertForMaskedLM,SqueezeBertForQuestionAnswering:()=>n.SqueezeBertForQuestionAnswering,SqueezeBertForSequenceClassification:()=>n.SqueezeBertForSequenceClassification,SqueezeBertModel:()=>n.SqueezeBertModel,SqueezeBertPreTrainedModel:()=>n.SqueezeBertPreTrainedModel,SqueezeBertTokenizer:()=>r.SqueezeBertTokenizer,StableLmForCausalLM:()=>n.StableLmForCausalLM,StableLmModel:()=>n.StableLmModel,StableLmPreTrainedModel:()=>n.StableLmPreTrainedModel,Starcoder2ForCausalLM:()=>n.Starcoder2ForCausalLM,Starcoder2Model:()=>n.Starcoder2Model,Starcoder2PreTrainedModel:()=>n.Starcoder2PreTrainedModel,StoppingCriteria:()=>b.StoppingCriteria,StoppingCriteriaList:()=>b.StoppingCriteriaList,StyleTextToSpeech2Model:()=>n.StyleTextToSpeech2Model,StyleTextToSpeech2PreTrainedModel:()=>n.StyleTextToSpeech2PreTrainedModel,SummarizationPipeline:()=>t.SummarizationPipeline,SuppressTokensAtBeginLogitsProcessor:()=>x.SuppressTokensAtBeginLogitsProcessor,Swin2SRForImageSuperResolution:()=>n.Swin2SRForImageSuperResolution,Swin2SRImageProcessor:()=>m.Swin2SRImageProcessor,Swin2SRModel:()=>n.Swin2SRModel,Swin2SRPreTrainedModel:()=>n.Swin2SRPreTrainedModel,SwinForImageClassification:()=>n.SwinForImageClassification,SwinForSemanticSegmentation:()=>n.SwinForSemanticSegmentation,SwinModel:()=>n.SwinModel,SwinPreTrainedModel:()=>n.SwinPreTrainedModel,T5ForConditionalGeneration:()=>n.T5ForConditionalGeneration,T5Model:()=>n.T5Model,T5PreTrainedModel:()=>n.T5PreTrainedModel,T5Tokenizer:()=>r.T5Tokenizer,TableTransformerForObjectDetection:()=>n.TableTransformerForObjectDetection,TableTransformerModel:()=>n.TableTransformerModel,TableTransformerObjectDetectionOutput:()=>n.TableTransformerObjectDetectionOutput,TableTransformerPreTrainedModel:()=>n.TableTransformerPreTrainedModel,TemperatureLogitsWarper:()=>x.TemperatureLogitsWarper,Tensor:()=>c.Tensor,Text2TextGenerationPipeline:()=>t.Text2TextGenerationPipeline,TextClassificationPipeline:()=>t.TextClassificationPipeline,TextGenerationPipeline:()=>t.TextGenerationPipeline,TextStreamer:()=>y.TextStreamer,TextToAudioPipeline:()=>t.TextToAudioPipeline,TokenClassificationPipeline:()=>t.TokenClassificationPipeline,TokenClassifierOutput:()=>n.TokenClassifierOutput,TokenizerModel:()=>r.TokenizerModel,TopKLogitsWarper:()=>x.TopKLogitsWarper,TopPLogitsWarper:()=>x.TopPLogitsWarper,TrOCRForCausalLM:()=>n.TrOCRForCausalLM,TrOCRPreTrainedModel:()=>n.TrOCRPreTrainedModel,TranslationPipeline:()=>t.TranslationPipeline,UltravoxModel:()=>n.UltravoxModel,UltravoxPreTrainedModel:()=>n.UltravoxPreTrainedModel,UltravoxProcessor:()=>_.UltravoxProcessor,UniSpeechForCTC:()=>n.UniSpeechForCTC,UniSpeechForSequenceClassification:()=>n.UniSpeechForSequenceClassification,UniSpeechModel:()=>n.UniSpeechModel,UniSpeechPreTrainedModel:()=>n.UniSpeechPreTrainedModel,UniSpeechSatForAudioFrameClassification:()=>n.UniSpeechSatForAudioFrameClassification,UniSpeechSatForCTC:()=>n.UniSpeechSatForCTC,UniSpeechSatForSequenceClassification:()=>n.UniSpeechSatForSequenceClassification,UniSpeechSatModel:()=>n.UniSpeechSatModel,UniSpeechSatPreTrainedModel:()=>n.UniSpeechSatPreTrainedModel,VLChatProcessor:()=>_.VLChatProcessor,VLMImageProcessor:()=>m.VLMImageProcessor,ViTFeatureExtractor:()=>m.ViTFeatureExtractor,ViTForImageClassification:()=>n.ViTForImageClassification,ViTImageProcessor:()=>m.ViTImageProcessor,ViTMAEModel:()=>n.ViTMAEModel,ViTMAEPreTrainedModel:()=>n.ViTMAEPreTrainedModel,ViTMSNForImageClassification:()=>n.ViTMSNForImageClassification,ViTMSNModel:()=>n.ViTMSNModel,ViTMSNPreTrainedModel:()=>n.ViTMSNPreTrainedModel,ViTModel:()=>n.ViTModel,ViTPreTrainedModel:()=>n.ViTPreTrainedModel,VisionEncoderDecoderModel:()=>n.VisionEncoderDecoderModel,VitMatteForImageMatting:()=>n.VitMatteForImageMatting,VitMatteImageProcessor:()=>m.VitMatteImageProcessor,VitMattePreTrainedModel:()=>n.VitMattePreTrainedModel,VitPoseForPoseEstimation:()=>n.VitPoseForPoseEstimation,VitPoseImageProcessor:()=>m.VitPoseImageProcessor,VitPosePreTrainedModel:()=>n.VitPosePreTrainedModel,VitsModel:()=>n.VitsModel,VitsModelOutput:()=>n.VitsModelOutput,VitsPreTrainedModel:()=>n.VitsPreTrainedModel,VitsTokenizer:()=>r.VitsTokenizer,Wav2Vec2BertForCTC:()=>n.Wav2Vec2BertForCTC,Wav2Vec2BertForSequenceClassification:()=>n.Wav2Vec2BertForSequenceClassification,Wav2Vec2BertModel:()=>n.Wav2Vec2BertModel,Wav2Vec2BertPreTrainedModel:()=>n.Wav2Vec2BertPreTrainedModel,Wav2Vec2CTCTokenizer:()=>r.Wav2Vec2CTCTokenizer,Wav2Vec2FeatureExtractor:()=>d.Wav2Vec2FeatureExtractor,Wav2Vec2ForAudioFrameClassification:()=>n.Wav2Vec2ForAudioFrameClassification,Wav2Vec2ForCTC:()=>n.Wav2Vec2ForCTC,Wav2Vec2ForSequenceClassification:()=>n.Wav2Vec2ForSequenceClassification,Wav2Vec2Model:()=>n.Wav2Vec2Model,Wav2Vec2PreTrainedModel:()=>n.Wav2Vec2PreTrainedModel,Wav2Vec2Processor:()=>_.Wav2Vec2Processor,Wav2Vec2ProcessorWithLM:()=>_.Wav2Vec2ProcessorWithLM,WavLMForAudioFrameClassification:()=>n.WavLMForAudioFrameClassification,WavLMForCTC:()=>n.WavLMForCTC,WavLMForSequenceClassification:()=>n.WavLMForSequenceClassification,WavLMForXVector:()=>n.WavLMForXVector,WavLMModel:()=>n.WavLMModel,WavLMPreTrainedModel:()=>n.WavLMPreTrainedModel,WeSpeakerFeatureExtractor:()=>d.WeSpeakerFeatureExtractor,WeSpeakerResNetModel:()=>n.WeSpeakerResNetModel,WeSpeakerResNetPreTrainedModel:()=>n.WeSpeakerResNetPreTrainedModel,WhisperFeatureExtractor:()=>d.WhisperFeatureExtractor,WhisperForConditionalGeneration:()=>n.WhisperForConditionalGeneration,WhisperModel:()=>n.WhisperModel,WhisperPreTrainedModel:()=>n.WhisperPreTrainedModel,WhisperProcessor:()=>_.WhisperProcessor,WhisperTextStreamer:()=>y.WhisperTextStreamer,WhisperTimeStampLogitsProcessor:()=>x.WhisperTimeStampLogitsProcessor,WhisperTokenizer:()=>r.WhisperTokenizer,XLMForQuestionAnswering:()=>n.XLMForQuestionAnswering,XLMForSequenceClassification:()=>n.XLMForSequenceClassification,XLMForTokenClassification:()=>n.XLMForTokenClassification,XLMModel:()=>n.XLMModel,XLMPreTrainedModel:()=>n.XLMPreTrainedModel,XLMRobertaForMaskedLM:()=>n.XLMRobertaForMaskedLM,XLMRobertaForQuestionAnswering:()=>n.XLMRobertaForQuestionAnswering,XLMRobertaForSequenceClassification:()=>n.XLMRobertaForSequenceClassification,XLMRobertaForTokenClassification:()=>n.XLMRobertaForTokenClassification,XLMRobertaModel:()=>n.XLMRobertaModel,XLMRobertaPreTrainedModel:()=>n.XLMRobertaPreTrainedModel,XLMRobertaTokenizer:()=>r.XLMRobertaTokenizer,XLMTokenizer:()=>r.XLMTokenizer,XLMWithLMHeadModel:()=>n.XLMWithLMHeadModel,XVectorOutput:()=>n.XVectorOutput,YolosFeatureExtractor:()=>m.YolosFeatureExtractor,YolosForObjectDetection:()=>n.YolosForObjectDetection,YolosImageProcessor:()=>m.YolosImageProcessor,YolosModel:()=>n.YolosModel,YolosObjectDetectionOutput:()=>n.YolosObjectDetectionOutput,YolosPreTrainedModel:()=>n.YolosPreTrainedModel,ZeroShotAudioClassificationPipeline:()=>t.ZeroShotAudioClassificationPipeline,ZeroShotClassificationPipeline:()=>t.ZeroShotClassificationPipeline,ZeroShotImageClassificationPipeline:()=>t.ZeroShotImageClassificationPipeline,ZeroShotObjectDetectionPipeline:()=>t.ZeroShotObjectDetectionPipeline,bankers_round:()=>l.bankers_round,cat:()=>c.cat,cos_sim:()=>l.cos_sim,dot:()=>l.dot,dynamic_time_warping:()=>l.dynamic_time_warping,env:()=>e.env,full:()=>c.full,full_like:()=>c.full_like,getKeyValueShapes:()=>i.getKeyValueShapes,hamming:()=>a.hamming,hanning:()=>a.hanning,interpolate:()=>c.interpolate,interpolate_4d:()=>c.interpolate_4d,interpolate_data:()=>l.interpolate_data,is_chinese_char:()=>r.is_chinese_char,layer_norm:()=>c.layer_norm,load_image:()=>o.load_image,load_video:()=>s.load_video,log_softmax:()=>l.log_softmax,magnitude:()=>l.magnitude,matmul:()=>c.matmul,max:()=>l.max,mean:()=>c.mean,mean_pooling:()=>c.mean_pooling,medianFilter:()=>l.medianFilter,mel_filter_bank:()=>a.mel_filter_bank,min:()=>l.min,ones:()=>c.ones,ones_like:()=>c.ones_like,permute:()=>c.permute,permute_data:()=>l.permute_data,pipeline:()=>t.pipeline,quantize_embeddings:()=>c.quantize_embeddings,rand:()=>c.rand,read_audio:()=>a.read_audio,rfft:()=>c.rfft,round:()=>l.round,slice:()=>c.slice,softmax:()=>l.softmax,spectrogram:()=>a.spectrogram,stack:()=>c.stack,std_mean:()=>c.std_mean,topk:()=>c.topk,window_function:()=>a.window_function,zeros:()=>c.zeros,zeros_like:()=>c.zeros_like});var e=lf( +`./src/env.js`);class a{constructor(e,t){this.image=e,this.timestamp=t}}class o{constructor(e,t){e.length>0&&e[0]instanceof r.RawImage&&(e=e.map((n,r)=>new a(n,(r+1)/(e.length+1)*t))),this.frames=e,this.duration=t}get width(){return this.frames[0].image.width}get height(){return this.frames[0].image.height}get fps(){return this.frames.length/this.duration}}async function s(e,{num_frames:t=null,fps:n=null}={}){if(!i.apis.IS_BROWSER_ENV)throw Error("`load_video` is currently only supported in browser environments.");if(t==null&&n==null)throw Error(`Either num_frames or fps must be provided.`);let s=[],c=document.createElement(`video`);if(c.crossOrigin=`anonymous`,c.muted=!0,typeof e==`string`)c.src=e;else if(e instanceof Blob)c.src=URL.createObjectURL(e);else if(e instanceof HTMLVideoElement)c.src=e.src;else throw Error(`Invalid URL or video element provided.`);if(await new Promise(e=>c.onloadedmetadata=e),c.seekable.start(0)===c.seekable.end(0)){let e=await fetch(c.src),t=await e.blob();c.src=URL.createObjectURL(t),await new Promise(e=>c.onloadedmetadata=e)}let l=c.duration,u,d;t==null?(d=1/n,u=Math.floor(l/d)):(u=t,d=t===1?0:l/(t-1));let f=[];for(let e=0;e{c.onseeked=e}),m.drawImage(c,0,0,p.width,p.height);let t=m.getImageData(0,0,p.width,p.height),n=new r.RawImage(t.data,p.width,p.height,4),i=new a(n,e);s.push(i)}return c.remove(),new o(s,l)}}},cf={};function lf(e){var t=cf[e];if(t!==void 0)return t.exports;var n=cf[e]={exports:{}};return sf[e](n,n.exports,lf),n.exports}(()=>{var e=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,t;lf.t=function(n,r){if(r&1&&(n=this(n)),r&8||typeof n==`object`&&n&&(r&4&&n.__esModule||r&16&&typeof n.then==`function`))return n;var i=Object.create(null);lf.r(i);var a={};t||=[null,e({}),e([]),e(e)];for(var o=r&2&&n;typeof o==`object`&&!~t.indexOf(o);o=e(o))Object.getOwnPropertyNames(o).forEach(e=>a[e]=()=>n[e]);return a.default=()=>n,lf.d(i,a),i}})(),lf.d=(e,t)=>{for(var n in t)lf.o(t,n)&&!lf.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},lf.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),lf.r=e=>{typeof Symbol<`u`&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),Object.defineProperty(e,`__esModule`,{value:!0})};var $={};(()=>{lf.r($),lf.d($,{ASTFeatureExtractor:()=>d.ASTFeatureExtractor,ASTForAudioClassification:()=>n.ASTForAudioClassification,ASTModel:()=>n.ASTModel,ASTPreTrainedModel:()=>n.ASTPreTrainedModel,AlbertForMaskedLM:()=>n.AlbertForMaskedLM,AlbertForQuestionAnswering:()=>n.AlbertForQuestionAnswering,AlbertForSequenceClassification:()=>n.AlbertForSequenceClassification,AlbertModel:()=>n.AlbertModel,AlbertPreTrainedModel:()=>n.AlbertPreTrainedModel,AlbertTokenizer:()=>r.AlbertTokenizer,AudioClassificationPipeline:()=>t.AudioClassificationPipeline,AutoConfig:()=>i.AutoConfig,AutoFeatureExtractor:()=>f.AutoFeatureExtractor,AutoImageProcessor:()=>h.AutoImageProcessor,AutoModel:()=>n.AutoModel,AutoModelForAudioClassification:()=>n.AutoModelForAudioClassification,AutoModelForAudioFrameClassification:()=>n.AutoModelForAudioFrameClassification,AutoModelForAudioTextToText:()=>n.AutoModelForAudioTextToText,AutoModelForCTC:()=>n.AutoModelForCTC,AutoModelForCausalLM:()=>n.AutoModelForCausalLM,AutoModelForDepthEstimation:()=>n.AutoModelForDepthEstimation,AutoModelForDocumentQuestionAnswering:()=>n.AutoModelForDocumentQuestionAnswering,AutoModelForImageClassification:()=>n.AutoModelForImageClassification,AutoModelForImageFeatureExtraction:()=>n.AutoModelForImageFeatureExtraction,AutoModelForImageMatting:()=>n.AutoModelForImageMatting,AutoModelForImageSegmentation:()=>n.AutoModelForImageSegmentation,AutoModelForImageTextToText:()=>n.AutoModelForImageTextToText,AutoModelForImageToImage:()=>n.AutoModelForImageToImage,AutoModelForMaskGeneration:()=>n.AutoModelForMaskGeneration,AutoModelForMaskedLM:()=>n.AutoModelForMaskedLM,AutoModelForNormalEstimation:()=>n.AutoModelForNormalEstimation,AutoModelForObjectDetection:()=>n.AutoModelForObjectDetection,AutoModelForPoseEstimation:()=>n.AutoModelForPoseEstimation,AutoModelForQuestionAnswering:()=>n.AutoModelForQuestionAnswering,AutoModelForSemanticSegmentation:()=>n.AutoModelForSemanticSegmentation,AutoModelForSeq2SeqLM:()=>n.AutoModelForSeq2SeqLM,AutoModelForSequenceClassification:()=>n.AutoModelForSequenceClassification,AutoModelForSpeechSeq2Seq:()=>n.AutoModelForSpeechSeq2Seq,AutoModelForTextToSpectrogram:()=>n.AutoModelForTextToSpectrogram,AutoModelForTextToWaveform:()=>n.AutoModelForTextToWaveform,AutoModelForTokenClassification:()=>n.AutoModelForTokenClassification,AutoModelForUniversalSegmentation:()=>n.AutoModelForUniversalSegmentation,AutoModelForVision2Seq:()=>n.AutoModelForVision2Seq,AutoModelForXVector:()=>n.AutoModelForXVector,AutoModelForZeroShotObjectDetection:()=>n.AutoModelForZeroShotObjectDetection,AutoProcessor:()=>v.AutoProcessor,AutoTokenizer:()=>r.AutoTokenizer,AutomaticSpeechRecognitionPipeline:()=>t.AutomaticSpeechRecognitionPipeline,BackgroundRemovalPipeline:()=>t.BackgroundRemovalPipeline,BartForConditionalGeneration:()=>n.BartForConditionalGeneration,BartForSequenceClassification:()=>n.BartForSequenceClassification,BartModel:()=>n.BartModel,BartPretrainedModel:()=>n.BartPretrainedModel,BartTokenizer:()=>r.BartTokenizer,BaseModelOutput:()=>n.BaseModelOutput,BaseStreamer:()=>y.BaseStreamer,BeitFeatureExtractor:()=>m.BeitFeatureExtractor,BeitForImageClassification:()=>n.BeitForImageClassification,BeitModel:()=>n.BeitModel,BeitPreTrainedModel:()=>n.BeitPreTrainedModel,BertForMaskedLM:()=>n.BertForMaskedLM,BertForQuestionAnswering:()=>n.BertForQuestionAnswering,BertForSequenceClassification:()=>n.BertForSequenceClassification,BertForTokenClassification:()=>n.BertForTokenClassification,BertModel:()=>n.BertModel,BertPreTrainedModel:()=>n.BertPreTrainedModel,BertTokenizer:()=>r.BertTokenizer,BitImageProcessor:()=>m.BitImageProcessor,BlenderbotForConditionalGeneration:()=>n.BlenderbotForConditionalGeneration,BlenderbotModel:()=>n.BlenderbotModel,BlenderbotPreTrainedModel:()=>n.BlenderbotPreTrainedModel,BlenderbotSmallForConditionalGeneration:()=>n.BlenderbotSmallForConditionalGeneration,BlenderbotSmallModel:()=>n.BlenderbotSmallModel,BlenderbotSmallPreTrainedModel:()=>n.BlenderbotSmallPreTrainedModel,BlenderbotSmallTokenizer:()=>r.BlenderbotSmallTokenizer,BlenderbotTokenizer:()=>r.BlenderbotTokenizer,BloomForCausalLM:()=>n.BloomForCausalLM,BloomModel:()=>n.BloomModel,BloomPreTrainedModel:()=>n.BloomPreTrainedModel,BloomTokenizer:()=>r.BloomTokenizer,CLIPFeatureExtractor:()=>m.CLIPFeatureExtractor,CLIPImageProcessor:()=>m.CLIPImageProcessor,CLIPModel:()=>n.CLIPModel,CLIPPreTrainedModel:()=>n.CLIPPreTrainedModel,CLIPSegForImageSegmentation:()=>n.CLIPSegForImageSegmentation,CLIPSegModel:()=>n.CLIPSegModel,CLIPSegPreTrainedModel:()=>n.CLIPSegPreTrainedModel,CLIPTextModel:()=>n.CLIPTextModel,CLIPTextModelWithProjection:()=>n.CLIPTextModelWithProjection,CLIPTokenizer:()=>r.CLIPTokenizer,CLIPVisionModel:()=>n.CLIPVisionModel,CLIPVisionModelWithProjection:()=>n.CLIPVisionModelWithProjection,CamembertForMaskedLM:()=>n.CamembertForMaskedLM,CamembertForQuestionAnswering:()=>n.CamembertForQuestionAnswering,CamembertForSequenceClassification:()=>n.CamembertForSequenceClassification,CamembertForTokenClassification:()=>n.CamembertForTokenClassification,CamembertModel:()=>n.CamembertModel,CamembertPreTrainedModel:()=>n.CamembertPreTrainedModel,CamembertTokenizer:()=>r.CamembertTokenizer,CausalLMOutput:()=>n.CausalLMOutput,CausalLMOutputWithPast:()=>n.CausalLMOutputWithPast,ChineseCLIPFeatureExtractor:()=>m.ChineseCLIPFeatureExtractor,ChineseCLIPModel:()=>n.ChineseCLIPModel,ChineseCLIPPreTrainedModel:()=>n.ChineseCLIPPreTrainedModel,ClapAudioModelWithProjection:()=>n.ClapAudioModelWithProjection,ClapFeatureExtractor:()=>d.ClapFeatureExtractor,ClapModel:()=>n.ClapModel,ClapPreTrainedModel:()=>n.ClapPreTrainedModel,ClapTextModelWithProjection:()=>n.ClapTextModelWithProjection,ClassifierFreeGuidanceLogitsProcessor:()=>x.ClassifierFreeGuidanceLogitsProcessor,CodeGenForCausalLM:()=>n.CodeGenForCausalLM,CodeGenModel:()=>n.CodeGenModel,CodeGenPreTrainedModel:()=>n.CodeGenPreTrainedModel,CodeGenTokenizer:()=>r.CodeGenTokenizer,CodeLlamaTokenizer:()=>r.CodeLlamaTokenizer,CohereForCausalLM:()=>n.CohereForCausalLM,CohereModel:()=>n.CohereModel,CoherePreTrainedModel:()=>n.CoherePreTrainedModel,CohereTokenizer:()=>r.CohereTokenizer,ConvBertForMaskedLM:()=>n.ConvBertForMaskedLM,ConvBertForQuestionAnswering:()=>n.ConvBertForQuestionAnswering,ConvBertForSequenceClassification:()=>n.ConvBertForSequenceClassification,ConvBertForTokenClassification:()=>n.ConvBertForTokenClassification,ConvBertModel:()=>n.ConvBertModel,ConvBertPreTrainedModel:()=>n.ConvBertPreTrainedModel,ConvBertTokenizer:()=>r.ConvBertTokenizer,ConvNextFeatureExtractor:()=>m.ConvNextFeatureExtractor,ConvNextForImageClassification:()=>n.ConvNextForImageClassification,ConvNextImageProcessor:()=>m.ConvNextImageProcessor,ConvNextModel:()=>n.ConvNextModel,ConvNextPreTrainedModel:()=>n.ConvNextPreTrainedModel,ConvNextV2ForImageClassification:()=>n.ConvNextV2ForImageClassification,ConvNextV2Model:()=>n.ConvNextV2Model,ConvNextV2PreTrainedModel:()=>n.ConvNextV2PreTrainedModel,DFineForObjectDetection:()=>n.DFineForObjectDetection,DFineModel:()=>n.DFineModel,DFinePreTrainedModel:()=>n.DFinePreTrainedModel,DPTFeatureExtractor:()=>m.DPTFeatureExtractor,DPTForDepthEstimation:()=>n.DPTForDepthEstimation,DPTImageProcessor:()=>m.DPTImageProcessor,DPTModel:()=>n.DPTModel,DPTPreTrainedModel:()=>n.DPTPreTrainedModel,DacDecoderModel:()=>n.DacDecoderModel,DacDecoderOutput:()=>n.DacDecoderOutput,DacEncoderModel:()=>n.DacEncoderModel,DacEncoderOutput:()=>n.DacEncoderOutput,DacFeatureExtractor:()=>d.DacFeatureExtractor,DacModel:()=>n.DacModel,DacPreTrainedModel:()=>n.DacPreTrainedModel,DataTypeMap:()=>c.DataTypeMap,DebertaForMaskedLM:()=>n.DebertaForMaskedLM,DebertaForQuestionAnswering:()=>n.DebertaForQuestionAnswering,DebertaForSequenceClassification:()=>n.DebertaForSequenceClassification,DebertaForTokenClassification:()=>n.DebertaForTokenClassification,DebertaModel:()=>n.DebertaModel,DebertaPreTrainedModel:()=>n.DebertaPreTrainedModel,DebertaTokenizer:()=>r.DebertaTokenizer,DebertaV2ForMaskedLM:()=>n.DebertaV2ForMaskedLM,DebertaV2ForQuestionAnswering:()=>n.DebertaV2ForQuestionAnswering,DebertaV2ForSequenceClassification:()=>n.DebertaV2ForSequenceClassification,DebertaV2ForTokenClassification:()=>n.DebertaV2ForTokenClassification,DebertaV2Model:()=>n.DebertaV2Model,DebertaV2PreTrainedModel:()=>n.DebertaV2PreTrainedModel,DebertaV2Tokenizer:()=>r.DebertaV2Tokenizer,DecisionTransformerModel:()=>n.DecisionTransformerModel,DecisionTransformerPreTrainedModel:()=>n.DecisionTransformerPreTrainedModel,DeiTFeatureExtractor:()=>m.DeiTFeatureExtractor,DeiTForImageClassification:()=>n.DeiTForImageClassification,DeiTImageProcessor:()=>m.DeiTImageProcessor,DeiTModel:()=>n.DeiTModel,DeiTPreTrainedModel:()=>n.DeiTPreTrainedModel,DepthAnythingForDepthEstimation:()=>n.DepthAnythingForDepthEstimation,DepthAnythingPreTrainedModel:()=>n.DepthAnythingPreTrainedModel,DepthEstimationPipeline:()=>t.DepthEstimationPipeline,DepthProForDepthEstimation:()=>n.DepthProForDepthEstimation,DepthProPreTrainedModel:()=>n.DepthProPreTrainedModel,DetrFeatureExtractor:()=>m.DetrFeatureExtractor,DetrForObjectDetection:()=>n.DetrForObjectDetection,DetrForSegmentation:()=>n.DetrForSegmentation,DetrImageProcessor:()=>m.DetrImageProcessor,DetrModel:()=>n.DetrModel,DetrObjectDetectionOutput:()=>n.DetrObjectDetectionOutput,DetrPreTrainedModel:()=>n.DetrPreTrainedModel,DetrSegmentationOutput:()=>n.DetrSegmentationOutput,Dinov2ForImageClassification:()=>n.Dinov2ForImageClassification,Dinov2Model:()=>n.Dinov2Model,Dinov2PreTrainedModel:()=>n.Dinov2PreTrainedModel,Dinov2WithRegistersForImageClassification:()=>n.Dinov2WithRegistersForImageClassification,Dinov2WithRegistersModel:()=>n.Dinov2WithRegistersModel,Dinov2WithRegistersPreTrainedModel:()=>n.Dinov2WithRegistersPreTrainedModel,DistilBertForMaskedLM:()=>n.DistilBertForMaskedLM,DistilBertForQuestionAnswering:()=>n.DistilBertForQuestionAnswering,DistilBertForSequenceClassification:()=>n.DistilBertForSequenceClassification,DistilBertForTokenClassification:()=>n.DistilBertForTokenClassification,DistilBertModel:()=>n.DistilBertModel,DistilBertPreTrainedModel:()=>n.DistilBertPreTrainedModel,DistilBertTokenizer:()=>r.DistilBertTokenizer,DocumentQuestionAnsweringPipeline:()=>t.DocumentQuestionAnsweringPipeline,DonutFeatureExtractor:()=>m.DonutFeatureExtractor,DonutImageProcessor:()=>m.DonutImageProcessor,DonutSwinModel:()=>n.DonutSwinModel,DonutSwinPreTrainedModel:()=>n.DonutSwinPreTrainedModel,EfficientNetForImageClassification:()=>n.EfficientNetForImageClassification,EfficientNetImageProcessor:()=>m.EfficientNetImageProcessor,EfficientNetModel:()=>n.EfficientNetModel,EfficientNetPreTrainedModel:()=>n.EfficientNetPreTrainedModel,ElectraForMaskedLM:()=>n.ElectraForMaskedLM,ElectraForQuestionAnswering:()=>n.ElectraForQuestionAnswering,ElectraForSequenceClassification:()=>n.ElectraForSequenceClassification,ElectraForTokenClassification:()=>n.ElectraForTokenClassification,ElectraModel:()=>n.ElectraModel,ElectraPreTrainedModel:()=>n.ElectraPreTrainedModel,ElectraTokenizer:()=>r.ElectraTokenizer,EncodecFeatureExtractor:()=>d.EncodecFeatureExtractor,EosTokenCriteria:()=>b.EosTokenCriteria,Ernie4_5_ForCausalLM:()=>n.Ernie4_5_ForCausalLM,Ernie4_5_Model:()=>n.Ernie4_5_Model,Ernie4_5_PretrainedModel:()=>n.Ernie4_5_PretrainedModel,Ernie4_5_Tokenizer:()=>r.Ernie4_5_Tokenizer,EsmForMaskedLM:()=>n.EsmForMaskedLM,EsmForSequenceClassification:()=>n.EsmForSequenceClassification,EsmForTokenClassification:()=>n.EsmForTokenClassification,EsmModel:()=>n.EsmModel,EsmPreTrainedModel:()=>n.EsmPreTrainedModel,EsmTokenizer:()=>r.EsmTokenizer,ExaoneForCausalLM:()=>n.ExaoneForCausalLM,ExaoneModel:()=>n.ExaoneModel,ExaonePreTrainedModel:()=>n.ExaonePreTrainedModel,FFT:()=>l.FFT,FalconForCausalLM:()=>n.FalconForCausalLM,FalconModel:()=>n.FalconModel,FalconPreTrainedModel:()=>n.FalconPreTrainedModel,FalconTokenizer:()=>r.FalconTokenizer,FastViTForImageClassification:()=>n.FastViTForImageClassification,FastViTModel:()=>n.FastViTModel,FastViTPreTrainedModel:()=>n.FastViTPreTrainedModel,FeatureExtractionPipeline:()=>t.FeatureExtractionPipeline,FeatureExtractor:()=>u.FeatureExtractor,FillMaskPipeline:()=>t.FillMaskPipeline,Florence2ForConditionalGeneration:()=>n.Florence2ForConditionalGeneration,Florence2PreTrainedModel:()=>n.Florence2PreTrainedModel,Florence2Processor:()=>_.Florence2Processor,ForcedBOSTokenLogitsProcessor:()=>x.ForcedBOSTokenLogitsProcessor,ForcedEOSTokenLogitsProcessor:()=>x.ForcedEOSTokenLogitsProcessor,GLPNFeatureExtractor:()=>m.GLPNFeatureExtractor,GLPNForDepthEstimation:()=>n.GLPNForDepthEstimation,GLPNModel:()=>n.GLPNModel,GLPNPreTrainedModel:()=>n.GLPNPreTrainedModel,GPT2LMHeadModel:()=>n.GPT2LMHeadModel,GPT2Model:()=>n.GPT2Model,GPT2PreTrainedModel:()=>n.GPT2PreTrainedModel,GPT2Tokenizer:()=>r.GPT2Tokenizer,GPTBigCodeForCausalLM:()=>n.GPTBigCodeForCausalLM,GPTBigCodeModel:()=>n.GPTBigCodeModel,GPTBigCodePreTrainedModel:()=>n.GPTBigCodePreTrainedModel,GPTJForCausalLM:()=>n.GPTJForCausalLM,GPTJModel:()=>n.GPTJModel,GPTJPreTrainedModel:()=>n.GPTJPreTrainedModel,GPTNeoForCausalLM:()=>n.GPTNeoForCausalLM,GPTNeoModel:()=>n.GPTNeoModel,GPTNeoPreTrainedModel:()=>n.GPTNeoPreTrainedModel,GPTNeoXForCausalLM:()=>n.GPTNeoXForCausalLM,GPTNeoXModel:()=>n.GPTNeoXModel,GPTNeoXPreTrainedModel:()=>n.GPTNeoXPreTrainedModel,GPTNeoXTokenizer:()=>r.GPTNeoXTokenizer,Gemma2ForCausalLM:()=>n.Gemma2ForCausalLM,Gemma2Model:()=>n.Gemma2Model,Gemma2PreTrainedModel:()=>n.Gemma2PreTrainedModel,Gemma3ForCausalLM:()=>n.Gemma3ForCausalLM,Gemma3Model:()=>n.Gemma3Model,Gemma3PreTrainedModel:()=>n.Gemma3PreTrainedModel,Gemma3nAudioFeatureExtractor:()=>d.Gemma3nAudioFeatureExtractor,Gemma3nForConditionalGeneration:()=>n.Gemma3nForConditionalGeneration,Gemma3nPreTrainedModel:()=>n.Gemma3nPreTrainedModel,Gemma3nProcessor:()=>_.Gemma3nProcessor,GemmaForCausalLM:()=>n.GemmaForCausalLM,GemmaModel:()=>n.GemmaModel,GemmaPreTrainedModel:()=>n.GemmaPreTrainedModel,GemmaTokenizer:()=>r.GemmaTokenizer,GlmForCausalLM:()=>n.GlmForCausalLM,GlmModel:()=>n.GlmModel,GlmPreTrainedModel:()=>n.GlmPreTrainedModel,GraniteForCausalLM:()=>n.GraniteForCausalLM,GraniteModel:()=>n.GraniteModel,GranitePreTrainedModel:()=>n.GranitePreTrainedModel,Grok1Tokenizer:()=>r.Grok1Tokenizer,GroundingDinoForObjectDetection:()=>n.GroundingDinoForObjectDetection,GroundingDinoImageProcessor:()=>m.GroundingDinoImageProcessor,GroundingDinoPreTrainedModel:()=>n.GroundingDinoPreTrainedModel,GroundingDinoProcessor:()=>_.GroundingDinoProcessor,GroupViTModel:()=>n.GroupViTModel,GroupViTPreTrainedModel:()=>n.GroupViTPreTrainedModel,HeliumForCausalLM:()=>n.HeliumForCausalLM,HeliumModel:()=>n.HeliumModel,HeliumPreTrainedModel:()=>n.HeliumPreTrainedModel,HerbertTokenizer:()=>r.HerbertTokenizer,HieraForImageClassification:()=>n.HieraForImageClassification,HieraModel:()=>n.HieraModel,HieraPreTrainedModel:()=>n.HieraPreTrainedModel,HubertForCTC:()=>n.HubertForCTC,HubertForSequenceClassification:()=>n.HubertForSequenceClassification,HubertModel:()=>n.HubertModel,HubertPreTrainedModel:()=>n.HubertPreTrainedModel,IJepaForImageClassification:()=>n.IJepaForImageClassification,IJepaModel:()=>n.IJepaModel,IJepaPreTrainedModel:()=>n.IJepaPreTrainedModel,Idefics3ForConditionalGeneration:()=>n.Idefics3ForConditionalGeneration,Idefics3ImageProcessor:()=>m.Idefics3ImageProcessor,Idefics3PreTrainedModel:()=>n.Idefics3PreTrainedModel,Idefics3Processor:()=>_.Idefics3Processor,ImageClassificationPipeline:()=>t.ImageClassificationPipeline,ImageFeatureExtractionPipeline:()=>t.ImageFeatureExtractionPipeline,ImageFeatureExtractor:()=>d.ImageFeatureExtractor,ImageMattingOutput:()=>n.ImageMattingOutput,ImageProcessor:()=>p.ImageProcessor,ImageSegmentationPipeline:()=>t.ImageSegmentationPipeline,ImageToImagePipeline:()=>t.ImageToImagePipeline,ImageToTextPipeline:()=>t.ImageToTextPipeline,InterruptableStoppingCriteria:()=>b.InterruptableStoppingCriteria,JAISLMHeadModel:()=>n.JAISLMHeadModel,JAISModel:()=>n.JAISModel,JAISPreTrainedModel:()=>n.JAISPreTrainedModel,JinaCLIPImageProcessor:()=>m.JinaCLIPImageProcessor,JinaCLIPModel:()=>n.JinaCLIPModel,JinaCLIPPreTrainedModel:()=>n.JinaCLIPPreTrainedModel,JinaCLIPProcessor:()=>_.JinaCLIPProcessor,JinaCLIPTextModel:()=>n.JinaCLIPTextModel,JinaCLIPVisionModel:()=>n.JinaCLIPVisionModel,LiteWhisperForConditionalGeneration:()=>n.LiteWhisperForConditionalGeneration,LlamaForCausalLM:()=>n.LlamaForCausalLM,LlamaModel:()=>n.LlamaModel,LlamaPreTrainedModel:()=>n.LlamaPreTrainedModel,LlamaTokenizer:()=>r.LlamaTokenizer,LlavaForConditionalGeneration:()=>n.LlavaForConditionalGeneration,LlavaOnevisionForConditionalGeneration:()=>n.LlavaOnevisionForConditionalGeneration,LlavaOnevisionImageProcessor:()=>m.LlavaOnevisionImageProcessor,LlavaPreTrainedModel:()=>n.LlavaPreTrainedModel,LlavaProcessor:()=>_.LlavaProcessor,LlavaQwen2ForCausalLM:()=>n.LlavaQwen2ForCausalLM,LogitsProcessor:()=>x.LogitsProcessor,LogitsProcessorList:()=>x.LogitsProcessorList,LogitsWarper:()=>x.LogitsWarper,LongT5ForConditionalGeneration:()=>n.LongT5ForConditionalGeneration,LongT5Model:()=>n.LongT5Model,LongT5PreTrainedModel:()=>n.LongT5PreTrainedModel,M2M100ForConditionalGeneration:()=>n.M2M100ForConditionalGeneration,M2M100Model:()=>n.M2M100Model,M2M100PreTrainedModel:()=>n.M2M100PreTrainedModel,M2M100Tokenizer:()=>r.M2M100Tokenizer,MBart50Tokenizer:()=>r.MBart50Tokenizer,MBartForCausalLM:()=>n.MBartForCausalLM,MBartForConditionalGeneration:()=>n.MBartForConditionalGeneration,MBartForSequenceClassification:()=>n.MBartForSequenceClassification,MBartModel:()=>n.MBartModel,MBartPreTrainedModel:()=>n.MBartPreTrainedModel,MBartTokenizer:()=>r.MBartTokenizer,MPNetForMaskedLM:()=>n.MPNetForMaskedLM,MPNetForQuestionAnswering:()=>n.MPNetForQuestionAnswering,MPNetForSequenceClassification:()=>n.MPNetForSequenceClassification,MPNetForTokenClassification:()=>n.MPNetForTokenClassification,MPNetModel:()=>n.MPNetModel,MPNetPreTrainedModel:()=>n.MPNetPreTrainedModel,MPNetTokenizer:()=>r.MPNetTokenizer,MT5ForConditionalGeneration:()=>n.MT5ForConditionalGeneration,MT5Model:()=>n.MT5Model,MT5PreTrainedModel:()=>n.MT5PreTrainedModel,MarianMTModel:()=>n.MarianMTModel,MarianModel:()=>n.MarianModel,MarianPreTrainedModel:()=>n.MarianPreTrainedModel,MarianTokenizer:()=>r.MarianTokenizer,Mask2FormerImageProcessor:()=>m.Mask2FormerImageProcessor,MaskFormerFeatureExtractor:()=>m.MaskFormerFeatureExtractor,MaskFormerForInstanceSegmentation:()=>n.MaskFormerForInstanceSegmentation,MaskFormerImageProcessor:()=>m.MaskFormerImageProcessor,MaskFormerModel:()=>n.MaskFormerModel,MaskFormerPreTrainedModel:()=>n.MaskFormerPreTrainedModel,MaskedLMOutput:()=>n.MaskedLMOutput,MaxLengthCriteria:()=>b.MaxLengthCriteria,Metric3DForDepthEstimation:()=>n.Metric3DForDepthEstimation,Metric3DPreTrainedModel:()=>n.Metric3DPreTrainedModel,Metric3Dv2ForDepthEstimation:()=>n.Metric3Dv2ForDepthEstimation,Metric3Dv2PreTrainedModel:()=>n.Metric3Dv2PreTrainedModel,MgpstrForSceneTextRecognition:()=>n.MgpstrForSceneTextRecognition,MgpstrModelOutput:()=>n.MgpstrModelOutput,MgpstrPreTrainedModel:()=>n.MgpstrPreTrainedModel,MgpstrProcessor:()=>_.MgpstrProcessor,MgpstrTokenizer:()=>r.MgpstrTokenizer,MimiDecoderModel:()=>n.MimiDecoderModel,MimiDecoderOutput:()=>n.MimiDecoderOutput,MimiEncoderModel:()=>n.MimiEncoderModel,MimiEncoderOutput:()=>n.MimiEncoderOutput,MimiModel:()=>n.MimiModel,MimiPreTrainedModel:()=>n.MimiPreTrainedModel,MinLengthLogitsProcessor:()=>x.MinLengthLogitsProcessor,MinNewTokensLengthLogitsProcessor:()=>x.MinNewTokensLengthLogitsProcessor,MistralForCausalLM:()=>n.MistralForCausalLM,MistralModel:()=>n.MistralModel,MistralPreTrainedModel:()=>n.MistralPreTrainedModel,MobileBertForMaskedLM:()=>n.MobileBertForMaskedLM,MobileBertForQuestionAnswering:()=>n.MobileBertForQuestionAnswering,MobileBertForSequenceClassification:()=>n.MobileBertForSequenceClassification,MobileBertModel:()=>n.MobileBertModel,MobileBertPreTrainedModel:()=>n.MobileBertPreTrainedModel,MobileBertTokenizer:()=>r.MobileBertTokenizer,MobileLLMForCausalLM:()=>n.MobileLLMForCausalLM,MobileLLMModel:()=>n.MobileLLMModel,MobileLLMPreTrainedModel:()=>n.MobileLLMPreTrainedModel,MobileNetV1FeatureExtractor:()=>m.MobileNetV1FeatureExtractor,MobileNetV1ForImageClassification:()=>n.MobileNetV1ForImageClassification,MobileNetV1ForSemanticSegmentation:()=>n.MobileNetV1ForSemanticSegmentation,MobileNetV1ImageProcessor:()=>m.MobileNetV1ImageProcessor,MobileNetV1Model:()=>n.MobileNetV1Model,MobileNetV1PreTrainedModel:()=>n.MobileNetV1PreTrainedModel,MobileNetV2FeatureExtractor:()=>m.MobileNetV2FeatureExtractor,MobileNetV2ForImageClassification:()=>n.MobileNetV2ForImageClassification,MobileNetV2ForSemanticSegmentation:()=>n.MobileNetV2ForSemanticSegmentation,MobileNetV2ImageProcessor:()=>m.MobileNetV2ImageProcessor,MobileNetV2Model:()=>n.MobileNetV2Model,MobileNetV2PreTrainedModel:()=>n.MobileNetV2PreTrainedModel,MobileNetV3FeatureExtractor:()=>m.MobileNetV3FeatureExtractor,MobileNetV3ForImageClassification:()=>n.MobileNetV3ForImageClassification,MobileNetV3ForSemanticSegmentation:()=>n.MobileNetV3ForSemanticSegmentation,MobileNetV3ImageProcessor:()=>m.MobileNetV3ImageProcessor,MobileNetV3Model:()=>n.MobileNetV3Model,MobileNetV3PreTrainedModel:()=>n.MobileNetV3PreTrainedModel,MobileNetV4FeatureExtractor:()=>m.MobileNetV4FeatureExtractor,MobileNetV4ForImageClassification:()=>n.MobileNetV4ForImageClassification,MobileNetV4ForSemanticSegmentation:()=>n.MobileNetV4ForSemanticSegmentation,MobileNetV4ImageProcessor:()=>m.MobileNetV4ImageProcessor,MobileNetV4Model:()=>n.MobileNetV4Model,MobileNetV4PreTrainedModel:()=>n.MobileNetV4PreTrainedModel,MobileViTFeatureExtractor:()=>m.MobileViTFeatureExtractor,MobileViTForImageClassification:()=>n.MobileViTForImageClassification,MobileViTImageProcessor:()=>m.MobileViTImageProcessor,MobileViTModel:()=>n.MobileViTModel,MobileViTPreTrainedModel:()=>n.MobileViTPreTrainedModel,MobileViTV2ForImageClassification:()=>n.MobileViTV2ForImageClassification,MobileViTV2Model:()=>n.MobileViTV2Model,MobileViTV2PreTrainedModel:()=>n.MobileViTV2PreTrainedModel,ModelOutput:()=>n.ModelOutput,ModernBertForMaskedLM:()=>n.ModernBertForMaskedLM,ModernBertForSequenceClassification:()=>n.ModernBertForSequenceClassification,ModernBertForTokenClassification:()=>n.ModernBertForTokenClassification,ModernBertModel:()=>n.ModernBertModel,ModernBertPreTrainedModel:()=>n.ModernBertPreTrainedModel,Moondream1ForConditionalGeneration:()=>n.Moondream1ForConditionalGeneration,MoonshineFeatureExtractor:()=>d.MoonshineFeatureExtractor,MoonshineForConditionalGeneration:()=>n.MoonshineForConditionalGeneration,MoonshineModel:()=>n.MoonshineModel,MoonshinePreTrainedModel:()=>n.MoonshinePreTrainedModel,MoonshineProcessor:()=>_.MoonshineProcessor,MptForCausalLM:()=>n.MptForCausalLM,MptModel:()=>n.MptModel,MptPreTrainedModel:()=>n.MptPreTrainedModel,MultiModalityCausalLM:()=>n.MultiModalityCausalLM,MultiModalityPreTrainedModel:()=>n.MultiModalityPreTrainedModel,MusicgenForCausalLM:()=>n.MusicgenForCausalLM,MusicgenForConditionalGeneration:()=>n.MusicgenForConditionalGeneration,MusicgenModel:()=>n.MusicgenModel,MusicgenPreTrainedModel:()=>n.MusicgenPreTrainedModel,NeoBertForMaskedLM:()=>n.NeoBertForMaskedLM,NeoBertForQuestionAnswering:()=>n.NeoBertForQuestionAnswering,NeoBertForSequenceClassification:()=>n.NeoBertForSequenceClassification,NeoBertForTokenClassification:()=>n.NeoBertForTokenClassification,NeoBertModel:()=>n.NeoBertModel,NeoBertPreTrainedModel:()=>n.NeoBertPreTrainedModel,NllbTokenizer:()=>r.NllbTokenizer,NoBadWordsLogitsProcessor:()=>x.NoBadWordsLogitsProcessor,NoRepeatNGramLogitsProcessor:()=>x.NoRepeatNGramLogitsProcessor,NomicBertModel:()=>n.NomicBertModel,NomicBertPreTrainedModel:()=>n.NomicBertPreTrainedModel,NougatImageProcessor:()=>m.NougatImageProcessor,NougatTokenizer:()=>r.NougatTokenizer,OPTForCausalLM:()=>n.OPTForCausalLM,OPTModel:()=>n.OPTModel,OPTPreTrainedModel:()=>n.OPTPreTrainedModel,ObjectDetectionPipeline:()=>t.ObjectDetectionPipeline,Olmo2ForCausalLM:()=>n.Olmo2ForCausalLM,Olmo2Model:()=>n.Olmo2Model,Olmo2PreTrainedModel:()=>n.Olmo2PreTrainedModel,OlmoForCausalLM:()=>n.OlmoForCausalLM,OlmoModel:()=>n.OlmoModel,OlmoPreTrainedModel:()=>n.OlmoPreTrainedModel,OpenELMForCausalLM:()=>n.OpenELMForCausalLM,OpenELMModel:()=>n.OpenELMModel,OpenELMPreTrainedModel:()=>n.OpenELMPreTrainedModel,OwlViTFeatureExtractor:()=>m.OwlViTFeatureExtractor,OwlViTForObjectDetection:()=>n.OwlViTForObjectDetection,OwlViTImageProcessor:()=>m.OwlViTImageProcessor,OwlViTModel:()=>n.OwlViTModel,OwlViTPreTrainedModel:()=>n.OwlViTPreTrainedModel,OwlViTProcessor:()=>_.OwlViTProcessor,Owlv2ForObjectDetection:()=>n.Owlv2ForObjectDetection,Owlv2ImageProcessor:()=>m.Owlv2ImageProcessor,Owlv2Model:()=>n.Owlv2Model,Owlv2PreTrainedModel:()=>n.Owlv2PreTrainedModel,PaliGemmaForConditionalGeneration:()=>n.PaliGemmaForConditionalGeneration,PaliGemmaPreTrainedModel:()=>n.PaliGemmaPreTrainedModel,PaliGemmaProcessor:()=>_.PaliGemmaProcessor,PatchTSMixerForPrediction:()=>n.PatchTSMixerForPrediction,PatchTSMixerModel:()=>n.PatchTSMixerModel,PatchTSMixerPreTrainedModel:()=>n.PatchTSMixerPreTrainedModel,PatchTSTForPrediction:()=>n.PatchTSTForPrediction,PatchTSTModel:()=>n.PatchTSTModel,PatchTSTPreTrainedModel:()=>n.PatchTSTPreTrainedModel,Phi3ForCausalLM:()=>n.Phi3ForCausalLM,Phi3Model:()=>n.Phi3Model,Phi3PreTrainedModel:()=>n.Phi3PreTrainedModel,Phi3VForCausalLM:()=>n.Phi3VForCausalLM,Phi3VImageProcessor:()=>m.Phi3VImageProcessor,Phi3VPreTrainedModel:()=>n.Phi3VPreTrainedModel,Phi3VProcessor:()=>_.Phi3VProcessor,PhiForCausalLM:()=>n.PhiForCausalLM,PhiModel:()=>n.PhiModel,PhiPreTrainedModel:()=>n.PhiPreTrainedModel,Pipeline:()=>t.Pipeline,PreTrainedModel:()=>n.PreTrainedModel,PreTrainedTokenizer:()=>r.PreTrainedTokenizer,PretrainedConfig:()=>i.PretrainedConfig,PretrainedMixin:()=>n.PretrainedMixin,Processor:()=>g.Processor,PvtForImageClassification:()=>n.PvtForImageClassification,PvtImageProcessor:()=>m.PvtImageProcessor,PvtModel:()=>n.PvtModel,PvtPreTrainedModel:()=>n.PvtPreTrainedModel,PyAnnoteFeatureExtractor:()=>d.PyAnnoteFeatureExtractor,PyAnnoteForAudioFrameClassification:()=>n.PyAnnoteForAudioFrameClassification,PyAnnoteModel:()=>n.PyAnnoteModel,PyAnnotePreTrainedModel:()=>n.PyAnnotePreTrainedModel,PyAnnoteProcessor:()=>_.PyAnnoteProcessor,QuestionAnsweringModelOutput:()=>n.QuestionAnsweringModelOutput,QuestionAnsweringPipeline:()=>t.QuestionAnsweringPipeline,Qwen2ForCausalLM:()=>n.Qwen2ForCausalLM,Qwen2Model:()=>n.Qwen2Model,Qwen2PreTrainedModel:()=>n.Qwen2PreTrainedModel,Qwen2Tokenizer:()=>r.Qwen2Tokenizer,Qwen2VLForConditionalGeneration:()=>n.Qwen2VLForConditionalGeneration,Qwen2VLImageProcessor:()=>m.Qwen2VLImageProcessor,Qwen2VLPreTrainedModel:()=>n.Qwen2VLPreTrainedModel,Qwen2VLProcessor:()=>_.Qwen2VLProcessor,Qwen3ForCausalLM:()=>n.Qwen3ForCausalLM,Qwen3Model:()=>n.Qwen3Model,Qwen3PreTrainedModel:()=>n.Qwen3PreTrainedModel,RFDetrForObjectDetection:()=>n.RFDetrForObjectDetection,RFDetrModel:()=>n.RFDetrModel,RFDetrObjectDetectionOutput:()=>n.RFDetrObjectDetectionOutput,RFDetrPreTrainedModel:()=>n.RFDetrPreTrainedModel,RTDetrForObjectDetection:()=>n.RTDetrForObjectDetection,RTDetrImageProcessor:()=>m.RTDetrImageProcessor,RTDetrModel:()=>n.RTDetrModel,RTDetrObjectDetectionOutput:()=>n.RTDetrObjectDetectionOutput,RTDetrPreTrainedModel:()=>n.RTDetrPreTrainedModel,RTDetrV2ForObjectDetection:()=>n.RTDetrV2ForObjectDetection,RTDetrV2Model:()=>n.RTDetrV2Model,RTDetrV2ObjectDetectionOutput:()=>n.RTDetrV2ObjectDetectionOutput,RTDetrV2PreTrainedModel:()=>n.RTDetrV2PreTrainedModel,RawAudio:()=>a.RawAudio,RawImage:()=>o.RawImage,RawVideo:()=>s.RawVideo,RawVideoFrame:()=>s.RawVideoFrame,RepetitionPenaltyLogitsProcessor:()=>x.RepetitionPenaltyLogitsProcessor,ResNetForImageClassification:()=>n.ResNetForImageClassification,ResNetModel:()=>n.ResNetModel,ResNetPreTrainedModel:()=>n.ResNetPreTrainedModel,RoFormerForMaskedLM:()=>n.RoFormerForMaskedLM,RoFormerForQuestionAnswering:()=>n.RoFormerForQuestionAnswering,RoFormerForSequenceClassification:()=>n.RoFormerForSequenceClassification,RoFormerForTokenClassification:()=>n.RoFormerForTokenClassification,RoFormerModel:()=>n.RoFormerModel,RoFormerPreTrainedModel:()=>n.RoFormerPreTrainedModel,RoFormerTokenizer:()=>r.RoFormerTokenizer,RobertaForMaskedLM:()=>n.RobertaForMaskedLM,RobertaForQuestionAnswering:()=>n.RobertaForQuestionAnswering,RobertaForSequenceClassification:()=>n.RobertaForSequenceClassification,RobertaForTokenClassification:()=>n.RobertaForTokenClassification,RobertaModel:()=>n.RobertaModel,RobertaPreTrainedModel:()=>n.RobertaPreTrainedModel,RobertaTokenizer:()=>r.RobertaTokenizer,SamImageProcessor:()=>m.SamImageProcessor,SamImageSegmentationOutput:()=>n.SamImageSegmentationOutput,SamModel:()=>n.SamModel,SamPreTrainedModel:()=>n.SamPreTrainedModel,SamProcessor:()=>_.SamProcessor,SapiensForDepthEstimation:()=>n.SapiensForDepthEstimation,SapiensForNormalEstimation:()=>n.SapiensForNormalEstimation,SapiensForSemanticSegmentation:()=>n.SapiensForSemanticSegmentation,SapiensPreTrainedModel:()=>n.SapiensPreTrainedModel,SeamlessM4TFeatureExtractor:()=>d.SeamlessM4TFeatureExtractor,SegformerFeatureExtractor:()=>m.SegformerFeatureExtractor,SegformerForImageClassification:()=>n.SegformerForImageClassification,SegformerForSemanticSegmentation:()=>n.SegformerForSemanticSegmentation,SegformerImageProcessor:()=>m.SegformerImageProcessor,SegformerModel:()=>n.SegformerModel,SegformerPreTrainedModel:()=>n.SegformerPreTrainedModel,Seq2SeqLMOutput:()=>n.Seq2SeqLMOutput,SequenceClassifierOutput:()=>n.SequenceClassifierOutput,SiglipImageProcessor:()=>m.SiglipImageProcessor,SiglipModel:()=>n.SiglipModel,SiglipPreTrainedModel:()=>n.SiglipPreTrainedModel,SiglipTextModel:()=>n.SiglipTextModel,SiglipTokenizer:()=>r.SiglipTokenizer,SiglipVisionModel:()=>n.SiglipVisionModel,SmolLM3ForCausalLM:()=>n.SmolLM3ForCausalLM,SmolLM3Model:()=>n.SmolLM3Model,SmolLM3PreTrainedModel:()=>n.SmolLM3PreTrainedModel,SmolVLMForConditionalGeneration:()=>n.SmolVLMForConditionalGeneration,SmolVLMImageProcessor:()=>m.SmolVLMImageProcessor,SmolVLMProcessor:()=>_.SmolVLMProcessor,SnacDecoderModel:()=>n.SnacDecoderModel,SnacEncoderModel:()=>n.SnacEncoderModel,SnacFeatureExtractor:()=>d.SnacFeatureExtractor,SnacModel:()=>n.SnacModel,SnacPreTrainedModel:()=>n.SnacPreTrainedModel,SpeechT5FeatureExtractor:()=>d.SpeechT5FeatureExtractor,SpeechT5ForSpeechToText:()=>n.SpeechT5ForSpeechToText,SpeechT5ForTextToSpeech:()=>n.SpeechT5ForTextToSpeech,SpeechT5HifiGan:()=>n.SpeechT5HifiGan,SpeechT5Model:()=>n.SpeechT5Model,SpeechT5PreTrainedModel:()=>n.SpeechT5PreTrainedModel,SpeechT5Processor:()=>_.SpeechT5Processor,SpeechT5Tokenizer:()=>r.SpeechT5Tokenizer,SqueezeBertForMaskedLM:()=>n.SqueezeBertForMaskedLM,SqueezeBertForQuestionAnswering:()=>n.SqueezeBertForQuestionAnswering,SqueezeBertForSequenceClassification:()=>n.SqueezeBertForSequenceClassification,SqueezeBertModel:()=>n.SqueezeBertModel,SqueezeBertPreTrainedModel:()=>n.SqueezeBertPreTrainedModel,SqueezeBertTokenizer:()=>r.SqueezeBertTokenizer,StableLmForCausalLM:()=>n.StableLmForCausalLM,StableLmModel:()=>n.StableLmModel,StableLmPreTrainedModel:()=>n.StableLmPreTrainedModel,Starcoder2ForCausalLM:()=>n.Starcoder2ForCausalLM,Starcoder2Model:()=>n.Starcoder2Model,Starcoder2PreTrainedModel:()=>n.Starcoder2PreTrainedModel,StoppingCriteria:()=>b.StoppingCriteria,StoppingCriteriaList:()=>b.StoppingCriteriaList,StyleTextToSpeech2Model:()=>n.StyleTextToSpeech2Model,StyleTextToSpeech2PreTrainedModel:()=>n.StyleTextToSpeech2PreTrainedModel,SummarizationPipeline:()=>t.SummarizationPipeline,SuppressTokensAtBeginLogitsProcessor:()=>x.SuppressTokensAtBeginLogitsProcessor,Swin2SRForImageSuperResolution:()=>n.Swin2SRForImageSuperResolution,Swin2SRImageProcessor:()=>m.Swin2SRImageProcessor,Swin2SRModel:()=>n.Swin2SRModel,Swin2SRPreTrainedModel:()=>n.Swin2SRPreTrainedModel,SwinForImageClassification:()=>n.SwinForImageClassification,SwinForSemanticSegmentation:()=>n.SwinForSemanticSegmentation,SwinModel:()=>n.SwinModel,SwinPreTrainedModel:()=>n.SwinPreTrainedModel,T5ForConditionalGeneration:()=>n.T5ForConditionalGeneration,T5Model:()=>n.T5Model,T5PreTrainedModel:()=>n.T5PreTrainedModel,T5Tokenizer:()=>r.T5Tokenizer,TableTransformerForObjectDetection:()=>n.TableTransformerForObjectDetection,TableTransformerModel:()=>n.TableTransformerModel,TableTransformerObjectDetectionOutput:()=>n.TableTransformerObjectDetectionOutput,TableTransformerPreTrainedModel:()=>n.TableTransformerPreTrainedModel,TemperatureLogitsWarper:()=>x.TemperatureLogitsWarper,Tensor:()=>c.Tensor,Text2TextGenerationPipeline:()=>t.Text2TextGenerationPipeline,TextClassificationPipeline:()=>t.TextClassificationPipeline,TextGenerationPipeline:()=>t.TextGenerationPipeline,TextStreamer:()=>y.TextStreamer,TextToAudioPipeline:()=>t.TextToAudioPipeline,TokenClassificationPipeline:()=>t.TokenClassificationPipeline,TokenClassifierOutput:()=>n.TokenClassifierOutput,TokenizerModel:()=>r.TokenizerModel,TopKLogitsWarper:()=>x.TopKLogitsWarper,TopPLogitsWarper:()=>x.TopPLogitsWarper,TrOCRForCausalLM:()=>n.TrOCRForCausalLM,TrOCRPreTrainedModel:()=>n.TrOCRPreTrainedModel,TranslationPipeline:()=>t.TranslationPipeline,UltravoxModel:()=>n.UltravoxModel,UltravoxPreTrainedModel:()=>n.UltravoxPreTrainedModel,UltravoxProcessor:()=>_.UltravoxProcessor,UniSpeechForCTC:()=>n.UniSpeechForCTC,UniSpeechForSequenceClassification:()=>n.UniSpeechForSequenceClassification,UniSpeechModel:()=>n.UniSpeechModel,UniSpeechPreTrainedModel:()=>n.UniSpeechPreTrainedModel,UniSpeechSatForAudioFrameClassification:()=>n.UniSpeechSatForAudioFrameClassification,UniSpeechSatForCTC:()=>n.UniSpeechSatForCTC,UniSpeechSatForSequenceClassification:()=>n.UniSpeechSatForSequenceClassification,UniSpeechSatModel:()=>n.UniSpeechSatModel,UniSpeechSatPreTrainedModel:()=>n.UniSpeechSatPreTrainedModel,VLChatProcessor:()=>_.VLChatProcessor,VLMImageProcessor:()=>m.VLMImageProcessor,ViTFeatureExtractor:()=>m.ViTFeatureExtractor,ViTForImageClassification:()=>n.ViTForImageClassification,ViTImageProcessor:()=>m.ViTImageProcessor,ViTMAEModel:()=>n.ViTMAEModel,ViTMAEPreTrainedModel:()=>n.ViTMAEPreTrainedModel,ViTMSNForImageClassification:()=>n.ViTMSNForImageClassification,ViTMSNModel:()=>n.ViTMSNModel,ViTMSNPreTrainedModel:()=>n.ViTMSNPreTrainedModel,ViTModel:()=>n.ViTModel,ViTPreTrainedModel:()=>n.ViTPreTrainedModel,VisionEncoderDecoderModel:()=>n.VisionEncoderDecoderModel,VitMatteForImageMatting:()=>n.VitMatteForImageMatting,VitMatteImageProcessor:()=>m.VitMatteImageProcessor,VitMattePreTrainedModel:()=>n.VitMattePreTrainedModel,VitPoseForPoseEstimation:()=>n.VitPoseForPoseEstimation,VitPoseImageProcessor:()=>m.VitPoseImageProcessor,VitPosePreTrainedModel:()=>n.VitPosePreTrainedModel,VitsModel:()=>n.VitsModel,VitsModelOutput:()=>n.VitsModelOutput,VitsPreTrainedModel:()=>n.VitsPreTrainedModel,VitsTokenizer:()=>r.VitsTokenizer,Wav2Vec2BertForCTC:()=>n.Wav2Vec2BertForCTC,Wav2Vec2BertForSequenceClassification:()=>n.Wav2Vec2BertForSequenceClassification,Wav2Vec2BertModel:()=>n.Wav2Vec2BertModel,Wav2Vec2BertPreTrainedModel:()=>n.Wav2Vec2BertPreTrainedModel,Wav2Vec2CTCTokenizer:()=>r.Wav2Vec2CTCTokenizer,Wav2Vec2FeatureExtractor:()=>d.Wav2Vec2FeatureExtractor,Wav2Vec2ForAudioFrameClassification:()=>n.Wav2Vec2ForAudioFrameClassification,Wav2Vec2ForCTC:()=>n.Wav2Vec2ForCTC,Wav2Vec2ForSequenceClassification:()=>n.Wav2Vec2ForSequenceClassification,Wav2Vec2Model:()=>n.Wav2Vec2Model,Wav2Vec2PreTrainedModel:()=>n.Wav2Vec2PreTrainedModel,Wav2Vec2Processor:()=>_.Wav2Vec2Processor,Wav2Vec2ProcessorWithLM:()=>_.Wav2Vec2ProcessorWithLM,WavLMForAudioFrameClassification:()=>n.WavLMForAudioFrameClassification,WavLMForCTC:()=>n.WavLMForCTC,WavLMForSequenceClassification:()=>n.WavLMForSequenceClassification,WavLMForXVector:()=>n.WavLMForXVector,WavLMModel:()=>n.WavLMModel,WavLMPreTrainedModel:()=>n.WavLMPreTrainedModel,WeSpeakerFeatureExtractor:()=>d.WeSpeakerFeatureExtractor,WeSpeakerResNetModel:()=>n.WeSpeakerResNetModel,WeSpeakerResNetPreTrainedModel:()=>n.WeSpeakerResNetPreTrainedModel,WhisperFeatureExtractor:()=>d.WhisperFeatureExtractor,WhisperForConditionalGeneration:()=>n.WhisperForConditionalGeneration,WhisperModel:()=>n.WhisperModel,WhisperPreTrainedModel:()=>n.WhisperPreTrainedModel,WhisperProcessor:()=>_.WhisperProcessor,WhisperTextStreamer:()=>y.WhisperTextStreamer,WhisperTimeStampLogitsProcessor:()=>x.WhisperTimeStampLogitsProcessor,WhisperTokenizer:()=>r.WhisperTokenizer,XLMForQuestionAnswering:()=>n.XLMForQuestionAnswering,XLMForSequenceClassification:()=>n.XLMForSequenceClassification,XLMForTokenClassification:()=>n.XLMForTokenClassification,XLMModel:()=>n.XLMModel,XLMPreTrainedModel:()=>n.XLMPreTrainedModel,XLMRobertaForMaskedLM:()=>n.XLMRobertaForMaskedLM,XLMRobertaForQuestionAnswering:()=>n.XLMRobertaForQuestionAnswering,XLMRobertaForSequenceClassification:()=>n.XLMRobertaForSequenceClassification,XLMRobertaForTokenClassification:()=>n.XLMRobertaForTokenClassification,XLMRobertaModel:()=>n.XLMRobertaModel,XLMRobertaPreTrainedModel:()=>n.XLMRobertaPreTrainedModel,XLMRobertaTokenizer:()=>r.XLMRobertaTokenizer,XLMTokenizer:()=>r.XLMTokenizer,XLMWithLMHeadModel:()=>n.XLMWithLMHeadModel,XVectorOutput:()=>n.XVectorOutput,YolosFeatureExtractor:()=>m.YolosFeatureExtractor,YolosForObjectDetection:()=>n.YolosForObjectDetection,YolosImageProcessor:()=>m.YolosImageProcessor,YolosModel:()=>n.YolosModel,YolosObjectDetectionOutput:()=>n.YolosObjectDetectionOutput,YolosPreTrainedModel:()=>n.YolosPreTrainedModel,ZeroShotAudioClassificationPipeline:()=>t.ZeroShotAudioClassificationPipeline,ZeroShotClassificationPipeline:()=>t.ZeroShotClassificationPipeline,ZeroShotImageClassificationPipeline:()=>t.ZeroShotImageClassificationPipeline,ZeroShotObjectDetectionPipeline:()=>t.ZeroShotObjectDetectionPipeline,bankers_round:()=>l.bankers_round,cat:()=>c.cat,cos_sim:()=>l.cos_sim,dot:()=>l.dot,dynamic_time_warping:()=>l.dynamic_time_warping,env:()=>e.env,full:()=>c.full,full_like:()=>c.full_like,getKeyValueShapes:()=>i.getKeyValueShapes,hamming:()=>a.hamming,hanning:()=>a.hanning,interpolate:()=>c.interpolate,interpolate_4d:()=>c.interpolate_4d,interpolate_data:()=>l.interpolate_data,is_chinese_char:()=>r.is_chinese_char,layer_norm:()=>c.layer_norm,load_image:()=>o.load_image,load_video:()=>s.load_video,log_softmax:()=>l.log_softmax,magnitude:()=>l.magnitude,matmul:()=>c.matmul,max:()=>l.max,mean:()=>c.mean,mean_pooling:()=>c.mean_pooling,medianFilter:()=>l.medianFilter,mel_filter_bank:()=>a.mel_filter_bank,min:()=>l.min,ones:()=>c.ones,ones_like:()=>c.ones_like,permute:()=>c.permute,permute_data:()=>l.permute_data,pipeline:()=>t.pipeline,quantize_embeddings:()=>c.quantize_embeddings,rand:()=>c.rand,read_audio:()=>a.read_audio,rfft:()=>c.rfft,round:()=>l.round,slice:()=>c.slice,softmax:()=>l.softmax,spectrogram:()=>a.spectrogram,stack:()=>c.stack,std_mean:()=>c.std_mean,topk:()=>c.topk,window_function:()=>a.window_function,zeros:()=>c.zeros,zeros_like:()=>c.zeros_like});var e=lf( /*! ./env.js */ `./src/env.js`),t=lf( /*! ./pipelines.js */ @@ -3595,4 +3595,4 @@ let af={url:self.location.href};var sf={"onnxruntime-common":e=>{e.exports=ne}," /*! ./generation/stopping_criteria.js */ `./src/generation/stopping_criteria.js`),x=lf( /*! ./generation/logits_process.js */ -`./src/generation/logits_process.js`)})();var uf=$.ASTFeatureExtractor,df=$.ASTForAudioClassification,ff=$.ASTModel,pf=$.ASTPreTrainedModel,mf=$.AlbertForMaskedLM,hf=$.AlbertForQuestionAnswering,gf=$.AlbertForSequenceClassification,_f=$.AlbertModel,vf=$.AlbertPreTrainedModel,yf=$.AlbertTokenizer,bf=$.AudioClassificationPipeline,xf=$.AutoConfig,Sf=$.AutoFeatureExtractor,Cf=$.AutoImageProcessor,wf=$.AutoModel,Tf=$.AutoModelForAudioClassification,Ef=$.AutoModelForAudioFrameClassification,Df=$.AutoModelForAudioTextToText,Of=$.AutoModelForCTC,kf=$.AutoModelForCausalLM,Af=$.AutoModelForDepthEstimation,jf=$.AutoModelForDocumentQuestionAnswering,Mf=$.AutoModelForImageClassification,Nf=$.AutoModelForImageFeatureExtraction,Pf=$.AutoModelForImageMatting,Ff=$.AutoModelForImageSegmentation,If=$.AutoModelForImageTextToText,Lf=$.AutoModelForImageToImage,Rf=$.AutoModelForMaskGeneration,zf=$.AutoModelForMaskedLM,Bf=$.AutoModelForNormalEstimation,Vf=$.AutoModelForObjectDetection,Hf=$.AutoModelForPoseEstimation,Uf=$.AutoModelForQuestionAnswering,Wf=$.AutoModelForSemanticSegmentation,Gf=$.AutoModelForSeq2SeqLM,Kf=$.AutoModelForSequenceClassification,qf=$.AutoModelForSpeechSeq2Seq,Jf=$.AutoModelForTextToSpectrogram,Yf=$.AutoModelForTextToWaveform,Xf=$.AutoModelForTokenClassification,Zf=$.AutoModelForUniversalSegmentation,Qf=$.AutoModelForVision2Seq,$f=$.AutoModelForXVector,ep=$.AutoModelForZeroShotObjectDetection,tp=$.AutoProcessor,np=$.AutoTokenizer,rp=$.AutomaticSpeechRecognitionPipeline,ip=$.BackgroundRemovalPipeline,ap=$.BartForConditionalGeneration,op=$.BartForSequenceClassification,sp=$.BartModel,cp=$.BartPretrainedModel,lp=$.BartTokenizer,up=$.BaseModelOutput,dp=$.BaseStreamer,fp=$.BeitFeatureExtractor,pp=$.BeitForImageClassification,mp=$.BeitModel,hp=$.BeitPreTrainedModel,gp=$.BertForMaskedLM,_p=$.BertForQuestionAnswering,vp=$.BertForSequenceClassification,yp=$.BertForTokenClassification,bp=$.BertModel,xp=$.BertPreTrainedModel,Sp=$.BertTokenizer,Cp=$.BitImageProcessor,wp=$.BlenderbotForConditionalGeneration,Tp=$.BlenderbotModel,Ep=$.BlenderbotPreTrainedModel,Dp=$.BlenderbotSmallForConditionalGeneration,Op=$.BlenderbotSmallModel,kp=$.BlenderbotSmallPreTrainedModel,Ap=$.BlenderbotSmallTokenizer,jp=$.BlenderbotTokenizer,Mp=$.BloomForCausalLM,Np=$.BloomModel,Pp=$.BloomPreTrainedModel,Fp=$.BloomTokenizer,Ip=$.CLIPFeatureExtractor,Lp=$.CLIPImageProcessor,Rp=$.CLIPModel,zp=$.CLIPPreTrainedModel,Bp=$.CLIPSegForImageSegmentation,Vp=$.CLIPSegModel,Hp=$.CLIPSegPreTrainedModel,Up=$.CLIPTextModel,Wp=$.CLIPTextModelWithProjection,Gp=$.CLIPTokenizer,Kp=$.CLIPVisionModel,qp=$.CLIPVisionModelWithProjection,Jp=$.CamembertForMaskedLM,Yp=$.CamembertForQuestionAnswering,Xp=$.CamembertForSequenceClassification,Zp=$.CamembertForTokenClassification,Qp=$.CamembertModel,$p=$.CamembertPreTrainedModel,em=$.CamembertTokenizer,tm=$.CausalLMOutput,nm=$.CausalLMOutputWithPast,rm=$.ChineseCLIPFeatureExtractor,im=$.ChineseCLIPModel,am=$.ChineseCLIPPreTrainedModel,om=$.ClapAudioModelWithProjection,sm=$.ClapFeatureExtractor,cm=$.ClapModel,lm=$.ClapPreTrainedModel,um=$.ClapTextModelWithProjection,dm=$.ClassifierFreeGuidanceLogitsProcessor,fm=$.CodeGenForCausalLM,pm=$.CodeGenModel,mm=$.CodeGenPreTrainedModel,hm=$.CodeGenTokenizer,gm=$.CodeLlamaTokenizer,_m=$.CohereForCausalLM,vm=$.CohereModel,ym=$.CoherePreTrainedModel,bm=$.CohereTokenizer,xm=$.ConvBertForMaskedLM,Sm=$.ConvBertForQuestionAnswering,Cm=$.ConvBertForSequenceClassification,wm=$.ConvBertForTokenClassification,Tm=$.ConvBertModel,Em=$.ConvBertPreTrainedModel,Dm=$.ConvBertTokenizer,Om=$.ConvNextFeatureExtractor,km=$.ConvNextForImageClassification,Am=$.ConvNextImageProcessor,jm=$.ConvNextModel,Mm=$.ConvNextPreTrainedModel,Nm=$.ConvNextV2ForImageClassification,Pm=$.ConvNextV2Model,Fm=$.ConvNextV2PreTrainedModel,Im=$.DFineForObjectDetection,Lm=$.DFineModel,Rm=$.DFinePreTrainedModel,zm=$.DPTFeatureExtractor,Bm=$.DPTForDepthEstimation,Vm=$.DPTImageProcessor,Hm=$.DPTModel,Um=$.DPTPreTrainedModel,Wm=$.DacDecoderModel,Gm=$.DacDecoderOutput,Km=$.DacEncoderModel,qm=$.DacEncoderOutput,Jm=$.DacFeatureExtractor,Ym=$.DacModel,Xm=$.DacPreTrainedModel,Zm=$.DataTypeMap,Qm=$.DebertaForMaskedLM,$m=$.DebertaForQuestionAnswering,eh=$.DebertaForSequenceClassification,th=$.DebertaForTokenClassification,nh=$.DebertaModel,rh=$.DebertaPreTrainedModel,ih=$.DebertaTokenizer,ah=$.DebertaV2ForMaskedLM,oh=$.DebertaV2ForQuestionAnswering,sh=$.DebertaV2ForSequenceClassification,ch=$.DebertaV2ForTokenClassification,lh=$.DebertaV2Model,uh=$.DebertaV2PreTrainedModel,dh=$.DebertaV2Tokenizer,fh=$.DecisionTransformerModel,ph=$.DecisionTransformerPreTrainedModel,mh=$.DeiTFeatureExtractor,hh=$.DeiTForImageClassification,gh=$.DeiTImageProcessor,_h=$.DeiTModel,vh=$.DeiTPreTrainedModel,yh=$.DepthAnythingForDepthEstimation,bh=$.DepthAnythingPreTrainedModel,xh=$.DepthEstimationPipeline,Sh=$.DepthProForDepthEstimation,Ch=$.DepthProPreTrainedModel,wh=$.DetrFeatureExtractor,Th=$.DetrForObjectDetection,Eh=$.DetrForSegmentation,Dh=$.DetrImageProcessor,Oh=$.DetrModel,kh=$.DetrObjectDetectionOutput,Ah=$.DetrPreTrainedModel,jh=$.DetrSegmentationOutput,Mh=$.Dinov2ForImageClassification,Nh=$.Dinov2Model,Ph=$.Dinov2PreTrainedModel,Fh=$.Dinov2WithRegistersForImageClassification,Ih=$.Dinov2WithRegistersModel,Lh=$.Dinov2WithRegistersPreTrainedModel,Rh=$.DistilBertForMaskedLM,zh=$.DistilBertForQuestionAnswering,Bh=$.DistilBertForSequenceClassification,Vh=$.DistilBertForTokenClassification,Hh=$.DistilBertModel,Uh=$.DistilBertPreTrainedModel,Wh=$.DistilBertTokenizer,Gh=$.DocumentQuestionAnsweringPipeline,Kh=$.DonutFeatureExtractor,qh=$.DonutImageProcessor,Jh=$.DonutSwinModel,Yh=$.DonutSwinPreTrainedModel,Xh=$.EfficientNetForImageClassification,Zh=$.EfficientNetImageProcessor,Qh=$.EfficientNetModel,$h=$.EfficientNetPreTrainedModel,eg=$.ElectraForMaskedLM,tg=$.ElectraForQuestionAnswering,ng=$.ElectraForSequenceClassification,rg=$.ElectraForTokenClassification,ig=$.ElectraModel,ag=$.ElectraPreTrainedModel,og=$.ElectraTokenizer,sg=$.EncodecFeatureExtractor,cg=$.EosTokenCriteria,lg=$.EsmForMaskedLM,ug=$.EsmForSequenceClassification,dg=$.EsmForTokenClassification,fg=$.EsmModel,pg=$.EsmPreTrainedModel,mg=$.EsmTokenizer,hg=$.ExaoneForCausalLM,gg=$.ExaoneModel,_g=$.ExaonePreTrainedModel,vg=$.FFT,yg=$.FalconForCausalLM,bg=$.FalconModel,xg=$.FalconPreTrainedModel,Sg=$.FalconTokenizer,Cg=$.FastViTForImageClassification,wg=$.FastViTModel,Tg=$.FastViTPreTrainedModel,Eg=$.FeatureExtractionPipeline,Dg=$.FeatureExtractor,Og=$.FillMaskPipeline,kg=$.Florence2ForConditionalGeneration,Ag=$.Florence2PreTrainedModel,jg=$.Florence2Processor,Mg=$.ForcedBOSTokenLogitsProcessor,Ng=$.ForcedEOSTokenLogitsProcessor,Pg=$.GLPNFeatureExtractor,Fg=$.GLPNForDepthEstimation,Ig=$.GLPNModel,Lg=$.GLPNPreTrainedModel,Rg=$.GPT2LMHeadModel,zg=$.GPT2Model,Bg=$.GPT2PreTrainedModel,Vg=$.GPT2Tokenizer,Hg=$.GPTBigCodeForCausalLM,Ug=$.GPTBigCodeModel,Wg=$.GPTBigCodePreTrainedModel,Gg=$.GPTJForCausalLM,Kg=$.GPTJModel,qg=$.GPTJPreTrainedModel,Jg=$.GPTNeoForCausalLM,Yg=$.GPTNeoModel,Xg=$.GPTNeoPreTrainedModel,Zg=$.GPTNeoXForCausalLM,Qg=$.GPTNeoXModel,$g=$.GPTNeoXPreTrainedModel,e_=$.GPTNeoXTokenizer,t_=$.Gemma2ForCausalLM,n_=$.Gemma2Model,r_=$.Gemma2PreTrainedModel,i_=$.Gemma3ForCausalLM,a_=$.Gemma3Model,o_=$.Gemma3PreTrainedModel,s_=$.Gemma3nAudioFeatureExtractor,c_=$.Gemma3nForConditionalGeneration,l_=$.Gemma3nPreTrainedModel,u_=$.Gemma3nProcessor,d_=$.GemmaForCausalLM,f_=$.GemmaModel,p_=$.GemmaPreTrainedModel,m_=$.GemmaTokenizer,h_=$.GlmForCausalLM,g_=$.GlmModel,__=$.GlmPreTrainedModel,v_=$.GraniteForCausalLM,y_=$.GraniteModel,b_=$.GranitePreTrainedModel,x_=$.Grok1Tokenizer,S_=$.GroundingDinoForObjectDetection,C_=$.GroundingDinoImageProcessor,w_=$.GroundingDinoPreTrainedModel,T_=$.GroundingDinoProcessor,E_=$.GroupViTModel,D_=$.GroupViTPreTrainedModel,O_=$.HeliumForCausalLM,k_=$.HeliumModel,A_=$.HeliumPreTrainedModel,j_=$.HerbertTokenizer,M_=$.HieraForImageClassification,N_=$.HieraModel,P_=$.HieraPreTrainedModel,F_=$.HubertForCTC,I_=$.HubertForSequenceClassification,L_=$.HubertModel,R_=$.HubertPreTrainedModel,z_=$.IJepaForImageClassification,B_=$.IJepaModel,V_=$.IJepaPreTrainedModel,H_=$.Idefics3ForConditionalGeneration,U_=$.Idefics3ImageProcessor,W_=$.Idefics3PreTrainedModel,G_=$.Idefics3Processor,K_=$.ImageClassificationPipeline,q_=$.ImageFeatureExtractionPipeline,J_=$.ImageFeatureExtractor,Y_=$.ImageMattingOutput,X_=$.ImageProcessor,Z_=$.ImageSegmentationPipeline,Q_=$.ImageToImagePipeline,$_=$.ImageToTextPipeline,ev=$.InterruptableStoppingCriteria,tv=$.JAISLMHeadModel,nv=$.JAISModel,rv=$.JAISPreTrainedModel,iv=$.JinaCLIPImageProcessor,av=$.JinaCLIPModel,ov=$.JinaCLIPPreTrainedModel,sv=$.JinaCLIPProcessor,cv=$.JinaCLIPTextModel,lv=$.JinaCLIPVisionModel,uv=$.LiteWhisperForConditionalGeneration,dv=$.LlamaForCausalLM,fv=$.LlamaModel,pv=$.LlamaPreTrainedModel,mv=$.LlamaTokenizer,hv=$.LlavaForConditionalGeneration,gv=$.LlavaOnevisionForConditionalGeneration,_v=$.LlavaOnevisionImageProcessor,vv=$.LlavaPreTrainedModel,yv=$.LlavaProcessor,bv=$.LlavaQwen2ForCausalLM,xv=$.LogitsProcessor,Sv=$.LogitsProcessorList,Cv=$.LogitsWarper,wv=$.LongT5ForConditionalGeneration,Tv=$.LongT5Model,Ev=$.LongT5PreTrainedModel,Dv=$.M2M100ForConditionalGeneration,Ov=$.M2M100Model,kv=$.M2M100PreTrainedModel,Av=$.M2M100Tokenizer,jv=$.MBart50Tokenizer,Mv=$.MBartForCausalLM,Nv=$.MBartForConditionalGeneration,Pv=$.MBartForSequenceClassification,Fv=$.MBartModel,Iv=$.MBartPreTrainedModel,Lv=$.MBartTokenizer,Rv=$.MPNetForMaskedLM,zv=$.MPNetForQuestionAnswering,Bv=$.MPNetForSequenceClassification,Vv=$.MPNetForTokenClassification,Hv=$.MPNetModel,Uv=$.MPNetPreTrainedModel,Wv=$.MPNetTokenizer,Gv=$.MT5ForConditionalGeneration,Kv=$.MT5Model,qv=$.MT5PreTrainedModel,Jv=$.MarianMTModel,Yv=$.MarianModel,Xv=$.MarianPreTrainedModel,Zv=$.MarianTokenizer,Qv=$.Mask2FormerImageProcessor,$v=$.MaskFormerFeatureExtractor,ey=$.MaskFormerForInstanceSegmentation,ty=$.MaskFormerImageProcessor,ny=$.MaskFormerModel,ry=$.MaskFormerPreTrainedModel,iy=$.MaskedLMOutput,ay=$.MaxLengthCriteria,oy=$.Metric3DForDepthEstimation,sy=$.Metric3DPreTrainedModel,cy=$.Metric3Dv2ForDepthEstimation,ly=$.Metric3Dv2PreTrainedModel,uy=$.MgpstrForSceneTextRecognition,dy=$.MgpstrModelOutput,fy=$.MgpstrPreTrainedModel,py=$.MgpstrProcessor,my=$.MgpstrTokenizer,hy=$.MimiDecoderModel,gy=$.MimiDecoderOutput,_y=$.MimiEncoderModel,vy=$.MimiEncoderOutput,yy=$.MimiModel,by=$.MimiPreTrainedModel,xy=$.MinLengthLogitsProcessor,Sy=$.MinNewTokensLengthLogitsProcessor,Cy=$.MistralForCausalLM,wy=$.MistralModel,Ty=$.MistralPreTrainedModel,Ey=$.MobileBertForMaskedLM,Dy=$.MobileBertForQuestionAnswering,Oy=$.MobileBertForSequenceClassification,ky=$.MobileBertModel,Ay=$.MobileBertPreTrainedModel,jy=$.MobileBertTokenizer,My=$.MobileLLMForCausalLM,Ny=$.MobileLLMModel,Py=$.MobileLLMPreTrainedModel,Fy=$.MobileNetV1FeatureExtractor,Iy=$.MobileNetV1ForImageClassification,Ly=$.MobileNetV1ForSemanticSegmentation,Ry=$.MobileNetV1ImageProcessor,zy=$.MobileNetV1Model,By=$.MobileNetV1PreTrainedModel,Vy=$.MobileNetV2FeatureExtractor,Hy=$.MobileNetV2ForImageClassification,Uy=$.MobileNetV2ForSemanticSegmentation,Wy=$.MobileNetV2ImageProcessor,Gy=$.MobileNetV2Model,Ky=$.MobileNetV2PreTrainedModel,qy=$.MobileNetV3FeatureExtractor,Jy=$.MobileNetV3ForImageClassification,Yy=$.MobileNetV3ForSemanticSegmentation,Xy=$.MobileNetV3ImageProcessor,Zy=$.MobileNetV3Model,Qy=$.MobileNetV3PreTrainedModel,$y=$.MobileNetV4FeatureExtractor,eb=$.MobileNetV4ForImageClassification,tb=$.MobileNetV4ForSemanticSegmentation,nb=$.MobileNetV4ImageProcessor,rb=$.MobileNetV4Model,ib=$.MobileNetV4PreTrainedModel,ab=$.MobileViTFeatureExtractor,ob=$.MobileViTForImageClassification,sb=$.MobileViTImageProcessor,cb=$.MobileViTModel,lb=$.MobileViTPreTrainedModel,ub=$.MobileViTV2ForImageClassification,db=$.MobileViTV2Model,fb=$.MobileViTV2PreTrainedModel,pb=$.ModelOutput,mb=$.ModernBertForMaskedLM,hb=$.ModernBertForSequenceClassification,gb=$.ModernBertForTokenClassification,_b=$.ModernBertModel,vb=$.ModernBertPreTrainedModel,yb=$.Moondream1ForConditionalGeneration,bb=$.MoonshineFeatureExtractor,xb=$.MoonshineForConditionalGeneration,Sb=$.MoonshineModel,Cb=$.MoonshinePreTrainedModel,wb=$.MoonshineProcessor,Tb=$.MptForCausalLM,Eb=$.MptModel,Db=$.MptPreTrainedModel,Ob=$.MultiModalityCausalLM,kb=$.MultiModalityPreTrainedModel,Ab=$.MusicgenForCausalLM,jb=$.MusicgenForConditionalGeneration,Mb=$.MusicgenModel,Nb=$.MusicgenPreTrainedModel,Pb=$.NeoBertForMaskedLM,Fb=$.NeoBertForQuestionAnswering,Ib=$.NeoBertForSequenceClassification,Lb=$.NeoBertForTokenClassification,Rb=$.NeoBertModel,zb=$.NeoBertPreTrainedModel,Bb=$.NllbTokenizer,Vb=$.NoBadWordsLogitsProcessor,Hb=$.NoRepeatNGramLogitsProcessor,Ub=$.NomicBertModel,Wb=$.NomicBertPreTrainedModel,Gb=$.NougatImageProcessor,Kb=$.NougatTokenizer,qb=$.OPTForCausalLM,Jb=$.OPTModel,Yb=$.OPTPreTrainedModel,Xb=$.ObjectDetectionPipeline,Zb=$.Olmo2ForCausalLM,Qb=$.Olmo2Model,$b=$.Olmo2PreTrainedModel,ex=$.OlmoForCausalLM,tx=$.OlmoModel,nx=$.OlmoPreTrainedModel,rx=$.OpenELMForCausalLM,ix=$.OpenELMModel,ax=$.OpenELMPreTrainedModel,ox=$.OwlViTFeatureExtractor,sx=$.OwlViTForObjectDetection,cx=$.OwlViTImageProcessor,lx=$.OwlViTModel,ux=$.OwlViTPreTrainedModel,dx=$.OwlViTProcessor,fx=$.Owlv2ForObjectDetection,px=$.Owlv2ImageProcessor,mx=$.Owlv2Model,hx=$.Owlv2PreTrainedModel,gx=$.PaliGemmaForConditionalGeneration,_x=$.PaliGemmaPreTrainedModel,vx=$.PaliGemmaProcessor,yx=$.PatchTSMixerForPrediction,bx=$.PatchTSMixerModel,xx=$.PatchTSMixerPreTrainedModel,Sx=$.PatchTSTForPrediction,Cx=$.PatchTSTModel,wx=$.PatchTSTPreTrainedModel,Tx=$.Phi3ForCausalLM,Ex=$.Phi3Model,Dx=$.Phi3PreTrainedModel,Ox=$.Phi3VForCausalLM,kx=$.Phi3VImageProcessor,Ax=$.Phi3VPreTrainedModel,jx=$.Phi3VProcessor,Mx=$.PhiForCausalLM,Nx=$.PhiModel,Px=$.PhiPreTrainedModel,Fx=$.Pipeline,Ix=$.PreTrainedModel,Lx=$.PreTrainedTokenizer,Rx=$.PretrainedConfig,zx=$.PretrainedMixin,Bx=$.Processor,Vx=$.PvtForImageClassification,Hx=$.PvtImageProcessor,Ux=$.PvtModel,Wx=$.PvtPreTrainedModel,Gx=$.PyAnnoteFeatureExtractor,Kx=$.PyAnnoteForAudioFrameClassification,qx=$.PyAnnoteModel,Jx=$.PyAnnotePreTrainedModel,Yx=$.PyAnnoteProcessor,Xx=$.QuestionAnsweringModelOutput,Zx=$.QuestionAnsweringPipeline,Qx=$.Qwen2ForCausalLM,$x=$.Qwen2Model,eS=$.Qwen2PreTrainedModel,tS=$.Qwen2Tokenizer,nS=$.Qwen2VLForConditionalGeneration,rS=$.Qwen2VLImageProcessor,iS=$.Qwen2VLPreTrainedModel,aS=$.Qwen2VLProcessor,oS=$.Qwen3ForCausalLM,sS=$.Qwen3Model,cS=$.Qwen3PreTrainedModel,lS=$.RFDetrForObjectDetection,uS=$.RFDetrModel,dS=$.RFDetrObjectDetectionOutput,fS=$.RFDetrPreTrainedModel,pS=$.RTDetrForObjectDetection,mS=$.RTDetrImageProcessor,hS=$.RTDetrModel,gS=$.RTDetrObjectDetectionOutput,_S=$.RTDetrPreTrainedModel,vS=$.RTDetrV2ForObjectDetection,yS=$.RTDetrV2Model,bS=$.RTDetrV2ObjectDetectionOutput,xS=$.RTDetrV2PreTrainedModel,SS=$.RawAudio,CS=$.RawImage,wS=$.RawVideo,TS=$.RawVideoFrame,ES=$.RepetitionPenaltyLogitsProcessor,DS=$.ResNetForImageClassification,OS=$.ResNetModel,kS=$.ResNetPreTrainedModel,AS=$.RoFormerForMaskedLM,jS=$.RoFormerForQuestionAnswering,MS=$.RoFormerForSequenceClassification,NS=$.RoFormerForTokenClassification,PS=$.RoFormerModel,FS=$.RoFormerPreTrainedModel,IS=$.RoFormerTokenizer,LS=$.RobertaForMaskedLM,RS=$.RobertaForQuestionAnswering,zS=$.RobertaForSequenceClassification,BS=$.RobertaForTokenClassification,VS=$.RobertaModel,HS=$.RobertaPreTrainedModel,US=$.RobertaTokenizer,WS=$.SamImageProcessor,GS=$.SamImageSegmentationOutput,KS=$.SamModel,qS=$.SamPreTrainedModel,JS=$.SamProcessor,YS=$.SapiensForDepthEstimation,XS=$.SapiensForNormalEstimation,ZS=$.SapiensForSemanticSegmentation,QS=$.SapiensPreTrainedModel,$S=$.SeamlessM4TFeatureExtractor,eC=$.SegformerFeatureExtractor,tC=$.SegformerForImageClassification,nC=$.SegformerForSemanticSegmentation,rC=$.SegformerImageProcessor,iC=$.SegformerModel,aC=$.SegformerPreTrainedModel,oC=$.Seq2SeqLMOutput,sC=$.SequenceClassifierOutput,cC=$.SiglipImageProcessor,lC=$.SiglipModel,uC=$.SiglipPreTrainedModel,dC=$.SiglipTextModel,fC=$.SiglipTokenizer,pC=$.SiglipVisionModel,mC=$.SmolVLMForConditionalGeneration,hC=$.SmolVLMImageProcessor,gC=$.SmolVLMProcessor,_C=$.SnacDecoderModel,vC=$.SnacEncoderModel,yC=$.SnacFeatureExtractor,bC=$.SnacModel,xC=$.SnacPreTrainedModel,SC=$.SpeechT5FeatureExtractor,CC=$.SpeechT5ForSpeechToText,wC=$.SpeechT5ForTextToSpeech,TC=$.SpeechT5HifiGan,EC=$.SpeechT5Model,DC=$.SpeechT5PreTrainedModel,OC=$.SpeechT5Processor,kC=$.SpeechT5Tokenizer,AC=$.SqueezeBertForMaskedLM,jC=$.SqueezeBertForQuestionAnswering,MC=$.SqueezeBertForSequenceClassification,NC=$.SqueezeBertModel,PC=$.SqueezeBertPreTrainedModel,FC=$.SqueezeBertTokenizer,IC=$.StableLmForCausalLM,LC=$.StableLmModel,RC=$.StableLmPreTrainedModel,zC=$.Starcoder2ForCausalLM,BC=$.Starcoder2Model,VC=$.Starcoder2PreTrainedModel,HC=$.StoppingCriteria,UC=$.StoppingCriteriaList,WC=$.StyleTextToSpeech2Model,GC=$.StyleTextToSpeech2PreTrainedModel,KC=$.SummarizationPipeline,qC=$.SuppressTokensAtBeginLogitsProcessor,JC=$.Swin2SRForImageSuperResolution,YC=$.Swin2SRImageProcessor,XC=$.Swin2SRModel,ZC=$.Swin2SRPreTrainedModel,QC=$.SwinForImageClassification,$C=$.SwinForSemanticSegmentation,ew=$.SwinModel,tw=$.SwinPreTrainedModel,nw=$.T5ForConditionalGeneration,rw=$.T5Model,iw=$.T5PreTrainedModel,aw=$.T5Tokenizer,ow=$.TableTransformerForObjectDetection,sw=$.TableTransformerModel,cw=$.TableTransformerObjectDetectionOutput,lw=$.TableTransformerPreTrainedModel,uw=$.TemperatureLogitsWarper,dw=$.Tensor,fw=$.Text2TextGenerationPipeline,pw=$.TextClassificationPipeline,mw=$.TextGenerationPipeline,hw=$.TextStreamer,gw=$.TextToAudioPipeline,_w=$.TokenClassificationPipeline,vw=$.TokenClassifierOutput,yw=$.TokenizerModel,bw=$.TopKLogitsWarper,xw=$.TopPLogitsWarper,Sw=$.TrOCRForCausalLM,Cw=$.TrOCRPreTrainedModel,ww=$.TranslationPipeline,Tw=$.UltravoxModel,Ew=$.UltravoxPreTrainedModel,Dw=$.UltravoxProcessor,Ow=$.UniSpeechForCTC,kw=$.UniSpeechForSequenceClassification,Aw=$.UniSpeechModel,jw=$.UniSpeechPreTrainedModel,Mw=$.UniSpeechSatForAudioFrameClassification,Nw=$.UniSpeechSatForCTC,Pw=$.UniSpeechSatForSequenceClassification,Fw=$.UniSpeechSatModel,Iw=$.UniSpeechSatPreTrainedModel,Lw=$.VLChatProcessor,Rw=$.VLMImageProcessor,zw=$.ViTFeatureExtractor,Bw=$.ViTForImageClassification,Vw=$.ViTImageProcessor,Hw=$.ViTMAEModel,Uw=$.ViTMAEPreTrainedModel,Ww=$.ViTMSNForImageClassification,Gw=$.ViTMSNModel,Kw=$.ViTMSNPreTrainedModel,qw=$.ViTModel,Jw=$.ViTPreTrainedModel,Yw=$.VisionEncoderDecoderModel,Xw=$.VitMatteForImageMatting,Zw=$.VitMatteImageProcessor,Qw=$.VitMattePreTrainedModel,$w=$.VitPoseForPoseEstimation,eT=$.VitPoseImageProcessor,tT=$.VitPosePreTrainedModel,nT=$.VitsModel,rT=$.VitsModelOutput,iT=$.VitsPreTrainedModel,aT=$.VitsTokenizer,oT=$.Wav2Vec2BertForCTC,sT=$.Wav2Vec2BertForSequenceClassification,cT=$.Wav2Vec2BertModel,lT=$.Wav2Vec2BertPreTrainedModel,uT=$.Wav2Vec2CTCTokenizer,dT=$.Wav2Vec2FeatureExtractor,fT=$.Wav2Vec2ForAudioFrameClassification,pT=$.Wav2Vec2ForCTC,mT=$.Wav2Vec2ForSequenceClassification,hT=$.Wav2Vec2Model,gT=$.Wav2Vec2PreTrainedModel,_T=$.Wav2Vec2Processor,vT=$.Wav2Vec2ProcessorWithLM,yT=$.WavLMForAudioFrameClassification,bT=$.WavLMForCTC,xT=$.WavLMForSequenceClassification,ST=$.WavLMForXVector,CT=$.WavLMModel,wT=$.WavLMPreTrainedModel,TT=$.WeSpeakerFeatureExtractor,ET=$.WeSpeakerResNetModel,DT=$.WeSpeakerResNetPreTrainedModel,OT=$.WhisperFeatureExtractor,kT=$.WhisperForConditionalGeneration,AT=$.WhisperModel,jT=$.WhisperPreTrainedModel,MT=$.WhisperProcessor,NT=$.WhisperTextStreamer,PT=$.WhisperTimeStampLogitsProcessor,FT=$.WhisperTokenizer,IT=$.XLMForQuestionAnswering,LT=$.XLMForSequenceClassification,RT=$.XLMForTokenClassification,zT=$.XLMModel,BT=$.XLMPreTrainedModel,VT=$.XLMRobertaForMaskedLM,HT=$.XLMRobertaForQuestionAnswering,UT=$.XLMRobertaForSequenceClassification,WT=$.XLMRobertaForTokenClassification,GT=$.XLMRobertaModel,KT=$.XLMRobertaPreTrainedModel,qT=$.XLMRobertaTokenizer,JT=$.XLMTokenizer,YT=$.XLMWithLMHeadModel,XT=$.XVectorOutput,ZT=$.YolosFeatureExtractor,QT=$.YolosForObjectDetection,$T=$.YolosImageProcessor,eE=$.YolosModel,tE=$.YolosObjectDetectionOutput,nE=$.YolosPreTrainedModel,rE=$.ZeroShotAudioClassificationPipeline,iE=$.ZeroShotClassificationPipeline,aE=$.ZeroShotImageClassificationPipeline,oE=$.ZeroShotObjectDetectionPipeline,sE=$.bankers_round,cE=$.cat,lE=$.cos_sim,uE=$.dot,dE=$.dynamic_time_warping,fE=$.env,pE=$.full,mE=$.full_like,hE=$.getKeyValueShapes,gE=$.hamming,_E=$.hanning,vE=$.interpolate,yE=$.interpolate_4d,bE=$.interpolate_data,xE=$.is_chinese_char,SE=$.layer_norm,CE=$.load_image,wE=$.load_video,TE=$.log_softmax,EE=$.magnitude,DE=$.matmul,OE=$.max,kE=$.mean,AE=$.mean_pooling,jE=$.medianFilter,ME=$.mel_filter_bank,NE=$.min,PE=$.ones,FE=$.ones_like,IE=$.permute,LE=$.permute_data,RE=$.pipeline,zE=$.quantize_embeddings,BE=$.rand,VE=$.read_audio,HE=$.rfft,UE=$.round,WE=$.slice,GE=$.softmax,KE=$.spectrogram,qE=$.stack,JE=$.std_mean,YE=$.topk,XE=$.window_function,ZE=$.zeros,QE=$.zeros_like;let $E=64;var eD=class{static model_id=null;static tokenizer;static processor;static model;static async getInstance(e){return this.model_id=`onnx-community/whisper-large-v3-turbo`,this.tokenizer??=np.from_pretrained(this.model_id,{progress_callback:e}),this.processor??=tp.from_pretrained(this.model_id,{progress_callback:e}),this.model??=kT.from_pretrained(this.model_id,{dtype:{encoder_model:`fp16`,decoder_model_merged:`q4`},device:`webgpu`,progress_callback:e}),Promise.all([this.tokenizer,this.processor,this.model])}};async function tD(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e{o??=performance.now();let t;s++>0&&(t=s/(performance.now()-o)*1e3),globalThis.postMessage({status:`update`,output:e,tps:t,numTokens:s})},l=new hw(r,{skip_prompt:!0,decode_kwargs:{skip_special_tokens:!0},callback_function:c}),u=await i(n),d=await a.generate({...u,max_new_tokens:$E,language:t,streamer:l}),f=r.batch_decode(d,{skip_special_tokens:!0});globalThis.postMessage({status:`complete`,output:f}),nD=!1}async function iD(){globalThis.postMessage({status:`loading`,data:`Loading model...`});let[e,t,n]=await eD.getInstance(e=>{globalThis.postMessage(e)});globalThis.postMessage({status:`loading`,data:`Compiling shaders and warming up model...`}),await n.generate({input_features:pE([1,128,3e3],0),max_new_tokens:1}),globalThis.postMessage({status:`ready`})}globalThis.addEventListener(`message`,async e=>{let{type:t,data:n}=e.data;switch(t){case`load`:iD();break;case`generate`:rD(n);break}})})(); \ No newline at end of file +`./src/generation/logits_process.js`)})();var uf=$.ASTFeatureExtractor,df=$.ASTForAudioClassification,ff=$.ASTModel,pf=$.ASTPreTrainedModel,mf=$.AlbertForMaskedLM,hf=$.AlbertForQuestionAnswering,gf=$.AlbertForSequenceClassification,_f=$.AlbertModel,vf=$.AlbertPreTrainedModel,yf=$.AlbertTokenizer,bf=$.AudioClassificationPipeline,xf=$.AutoConfig,Sf=$.AutoFeatureExtractor,Cf=$.AutoImageProcessor,wf=$.AutoModel,Tf=$.AutoModelForAudioClassification,Ef=$.AutoModelForAudioFrameClassification,Df=$.AutoModelForAudioTextToText,Of=$.AutoModelForCTC,kf=$.AutoModelForCausalLM,Af=$.AutoModelForDepthEstimation,jf=$.AutoModelForDocumentQuestionAnswering,Mf=$.AutoModelForImageClassification,Nf=$.AutoModelForImageFeatureExtraction,Pf=$.AutoModelForImageMatting,Ff=$.AutoModelForImageSegmentation,If=$.AutoModelForImageTextToText,Lf=$.AutoModelForImageToImage,Rf=$.AutoModelForMaskGeneration,zf=$.AutoModelForMaskedLM,Bf=$.AutoModelForNormalEstimation,Vf=$.AutoModelForObjectDetection,Hf=$.AutoModelForPoseEstimation,Uf=$.AutoModelForQuestionAnswering,Wf=$.AutoModelForSemanticSegmentation,Gf=$.AutoModelForSeq2SeqLM,Kf=$.AutoModelForSequenceClassification,qf=$.AutoModelForSpeechSeq2Seq,Jf=$.AutoModelForTextToSpectrogram,Yf=$.AutoModelForTextToWaveform,Xf=$.AutoModelForTokenClassification,Zf=$.AutoModelForUniversalSegmentation,Qf=$.AutoModelForVision2Seq,$f=$.AutoModelForXVector,ep=$.AutoModelForZeroShotObjectDetection,tp=$.AutoProcessor,np=$.AutoTokenizer,rp=$.AutomaticSpeechRecognitionPipeline,ip=$.BackgroundRemovalPipeline,ap=$.BartForConditionalGeneration,op=$.BartForSequenceClassification,sp=$.BartModel,cp=$.BartPretrainedModel,lp=$.BartTokenizer,up=$.BaseModelOutput,dp=$.BaseStreamer,fp=$.BeitFeatureExtractor,pp=$.BeitForImageClassification,mp=$.BeitModel,hp=$.BeitPreTrainedModel,gp=$.BertForMaskedLM,_p=$.BertForQuestionAnswering,vp=$.BertForSequenceClassification,yp=$.BertForTokenClassification,bp=$.BertModel,xp=$.BertPreTrainedModel,Sp=$.BertTokenizer,Cp=$.BitImageProcessor,wp=$.BlenderbotForConditionalGeneration,Tp=$.BlenderbotModel,Ep=$.BlenderbotPreTrainedModel,Dp=$.BlenderbotSmallForConditionalGeneration,Op=$.BlenderbotSmallModel,kp=$.BlenderbotSmallPreTrainedModel,Ap=$.BlenderbotSmallTokenizer,jp=$.BlenderbotTokenizer,Mp=$.BloomForCausalLM,Np=$.BloomModel,Pp=$.BloomPreTrainedModel,Fp=$.BloomTokenizer,Ip=$.CLIPFeatureExtractor,Lp=$.CLIPImageProcessor,Rp=$.CLIPModel,zp=$.CLIPPreTrainedModel,Bp=$.CLIPSegForImageSegmentation,Vp=$.CLIPSegModel,Hp=$.CLIPSegPreTrainedModel,Up=$.CLIPTextModel,Wp=$.CLIPTextModelWithProjection,Gp=$.CLIPTokenizer,Kp=$.CLIPVisionModel,qp=$.CLIPVisionModelWithProjection,Jp=$.CamembertForMaskedLM,Yp=$.CamembertForQuestionAnswering,Xp=$.CamembertForSequenceClassification,Zp=$.CamembertForTokenClassification,Qp=$.CamembertModel,$p=$.CamembertPreTrainedModel,em=$.CamembertTokenizer,tm=$.CausalLMOutput,nm=$.CausalLMOutputWithPast,rm=$.ChineseCLIPFeatureExtractor,im=$.ChineseCLIPModel,am=$.ChineseCLIPPreTrainedModel,om=$.ClapAudioModelWithProjection,sm=$.ClapFeatureExtractor,cm=$.ClapModel,lm=$.ClapPreTrainedModel,um=$.ClapTextModelWithProjection,dm=$.ClassifierFreeGuidanceLogitsProcessor,fm=$.CodeGenForCausalLM,pm=$.CodeGenModel,mm=$.CodeGenPreTrainedModel,hm=$.CodeGenTokenizer,gm=$.CodeLlamaTokenizer,_m=$.CohereForCausalLM,vm=$.CohereModel,ym=$.CoherePreTrainedModel,bm=$.CohereTokenizer,xm=$.ConvBertForMaskedLM,Sm=$.ConvBertForQuestionAnswering,Cm=$.ConvBertForSequenceClassification,wm=$.ConvBertForTokenClassification,Tm=$.ConvBertModel,Em=$.ConvBertPreTrainedModel,Dm=$.ConvBertTokenizer,Om=$.ConvNextFeatureExtractor,km=$.ConvNextForImageClassification,Am=$.ConvNextImageProcessor,jm=$.ConvNextModel,Mm=$.ConvNextPreTrainedModel,Nm=$.ConvNextV2ForImageClassification,Pm=$.ConvNextV2Model,Fm=$.ConvNextV2PreTrainedModel,Im=$.DFineForObjectDetection,Lm=$.DFineModel,Rm=$.DFinePreTrainedModel,zm=$.DPTFeatureExtractor,Bm=$.DPTForDepthEstimation,Vm=$.DPTImageProcessor,Hm=$.DPTModel,Um=$.DPTPreTrainedModel,Wm=$.DacDecoderModel,Gm=$.DacDecoderOutput,Km=$.DacEncoderModel,qm=$.DacEncoderOutput,Jm=$.DacFeatureExtractor,Ym=$.DacModel,Xm=$.DacPreTrainedModel,Zm=$.DataTypeMap,Qm=$.DebertaForMaskedLM,$m=$.DebertaForQuestionAnswering,eh=$.DebertaForSequenceClassification,th=$.DebertaForTokenClassification,nh=$.DebertaModel,rh=$.DebertaPreTrainedModel,ih=$.DebertaTokenizer,ah=$.DebertaV2ForMaskedLM,oh=$.DebertaV2ForQuestionAnswering,sh=$.DebertaV2ForSequenceClassification,ch=$.DebertaV2ForTokenClassification,lh=$.DebertaV2Model,uh=$.DebertaV2PreTrainedModel,dh=$.DebertaV2Tokenizer,fh=$.DecisionTransformerModel,ph=$.DecisionTransformerPreTrainedModel,mh=$.DeiTFeatureExtractor,hh=$.DeiTForImageClassification,gh=$.DeiTImageProcessor,_h=$.DeiTModel,vh=$.DeiTPreTrainedModel,yh=$.DepthAnythingForDepthEstimation,bh=$.DepthAnythingPreTrainedModel,xh=$.DepthEstimationPipeline,Sh=$.DepthProForDepthEstimation,Ch=$.DepthProPreTrainedModel,wh=$.DetrFeatureExtractor,Th=$.DetrForObjectDetection,Eh=$.DetrForSegmentation,Dh=$.DetrImageProcessor,Oh=$.DetrModel,kh=$.DetrObjectDetectionOutput,Ah=$.DetrPreTrainedModel,jh=$.DetrSegmentationOutput,Mh=$.Dinov2ForImageClassification,Nh=$.Dinov2Model,Ph=$.Dinov2PreTrainedModel,Fh=$.Dinov2WithRegistersForImageClassification,Ih=$.Dinov2WithRegistersModel,Lh=$.Dinov2WithRegistersPreTrainedModel,Rh=$.DistilBertForMaskedLM,zh=$.DistilBertForQuestionAnswering,Bh=$.DistilBertForSequenceClassification,Vh=$.DistilBertForTokenClassification,Hh=$.DistilBertModel,Uh=$.DistilBertPreTrainedModel,Wh=$.DistilBertTokenizer,Gh=$.DocumentQuestionAnsweringPipeline,Kh=$.DonutFeatureExtractor,qh=$.DonutImageProcessor,Jh=$.DonutSwinModel,Yh=$.DonutSwinPreTrainedModel,Xh=$.EfficientNetForImageClassification,Zh=$.EfficientNetImageProcessor,Qh=$.EfficientNetModel,$h=$.EfficientNetPreTrainedModel,eg=$.ElectraForMaskedLM,tg=$.ElectraForQuestionAnswering,ng=$.ElectraForSequenceClassification,rg=$.ElectraForTokenClassification,ig=$.ElectraModel,ag=$.ElectraPreTrainedModel,og=$.ElectraTokenizer,sg=$.EncodecFeatureExtractor,cg=$.EosTokenCriteria,lg=$.Ernie4_5_ForCausalLM,ug=$.Ernie4_5_Model,dg=$.Ernie4_5_PretrainedModel,fg=$.Ernie4_5_Tokenizer,pg=$.EsmForMaskedLM,mg=$.EsmForSequenceClassification,hg=$.EsmForTokenClassification,gg=$.EsmModel,_g=$.EsmPreTrainedModel,vg=$.EsmTokenizer,yg=$.ExaoneForCausalLM,bg=$.ExaoneModel,xg=$.ExaonePreTrainedModel,Sg=$.FFT,Cg=$.FalconForCausalLM,wg=$.FalconModel,Tg=$.FalconPreTrainedModel,Eg=$.FalconTokenizer,Dg=$.FastViTForImageClassification,Og=$.FastViTModel,kg=$.FastViTPreTrainedModel,Ag=$.FeatureExtractionPipeline,jg=$.FeatureExtractor,Mg=$.FillMaskPipeline,Ng=$.Florence2ForConditionalGeneration,Pg=$.Florence2PreTrainedModel,Fg=$.Florence2Processor,Ig=$.ForcedBOSTokenLogitsProcessor,Lg=$.ForcedEOSTokenLogitsProcessor,Rg=$.GLPNFeatureExtractor,zg=$.GLPNForDepthEstimation,Bg=$.GLPNModel,Vg=$.GLPNPreTrainedModel,Hg=$.GPT2LMHeadModel,Ug=$.GPT2Model,Wg=$.GPT2PreTrainedModel,Gg=$.GPT2Tokenizer,Kg=$.GPTBigCodeForCausalLM,qg=$.GPTBigCodeModel,Jg=$.GPTBigCodePreTrainedModel,Yg=$.GPTJForCausalLM,Xg=$.GPTJModel,Zg=$.GPTJPreTrainedModel,Qg=$.GPTNeoForCausalLM,$g=$.GPTNeoModel,e_=$.GPTNeoPreTrainedModel,t_=$.GPTNeoXForCausalLM,n_=$.GPTNeoXModel,r_=$.GPTNeoXPreTrainedModel,i_=$.GPTNeoXTokenizer,a_=$.Gemma2ForCausalLM,o_=$.Gemma2Model,s_=$.Gemma2PreTrainedModel,c_=$.Gemma3ForCausalLM,l_=$.Gemma3Model,u_=$.Gemma3PreTrainedModel,d_=$.Gemma3nAudioFeatureExtractor,f_=$.Gemma3nForConditionalGeneration,p_=$.Gemma3nPreTrainedModel,m_=$.Gemma3nProcessor,h_=$.GemmaForCausalLM,g_=$.GemmaModel,__=$.GemmaPreTrainedModel,v_=$.GemmaTokenizer,y_=$.GlmForCausalLM,b_=$.GlmModel,x_=$.GlmPreTrainedModel,S_=$.GraniteForCausalLM,C_=$.GraniteModel,w_=$.GranitePreTrainedModel,T_=$.Grok1Tokenizer,E_=$.GroundingDinoForObjectDetection,D_=$.GroundingDinoImageProcessor,O_=$.GroundingDinoPreTrainedModel,k_=$.GroundingDinoProcessor,A_=$.GroupViTModel,j_=$.GroupViTPreTrainedModel,M_=$.HeliumForCausalLM,N_=$.HeliumModel,P_=$.HeliumPreTrainedModel,F_=$.HerbertTokenizer,I_=$.HieraForImageClassification,L_=$.HieraModel,R_=$.HieraPreTrainedModel,z_=$.HubertForCTC,B_=$.HubertForSequenceClassification,V_=$.HubertModel,H_=$.HubertPreTrainedModel,U_=$.IJepaForImageClassification,W_=$.IJepaModel,G_=$.IJepaPreTrainedModel,K_=$.Idefics3ForConditionalGeneration,q_=$.Idefics3ImageProcessor,J_=$.Idefics3PreTrainedModel,Y_=$.Idefics3Processor,X_=$.ImageClassificationPipeline,Z_=$.ImageFeatureExtractionPipeline,Q_=$.ImageFeatureExtractor,$_=$.ImageMattingOutput,ev=$.ImageProcessor,tv=$.ImageSegmentationPipeline,nv=$.ImageToImagePipeline,rv=$.ImageToTextPipeline,iv=$.InterruptableStoppingCriteria,av=$.JAISLMHeadModel,ov=$.JAISModel,sv=$.JAISPreTrainedModel,cv=$.JinaCLIPImageProcessor,lv=$.JinaCLIPModel,uv=$.JinaCLIPPreTrainedModel,dv=$.JinaCLIPProcessor,fv=$.JinaCLIPTextModel,pv=$.JinaCLIPVisionModel,mv=$.LiteWhisperForConditionalGeneration,hv=$.LlamaForCausalLM,gv=$.LlamaModel,_v=$.LlamaPreTrainedModel,vv=$.LlamaTokenizer,yv=$.LlavaForConditionalGeneration,bv=$.LlavaOnevisionForConditionalGeneration,xv=$.LlavaOnevisionImageProcessor,Sv=$.LlavaPreTrainedModel,Cv=$.LlavaProcessor,wv=$.LlavaQwen2ForCausalLM,Tv=$.LogitsProcessor,Ev=$.LogitsProcessorList,Dv=$.LogitsWarper,Ov=$.LongT5ForConditionalGeneration,kv=$.LongT5Model,Av=$.LongT5PreTrainedModel,jv=$.M2M100ForConditionalGeneration,Mv=$.M2M100Model,Nv=$.M2M100PreTrainedModel,Pv=$.M2M100Tokenizer,Fv=$.MBart50Tokenizer,Iv=$.MBartForCausalLM,Lv=$.MBartForConditionalGeneration,Rv=$.MBartForSequenceClassification,zv=$.MBartModel,Bv=$.MBartPreTrainedModel,Vv=$.MBartTokenizer,Hv=$.MPNetForMaskedLM,Uv=$.MPNetForQuestionAnswering,Wv=$.MPNetForSequenceClassification,Gv=$.MPNetForTokenClassification,Kv=$.MPNetModel,qv=$.MPNetPreTrainedModel,Jv=$.MPNetTokenizer,Yv=$.MT5ForConditionalGeneration,Xv=$.MT5Model,Zv=$.MT5PreTrainedModel,Qv=$.MarianMTModel,$v=$.MarianModel,ey=$.MarianPreTrainedModel,ty=$.MarianTokenizer,ny=$.Mask2FormerImageProcessor,ry=$.MaskFormerFeatureExtractor,iy=$.MaskFormerForInstanceSegmentation,ay=$.MaskFormerImageProcessor,oy=$.MaskFormerModel,sy=$.MaskFormerPreTrainedModel,cy=$.MaskedLMOutput,ly=$.MaxLengthCriteria,uy=$.Metric3DForDepthEstimation,dy=$.Metric3DPreTrainedModel,fy=$.Metric3Dv2ForDepthEstimation,py=$.Metric3Dv2PreTrainedModel,my=$.MgpstrForSceneTextRecognition,hy=$.MgpstrModelOutput,gy=$.MgpstrPreTrainedModel,_y=$.MgpstrProcessor,vy=$.MgpstrTokenizer,yy=$.MimiDecoderModel,by=$.MimiDecoderOutput,xy=$.MimiEncoderModel,Sy=$.MimiEncoderOutput,Cy=$.MimiModel,wy=$.MimiPreTrainedModel,Ty=$.MinLengthLogitsProcessor,Ey=$.MinNewTokensLengthLogitsProcessor,Dy=$.MistralForCausalLM,Oy=$.MistralModel,ky=$.MistralPreTrainedModel,Ay=$.MobileBertForMaskedLM,jy=$.MobileBertForQuestionAnswering,My=$.MobileBertForSequenceClassification,Ny=$.MobileBertModel,Py=$.MobileBertPreTrainedModel,Fy=$.MobileBertTokenizer,Iy=$.MobileLLMForCausalLM,Ly=$.MobileLLMModel,Ry=$.MobileLLMPreTrainedModel,zy=$.MobileNetV1FeatureExtractor,By=$.MobileNetV1ForImageClassification,Vy=$.MobileNetV1ForSemanticSegmentation,Hy=$.MobileNetV1ImageProcessor,Uy=$.MobileNetV1Model,Wy=$.MobileNetV1PreTrainedModel,Gy=$.MobileNetV2FeatureExtractor,Ky=$.MobileNetV2ForImageClassification,qy=$.MobileNetV2ForSemanticSegmentation,Jy=$.MobileNetV2ImageProcessor,Yy=$.MobileNetV2Model,Xy=$.MobileNetV2PreTrainedModel,Zy=$.MobileNetV3FeatureExtractor,Qy=$.MobileNetV3ForImageClassification,$y=$.MobileNetV3ForSemanticSegmentation,eb=$.MobileNetV3ImageProcessor,tb=$.MobileNetV3Model,nb=$.MobileNetV3PreTrainedModel,rb=$.MobileNetV4FeatureExtractor,ib=$.MobileNetV4ForImageClassification,ab=$.MobileNetV4ForSemanticSegmentation,ob=$.MobileNetV4ImageProcessor,sb=$.MobileNetV4Model,cb=$.MobileNetV4PreTrainedModel,lb=$.MobileViTFeatureExtractor,ub=$.MobileViTForImageClassification,db=$.MobileViTImageProcessor,fb=$.MobileViTModel,pb=$.MobileViTPreTrainedModel,mb=$.MobileViTV2ForImageClassification,hb=$.MobileViTV2Model,gb=$.MobileViTV2PreTrainedModel,_b=$.ModelOutput,vb=$.ModernBertForMaskedLM,yb=$.ModernBertForSequenceClassification,bb=$.ModernBertForTokenClassification,xb=$.ModernBertModel,Sb=$.ModernBertPreTrainedModel,Cb=$.Moondream1ForConditionalGeneration,wb=$.MoonshineFeatureExtractor,Tb=$.MoonshineForConditionalGeneration,Eb=$.MoonshineModel,Db=$.MoonshinePreTrainedModel,Ob=$.MoonshineProcessor,kb=$.MptForCausalLM,Ab=$.MptModel,jb=$.MptPreTrainedModel,Mb=$.MultiModalityCausalLM,Nb=$.MultiModalityPreTrainedModel,Pb=$.MusicgenForCausalLM,Fb=$.MusicgenForConditionalGeneration,Ib=$.MusicgenModel,Lb=$.MusicgenPreTrainedModel,Rb=$.NeoBertForMaskedLM,zb=$.NeoBertForQuestionAnswering,Bb=$.NeoBertForSequenceClassification,Vb=$.NeoBertForTokenClassification,Hb=$.NeoBertModel,Ub=$.NeoBertPreTrainedModel,Wb=$.NllbTokenizer,Gb=$.NoBadWordsLogitsProcessor,Kb=$.NoRepeatNGramLogitsProcessor,qb=$.NomicBertModel,Jb=$.NomicBertPreTrainedModel,Yb=$.NougatImageProcessor,Xb=$.NougatTokenizer,Zb=$.OPTForCausalLM,Qb=$.OPTModel,$b=$.OPTPreTrainedModel,ex=$.ObjectDetectionPipeline,tx=$.Olmo2ForCausalLM,nx=$.Olmo2Model,rx=$.Olmo2PreTrainedModel,ix=$.OlmoForCausalLM,ax=$.OlmoModel,ox=$.OlmoPreTrainedModel,sx=$.OpenELMForCausalLM,cx=$.OpenELMModel,lx=$.OpenELMPreTrainedModel,ux=$.OwlViTFeatureExtractor,dx=$.OwlViTForObjectDetection,fx=$.OwlViTImageProcessor,px=$.OwlViTModel,mx=$.OwlViTPreTrainedModel,hx=$.OwlViTProcessor,gx=$.Owlv2ForObjectDetection,_x=$.Owlv2ImageProcessor,vx=$.Owlv2Model,yx=$.Owlv2PreTrainedModel,bx=$.PaliGemmaForConditionalGeneration,xx=$.PaliGemmaPreTrainedModel,Sx=$.PaliGemmaProcessor,Cx=$.PatchTSMixerForPrediction,wx=$.PatchTSMixerModel,Tx=$.PatchTSMixerPreTrainedModel,Ex=$.PatchTSTForPrediction,Dx=$.PatchTSTModel,Ox=$.PatchTSTPreTrainedModel,kx=$.Phi3ForCausalLM,Ax=$.Phi3Model,jx=$.Phi3PreTrainedModel,Mx=$.Phi3VForCausalLM,Nx=$.Phi3VImageProcessor,Px=$.Phi3VPreTrainedModel,Fx=$.Phi3VProcessor,Ix=$.PhiForCausalLM,Lx=$.PhiModel,Rx=$.PhiPreTrainedModel,zx=$.Pipeline,Bx=$.PreTrainedModel,Vx=$.PreTrainedTokenizer,Hx=$.PretrainedConfig,Ux=$.PretrainedMixin,Wx=$.Processor,Gx=$.PvtForImageClassification,Kx=$.PvtImageProcessor,qx=$.PvtModel,Jx=$.PvtPreTrainedModel,Yx=$.PyAnnoteFeatureExtractor,Xx=$.PyAnnoteForAudioFrameClassification,Zx=$.PyAnnoteModel,Qx=$.PyAnnotePreTrainedModel,$x=$.PyAnnoteProcessor,eS=$.QuestionAnsweringModelOutput,tS=$.QuestionAnsweringPipeline,nS=$.Qwen2ForCausalLM,rS=$.Qwen2Model,iS=$.Qwen2PreTrainedModel,aS=$.Qwen2Tokenizer,oS=$.Qwen2VLForConditionalGeneration,sS=$.Qwen2VLImageProcessor,cS=$.Qwen2VLPreTrainedModel,lS=$.Qwen2VLProcessor,uS=$.Qwen3ForCausalLM,dS=$.Qwen3Model,fS=$.Qwen3PreTrainedModel,pS=$.RFDetrForObjectDetection,mS=$.RFDetrModel,hS=$.RFDetrObjectDetectionOutput,gS=$.RFDetrPreTrainedModel,_S=$.RTDetrForObjectDetection,vS=$.RTDetrImageProcessor,yS=$.RTDetrModel,bS=$.RTDetrObjectDetectionOutput,xS=$.RTDetrPreTrainedModel,SS=$.RTDetrV2ForObjectDetection,CS=$.RTDetrV2Model,wS=$.RTDetrV2ObjectDetectionOutput,TS=$.RTDetrV2PreTrainedModel,ES=$.RawAudio,DS=$.RawImage,OS=$.RawVideo,kS=$.RawVideoFrame,AS=$.RepetitionPenaltyLogitsProcessor,jS=$.ResNetForImageClassification,MS=$.ResNetModel,NS=$.ResNetPreTrainedModel,PS=$.RoFormerForMaskedLM,FS=$.RoFormerForQuestionAnswering,IS=$.RoFormerForSequenceClassification,LS=$.RoFormerForTokenClassification,RS=$.RoFormerModel,zS=$.RoFormerPreTrainedModel,BS=$.RoFormerTokenizer,VS=$.RobertaForMaskedLM,HS=$.RobertaForQuestionAnswering,US=$.RobertaForSequenceClassification,WS=$.RobertaForTokenClassification,GS=$.RobertaModel,KS=$.RobertaPreTrainedModel,qS=$.RobertaTokenizer,JS=$.SamImageProcessor,YS=$.SamImageSegmentationOutput,XS=$.SamModel,ZS=$.SamPreTrainedModel,QS=$.SamProcessor,$S=$.SapiensForDepthEstimation,eC=$.SapiensForNormalEstimation,tC=$.SapiensForSemanticSegmentation,nC=$.SapiensPreTrainedModel,rC=$.SeamlessM4TFeatureExtractor,iC=$.SegformerFeatureExtractor,aC=$.SegformerForImageClassification,oC=$.SegformerForSemanticSegmentation,sC=$.SegformerImageProcessor,cC=$.SegformerModel,lC=$.SegformerPreTrainedModel,uC=$.Seq2SeqLMOutput,dC=$.SequenceClassifierOutput,fC=$.SiglipImageProcessor,pC=$.SiglipModel,mC=$.SiglipPreTrainedModel,hC=$.SiglipTextModel,gC=$.SiglipTokenizer,_C=$.SiglipVisionModel,vC=$.SmolLM3ForCausalLM,yC=$.SmolLM3Model,bC=$.SmolLM3PreTrainedModel,xC=$.SmolVLMForConditionalGeneration,SC=$.SmolVLMImageProcessor,CC=$.SmolVLMProcessor,wC=$.SnacDecoderModel,TC=$.SnacEncoderModel,EC=$.SnacFeatureExtractor,DC=$.SnacModel,OC=$.SnacPreTrainedModel,kC=$.SpeechT5FeatureExtractor,AC=$.SpeechT5ForSpeechToText,jC=$.SpeechT5ForTextToSpeech,MC=$.SpeechT5HifiGan,NC=$.SpeechT5Model,PC=$.SpeechT5PreTrainedModel,FC=$.SpeechT5Processor,IC=$.SpeechT5Tokenizer,LC=$.SqueezeBertForMaskedLM,RC=$.SqueezeBertForQuestionAnswering,zC=$.SqueezeBertForSequenceClassification,BC=$.SqueezeBertModel,VC=$.SqueezeBertPreTrainedModel,HC=$.SqueezeBertTokenizer,UC=$.StableLmForCausalLM,WC=$.StableLmModel,GC=$.StableLmPreTrainedModel,KC=$.Starcoder2ForCausalLM,qC=$.Starcoder2Model,JC=$.Starcoder2PreTrainedModel,YC=$.StoppingCriteria,XC=$.StoppingCriteriaList,ZC=$.StyleTextToSpeech2Model,QC=$.StyleTextToSpeech2PreTrainedModel,$C=$.SummarizationPipeline,ew=$.SuppressTokensAtBeginLogitsProcessor,tw=$.Swin2SRForImageSuperResolution,nw=$.Swin2SRImageProcessor,rw=$.Swin2SRModel,iw=$.Swin2SRPreTrainedModel,aw=$.SwinForImageClassification,ow=$.SwinForSemanticSegmentation,sw=$.SwinModel,cw=$.SwinPreTrainedModel,lw=$.T5ForConditionalGeneration,uw=$.T5Model,dw=$.T5PreTrainedModel,fw=$.T5Tokenizer,pw=$.TableTransformerForObjectDetection,mw=$.TableTransformerModel,hw=$.TableTransformerObjectDetectionOutput,gw=$.TableTransformerPreTrainedModel,_w=$.TemperatureLogitsWarper,vw=$.Tensor,yw=$.Text2TextGenerationPipeline,bw=$.TextClassificationPipeline,xw=$.TextGenerationPipeline,Sw=$.TextStreamer,Cw=$.TextToAudioPipeline,ww=$.TokenClassificationPipeline,Tw=$.TokenClassifierOutput,Ew=$.TokenizerModel,Dw=$.TopKLogitsWarper,Ow=$.TopPLogitsWarper,kw=$.TrOCRForCausalLM,Aw=$.TrOCRPreTrainedModel,jw=$.TranslationPipeline,Mw=$.UltravoxModel,Nw=$.UltravoxPreTrainedModel,Pw=$.UltravoxProcessor,Fw=$.UniSpeechForCTC,Iw=$.UniSpeechForSequenceClassification,Lw=$.UniSpeechModel,Rw=$.UniSpeechPreTrainedModel,zw=$.UniSpeechSatForAudioFrameClassification,Bw=$.UniSpeechSatForCTC,Vw=$.UniSpeechSatForSequenceClassification,Hw=$.UniSpeechSatModel,Uw=$.UniSpeechSatPreTrainedModel,Ww=$.VLChatProcessor,Gw=$.VLMImageProcessor,Kw=$.ViTFeatureExtractor,qw=$.ViTForImageClassification,Jw=$.ViTImageProcessor,Yw=$.ViTMAEModel,Xw=$.ViTMAEPreTrainedModel,Zw=$.ViTMSNForImageClassification,Qw=$.ViTMSNModel,$w=$.ViTMSNPreTrainedModel,eT=$.ViTModel,tT=$.ViTPreTrainedModel,nT=$.VisionEncoderDecoderModel,rT=$.VitMatteForImageMatting,iT=$.VitMatteImageProcessor,aT=$.VitMattePreTrainedModel,oT=$.VitPoseForPoseEstimation,sT=$.VitPoseImageProcessor,cT=$.VitPosePreTrainedModel,lT=$.VitsModel,uT=$.VitsModelOutput,dT=$.VitsPreTrainedModel,fT=$.VitsTokenizer,pT=$.Wav2Vec2BertForCTC,mT=$.Wav2Vec2BertForSequenceClassification,hT=$.Wav2Vec2BertModel,gT=$.Wav2Vec2BertPreTrainedModel,_T=$.Wav2Vec2CTCTokenizer,vT=$.Wav2Vec2FeatureExtractor,yT=$.Wav2Vec2ForAudioFrameClassification,bT=$.Wav2Vec2ForCTC,xT=$.Wav2Vec2ForSequenceClassification,ST=$.Wav2Vec2Model,CT=$.Wav2Vec2PreTrainedModel,wT=$.Wav2Vec2Processor,TT=$.Wav2Vec2ProcessorWithLM,ET=$.WavLMForAudioFrameClassification,DT=$.WavLMForCTC,OT=$.WavLMForSequenceClassification,kT=$.WavLMForXVector,AT=$.WavLMModel,jT=$.WavLMPreTrainedModel,MT=$.WeSpeakerFeatureExtractor,NT=$.WeSpeakerResNetModel,PT=$.WeSpeakerResNetPreTrainedModel,FT=$.WhisperFeatureExtractor,IT=$.WhisperForConditionalGeneration,LT=$.WhisperModel,RT=$.WhisperPreTrainedModel,zT=$.WhisperProcessor,BT=$.WhisperTextStreamer,VT=$.WhisperTimeStampLogitsProcessor,HT=$.WhisperTokenizer,UT=$.XLMForQuestionAnswering,WT=$.XLMForSequenceClassification,GT=$.XLMForTokenClassification,KT=$.XLMModel,qT=$.XLMPreTrainedModel,JT=$.XLMRobertaForMaskedLM,YT=$.XLMRobertaForQuestionAnswering,XT=$.XLMRobertaForSequenceClassification,ZT=$.XLMRobertaForTokenClassification,QT=$.XLMRobertaModel,$T=$.XLMRobertaPreTrainedModel,eE=$.XLMRobertaTokenizer,tE=$.XLMTokenizer,nE=$.XLMWithLMHeadModel,rE=$.XVectorOutput,iE=$.YolosFeatureExtractor,aE=$.YolosForObjectDetection,oE=$.YolosImageProcessor,sE=$.YolosModel,cE=$.YolosObjectDetectionOutput,lE=$.YolosPreTrainedModel,uE=$.ZeroShotAudioClassificationPipeline,dE=$.ZeroShotClassificationPipeline,fE=$.ZeroShotImageClassificationPipeline,pE=$.ZeroShotObjectDetectionPipeline,mE=$.bankers_round,hE=$.cat,gE=$.cos_sim,_E=$.dot,vE=$.dynamic_time_warping,yE=$.env,bE=$.full,xE=$.full_like,SE=$.getKeyValueShapes,CE=$.hamming,wE=$.hanning,TE=$.interpolate,EE=$.interpolate_4d,DE=$.interpolate_data,OE=$.is_chinese_char,kE=$.layer_norm,AE=$.load_image,jE=$.load_video,ME=$.log_softmax,NE=$.magnitude,PE=$.matmul,FE=$.max,IE=$.mean,LE=$.mean_pooling,RE=$.medianFilter,zE=$.mel_filter_bank,BE=$.min,VE=$.ones,HE=$.ones_like,UE=$.permute,WE=$.permute_data,GE=$.pipeline,KE=$.quantize_embeddings,qE=$.rand,JE=$.read_audio,YE=$.rfft,XE=$.round,ZE=$.slice,QE=$.softmax,$E=$.spectrogram,eD=$.stack,tD=$.std_mean,nD=$.topk,rD=$.window_function,iD=$.zeros,aD=$.zeros_like;let oD=64;var sD=class{static model_id=null;static tokenizer;static processor;static model;static async getInstance(e){return this.model_id=`onnx-community/whisper-large-v3-turbo`,this.tokenizer??=np.from_pretrained(this.model_id,{progress_callback:e}),this.processor??=tp.from_pretrained(this.model_id,{progress_callback:e}),this.model??=IT.from_pretrained(this.model_id,{dtype:{encoder_model:`fp16`,decoder_model_merged:`q4`},device:`webgpu`,progress_callback:e}),Promise.all([this.tokenizer,this.processor,this.model])}};async function cD(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e{o??=performance.now();let t;s++>0&&(t=s/(performance.now()-o)*1e3),globalThis.postMessage({status:`update`,output:e,tps:t,numTokens:s})},l=new Sw(r,{skip_prompt:!0,decode_kwargs:{skip_special_tokens:!0},callback_function:c}),u=await i(n),d=await a.generate({...u,max_new_tokens:oD,language:t,streamer:l}),f=r.batch_decode(d,{skip_special_tokens:!0});globalThis.postMessage({status:`complete`,output:f}),lD=!1}async function dD(){globalThis.postMessage({status:`loading`,data:`Loading model...`});let[e,t,n]=await sD.getInstance(e=>{globalThis.postMessage(e)});globalThis.postMessage({status:`loading`,data:`Compiling shaders and warming up model...`}),await n.generate({input_features:bE([1,128,3e3],0),max_new_tokens:1}),globalThis.postMessage({status:`ready`})}globalThis.addEventListener(`message`,async e=>{let{type:t,data:n}=e.data;switch(t){case`load`:dD();break;case`generate`:uD(n);break}})})(); \ No newline at end of file diff --git a/assets/xai-DViBdpac.js b/assets/xai-DViBdpac.js new file mode 100644 index 0000000000000000000000000000000000000000..cbe43eca0b2e1fcbee03a06e7ac3251b9164f35b --- /dev/null +++ b/assets/xai-DViBdpac.js @@ -0,0 +1 @@ +import{J as e,L as t,aN as n,aS as r,bA as i,bE as a,bH as o,bJ as s,bL as c,bO as l,bQ as u,bT as d,b_ as f,t as p,u as m,v as h,w as g,x as _,y as v}from"./index-J3uhnpYL.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b=`xai`;var x=s({__name:`xai`,setup(s){let{t:y}=t(),x=n(),S=e(),{providers:C}=r(S),w=o(()=>S.getProviderMetadata(b)),T=o({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=o({get:()=>C.value[b]?.baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});a(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||``}),u([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)=>(d(),i(f(p),{"provider-name":w.value?.localizedName,"provider-icon":w.value?.icon,"on-back":()=>f(x).back()},{default:c(()=>[l(f(m),null,{default:c(()=>[l(f(h),{title:f(y)(`settings.pages.providers.common.section.basic.title`),description:f(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:c(()=>[l(f(_),{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`]),l(f(v),{title:f(y)(`settings.pages.providers.common.section.advanced.title`)},{default:c(()=>[l(f(g),{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/xai-nQqFIsUV.js b/assets/xai-nQqFIsUV.js deleted file mode 100644 index bb902f45d8b8767c5e13bb87bc1cbe6994b354fd..0000000000000000000000000000000000000000 --- a/assets/xai-nQqFIsUV.js +++ /dev/null @@ -1 +0,0 @@ -import{J as e,L as t,aN as n,aS as r,bA as i,bG as a,bK as o,bN as s,bP as c,bR as l,bU as u,b_ as d,by as f,t as p,u as m,v as h,w as g,x as _,y as v}from"./index-BFym949y.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b=`xai`;var x=c({__name:`xai`,setup(c){let{t:y}=t(),x=n(),S=e(),{providers:C}=r(S),w=s(()=>S.getProviderMetadata(b)),T=s({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=s({get:()=>C.value[b]?.baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});o(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||``}),f([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)=>(i(),a(d(p),{"provider-name":w.value?.localizedName,"provider-icon":w.value?.icon,"on-back":()=>d(x).back()},{default:l(()=>[u(d(m),null,{default:l(()=>[u(d(h),{title:d(y)(`settings.pages.providers.common.section.basic.title`),description:d(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:l(()=>[u(d(_),{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`]),u(d(v),{title:d(y)(`settings.pages.providers.common.section.advanced.title`)},{default:l(()=>[u(d(g),{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-CD8IEU5z-78-ilYcF.js b/assets/zod-CD8IEU5z-dVvvg2wD.js similarity index 59% rename from assets/zod-CD8IEU5z-78-ilYcF.js rename to assets/zod-CD8IEU5z-dVvvg2wD.js index b873170352004975137df96f3caa402bbd6d6a91..c01b2a7b32810a57a63bd4fb2d67eeab3a7489b3 100644 --- a/assets/zod-CD8IEU5z-78-ilYcF.js +++ b/assets/zod-CD8IEU5z-dVvvg2wD.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/esm-Cn7iquya.js","assets/index-BFym949y.js","assets/index-DW4V58Ib.css"])))=>i.map(i=>d[i]); -import{N as e,aR as t}from"./index-BFym949y.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-Bo_5D72p.js`);return{toJSONSchema:e}},[]);n=e}catch(e){e instanceof Error&&console.error(e.message)}try{let{zodToJsonSchema:e}=await t(async()=>{let{zodToJsonSchema:e}=await import(`./esm-Cn7iquya.js`);return{zodToJsonSchema:e}},__vite__mapDeps([0,1,2]));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/esm-DKRfnT7g.js","assets/index-J3uhnpYL.js","assets/index-BT-tiZao.css"])))=>i.map(i=>d[i]); +import{N as e,aR as t}from"./index-J3uhnpYL.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-52E9_3Ll.js`);return{toJSONSchema:e}},[]);n=e}catch(e){e instanceof Error&&console.error(e.message)}try{let{zodToJsonSchema:e}=await t(async()=>{let{zodToJsonSchema:e}=await import(`./esm-DKRfnT7g.js`);return{zodToJsonSchema:e}},__vite__mapDeps([0,1,2]));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 8bd524a200c45117fa9fe18cb53e0bda6a08212b..36b153fc82c953256c84bc4eef347317427ca709 100644 --- a/index.html +++ b/index.html @@ -32,8 +32,8 @@ src="/remote-assets/page-external-data/js/script.js" > - - + +
diff --git a/sw.js b/sw.js index 959f50ba1d0deb2e9695ce23e0912ecb215bf2b7..c94c6d991b7658e3e42d7d2aa36147ca40303811 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-CKGmuslh.js",revision:null},{url:"assets/__vite-optional-peer-dep_effect_xsschema-CXIfmAu1.js",revision:null},{url:"assets/__vite-optional-peer-dep_sury_xsschema-DBCftJAj.js",revision:null},{url:"assets/_...all_-TBhc7L19.js",revision:null},{url:"assets/airi-card-DVINiKa7.js",revision:null},{url:"assets/alibaba-cloud-model-studio-BJD00XEf.js",revision:null},{url:"assets/AnimatedWave-DHHIvVVC.js",revision:null},{url:"assets/AnimatedWave-Dw0iAXrn.css",revision:null},{url:"assets/anthropic-Ds06Wuq-.js",revision:null},{url:"assets/appearance-BKBvMHL0.js",revision:null},{url:"assets/arktype-C-GObzDh-DWDEUAMn.js",revision:null},{url:"assets/audio-BlXLxr75.js",revision:null},{url:"assets/audio-record-DrJXfolx.js",revision:null},{url:"assets/azure-ai-foundry-D_2nNXRn.js",revision:null},{url:"assets/background-remove-BnlMlOvh.js",revision:null},{url:"assets/Basic-CcFV8fg0.js",revision:null},{url:"assets/browser-CoZYwbon.js",revision:null},{url:"assets/browser-UfbE_1lV.js",revision:null},{url:"assets/CardCreate-BOXHbJQd.js",revision:null},{url:"assets/CardCreate-CQKwfgDh.js",revision:null},{url:"assets/CardCreationDialog-BrvTqDsp.js",revision:null},{url:"assets/CardCreationDialog-CG2KLbdk.css",revision:null},{url:"assets/CardCreationDialog-DzTU0wp7.js",revision:null},{url:"assets/CardDetailDialog-CxE7smOI.js",revision:null},{url:"assets/CardDetailDialog-DhX59GOE.js",revision:null},{url:"assets/CardListItem-BBGsnLNq.js",revision:null},{url:"assets/CardListItem-BPRbxcba.js",revision:null},{url:"assets/chat-BUZwRCyI.js",revision:null},{url:"assets/cloudflare-workers-ai-CL-TY-Cz.js",revision:null},{url:"assets/color-scheme-Cs2KuTF6.js",revision:null},{url:"assets/color-scheme-r2m6hu6X.css",revision:null},{url:"assets/consciousness-BLecufPV.js",revision:null},{url:"assets/core-Bo_5D72p.js",revision:null},{url:"assets/deepseek-BPOq0AFu.js",revision:null},{url:"assets/default-browser-BsyDD-mc.js",revision:null},{url:"assets/default-DhKdy896.js",revision:null},{url:"assets/default-node-C7L-dwjz.js",revision:null},{url:"assets/delays-BJ-K9VUB.js",revision:null},{url:"assets/DeleteCardDialog-Bm5B-ykC.js",revision:null},{url:"assets/DeleteCardDialog-DUAm5fH5.js",revision:null},{url:"assets/developer-Dqo6PXeC.js",revision:null},{url:"assets/dist-CshDQrOa.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-1eM9E9sB.js",revision:null},{url:"assets/duckdb-mvp-8HYqhb4i.wasm",revision:null},{url:"assets/effect-DBSVVF8G-PVyVIIwu.js",revision:null},{url:"assets/elevenlabs-tZGvWrsu.js",revision:null},{url:"assets/emotions-CUlnAOYu.js",revision:null},{url:"assets/esm-Cn7iquya.js",revision:null},{url:"assets/featherless-ai-B-HXyLKh.js",revision:null},{url:"assets/filter-message-BZNjFRng.js",revision:null},{url:"assets/fireworks-ai-CI_8N3O3.js",revision:null},{url:"assets/general-CVrjEVIh.js",revision:null},{url:"assets/gesture-circle-NieW4uSY.js",revision:null},{url:"assets/google-generative-ai-CjRSvghG.js",revision:null},{url:"assets/HeaderLink-4n3ShASi.css",revision:null},{url:"assets/HeaderLink-BXWLCGTy.js",revision:null},{url:"assets/hearing-DkgAkF88.js",revision:null},{url:"assets/home-_FSVNe9h.js",revision:null},{url:"assets/icon-animation-ChTUnIeG.js",revision:null},{url:"assets/IconAnimation-DfKVRS59.js",revision:null},{url:"assets/image-BhuwcwI9.css",revision:null},{url:"assets/image-CG6IRKrT.js",revision:null},{url:"assets/import-url-browser-CkMcxt8_.js",revision:null},{url:"assets/import-url-browser-CzbE4_30.js",revision:null},{url:"assets/import-url-node-DmUEwuAI.js",revision:null},{url:"assets/index-BFym949y.js",revision:null},{url:"assets/index-DW4V58Ib.css",revision:null},{url:"assets/InputFile-BA4DYXXI.js",revision:null},{url:"assets/js/CubismSdkForWeb-5-r.3/Core/live2dcubismcore.min.js",revision:null},{url:"assets/memory-DFoYeFiJ.js",revision:null},{url:"assets/memory-long-term-Bfhngu6P.js",revision:null},{url:"assets/memory-short-term-cIlmNFtC.js",revision:null},{url:"assets/messages-CYxzuiqf.js",revision:null},{url:"assets/microsoft-speech-CszGvA6L.js",revision:null},{url:"assets/mistral-ai-PlMgYfnI.js",revision:null},{url:"assets/models-C6mXogRh.js",revision:null},{url:"assets/modules-BSQfB0qf.js",revision:null},{url:"assets/moonshot-ai-CMPzQdws.js",revision:null},{url:"assets/novita-ai-B-sn63fK.js",revision:null},{url:"assets/ollama--RoUgpZl.js",revision:null},{url:"assets/openai-audio-speech-DWlI47_x.js",revision:null},{url:"assets/openai-audio-transcription-DxV0q5KK.js",revision:null},{url:"assets/openai-BaqtySWH.js",revision:null},{url:"assets/openrouter-ai-DVJv8zTp.js",revision:null},{url:"assets/ort-wasm-simd-threaded.jsep-B0T3yYHD.wasm",revision:null},{url:"assets/pages-CTAnVDmW.js",revision:null},{url:"assets/plain-CNQFJoOP.js",revision:null},{url:"assets/player2-C8nhkznT.js",revision:null},{url:"assets/player2-speech-CYU2KX04.js",revision:null},{url:"assets/polaroid-qE5EuLqQ.js",revision:null},{url:"assets/process.worklet-CF6Ao8XG.js",revision:null},{url:"assets/providers-DLjH9JAw.js",revision:null},{url:"assets/queue-ClKCooOo.js",revision:null},{url:"assets/route-block-DVyt-3Cw.js",revision:null},{url:"assets/scene-XjDq2xJ1.js",revision:null},{url:"assets/Scenes-CZrLq5ZX.js",revision:null},{url:"assets/settings-DV-w6Z9d.js",revision:null},{url:"assets/settings-V--rxRsA.js",revision:null},{url:"assets/speech-uucZ9CVe.js",revision:null},{url:"assets/stage-BJhNntgU.js",revision:null},{url:"assets/stage-DfACZXa2.js",revision:null},{url:"assets/sury-GtnkadyM-Dv3wvZV6.js",revision:null},{url:"assets/Textarea-DQ3UodrM.js",revision:null},{url:"assets/theme-color-BKoDN9T_.js",revision:null},{url:"assets/together-ai-COjt7TWP.js",revision:null},{url:"assets/transformers.web-B6jLny9T.js",revision:null},{url:"assets/valibot-CbgwcZn_-CLR2GVm1.js",revision:null},{url:"assets/vibrant-BnHhPWZj.js",revision:null},{url:"assets/volcengine-DGc8MHu2.js",revision:null},{url:"assets/worker-Bv82ofgX.js",revision:null},{url:"assets/xai-nQqFIsUV.js",revision:null},{url:"assets/zod-CD8IEU5z-78-ilYcF.js",revision:null},{url:"index.html",revision:"7097f86a8c36472bb0e582751143e80e"},{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 a=s=>l(s,n),o={module:{uri:n},exports:u,require:a};e[n]=Promise.all(r.map(s=>o[s]||a(s))).then(s=>(i(...s),u))}}define(["./workbox-3aa584b4"],function(s){"use strict";self.skipWaiting(),s.clientsClaim(),s.precacheAndRoute([{url:"assets/__vite-browser-external-MQa0rNba.js",revision:null},{url:"assets/__vite-optional-peer-dep_effect_xsschema-CXIfmAu1.js",revision:null},{url:"assets/__vite-optional-peer-dep_sury_xsschema-DBCftJAj.js",revision:null},{url:"assets/_...all_-B7_146pG.js",revision:null},{url:"assets/airi-card-23m5t20W.js",revision:null},{url:"assets/alibaba-cloud-model-studio-Bc3aTr9J.js",revision:null},{url:"assets/AnimatedWave-BNwebIpR.js",revision:null},{url:"assets/AnimatedWave-Dw0iAXrn.css",revision:null},{url:"assets/anthropic-BY1KMERF.js",revision:null},{url:"assets/appearance-CbLkQE_9.js",revision:null},{url:"assets/arktype-C-GObzDh-BBIv_cP1.js",revision:null},{url:"assets/audio-DYYSATQy.js",revision:null},{url:"assets/audio-record-Dpsb3s2S.js",revision:null},{url:"assets/azure-ai-foundry-CkLpWPUt.js",revision:null},{url:"assets/background-remove-Doptaj1n.js",revision:null},{url:"assets/Basic-Cwa2X3hA.js",revision:null},{url:"assets/browser-CoZYwbon.js",revision:null},{url:"assets/browser-UfbE_1lV.js",revision:null},{url:"assets/CardCreate-BlTH4Xox.js",revision:null},{url:"assets/CardCreate-eYkmqupR.js",revision:null},{url:"assets/CardCreationDialog-BV9G3q2c.js",revision:null},{url:"assets/CardCreationDialog-CG2KLbdk.css",revision:null},{url:"assets/CardCreationDialog-CSbQbKao.js",revision:null},{url:"assets/CardDetailDialog-BKAC6QHD.js",revision:null},{url:"assets/CardDetailDialog-DkixqMs_.js",revision:null},{url:"assets/CardListItem-CaTpYoW4.js",revision:null},{url:"assets/CardListItem-CfAvmf_x.js",revision:null},{url:"assets/chat-BIP9jXlU.js",revision:null},{url:"assets/cloudflare-workers-ai-BaI_Rwef.js",revision:null},{url:"assets/color-scheme-Dk37f8SX.js",revision:null},{url:"assets/color-scheme-r2m6hu6X.css",revision:null},{url:"assets/consciousness-CYrl8QXs.js",revision:null},{url:"assets/core-52E9_3Ll.js",revision:null},{url:"assets/deepseek-DnJanhZ7.js",revision:null},{url:"assets/default-BjhJ8iTT.js",revision:null},{url:"assets/default-browser-fG6G3mbs.js",revision:null},{url:"assets/default-node-DnFRZ-9a.js",revision:null},{url:"assets/delays-DJ8ppqmz.js",revision:null},{url:"assets/DeleteCardDialog-DTWpW-2T.js",revision:null},{url:"assets/DeleteCardDialog-UKAwGyZQ.js",revision:null},{url:"assets/developer-G1V3X_27.js",revision:null},{url:"assets/dist-CshDQrOa.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-1eM9E9sB.js",revision:null},{url:"assets/duckdb-mvp-8HYqhb4i.wasm",revision:null},{url:"assets/effect-DBSVVF8G-D__cQ9PS.js",revision:null},{url:"assets/elevenlabs-D_o9OBbz.js",revision:null},{url:"assets/emotions-DvokzTuq.js",revision:null},{url:"assets/esm-DKRfnT7g.js",revision:null},{url:"assets/featherless-ai-2oNxwFxi.js",revision:null},{url:"assets/filter-message-BcMyfSi6.js",revision:null},{url:"assets/fireworks-ai-CW9vBjr8.js",revision:null},{url:"assets/general-B2Scnzyg.js",revision:null},{url:"assets/gesture-circle-BBMVN_ye.js",revision:null},{url:"assets/google-generative-ai-BwVpRZEr.js",revision:null},{url:"assets/HeaderLink-4n3ShASi.css",revision:null},{url:"assets/HeaderLink-C5rYwZW4.js",revision:null},{url:"assets/hearing-DoOHup8T.js",revision:null},{url:"assets/home-kypUX7iO.js",revision:null},{url:"assets/icon-animation-kCs3SNq8.js",revision:null},{url:"assets/IconAnimation-BEHmQAW0.js",revision:null},{url:"assets/image-BhuwcwI9.css",revision:null},{url:"assets/image-ByPuRM0v.js",revision:null},{url:"assets/import-url-browser-BymzNjKM.js",revision:null},{url:"assets/import-url-browser-iGhQiEJs.js",revision:null},{url:"assets/import-url-node-DHMEAMi-.js",revision:null},{url:"assets/index-BT-tiZao.css",revision:null},{url:"assets/index-J3uhnpYL.js",revision:null},{url:"assets/InputFile-DYGPp1hR.js",revision:null},{url:"assets/js/CubismSdkForWeb-5-r.3/Core/live2dcubismcore.min.js",revision:null},{url:"assets/memory-CFffyGxF.js",revision:null},{url:"assets/memory-long-term-DiDwEey2.js",revision:null},{url:"assets/memory-short-term-ajNCalDy.js",revision:null},{url:"assets/messages-CgBnFGDa.js",revision:null},{url:"assets/microsoft-speech-C7ThD9iN.js",revision:null},{url:"assets/mistral-ai-CbjOvuKb.js",revision:null},{url:"assets/models-WA_l83eR.js",revision:null},{url:"assets/modules-CMn92Qgp.js",revision:null},{url:"assets/moonshot-ai-CFXUeFnc.js",revision:null},{url:"assets/novita-ai-CDmSyd2p.js",revision:null},{url:"assets/ollama-DEbOkWEd.js",revision:null},{url:"assets/openai-audio-speech-tr83Tays.js",revision:null},{url:"assets/openai-audio-transcription-53P1cwTz.js",revision:null},{url:"assets/openai-CfOD6NWP.js",revision:null},{url:"assets/openrouter-ai-BGXHC_hT.js",revision:null},{url:"assets/ort-wasm-simd-threaded.jsep-B0T3yYHD.wasm",revision:null},{url:"assets/pages-DgHFu8YX.js",revision:null},{url:"assets/plain-vwAfWNiv.js",revision:null},{url:"assets/player2-92SQ5DhN.js",revision:null},{url:"assets/player2-speech-QfJzu0W0.js",revision:null},{url:"assets/polaroid-Ch51z8b2.js",revision:null},{url:"assets/process.worklet-CF6Ao8XG.js",revision:null},{url:"assets/providers-BEf5BA57.js",revision:null},{url:"assets/queue-BLcf1-Jv.js",revision:null},{url:"assets/route-block-DVyt-3Cw.js",revision:null},{url:"assets/scene-ePckR2Tm.js",revision:null},{url:"assets/Scenes-CEy5mzwe.js",revision:null},{url:"assets/settings-C_Bl0Dic.js",revision:null},{url:"assets/settings-DGA0gtM5.js",revision:null},{url:"assets/speech-DILdLlfV.js",revision:null},{url:"assets/stage-BpXm32LC.js",revision:null},{url:"assets/stage-Ckabb-ev.js",revision:null},{url:"assets/sury-GtnkadyM-CUwsFFlt.js",revision:null},{url:"assets/Textarea-C55W7JzB.js",revision:null},{url:"assets/theme-color-BcLm08J4.js",revision:null},{url:"assets/together-ai-BHolxZvd.js",revision:null},{url:"assets/transformers.web-DPuLqcmp.js",revision:null},{url:"assets/valibot-CbgwcZn_-CzuPOF44.js",revision:null},{url:"assets/vibrant-D7XJhUFd.js",revision:null},{url:"assets/volcengine-CYOv3NuR.js",revision:null},{url:"assets/worker-FPXhib_8.js",revision:null},{url:"assets/xai-DViBdpac.js",revision:null},{url:"assets/zod-CD8IEU5z-dVvvg2wD.js",revision:null},{url:"index.html",revision:"12013aabec2563fdd9e94b92c707098e"},{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\//]}))});